Mathematical objects become richer when they can be related to each other. In linear algebra the objects of interest are vector spaces, and the way they are related to each other is by means of linear maps. The word "map" is a synonym of "function".
1. Definition and first examples
Definition (linear map). Let V,W be two vector spaces. A function f:V→W is called linear (or a linear map, or a linear transformation) if it satisfies
f(v+v′)=f(v)+f(v′)for all v,v′∈V,(L1)
f(av)=af(v)for all a∈R,v∈V.(L2)
The vector space V is called the domain of f and W the codomain of f.
Remark (one condition instead of two). The two conditions are equivalent to the single requirement
f(av+a′v′)=af(v)+a′f(v′)for all a,a′∈R,v,v′∈V,
which says that fpreserves linear combinations.
Consequence: f(0V)=0W. Since 0⋅v=0V, condition (L2) gives
f(0V)=f(0⋅v)=0⋅f(v)=0W.
So a linear map sends the zero vector of V to the zero vector of W.
Examples
Example 1 (reflection at the x-axis). The map f:R2→R2, f(x,y):=(x,−y) is linear. For (L1): if v=(x,y) and v′=(x′,y′), then
Checking (L2) is similar. Geometrically, (L1) says that reflecting the diagonal of the parallelogram spanned by v,v′ gives the diagonal of the reflected parallelogram. Below we see this map as multiplication by the matrix (100−1).
Example 2 (derivative). The map
D:R[x]→R[x],D(f):=f′
(the derivative of a polynomial) is linear, because of the formulae (f+g)′(x)=f′(x)+g′(x) and (af)′(x)=af′(x). Alternatively, with f(x)=∑n=0danxn and g(x)=∑n=0dbnxn, using f′(x)=∑n=1dnanxn−1:
Example 3 (abstract examples). Let V be any vector space.
The identity mapid=idV:V→V, id(v)=v, is linear.
For any other vector space W the zero map0:V→W, sending every v to 0W, is linear.
For any a∈R the map V→V, v↦av (scalar multiplication) is linear. This follows from the axioms of a vector space.
Non-examples.
f:R→R, f(x)=x2 is not linear: f(x+y)=x2+2xy+y2=x2+y2=f(x)+f(y). Also f(ax)=a2x2=ax2=af(x).
f:R→R, f(x)=x+1 is not linear: f(x+y)=x+y+1=(x+1)+(y+1)=f(x)+f(y), so (L1) fails; (L2) fails too, since f(ax)=ax+1=a(x+1)=af(x). (Another way to see it: f(0)=1=0.)
2. Multiplication of a matrix with a vector
This is an extremely important way to construct linear maps.
Definition. Let A=(aij)1≤i≤m,1≤j≤n be an m×n-matrix and v=v1⋮vn an n×1-matrix (a column vector with n rows). The product of A with v is the column vector with m entries
The i-th entry of Av is computed by traversing the i-th row of A and multiplying each entry of that row with the corresponding entry of v, then adding up.
Observation (matrices encode linear systems). Let A be an m×n-matrix, x=(x1,…,xn)T a column of unknowns and b=(b1,…,bm)T a column of constants. Then the equation Ax=b is equivalent to the linear system of m equations in x1,…,xn
a11x1+⋯+a1nxn=b1,…,am1x1+⋯+amnxn=bm.
For example, the system x+3y−2z=1, y=4, x−z=2 is the equation A(x,y,z)T=(1,4,2)T with the matrix A above.
Proposition (matrix multiplication is linear). For any m×n-matrix A, the map Rn→Rm, v↦Av, is linear.
which is the i-th entry of Av+Av′. Hence A(v+v′)=Av+Av′. For a∈R, the i-th entry of A(av) is ∑jaijavj=a∑jaijvj, so A(av)=a(Av). (The source writes this out for m=n=2, where A(v+v′)=(a11(v1+v1′)+a12(v2+v2′)a21(v1+v1′)+a22(v2+v2′)); the general case is only notationally more involved.) □
2.1 The case of 2×2-matrices: geometry
For A=(a11a21a12a22) and v=(xy) we have Av=(a11x+a12ya21x+a22y), and f:R2→R2, v↦Av ("v maps to Av") is a linear map depending on the entries of A.
Matrix A
Effect of v↦Av
(100−1)
Av=(x,−y): reflection of v at the x-axis
(r00s)
rescales the x-direction by r and the y-direction by s (shrinks if the factor is below 1 in absolute value, enlarges if above 1)
(10r1)
Av=(x+ry,y): shearing
(01−10)
Av=(−y,x): counterclockwise rotation by 90∘
(−100−1)
Av=(−x,−y): rotation by 180∘ (counterclockwise or clockwise, the same)
(cosrsinr−sinrcosr)
Av=(cosr⋅x−sinr⋅y,sinr⋅x+cosr⋅y): counterclockwise rotation by the angle r (a rotation matrix)
Details from the source:
For the reflection, v=(3,4) goes to Av=(3,−4).
The matrix (21001) compresses the x-direction by the factor 21 and leaves the y-direction untouched. For (21002), the vector v=(3,2) goes to Av=(23,4).
For the shear with r=2, the vector v=(−3,4) goes to Av=(5,4): the height y is kept, and the point slides horizontally by ry.
For the rotation by 90∘, v=(3,4) goes to Av=(−4,3).
3. Kernel and image
The kernel and the image measure how "interesting" a linear map is. The zero map R2→R2 only produces the zero vector; a rotation by a fixed angle r is more interesting, since every point can be obtained from another point by rotating by r.
3.1 Preliminaries on maps between sets
Definition. Let f:X→Y be a function between two sets.
The preimage of y∈Y is f−1(y):={x∈X∣f(x)=y}(⊆X).
The image of f is im(f):=f(X):={f(x)∣x∈X}(⊆Y).
f is injective (one-to-one) if for each y the preimage f−1(y) contains at most one element.
f is surjective (onto) if for each y the preimage f−1(y) contains at least one element. Equivalently, im(f)=Y.
f is bijective if it is both injective and surjective, i.e. for each y∈Y the preimage f−1(y) contains exactly one element.
Example (birthdays). For a group of people {P1,…,Pn} let m:{P1,…,Pn}→{1,…,12} assign to each person the month of birth. It is surjective if in each month someone is born; injective if in each month at most one birthday party happens; bijective if in every month there is exactly one birthday party. In particular m can only be bijective if n=12: the two sets must have the same size. For vector spaces (which are infinite) the right notion of "size" is the dimension, see the corollary on rank-nullity below.
3.2 Kernel and image of a linear map
Definition. Let f:V→W be linear. The kernel of f is
ker(f):=f−1(0W)={v∈V∣f(v)=0W}.
Note ker(f)⊆V and im(f)⊆W; in fact these are subspaces:
Proposition. For a linear map f:V→W, kerf is a subspace of V and imf is a subspace of W.
Proof (for the kernel; the image is similar). We check the subspace conditions.
0V∈kerf: this means f(0V)=0W, which holds by the consequence of linearity proved above.
If v,v′∈kerf then v+v′∈kerf: by linearity, f(v+v′)=f(v)+f(v′)=0W+0W=0W.
If v∈kerf and a∈R then av∈kerf: f(av)=af(v)=a⋅0W=0W.
For the image: 0W=f(0V)∈imf; if w=f(v) and w′=f(v′) are in the image then w+w′=f(v+v′) and aw=f(av) are in the image as well. □
Example. Let A=(122400) and f:R3→R2, (x,y,z)T↦Av=(x+2y,2x+4y)T.
Kernel. We need x+2y=0 and 2x+4y=0 (in the unknowns x,y,z). So
kerf=⎩⎨⎧−2yyz∣y,z∈R⎭⎬⎫,
with basis −210,001, so dimkerf=2.
Image. The image consists of all (x+2y,2x+4y) with x,y arbitrary (z does not appear). So v2=2v1 and v1 is arbitrary:
imf={(v12v1)∣v1∈R}⊊R2,
with basis (12), so dimimf=1.
Observe dimkerf+dimimf=2+1=3=dimR3: an instance of the rank-nullity theorem below.
3.3 Injectivity is measured by the kernel
Lemma. Let f:V→W be a linear map. The following are equivalent:
f is injective;
kerf={0V}.
Proof. (1) ⇒ (2): Since f(0)=0 we have 0∈kerf. If v∈kerf then f(v)=0W, so both v and 0V are in the preimage of 0W. By injectivity, v=0.
(2) ⇒ (1): Suppose v,v′∈V lie in the preimage of the same w∈W, i.e. f(v)=f(v′)=w. By linearity
f(v−v′)=f(v+(−1)v′)=f(v)+(−1)f(v′)=f(v)−f(v′)=0.
So v−v′∈kerf={0}, hence v=v′. Therefore f is injective. □
3.4 The rank-nullity theorem
Theorem (rank-nullity). Let f:V→W be a linear map between (finite-dimensional) vector spaces. Then
dim(kerf)+dim(imf)=dimV.
The rank of f is rkf:=dim(imf), the nullity of f is dim(kerf).
The source refers to textbooks for the proof and records the following fact, which contains its essence:
Theorem. Let f:V→W be linear and let v1,…,vr,vr+1,…,vn be a basis of V such that v1,…,vr is a basis of kerf. Then f(vr+1),…,f(vn) is a basis of imf.
How rank-nullity follows. Here dimkerf=r and dimimf=n−r (the number of vectors f(vr+1),…,f(vn)), hence r+(n−r)=n=dimV. (Such a basis of V always exists: take a basis of kerf and extend it to a basis of V, see the chapter on vector spaces.)
Corollary. Let f:V→W be a linear map between finite-dimensional vector spaces.
If f is injective then dimV≤dimW (then kerf={0}, i.e. dimkerf=0, so dimimf=dimV≤dimW).
If f is surjective then dimV≥dimW (then imf=W, so dimimf=dimW≤dimV).
If f is bijective then dimV=dimW.
These statements cannot be reversed in general: if dimV≤dimW, f need not be injective. For example the zero map V→W is never injective if V={0}.
If in addition dimV=dimW, then f is injective if and only if f is surjective. (If f is injective, dimimf=dimV=dimW, so imf=W because a subspace of a finite-dimensional space with the same dimension is the whole space. If f is surjective, dimimf=dimW=dimV, so dimkerf=0 and kerf={0}.)
3.5 Image and kernel of a matrix; column and row space
Let f:Rn→Rm be the map v↦Av for an m×n-matrix A. The rank and nullity of A are those of f; the rank is written rkA.
Recall the standard basis vectors e1=(1,0,…,0)T,…,en=(0,…,0,1)T, written as columns. Then
The product Aei is precisely the i-th column of A. Every v=∑ibiei gives f(v)=∑ibif(ei), a linear combination of the columns of A. This proves:
Proposition. Write A=(c1c2…cn) with columns ci∈Rm. Then imf=L(c1,…,cn) (the span of the columns). This subspace of Rm is the column space of A.
Definition. The row space of A is the subspace of Rn spanned by the rows of A.
Proposition (computing the rank). Let A be an m×n-matrix and let B be a (possibly non-reduced) row-echelon matrix obtained from A by elementary row operations.
The non-zero rows of B form a basis of the row space of A.
If the leading ones of B lie in the columns j1,…,jr, then these columns of A (not of B) form a basis of the column space of A.
The following numbers are all equal: (a) rkA, (b) the dimension of the column space, (c) the dimension of the row space, (d) the number of leading ones in B.
The nullity of A equals n (the number of columns) minus any of the quantities in point 3.
Proof. (1) and (2) follow by showing that the row and column spaces do not change under an elementary row operation (the source skips this part). (3): by definition rkA=dimimf, which by the previous proposition is the dimension of the column space; by (2) it equals the number of leading ones in B. Since B is in row-echelon form this is also the number of non-zero rows, i.e. by (1) the dimension of the row space. (4) is a consequence of rank-nullity. □
Example. Let
A=13126225110−2,f:R4→R3,v↦Av.
Row reduction (R2−3R1, R3−R1, then multiply the second row by −1, then R3−R2):
Row space: basis (1,2,2,1) and (0,0,1,3), dimension 2 (a subspace of R4).
The leading ones are in columns 1 and 3, so a basis of the column space (a subspace of R3) is given by columns 1 and 3 of A:
imf=L131,251,rkf=rkA=2.
Rank-nullity: dimkerf=4−2=2. To find a basis: x2 and x4 are free variables, x3=−3x4 from the second row, and x1=−2x2−2x3−x4=−2x2+5x4. A basis of kerf is
−2100,50−31.
Remark. The row space and column space have the same dimension but are in general different spaces; they are not even comparable, since the row space lies in Rn and the column space in Rm.
3.6 Dimension formula for two subspaces
Theorem. If A,B are subspaces of a vector space V, then
dim(A∩B)+dim(A+B)=dimA+dimB.
Proof. The map f:A⊕B→V, (a,b)↦a−b is linear (A⊕B is the space of pairs, of dimension dimA+dimB). Since with b also −b lies in B, the image of f is A+B. The kernel consists of the pairs (a,b) with a−b=0, i.e. a=b; this means a∈A∩B, so kerf={(a,a)∣a∈A∩B} has dimension dim(A∩B). By rank-nullity,
Let A=(aij) be the m×n-matrix of coefficients of a system Ax=b, and f:Rn→Rm, v↦Av.
Theorem.
If b=0 (homogeneous system), the solution set equals kerf; in particular it is a subspace of Rn.
For arbitrary b, the system has at least one solution if and only if b∈imf. If r is any solution, then the solution set consists precisely of the vectors
r+kerf:={r+v∣v∈kerf}.
Proof.f−1(b)={r∈Rn∣Ar=b} is exactly the set of solutions. So kerf=f−1(0) is the set of solutions of the homogeneous system, and the system is solvable exactly when f−1(b)=∅, i.e. b∈imf. For the last statement:
If s is a solution, then f(s−r)=f(s)−f(r)=b−b=0 by linearity, so v:=s−r∈kerf and s=r+v.
Conversely, for v∈kerf: f(r+v)=f(r)+f(v)=b+0=b, so r+v is a solution. □
Remark. For b=0 the solution set r+kerf is never a subspace (it does not contain 0, since A0=0=b). It is a translation of kerf:
ker f = f^{-1}(0): a line (or plane...) through the origin 0
r + ker f = f^{-1}(b): the parallel copy of ker f shifted by r
(every point r + v, v in ker f, is a solution; 0 is not one when b is not 0)
Example. For the system x+3y+5z=7,3x+9y+10z=11,2x+9y+12z=10 the coefficient matrix is
A=13239951012.
Row reduction (R2−3R1, R3−2R1, then scale and swap):
An arbitrary map f:V→W requires specifying f(v) for every v∈V. For linear maps this simplifies drastically:
Proposition. Let v1,…,vn be a basis of a vector space V, let W be another vector space and w1,…,wn arbitrary vectors of W (they need not be linearly independent, nor span W). Then there is a unique linear map f:V→W such that f(vi)=wi for all i.
Proof. Every v∈V can be written uniquely as v=b1v1+⋯+bnvn (the coordinates of v in the basis). For another v′=∑bi′vi and a∈R we have v+v′=∑(bi+bi′)vi and av=∑(abi)vi. Existence: define
f(v):=i=1∑nbiwi.
Then f(vi)=wi, and by the formulas just written f(v+v′)=∑(bi+bi′)wi=f(v)+f(v′) and f(av)=∑abiwi=af(v), so f is linear. Uniqueness: if a linear f satisfies f(vi)=wi, it must satisfy f(v)=f(∑bivi)=∑bif(vi)=∑biwi, which is the map defined above. □
Example. In V=R3 take the basis v1=e1=(1,0,0), v2=e2=(0,1,0), v3=(0,1,1). There is a unique linear map f:R3→R3 with
f(v1)=(2,1,0),f(v2)=(1,−1,1),f(v3)=(0,2,2).
To find f(e3): e3=−v2+v3, so
f(e3)=−f(v2)+f(v3)=−(1,−1,1)+(0,2,2)=(−1,3,1).
With respect to the standard basis (different from the basis v!) the matrix of f has as columns f(e1),f(e2),f(e3):
A=2101−11−131,
i.e. f agrees with v↦Av. (Check: A(0,1,1)T=(0,2,2)T=f(v3).)
6. Isomorphisms and inverses of linear maps
Given a linear map f:V→W, can applying f be undone? A counterclockwise rotation by 60∘ is undone by rotating clockwise by 60∘. But R2→R2, (x,y)↦(x,0) cannot be undone: (x,y) cannot be recovered from x only.
Definition and Lemma. Let f:V→W be linear. The following are equivalent:
f is bijective;
there is a linear map g:W→V with g∘f=idV and f∘g=idW (i.e. g(f(v))=v for all v∈V and f(g(w))=w for all w∈W).
If this holds, f is called an isomorphism. Then such a g is unique, called the inverse of f and denoted f−1:W→V; and dimV=dimW.
Proof of (1) ⇒ (2). Since f is bijective, the preimage f−1(w) consists of exactly one element, say f−1(w)={v}. Define g(w):=v.
g(f(v))=v: the only element of V mapped to f(v) is v.
f(g(w))=w: if f−1(w)={v} then f(v)=w and g(w)=v.
g is linear: given w,w′∈W let v,v′ be the unique elements with f(v)=w, f(v′)=w′, so g(w)=v, g(w′)=v′. By linearity w+w′=f(v+v′), hence g(w+w′)=v+v′=g(w)+g(w′). Similarly g(aw)=ag(w).
Uniqueness: if g′ also satisfies f(g′(w))=w then f(g′(w))=f(g(w)), and by injectivity g′(w)=g(w).
dimV=dimW follows from part 3 of the rank-nullity corollary. □
Combined with part 5 of the corollary: a linear map between spaces of the same finite dimension is an isomorphism as soon as it is injective, or equivalently as soon as it is surjective.
Definition.f:V→W is linear if f(v+v′)=f(v)+f(v′) and f(av)=af(v); equivalently f preserves linear combinations. Then f(0V)=0W (a map with f(0)=0, like x+1, is not linear; x2 is not linear either).
Examples. Reflection (x,y)↦(x,−y), derivative D:R[x]→R[x], identity, zero map, scalar multiplication, and v↦Av for any m×n-matrix A (the i-th entry of Av is row i of A times v; Ax=b is a linear system).
2D matrices. Reflection (100−1); rescaling (r00s); shear (10r1) (v↦(x+ry,y)); rotation by r counterclockwise (cosrsinr−sinrcosr) (90∘: (x,y)↦(−y,x)).
Kernel and image.kerf=f−1(0W) is a subspace of V; imf is a subspace of W. f is injective ⟺kerf={0V} (if f(v)=f(v′) then v−v′∈kerf).
Rank-nullity.dimkerf+dimimf=dimV (rkf=dimimf). If v1,…,vr is a basis of kerf extended to a basis v1,…,vn of V, then f(vr+1),…,f(vn) is a basis of imf.
Corollary. Injective ⇒dimV≤dimW; surjective ⇒dimV≥dimW; bijective ⇒dimV=dimW (the converses fail, e.g. the zero map). If dimV=dimW: injective ⟺ surjective.
Matrices.Aei = i-th column of A, so im(v↦Av) = column space =L(c1,…,cn). Reduce A to echelon form B: non-zero rows of B = basis of the row space; columns of A (not of B) at the leading ones = basis of the column space; rkA = number of leading ones = dim row space = dim column space; nullity =n−rkA. Kernel basis: solve Ax=0 with free variables. Row space ⊆Rn, column space ⊆Rm: same dimension, different spaces.
Dimension formula.dim(A∩B)+dim(A+B)=dimA+dimB (apply rank-nullity to (a,b)↦a−b on A⊕B).
Linear systems. Solutions of Ax=0 form kerf. Ax=b is solvable ⟺b∈imf, and then the solution set is r+kerf for any particular solution r (a translate of kerf, never a subspace if b=0). Example: a 3×3 matrix of rank 3 gives one unique solution for every b.
Linear map on a basis. For a basis v1,…,vn of V and arbitrary w1,…,wn∈W there is a unique linear f with f(vi)=wi, namely f(∑bivi)=∑biwi. Use it to compute f on other vectors by writing them in the basis (e.g. e3=−v2+v3 gives f(e3)=−f(v2)+f(v3)).
Isomorphism.f bijective ⟺ there is a linear g with g∘f=idV and f∘g=idW; g=f−1 is unique and linear, and dimV=dimW.
Typical mistakes. Taking columns of B instead of A for the column space; forgetting that ker lives in the domain and im in the codomain; believing the solution set of Ax=b with b=0 is a subspace; using the dimension equality alone to conclude a map is bijective without injectivity or surjectivity.