Any smooth manifold comes with its sheaf of rings of smooth functions. This sheaf labels each open set in with the set of smooth, real-valued function defined over . Given any point , the stalk at , written , is defined to be the direct limit over the directed set of all open neighborhoods of (this directed set is written as ):
Elements of are called germs at and they are essentially “shreds” of a smooth function at a point. They can be interpreted somewhat abstractly as the set of functions that are defined “close” to , on an infinitesimal (or, if you prefer, arbitrary small) open neighborhood around . Concretely, germs are equivalence classes, each one represented by a smooth function defined on some open set containing . For any germ at , we may evaluate any representative function at , and this gives a well-defined morphism of rings, called the evaluation at : The kernel of is precisely the ideal of smooth functions which vanish at , which we denote . Because , the ideal is actually a maximal ideal. Since any germ not in is represented by a smooth function which is nonzero and thus invertible around , the ideal is the only maximal ideal of the ring . We say in that case is a local ring, and is a locally ringed space because is a local ring at every point of the smooth manifold .
Recall how products of ideals work: the ideal is the ideal generated by products of the form , with both and germs at that vanish there. Because , we can take the quotient . This ideal in is actually a real vector space, in a natural way (hint: ). It can be used as the definition of the cotangent space at on the manifold, written as . If is of dimension then, by the multivariate version of Taylor’s theorem, any smooth function can be written, in local coordinates around , as where is a linear map , each is a multi-index as usual, each is some real number, and each is a function such that . From this, we see that the germ is represented by in , since the part where we sum over indices with is killed when we quotient out . Now we see that is actually a finite real vector space of dimension , with basis the set of (classes of) germs represented by the linear maps which are defined around and which send, in the local coordinates, a point to its -th coordinate. We write these linear maps as . Now the tangent space at a point on a smooth manifold , written as , can be defined as the dual of the vector space .
The construction of the tangent space from the cotangent space is interesting. It shows how the cotangent space is somehow more algebraically natural, while the tangent space is obviously more natural from a geometrical point of view. This illustrate a general phenomenon, where geometry and algebra are two sides of the same coin. But this is also interesting because we only used the locally ringed space structure on the manifold (the fact we have smooth functions was only used to show it corresponds to the usual definition). Hence we can go through the cotangent space construction in order to build tangent spaces at points on any locally ringed space, such as schemes.