Given a compact smooth manifold $M$, it's relatively well known that $C^\infty(M)$ determines $M$ up to diffeomorphism. That is, if $M$ and $N$ are two smooth manifolds and there is an $\mathbb{R}$-algebra isomorphism between $C^\infty(M)$ and $C^\infty(N)$, then $M$ and $N$ are diffeomorphic.


(See, for example, Milnor and Stasheff's "Characteristic Classes" book where an exercise walks one through the proof of this fact).


Thus, in some sense, all the information about the manifold is contained in $C^\infty(M)$.


Further, the tools of logic/set theory/model theory etc. have clearly been applied with greater success to purely algebraic structures than to, say, differential or Riemannian geometry. This is partly do the fact that many interesting algebraic structures can be defined via first-order formulas, whereas in the geometric setting, one often uses (needs?) second-order formulas.


So, my question is two-fold:


First, is there a known characterization of when a given (commutive, unital) $\mathbb{R}$-algebra is isomorphic to $C^\infty(M)$ for some compact smooth manifold $M$? I imagine the answer is either known, very difficult, or both.


Second, has anyone applied the machinery of logic/etc to, say, prove an independence result in differential or Riemannian geometry? What are the references?



Algebraic description of compact smooth manifolds?
There is a very cool answer to your question, and it goes by the name [well-adapted models](http://ncatlab.org/nlab/show/Models+for+Smooth+Infinitesimal+Analysis) for [synthetic differential geometry](http://ncatlab.org/nlab/show/synthetic+differential+geometry). Andrew Stacey already indicated it in his reply, but maybe I can expand a bit more on this.


Synthetic differential geometry is an axiom system that characterizes those categories whose objects may sensibly be regarded as spaces on which differential calculus makes sense. These categories are called [smooth toposes](http://ncatlab.org/nlab/show/smooth+topos).


A *model* for this is a particular such category with these properties. A *well-adapted model* is one which has a [full and faithful embedding](http://ncatlab.org/nlab/show/full+and+faithful+functor) of the category of smooth manifolds. (This is "well adapted" from the point of view of ordinary differential geoemtry: ordinary differential geometry embeds into these more powerful theories of smooth structures).


The striking insight is that this perspective in particular usefully unifies the ideas of algebraic geometry with that of differential geoemtry to a grander whole.


Indeed, the category of presheaves on the opposite of (finitely generated) commutative rings is a model for the axioms, and of course this is the context in which algebraic geometry takes place. 


But we are entitled to take probe categories considerably richer than just that of duals of commutative rings. In particular, we may consider a category of commutative rings that have a notion of being "smooth" the way a ring of smooth functions is "smooth". These are the C-infinity rings or [generalized smooth algebra](http://ncatlab.org/nlab/show/generalized+smooth+algebra)s. Every ring of smooth functions on a smooth manifold is an example, but there are more.


The formal dual of these rings are spaces called [smooth loci](http://ncatlab.org/nlab/show/smooth+loci). This is a smooth analog of the notion of affine scheme. (Notice that the notion of "smooth" as used here is that of differential geometry, not quite that of algebraic geometry, which is more like "singularity free". But they are not unrelated).


The main theorem going in the direction of an answer to your question is that the category of manifolds embeds fully and faithfully into that of smooth loci. See at the link [smooth loci](http://ncatlab.org/nlab/show/smooth+loci) for the details.


But inside the category SmoothLoci, manifolds are characterized as the formal dual to their smooth rings of functions, so that's one way to answer your question.


There is a grand story developing from this point on, but for the moment this much is maybe sufficient as a reply. 


