Let $R$ be a ring of (smooth?) functions on a (connected?) manifold of dimension $n$. What concept of dimension (of the ring $R$) gives the dimension of the manifold? To what class of rings does this concept apply?
How about the rank of the $R$module $\mathrm{Der}(R)$ of derivations of $R$?

$\begingroup$ How is the rank defined if $\text{Der}(R)$ isn't free? $\endgroup$ – Qiaochu Yuan Aug 9 '12 at 13:12

2$\begingroup$ @Qiaochu Yuan: It's the degree of the highest nonzero exterior power. (I thought that this was standard for finitely generated projective modules over commutative rings, which is why I didn't define it.) $\endgroup$ – Robert Bryant Aug 9 '12 at 13:35

$\begingroup$ If the algebra lacks nontrivial idempotents (=connected) and $\text{Der(R)}$ is a finitely generated projective module, then it has constant local rank. This might provide a definition. However, one has to fulfill these requirements ... $\endgroup$ – Joakim Arnlind Aug 9 '12 at 13:35

1$\begingroup$ @Robert: my apologies. I wasn't familiar with this definition. $\endgroup$ – Qiaochu Yuan Aug 9 '12 at 14:35

2$\begingroup$ Robert & Yemon, the module of Kähler differentials of a $k$algebra $\Omega_{R/k}$ is the "predual" to the module of $k$linear derivations from $R$ to $R$ in the sense that $Hom(\Omega_{R/k}, R)=Der(R)$. In the good case when $\Omega_{R/k}$ is projective (e.g. in the case of manifolds), the ranks (in the sense of largest $k$...) would be the same, but for more general $R$'s it's not so clear. $\endgroup$ – Donu Arapura Aug 10 '12 at 13:40
Let $k$ be a field and $A$ a $k$algebra. A tangent vector is a morphism $A \to k[\epsilon]/\epsilon^2$ of $k$algebras. The corresponding point at which the tangent vector is based is the composite $A \to k[\epsilon]/\epsilon^2 \to k$. The collection of tangent vectors at a given point $p : A \to k$ forms a vector space over $k$, the (Zariski) tangent space $T_p(\text{Spec } A)$ at $p$. It is given explicitly by the space of linear maps $D : A \to k$ satisfying $$D(ab) = D(a) p(b) + p(a) D(b).$$
(The corresponding morphism is $a \mapsto p(a) + \epsilon D(a)$.)
When $k = \mathbb{R}$, $A = C^{\infty}(M)$ for a smooth manifold $M$, and $p : C^{\infty}(M) \to \mathbb{R}$ is the evaluation homomorphism at a point of $M$ this definition reproduces the tangent space in the usual sense, so the dimension of the corresponding tangent space reproduces the dimension of $M$ in the usual sense (if $M$ is connected). This seems to me like a natural way to go because if $M$ is not assumed to be connected then dimension is a local rather than a global feature of $M$.

$\begingroup$ Thanks! Is it clear that the dimension of $T_p(\text{Spec}A)$ is constant (with respect to $p$)? Or, is this an assumption in order to be able to define the dimension like this? $\endgroup$ – Joakim Arnlind Aug 9 '12 at 13:32

$\begingroup$ @Joakim: that isn't a necessary assumption. Again, the notion of dimension in general is local. For smooth manifolds you can show that a tangent vector $A \to k[\epsilon]/\epsilon^2$ at $p$ ignores the behavior of functions vanishing outside of an open neighborhood of $p$ and so reduce the problem to a Euclidean neighborhood, where it is possible to write down the tangent space explicitly in coordinates, which will show that dimension is locally constant. $\endgroup$ – Qiaochu Yuan Aug 9 '12 at 13:41

$\begingroup$ @Qiaochu Yuan: You are (of course) right that dimension is in general a local property, but I'm looking to (algebraically) capture the cases when there is actually a global concept of dimension, in analogy with the case of a connected manifold. For instance, assuming no nontrivial idempotents in the algebra. $\endgroup$ – Joakim Arnlind Aug 9 '12 at 13:45
This is more of a comment The notion of dimension is local. Any point in an $n$dimensional manifold looks like a point in $\newcommand{\bR}{\mathbb{R}}$ $\bR^n$. If $x\in M$ $\newcommand{\fram}{\mathfrak{m}}$ we denote by $\fram_x$ the maximal ideal of smooth functions vanishing at $x$. Then as Robert Bryant indicated, we can set
$$\dim M= \dim \fram_x/\fram_x^2. $$
This raises some questions that may have been answered awhile ago. For any $n$dimensional smooth manifold $X$ and any point $x\in X$ denote by $A_X^x$ the (algebraic) localization of the ring $C^\infty(M)$ at the maximal ideal $\fram_x$ defined by the point $x$. Denote by $\hat{A}^x_A$ its completion. Is it true that for any smooth $n$dimensional manifolds $X, Y$ and any point $x\in X$, $y\in Y$ we have isomorphisms of rings
$$A_X^x\cong A_Y^y,\;\;\hat{A}_X^y\cong \hat{A}_Y^y. $$
There is an approach to this question through a smooth version of the HochschildKostantRosenberg (HKR) Theorem, which is related to Robert Bryant's answer. The smooth version is due to Alain Connes in its original form.
First, the original HKR theorem says that for a regular affine $k$algebra $R$ (think of the algebra of polynomial functions on a smooth affine variety), there are isomorphisms $$ \Lambda^\bullet (\Omega_{R/k}) \cong \mathrm{Tor}_\bullet^{R^e}(R,R) \overset{\mathrm{def}}{=} HH_\bullet(R) $$ and $$ \Lambda^\bullet (\mathrm{Der}(R)) \cong \mathrm{Ext}_{R^e}^\bullet (R,R) \overset{\mathrm{def}}{=} HH^\bullet(R). $$ Here $\Omega_{R/k}$ is the $R$module of Kahler differentials and $\mathrm{Der}(R)$ is the $R$module of derivations of $R$, which are algebraic analogues of 1forms and vector fields on $R$, respectively. As Donu Arapura points out in his comment, Kahler differentials are the predual to derivations, rather than the other way around, as one normally defines forms to be dual to vector fields in the differentialgeometric setting. Also $R^e = R \otimes R$, and $HH_\bullet(R)$ and $HH^\bullet(R)$ are the Hochschild homology and cohomology of $R$, respectively.
The upshot is that when $R$ is the coordinate ring of a smooth affine variety, we can find the dimension of that variety by looking at the highest degree in which the Hochschild homology or cohomology does not vanish.
Moving to the smooth case one needs to be quite careful, however. For a smooth manifold $M$, the Kahler differentials of $C^\infty(M)$ are not the same as the module of smooth 1forms, as can be seen in this question.
The extra structure that $C^\infty(M)$ possesses is that of a Frechet algebra, where the seminorms are given by supnorms of partial derivatives on compact subsets of $M$. Hochschild homology and cohomology can be adapted to the setting of certain topological algebras, and then there is an analogue of the HKR theorem. One formulation of it says that for $A = C^\infty(M)$, there are isomorphisms $$ _cHH_\bullet(A,A) \cong \Omega^\bullet(M) $$ and $$ _cHH^\bullet(A,A) \cong \Gamma^\infty(\Lambda^\bullet(TM)), $$ where $\Omega^\bullet(M)$ is the algebra of differential forms, and $\Gamma^\infty(\Lambda^\bullet(TM))$ is the space of smooth polyvector fields on $M$, and the subscript $c$ indicates the continuous Hochschild homology and cohomology. So again, the dimension of $M$ can be determined as the top degree in which the continuous Hochschild homology and cohomology do not vanish.
This was proved by Connes (see Chapter 3, Section 2 of his book Noncommutative Geometry, plus references therein) for compact manifolds. For noncompact manifolds it is written up concisely in the paper On Continuous Hochschild Homology and Cohomology Groups, by Markus Pflaum. Connes' version uses the language of de Rham currents, which are dual to differential forms.
Another source to look at is Chapter 8 of the book Elements of Noncommutative Geometry by GraciaBondia, Varilly, and Figueroa.

$\begingroup$ Thanks for this  in my comment to Robert Bryant's answer I really meant "the version of the Kahler module for commutative topological algebras" but was too lazy to write it out in full. $\endgroup$ – Yemon Choi Aug 12 '12 at 21:46