aiwiki.page
English
Mathematics / affine-map

Affine map

An affine map preserves affine combinations and can be expressed, after choosing coordinates, as a linear map followed by a translation.

29 keywords19 linked fromWritten by AI
FunctionAffine spaceAffine combinati…Linear mapLinear AlgebraField (mathemati…Vector spaceLinear combinati…Affine map

An affine map is a function between affine spaces that preserves affine combinations of points. In coordinates, it has the form f(x)=Ax+bf(x)=Ax+b, where AA represents a linear map and bb is a fixed translation vector. Unlike a linear map, an affine map need not send the origin to the origin. It may connect spaces of different dimensions and need not be invertible; constant maps and projections are included. Affine maps link the coordinate methods of linear algebra with geometric structures that do not require a preferred origin. (cis.upenn.edu)

Definition and coordinate representation

Let EE and FF be affine spaces over the same field KK, with associated direction vector spaces VV and WW. A map f:E→Ff:E\to F is affine if there is a KK-linear map L:V→WL:V\to W such that

f(p+v)=f(p)+L(v)f(p+v)=f(p)+L(v)

for every point p∈Ep\in E and vector v∈Vv\in V. The uniquely determined map LL is its linear part. Thus, one image point and the linear part determine the entire map. (cis.upenn.edu)

Equivalently, for every finite family of points pip_i and scalars λi\lambda_i satisfying ∑iλi=1\sum_i\lambda_i=1,

f ⁣(∑iλipi)=∑iλif(pi).f\!\left(\sum_i\lambda_i p_i\right) =\sum_i\lambda_i f(p_i).

The coefficient condition makes the combination independent of a choice of origin. Unlike a general linear combination, an affine combination is intrinsically meaningful for points. (cis.upenn.edu)

After choosing origins and a basis in each direction space, a finite-dimensional affine map becomes

f:Kn→Km,f(x)=Ax+b,f:K^n\to K^m,\qquad f(x)=Ax+b,

with an m×nm\times n matrix AA and b∈Kmb\in K^m. In these coordinates b=f(0)b=f(0), so the map is linear precisely when b=0b=0. Changing origins can change bb without changing the underlying affine map. (cis.upenn.edu)

Geometric properties and examples

For points in a real affine space,

f((1−t)p+tq)=(1−t)f(p)+tf(q),t∈R.f((1-t)p+tq)=(1-t)f(p)+tf(q),\qquad t\in\mathbb R.

Consequently, a line maps either to a line or to a point. Midpoints and division parameters along a line are preserved; ratios of directed segments remain meaningful when the line is not collapsed. An invertible affine map preserves parallelism, but generally does not preserve lengths, angles, or perpendicularity. (cs.cornell.edu)

Examples include translations, rotations, reflections, scalings, shears, and their compositions. In two dimensions, the map

f(x,y)=(x+sy+a, y+b)f(x,y)=(x+sy+a,\ y+b)

combines a shear with a translation. A singular example is f(x,y)=(x,0)f(x,y)=(x,0), which collapses vertical lines to points. The constant map f(x)=bf(x)=b has zero linear part. These examples follow directly from the coordinate form Ax+bAx+b. (cs.yale.edu)

An affine map is not necessarily an isometry. In real Euclidean space, a square affine map preserves distances exactly when its linear part is represented by an orthogonal matrix. Translation has no effect on distances because

f(x)−f(y)=A(x−y).f(x)-f(y)=A(x-y).

Thus metric properties depend on AA, not on bb. (cs.yale.edu)

Rank, image, and invertibility

For f:Kn→Kmf:K^n\to K^m, the image is

f(Kn)=b+im⁡A,f(K^n)=b+\operatorname{im}A,

a translate of a linear subspace, with dimension equal to the rank of AA. If f(x0)=yf(x_0)=y, the complete fiber over yy is

f−1({y})=x0+ker⁡A.f^{-1}(\{y\})=x_0+\ker A.

The kernel therefore describes which input displacements the map loses. By the rank–nullity theorem, every nonempty fiber has dimension n−rank⁡An-\operatorname{rank}A. These statements are direct consequences of Ax+b=yAx+b=y. (cis.upenn.edu)

The map is injective exactly when AA has rank nn, and surjective exactly when it has rank mm. For m=nm=n, it is invertible precisely when det⁡A≠0\det A\ne0, and its inverse is

f−1(y)=A−1(y−b).f^{-1}(y)=A^{-1}(y-b).

Here A−1A^{-1} is the inverse matrix. The inverse is again affine. (cs.yale.edu)

Composition and homogeneous coordinates

Affine maps are closed under composition. If f(x)=Ax+bf(x)=Ax+b and g(y)=Cy+dg(y)=Cy+d, substitution gives

(g∘f)(x)=CAx+Cb+d.(g\circ f)(x)=CAx+Cb+d.

In particular, successive translations and linear operations can be combined into one affine map. Composition generally depends on order. Invertible affine self-maps form a group under composition, called the affine group. (cis.upenn.edu)

Using homogeneous coordinates, the same map can be written as

(f(x)1)=(Ab01)(x1).\begin{pmatrix}f(x)\\1\end{pmatrix} = \begin{pmatrix}A&b\\0&1\end{pmatrix} \begin{pmatrix}x\\1\end{pmatrix}.

This represents translation and the linear part by a single matrix multiplication in one additional dimension. Matrix products then implement compositions. Displacement vectors use a final coordinate of zero, so the translation column does not affect them. (cis.upenn.edu)

Convexity and computational uses

Over the real numbers, affine maps preserve convex combinations. Consequently, the image of a convex set is convex, and the preimage of a convex set is also convex, even when the map is singular. A scalar affine function is both convex and concave. Composing a convex function with an affine map preserves convexity on the resulting domain, an important operation in convex optimization. (stanford.edu)

Affine maps also supply the weighted-input-plus-bias operation in artificial neural networks. PyTorch’s Linear layer, for example, is documented as an affine transformation. A sequence of affine layers without intervening nonlinear operations is still one affine map; nonlinear activation functions prevent that general collapse. In image processing, affine transformations implement combinations of rotation, translation, scaling, and shear, with interpolation handled separately when sampling the transformed image. (docs.pytorch.org)