An affine space or affine linear space is a vector space that has forgotten its origin. An affine linear map (a morphism of affine spaces) is a linear map (a morphism of vector spaces) that need not preserve the origin.
Note that the ‘linear functions’ of elementary algebra —the total functions whose graphs are lines— are in fact (precisely) affine -linear maps from to itself. (Similarly, the ‘linear relations’ —the relations whose graphs are lines— are precisely the projective -linear maps.)
The definition of affine space can be made precise in various (equivalent) ways. We give a name to some of the definitions for later reference.
There should be another characterisation, which I don't quite see how to phrase, at least when , which is that an affine space is a manifold (perhaps Riemannian) that is sufficiently flat and unbounded in some sense. —Toby
Mike Shulman: It’d have to be at least Riemannian, otherwise you don’t have enough structure. I don’t suppose it’s enough to say that a (finitely generated) affine space is a Riemannian manifold isometric to some ?
Toby: I intended ‘that is  in some sense’ to include the possibility of structure that should be preserved by the morphisms. Note that a Riemannian manifold is too much structure, although it allows a definition like the first one above. (A Riemannian manifold isometric to some is precisely a Euclidean space.) But really, I'm hoping for some phrasing such that ‹isomorphic to some › actually becomes a (not too obvious) theorem. I'll keep thinking about it.
Mike Shulman: Shouldn’t a Riemannian manifold isometric to some be a “Euclidean affine space” (a torsor over a Euclidean space)? Seems that a Euclidean space would be a Riemannian manifold equipped with an isometry to some . It does seem like there should be a natural way to say this, but I don’t know what it is.
Toby: I guess that this depends on what you think ‘Euclidean space’ means; I've known people to define it to be , but that seems quite ahistorical to me; I like that Urs calls such a thing Cartesian space instead. Euclid did not have coordinates; he did not even have an origin, so a Euclidean space should be a heap rather than a group. For my comment above, I would define a Euclidean space to be an affine inner product space; FWIW Wikipedia agrees. (However, Wikipedia doesn't go as far as I do when I claim that the inner product should be valued in an -line rather than in itself; then again, I ignored that subtlety myself in my previous comment.)
Mike Shulman: I think there should also be a definition of the form “an affine space is a projective space” with a distinguished line called “infinity,” and an affine linear map is a projective morphism which preserves infinity. But I’m not going to put that in the list until I’m sure.
Clearly every vector space has an underlying affine space (and every linear map is affine linear), giving a forgetful functor . Conversely, any affine space gives rise to a canonical vector space, sometimes called its space of displacements. This is obvious from the definitions that involve a vector space as part of the structure, but a vector space can also be reconstructed from the other definitions as well, analogously to how a group can be reconstructed from a heap. This gives a functor in the other direction. One can verify that and ; the first isomorphism is natural, but the second is not (otherwise and would be equivalent categories, which they are not).
The category of affine spaces is almost a variety of algebras, as can be seen from the last few definitions, except for the requirement that an affine space be inhabited. To rectify this, sometimes one allows the empty set to be an affine space, although it does not have any particular vector space of displacements.
Note that there are a few different ways to think about the operations involved in the final three definitions (those not explicitly involving a vector space). The operation is the same as the Mal'cev operation (i.e. heap structure) of the additive group of a vector space. It can be viewed as the point completing a parallelogram with given vertices , or equivalently as the result of adding and , relative to a choice of as the origin. The operation can be viewed as either a weighted average of and (i.e. as ) or as the result of multiplying the “displacement vector” by , relative to the origin (i.e. as ).
The first few definitions, which explicitly involve a vector space, make no especial use of the fact that the vector space is a vector space rather than merely an abelian group. Thus, they are valid (and equivalent) in the more general context of torsors and heaps. They are also mostly complete as stated, except for the final one.
In this definition, an affine space over a vector space is a set together with a “subtraction” function , written , such that:
If , then we write , which we can regard as an operation on and by the third axiom. Hence we have and (by uniqueness) , and also and by the first two axioms. Thus, these axioms suffice to make into a torsor over the additive group of with the action , which is one of the previous definitions given.
Note again that this would makes sense if is any group, not just the additive group of a vector space.
This definition is an affine version of the usual definition of a vector space in terms of addition and scalar multiplication. However, in each case the affine operation needs to take an extra parameter. In reading the following axioms it helps to think of as “the sum of and relative to the basepoint ” and likewise as “the product relative to the basepoint ”.
This definition is an affine version of the less standard definition of a vector space in terms of a single operation . Here an affine space over is a set together with a single operation , written as and thought of as the sum ” relative to the basepoint ,” such that:
In the affine case (in contrast to the vector space case), it turns out that if is invertible the “addition” can be recovered from the “scalar multiplication” by . Thus, in this case we can define an affine space over to be a set together with a single operation such that the axioms for the two-ternary-operations definition are satisfied with this definition of .
However, we can also simplify the requisite axioms in this presentation. The following axioms are easier to state if we write as , or equivalently as , where we require for the expression to be defined.
The first is defined whenever , the second whenever , and the third whenever . Since has characteristic , we cannot have and at the same time, so at least one of these expressions is always defined. We write for the common value of whichever of them are defined.
Let denote the Lawvere theory of -vector spaces. For any , its -ary operations are -tuples representing the linear combination operation . Composition of operations is by substitution in the obvious way, and the identity operation is . A model of this theory is simply a vector space. With this ‘unbiased’ definition, a vector space comes equipped with, for every integer and -tuple of elements of , a function (thought of as ), satisfying some axioms.
Let denote the subtheory of containing only those operations such that ; an affine space is a nonempty model of . (We have to observe that these are closed under the theory operations and thus define a subtheory. Note that this excludes all zero-ary operations, so an affine space has no distinguished constants, and it also excludes all nonidentity unary operations.) The basic operations , when , are called affine (linear) combinations of elements of .
The axioms for the unbiased definition are most straightforward to see by writing out the operations of . In particular, this includes “substitution” axioms of the form
However, it also includes “permutation” axioms of the form
and also “duplication” and “omission” axioms. This Lawvere theory can be defined concisely as follows. The Lawvere theory of vector spaces is the opposite of the category of finite-dimensional vector spaces; its operations are all linear combinations. The Lawvere theory for affine spaces is the sub-theory of this consisting of only the affine combinations. (The Lawvere theory of vector spaces also has other interesting sub-theories, such as that consisting of convex combinations whose algebras are abstract convex spaces in one sense of the term.) Note that the empty set is a model (algebra) of this Lawvere theory; an affine space is an inhabited model.
Given the unbiased definition in terms of a Lawvere theory, the previous three “biased” vector-space-free definitions can then be recovered by finding particular generating operations for the theory. In particular, this Lawvere theory is generated by -ary operations if , and by -ary ones if . To wit, suppose given with such that . Suppose for the moment that the are not all , and WLOG suppose that . (Note that here we use the invariance under permutations.) Then we have
so we have expressed the given -ary operation in terms of a -ary one and an -ary one. By induction, in this way we can express any -ary operation in terms of -ary ones (note that there is only one -ary operation, namely the identity, and no -ary ones) — as long as we never hit a tuple where every . But since we always have the requirement , this badness can only happen if the characteristic of is . Moreover, we still have
so we can still write this -ary operation in terms of a -ary one and an -ary one. So only if (i.e. ) are we prevented from getting down to -ary operations only, and in this case we can still get down to -ary ones. Finally, we observe that any -ary operation can be written in terms of -ary ones and the particular -ary operation :
Every finitely-generated affine space is isomorphic to the -fold direct sum , where is the base field and is a natural number (possibly ). In algebraic geometry, an -dimensional affine space is often denoted and identified with . If one accepts the empty set as an affine space, then this is considered to have dimension by convention (so ).
The notion of affine space may be generalised to affine module by replacing the vector space above by a module and the base field by a commutative ring. Then an affine module over the ring of integers is precisely a commutative heap, just like a module over is an abelian group. Note that the definition involving only one, “scalar multiplication”, operation works if and only if is invertible in ; it's not enough that in .
Mike Shulman: I haven’t thought much about affine modules, but it seems likely to me that the “biased” module-free definitions won’t be right any more, since the Lawvere theory needn’t be generated by 2-ary or 3-ary operations (as far as I can see). More explicitly, I don’t immediately see how to write an operation like
in terms of and , but it seems to me that this operation should still exist in an affine -module.
Mike Shulman: Well that’s rubbish isn’t it. The operation is enough to give you a heap, hence an additive group, and then gives you the scalar multiplication. And so
for any at all.
Toby: Right. But I find an affine module of a rig to be a trickier concept.
Toby: Yes, that would be an affine -module.
Affine spaces typically serve as local models for more general kinds of spaces.
Therefore there are attempts to axiomatize properties of categories of affine spaces for the purpose of using these as model spaces for more complicated geometries. One such axiomatization is the notion of geometry (for structured (∞,1)-toposes). and in particular that of pregeometry.