I'm trying to better understand how to think about invariance in the setting of category theory.

In some cases it seems there's an obvious interpretation: for instance, the fundamental group $\pi_1$ of a topological space is invariant (up to group isomorphism) with respect to mapping by basepoint-preserving homeomorphisms, which are the isomorphisms in the category **Top•** of topological spaces with distinguished base point and basepoint-preserving continuous maps. Further, $\pi_1$ can be viewed as a functor from **Top•** to **Grp**, the category of groups and homomorphisms. So here an invariant is encoded as a functor in a nice way.

What about less obvious examples? Here are a few I've been thinking about:

- The Gauss-Bonnet theorem says that the total (Gaussian) curvature of a compact surface equals $2\pi\chi$, where $\chi$ is the Euler characteristic. So total curvature is also invariant w.r.t. homeomorphism. Of course, $\chi$ can be expressed in terms of the ranks of the homology groups, which are themselves functors, so this gives us a way to relate Gauss-Bonnet to categories and functors. But is it possible in the language of category theory to specify that, more specifically, total curvature is an invariant?
- In classical mechanics, the symplectic form associated with a conservative system is preserved under the flow induced by the Hamiltonian of that system. Categorically, (and actually, more generally) we can say that the symplectic form is preserved by symplectomorphisms, which are the isomorphisms in the category of symplectic manifolds. But it is not obvious (to me) that the symplectic form can be viewed as a functor.
- Maybe this is a poor example, but distance in the vector space $\mathbb{R}^n$ is preserved by Euclidean transformations, i.e., maps in $E(n,\mathbb{R})$. Does this fact have a description via categories and functors?

Finally, note that in the first two examples, the invariants metnioned are preserved under the *isomorphisms* of the associated category. Does this generalize? I.e., can we aways build a reasonable category (e.g., must be non-trivial) in which a given invariant is preserved by isomorphisms?

path connectedspace is invariant, in the sense thatup to isomorphismit is well-defined and depends only on the homeomorphism class of the space. But "the" fundamental group of a space transforms under nontrivial automorphisms when the space is put through automorphisms, and so from a categorical point of view it is not clear at all how to identify fundamental groups at different base points. $\endgroup$ – Theo Johnson-Freyd Nov 12 '09 at 8:42