I'm in a bit of a conundrum at the moment, since my real research interests (constructive type theory, proof theory, categorical logic) are only actively studied at a handful of places in the U.S, and for the most part those tend to be top schools.
Thus, I'm wondering if I don't get into one of said schools, would it still be possible for me to write my thesis in one of my areas of interest even if it is not directly related to any of the faculty's research interests? How much leeway do you have there?
For example, if I get into a school that has a good logic group, even if the research interests of the professors there is, say, more in set theory, would I still likely be able to do my thesis on type theory? What about at a school that doesn't even have a solid logic program?