Salta al contenuto
Note per Studenti Matrices and Change of Basis Report

Matrices and Change of Basis

In questa pagina 5

In Linear MapsA linear map between vector spaces preserves sums and scalar multiples; its kernel and image are subspaces whose dimensions add up to the dimension of the domain (rank-nullity), and a linear map is determined by its values on a basis.Linear Maps → we associated to an m×nm \times n-matrix AA the linear map Rn→Rm\mathbb{R}^n \to \mathbb{R}^m, v↦Avv \mapsto Av. Here we reverse the process: starting from a linear map we build a matrix, show that composition corresponds to the matrix product, study invertible matrices, and see how the matrix changes when the bases change.

1. The matrix associated to a linear map

Proposition (matrix of a linear map). Let V,WV, W be vector spaces with bases v1,…,vnv_1, \dots, v_n and w1,…,wmw_1, \dots, w_m respectively, and let f:V→Wf : V \to W be linear. Then there is a unique m×nm \times n-matrix A=(aij)A = (a_{ij}), the matrix associated to ff with respect to the given bases, such that

f(vi)=∑j=1maji wj(i=1,…,n).f(v_i) = \sum_{j=1}^{m} a_{ji}\, w_j \qquad (i = 1, \dots, n).

We write Mf,v,w:=(aij)M_{f,\mathbf{v},\mathbf{w}} := (a_{ij}), where v={v1,…,vn}\mathbf{v} = \{v_1, \dots, v_n\} and w={w1,…,wm}\mathbf{w} = \{w_1, \dots, w_m\}.

In words: the ii-th column of Mf,v,wM_{f,\mathbf{v},\mathbf{w}} contains the coordinates of f(vi)f(v_i) with respect to the basis w\mathbf{w}. For a general vector v=∑i=1nbiviv = \sum_{i=1}^{n} b_i v_i,

f(v)=∑i=1n∑j=1mbiaji wj,f(v) = \sum_{i=1}^{n} \sum_{j=1}^{m} b_i a_{ji}\, w_j,

i.e. the coordinates of f(v)f(v) are obtained by multiplying the matrix with the coordinate column (b1,…,bn)T(b_1, \dots, b_n)^T.

Proof. Each f(vi)∈Wf(v_i) \in W can be written in a unique way as a linear combination of the basis w1,…,wmw_1, \dots, w_m (uniqueness of coordinates). This gives the existence and uniqueness of the ajia_{ji}. For general vv, using linearity,

f(v)=f(∑ibivi)=∑ibif(vi)=∑ibi∑jajiwj=∑i∑jbiajiwj.□f(v) = f\Big(\sum_i b_i v_i\Big) = \sum_i b_i f(v_i) = \sum_i b_i \sum_j a_{ji} w_j = \sum_i \sum_j b_i a_{ji} w_j. \qquad \square

For V=RnV = \mathbb{R}^n, W=RmW = \mathbb{R}^m with the standard bases, and f(v)=Avf(v) = Av, we recover AA itself, because AeiA e_i is the ii-th column of AA.

Example. Take the linear map f:R3→R3f : \mathbb{R}^3 \to \mathbb{R}^3 with f(v1)=(2,1,0)f(v_1) = (2, 1, 0), f(v2)=(1,−1,1)f(v_2) = (1, -1, 1), f(v3)=(0,2,2)f(v_3) = (0, 2, 2) on the basis v1=e1v_1 = e_1, v2=e2v_2 = e_2, v3=(0,1,1)v_3 = (0, 1, 1) (see Linear MapsA linear map between vector spaces preserves sums and scalar multiples; its kernel and image are subspaces whose dimensions add up to the dimension of the domain (rank-nullity), and a linear map is determined by its values on a basis.Linear Maps →), so f(e3)=(−1,3,1)f(e_3) = (-1, 3, 1). Put w1=f(v1)w_1 = f(v_1), w2=f(v2)w_2 = f(v_2), w3=f(v3)w_3 = f(v_3). They form a basis of R3\mathbb{R}^3 since the matrix with rows w1,w2,w3w_1, w_2, w_3 has rank 3.

  • With bases v1,v2,v3v_1, v_2, v_3 (domain) and w1,w2,w3w_1, w_2, w_3 (codomain) the matrix is the identity (100010001)\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}, since f(vi)=wif(v_i) = w_i.
  • With the standard basis e1,e2,e3e_1, e_2, e_3 in the domain and w1,w2,w3w_1, w_2, w_3 in the codomain: f(e1)=w1f(e_1) = w_1, f(e2)=w2f(e_2) = w_2, f(e3)=−w2+w3f(e_3) = -w_2 + w_3, so the matrix is (10001−1001).\begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & -1 \\ 0 & 0 & 1 \end{pmatrix}. For instance the third column expresses f(e3)=a13w1+a23w2+a33w3=−w2+w3f(e_3) = a_{13} w_1 + a_{23} w_2 + a_{33} w_3 = -w_2 + w_3.

So the matrix depends not only on ff but also on the choice of the bases of VV and WW.

Example (rotation in a non-standard basis). Let A=(0−110)A = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} and f:R2→R2f : \mathbb{R}^2 \to \mathbb{R}^2, (x,y)↦(−y,x)(x, y) \mapsto (-y, x) (rotation by 90∘90^\circ). Take the basis v1=(1,0)v_1 = (1, 0), v2=(1,1)v_2 = (1, 1).

  • Matrix with respect to v\mathbf{v} in the domain and the standard basis in the codomain: v1=1e1+0e2v_1 = 1 e_1 + 0 e_2 and v2=1e1+1e2v_2 = 1 e_1 + 1 e_2, so by linearity f(v1)=f(e1)=(0,1)=0 e1+1 e2,f(v2)=f(e1)+f(e2)=(0,1)+(−1,0)=(−1,1)=−1 e1+1 e2,f(v_1) = f(e_1) = (0, 1) = 0\, e_1 + 1\, e_2, \qquad f(v_2) = f(e_1) + f(e_2) = (0, 1) + (-1, 0) = (-1, 1) = -1\, e_1 + 1\, e_2, and the matrix is (0−111)\begin{pmatrix} 0 & -1 \\ 1 & 1 \end{pmatrix}.
  • Matrix with respect to v\mathbf{v} in both domain and codomain: express (0,1)=−v1+v2(0, 1) = -v_1 + v_2 and (−1,1)=−2v1+v2(-1, 1) = -2 v_1 + v_2. So f(v1)=−v1+v2f(v_1) = -v_1 + v_2, f(v2)=−2v1+v2f(v_2) = -2 v_1 + v_2 and the matrix is (−1−211).\begin{pmatrix} -1 & -2 \\ 1 & 1 \end{pmatrix}.

2. Composing linear maps and multiplying matrices

Definition and Lemma. Let f:U→Vf : U \to V and g:V→Wg : V \to W be linear maps. The composition is g∘f:U→Wg \circ f : U \to W, u↦g(f(u))u \mapsto g(f(u)). It is again linear.

Proof. For u,u′∈Uu, u' \in U and a∈Ra \in \mathbb{R}, using linearity of ff and of gg:

(g∘f)(u+u′)=g(f(u+u′))=g(f(u)+f(u′))=g(f(u))+g(f(u′))=(g∘f)(u)+(g∘f)(u′),(g \circ f)(u + u') = g(f(u + u')) = g(f(u) + f(u')) = g(f(u)) + g(f(u')) = (g \circ f)(u) + (g \circ f)(u'),

(g∘f)(au)=g(f(au))=g(af(u))=a g(f(u))=a (g∘f)(u).□(g \circ f)(au) = g(f(au)) = g(a f(u)) = a\, g(f(u)) = a\,(g \circ f)(u). \qquad \square

Example. f:R2→Rf : \mathbb{R}^2 \to \mathbb{R}, (x,y)↦x(x, y) \mapsto x and g:R→R3g : \mathbb{R} \to \mathbb{R}^3, x↦(x,0,x)x \mapsto (x, 0, x) are linear, and g∘f:(x,y)↦g(x)=(x,0,x)g \circ f : (x, y) \mapsto g(x) = (x, 0, x). With h:R→R2h : \mathbb{R} \to \mathbb{R}^2, x↦(x,x)x \mapsto (x, x) we get h∘f:(x,y)↦(x,x)h \circ f : (x, y) \mapsto (x, x) and f∘h:R→Rf \circ h : \mathbb{R} \to \mathbb{R}, x↦f(x,x)=xx \mapsto f(x, x) = x. The composition f∘gf \circ g is not defined, since gg takes values in R3\mathbb{R}^3 but ff is defined on R2\mathbb{R}^2.

2.1 The matrix product

Definition. If A=(aij)A = (a_{ij}) is an m×nm \times n-matrix and B=(bij)B = (b_{ij}) is an n×kn \times k-matrix, the product ABAB is the m×km \times k-matrix whose entry in row ii and column jj is

∑e=1naiebej=ai1b1j+ai2b2j+⋯+ainbnj.\sum_{e=1}^{n} a_{ie} b_{ej} = a_{i1} b_{1j} + a_{i2} b_{2j} + \dots + a_{in} b_{nj}.

One picks the ii-th row of AA and the jj-th column of BB, multiplies corresponding entries and adds. The product is defined only if the number of columns of AA equals the number of rows of BB.

Example.

(1234)(−106−2)=(1⋅(−1)+2⋅61⋅0+2⋅(−2)3⋅(−1)+4⋅63⋅0+4⋅(−2))=(11−421−8).\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} -1 & 0 \\ 6 & -2 \end{pmatrix} = \begin{pmatrix} 1 \cdot (-1) + 2 \cdot 6 & 1 \cdot 0 + 2 \cdot (-2) \\ 3 \cdot (-1) + 4 \cdot 6 & 3 \cdot 0 + 4 \cdot (-2) \end{pmatrix} = \begin{pmatrix} 11 & -4 \\ 21 & -8 \end{pmatrix}.

A 2×32 \times 3 matrix times a 3×23 \times 2 matrix is a 2×22 \times 2 matrix, while the same two matrices multiplied in the other order give a 3×33 \times 3 matrix. A 3×23 \times 2 matrix times a 3×23 \times 2 matrix is not defined at all.

Remark (columns). If BB is an n×kn \times k-matrix with columns b1,…,bkb_1, \dots, b_k then AB=(Ab1 Ab2 … Abk)AB = (Ab_1\ Ab_2\ \dots\ Ab_k). For k=1k = 1 (a column vector BB) this is the matrix-vector product of Linear MapsA linear map between vector spaces preserves sums and scalar multiples; its kernel and image are subspaces whose dimensions add up to the dimension of the domain (rank-nullity), and a linear map is determined by its values on a basis.Linear Maps →.

Proposition (composition = product). Let AA be an m×nm \times n-matrix with map f:Rn→Rmf : \mathbb{R}^n \to \mathbb{R}^m, v↦Avv \mapsto Av, and let BB be an n×ln \times l-matrix with map g:Rl→Rng : \mathbb{R}^l \to \mathbb{R}^n, u↦Buu \mapsto Bu. Then f∘g:Rl→Rmf \circ g : \mathbb{R}^l \to \mathbb{R}^m is the map u↦(AB)uu \mapsto (AB)u.

Proof. Let C=AB=(cij)C = AB = (c_{ij}), an m×lm \times l-matrix, cij=∑r=1nairbrjc_{ij} = \sum_{r=1}^{n} a_{ir} b_{rj}. Two linear maps that agree on a basis are equal (uniqueness in the proposition on linear maps defined on a basis, see Linear MapsA linear map between vector spaces preserves sums and scalar multiples; its kernel and image are subspaces whose dimensions add up to the dimension of the domain (rank-nullity), and a linear map is determined by its values on a basis.Linear Maps →), so it suffices to compare f∘gf \circ g and u↦Cuu \mapsto Cu on the standard basis e1,…,ele_1, \dots, e_l of Rl\mathbb{R}^l. The product CeiC e_i is the ii-th column of CC:

Cei=∑s=1mcsies=∑s=1m∑r=1nasrbri es.C e_i = \sum_{s=1}^{m} c_{si} e_s = \sum_{s=1}^{m} \sum_{r=1}^{n} a_{sr} b_{ri}\, e_s.

On the other hand g(ei)=Bei=∑r=1nbrierg(e_i) = B e_i = \sum_{r=1}^{n} b_{ri} e_r and f(er)=Aer=∑s=1masresf(e_r) = A e_r = \sum_{s=1}^{m} a_{sr} e_s, so by linearity of ff

(f∘g)(ei)=f(∑rbrier)=∑rbrif(er)=∑rbri∑sasres=∑s∑rasrbri es=Cei.□(f \circ g)(e_i) = f\Big(\sum_{r} b_{ri} e_r\Big) = \sum_{r} b_{ri} f(e_r) = \sum_{r} b_{ri} \sum_{s} a_{sr} e_s = \sum_{s} \sum_{r} a_{sr} b_{ri}\, e_s = C e_i. \qquad \square

Proposition (matrices of a composition). Let f:U→Vf : U \to V and g:V→Wg : V \to W be linear with bases u1,…,ulu_1, \dots, u_l, v1,…,vmv_1, \dots, v_m, w1,…,wnw_1, \dots, w_n of U,V,WU, V, W. If AA is the matrix of ff (bases of UU and VV) and BB the matrix of gg (bases of VV and WW), then BABA is the matrix of g∘fg \circ f with respect to the bases of UU and WW. (Proved with similar arguments.)

2.2 Properties of matrix multiplication

Warning: the product depends on the order. For square matrices A,BA, B in general AB≠BAAB \neq BA.

(1101)(1011)=(2111),(1011)(1101)=(1112).\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}, \qquad \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}.

This is best understood through composition: for linear maps f,g:Rn→Rnf, g : \mathbb{R}^n \to \mathbb{R}^n in general g∘f≠f∘gg \circ f \neq f \circ g. For instance let ff be the reflection at the x-axis and gg the counterclockwise rotation by 90∘90^\circ. For w=(x,y)w = (x, y): g(f(w))=g(x,−y)=(y,x)g(f(w)) = g(x, -y) = (y, x) but f(g(w))=f(−y,x)=(−y,−x)f(g(w)) = f(-y, x) = (-y, -x). In matrices, (0−110)(100−1)=(0110)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} whereas the other order gives (0−1−10)\begin{pmatrix} 0 & -1 \\ -1 & 0 \end{pmatrix}. (Doing sports then showering is not the same as showering then doing sports.)

Identity matrix. The identity matrix idn\mathrm{id}_n is the n×nn \times n matrix whose entries on the main diagonal (north-west to south-east) are all 11 and all other entries 00; id1=(1)\mathrm{id}_1 = (1) and id2=(1001)\mathrm{id}_2 = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}.

Lemma. For matrices A,B,CA, B, C of sizes such that the products and sums are defined, and r∈Rr \in \mathbb{R}:

  • id⋅A=A\mathrm{id} \cdot A = A and A⋅id=AA \cdot \mathrm{id} = A (the identity plays the role of the number 1);
  • A(B+C)=AB+ACA(B + C) = AB + AC and (A+B)C=AC+BC(A + B)C = AC + BC (distributivity);
  • (AB)C=A(BC)(AB)C = A(BC) (associativity);
  • r(AB)=(rA)B=A(rB)r(AB) = (rA)B = A(rB).

Proof (illustrated for the first distributivity law). Let AA be m×nm \times n and B,CB, C be n×kn \times k. Then B+C=(bij+cij)B + C = (b_{ij} + c_{ij}) and the (i,j)(i, j) entry of A(B+C)A(B + C) is

∑e=1naie(bej+cej)=∑e=1naiebej+∑e=1naiecej,\sum_{e=1}^{n} a_{ie}(b_{ej} + c_{ej}) = \sum_{e=1}^{n} a_{ie} b_{ej} + \sum_{e=1}^{n} a_{ie} c_{ej},

where the distributivity law for real numbers was used. This is the (i,j)(i, j) entry of AB+ACAB + AC. The other identities follow in the same way from the corresponding laws for real numbers. □\square

2.3 Elementary matrices

Elementary row operations can be recast as multiplication with matrices. (An "invisible" entry of a matrix is zero.)

Proposition. Let AA be an m×nm \times n-matrix.

  1. If A′A' is obtained from AA by interchanging rows ii and jj, then A′=Ei,j(1)AA' = E^{(1)}_{i,j} A, where Ei,j(1)E^{(1)}_{i,j} is the m×mm \times m matrix obtained from idm\mathrm{id}_m by exchanging its ii-th and jj-th rows.
  2. If A′A' is obtained by multiplying row ii by r∈Rr \in \mathbb{R}, then A′=Ei,r(2)AA' = E^{(2)}_{i,r} A, where Ei,r(2)E^{(2)}_{i,r} is idm\mathrm{id}_m with the (i,i)(i, i)-entry replaced by rr.
  3. If A′A' is obtained by adding rr times row jj to row ii, then A′=Ei,j,r(3)AA' = E^{(3)}_{i,j,r} A, where Ei,j,r(3)E^{(3)}_{i,j,r} is idm\mathrm{id}_m with the (i,j)(i, j)-entry replaced by rr.

The matrices Ei,j(1)E^{(1)}_{i,j}, Ei,r(2)E^{(2)}_{i,r} (with r≠0r \neq 0) and Ei,j,r(3)E^{(3)}_{i,j,r} are called elementary matrices. For example, for m=3m = 3:

E1,3,r(3)=(10r010001),E1,3,r(3) A has first row (row 1)+r (row 3).E^{(3)}_{1,3,r} = \begin{pmatrix} 1 & 0 & r \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}, \qquad E^{(3)}_{1,3,r}\,A \text{ has first row } (\text{row } 1) + r\,(\text{row } 3).

Proof of the third statement. Let B=Ei,j,r(3)B = E^{(3)}_{i,j,r}, so bii=1b_{ii} = 1, bij=rb_{ij} = r and all other entries on row ii are zero; the other rows are those of the identity. Let C=BA=(cst)C = BA = (c_{st}), cst=∑e=1mbseaetc_{st} = \sum_{e=1}^{m} b_{se} a_{et}.

  • If s≠is \neq i, the only non-zero bseb_{se} is bss=1b_{ss} = 1, so cst=astc_{st} = a_{st}.
  • If s=is = i, the non-zero coefficients are bii=1b_{ii} = 1 and bij=rb_{ij} = r, so cit=ait+rajtc_{it} = a_{it} + r a_{jt}.

Thus the ii-th row of CC is row ii of AA plus rr times row jj of AA, and the other rows are unchanged. □\square

3. Invertible matrices

Definition. Let AA be an n×nn \times n-matrix. An n×nn \times n-matrix BB is an inverse of AA if AB=idAB = \mathrm{id} and BA=idBA = \mathrm{id}. If such a BB exists, AA is called invertible.

Example. A=(0111)A = \begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix} is invertible with inverse B=(−1110)B = \begin{pmatrix} -1 & 1 \\ 1 & 0 \end{pmatrix}:

AB=(0⋅(−1)+1⋅10⋅1+1⋅01⋅(−1)+1⋅11⋅1+1⋅0)=(1001),BA=(1001).AB = \begin{pmatrix} 0 \cdot (-1) + 1 \cdot 1 & 0 \cdot 1 + 1 \cdot 0 \\ 1 \cdot (-1) + 1 \cdot 1 & 1 \cdot 1 + 1 \cdot 0 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \qquad BA = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}.

A 1×11 \times 1 matrix (a)(a) is invertible precisely if a≠0a \neq 0 (inverse (a−1)(a^{-1})). For larger matrices being non-zero is not enough:

Example (a non-invertible matrix). A=(1224)A = \begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} is not invertible. For an arbitrary B=(abcd)B = \begin{pmatrix} a & b \\ c & d \end{pmatrix},

AB=(a+2cb+2d2a+4c2b+4d).AB = \begin{pmatrix} a + 2c & b + 2d \\ 2a + 4c & 2b + 4d \end{pmatrix}.

AB=idAB = \mathrm{id} would require a+2c=1a + 2c = 1, b+2d=0b + 2d = 0, 2a+4c=02a + 4c = 0, 2b+4d=12b + 4d = 1. Multiplying the first equation by 2 gives 2a+4c=22a + 4c = 2, and the third equation then yields the contradiction 0=20 = 2. Hence no such BB exists. Observe that the two rows (and the two columns) of AA are linearly dependent; this is no accident, see the criteria below.

The geometric matrices and their inverses.

Geometrical description Matrix AA Inverse A−1A^{-1}
Reflection at the x-axis (100−1)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} (100−1)\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}
Reflection at the y-axis (−1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix} (−1001)\begin{pmatrix} -1 & 0 \\ 0 & 1 \end{pmatrix}
Rescaling (if r,s≠0r, s \neq 0; if r=0r = 0 or s=0s = 0 then AA is not invertible) (r00s)\begin{pmatrix} r & 0 \\ 0 & s \end{pmatrix} (r−100s−1)\begin{pmatrix} r^{-1} & 0 \\ 0 & s^{-1} \end{pmatrix}
Rotation (cos⁡r−sin⁡rsin⁡rcos⁡r)\begin{pmatrix} \cos r & -\sin r \\ \sin r & \cos r \end{pmatrix} (cos⁡(−r)−sin⁡(−r)sin⁡(−r)cos⁡(−r))=(cos⁡rsin⁡r−sin⁡rcos⁡r)\begin{pmatrix} \cos(-r) & -\sin(-r) \\ \sin(-r) & \cos(-r) \end{pmatrix} = \begin{pmatrix} \cos r & \sin r \\ -\sin r & \cos r \end{pmatrix}
Shearing (any r∈Rr \in \mathbb{R}) (1r01)\begin{pmatrix} 1 & r \\ 0 & 1 \end{pmatrix} (1−r01)\begin{pmatrix} 1 & -r \\ 0 & 1 \end{pmatrix}

Lemma (uniqueness of the inverse). An invertible matrix has exactly one inverse: if BB and CC are inverses of AA (AB=BA=idAB = BA = \mathrm{id} and AC=CA=idAC = CA = \mathrm{id}), then B=CB = C. One writes A−1A^{-1}.

Proof. Using associativity (marked !!): B=B id=B(AC)=!(BA)C=id C=CB = B\,\mathrm{id} = B(AC) \overset{!}{=} (BA)C = \mathrm{id}\, C = C. □\square

Theorem (linear systems with invertible matrix). Let AA be an invertible n×nn \times n-matrix. The system Ax=bAx = b (with x=(x1,…,xn)Tx = (x_1, \dots, x_n)^T unknown and b∈Rnb \in \mathbb{R}^n) has a unique solution, namely

x=A−1b.x = A^{-1} b.

Proof. A−1bA^{-1}b is a solution: A(A−1b)=!(AA−1)b=idn b=bA(A^{-1}b) \overset{!}{=} (AA^{-1})b = \mathrm{id}_n\, b = b (associativity, with bb regarded as an n×1n \times 1-matrix). It is the only solution: let yy be any solution, Ay=bAy = b, and put z:=A−1b−yz := A^{-1}b - y. Then Az=AA−1b−Ay=b−b=0Az = AA^{-1}b - Ay = b - b = 0, and multiplying by A−1A^{-1}: z=A−1Az=A−10=0z = A^{-1}Az = A^{-1}0 = 0. So y=A−1by = A^{-1}b. □\square

Theorem (rules for inverses). For square matrices of the same size:

Statement For 1×11 \times 1-matrices
id\mathrm{id} is invertible: id−1=id\mathrm{id}^{-1} = \mathrm{id} 1−1=11^{-1} = 1
If AA is invertible, so is A−1A^{-1} and (A−1)−1=A(A^{-1})^{-1} = A 1/(1/a)=a1/(1/a) = a
If A,BA, B are invertible, so is ABAB and (AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1} 1/(ab)=(1/b)(1/a)1/(ab) = (1/b)(1/a)
(A1⋯Ak)−1=Ak−1⋯A1−1(A_1 \cdots A_k)^{-1} = A_k^{-1} \cdots A_1^{-1} 1/(a1⋯ak)=(1/ak)⋯(1/a1)1/(a_1 \cdots a_k) = (1/a_k) \cdots (1/a_1)

Proof of (AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1}. (AB)(B−1A−1)=A(BB−1)A−1=AA−1=id(AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = AA^{-1} = \mathrm{id} by associativity and since B−1B^{-1}, A−1A^{-1} are inverses; likewise (B−1A−1)(AB)=id(B^{-1}A^{-1})(AB) = \mathrm{id}. □\square

Note that the order is reversed; since AB≠BAAB \neq BA in general this matters (only for 1×11 \times 1 matrices does the order not matter).

3.1 Invertible matrices and elementary operations

Lemma. Every elementary matrix is invertible:

(Ei,j(1))−1=Ei,j(1),(Ei,r(2))−1=Ei,r−1(2),(Ei,j,r(3))−1=Ei,j,−r(3).\left(E^{(1)}_{i,j}\right)^{-1} = E^{(1)}_{i,j}, \qquad \left(E^{(2)}_{i,r}\right)^{-1} = E^{(2)}_{i,r^{-1}}, \qquad \left(E^{(3)}_{i,j,r}\right)^{-1} = E^{(3)}_{i,j,-r}.

Proof (for the last one, 2×22 \times 2 case). (1r01)(1−r01)=(1−r+r01)=id\begin{pmatrix} 1 & r \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & -r \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & -r + r \\ 0 & 1 \end{pmatrix} = \mathrm{id}, and symmetrically in the other order. □\square

Lemma. If BB is obtained from the m×nm \times n-matrix AA by elementary row operations, A⇝BA \rightsquigarrow B, then B=UAB = UA for an invertible m×mm \times m-matrix UU. (In particular, if A⇝idA \rightsquigarrow \mathrm{id} then id=UA\mathrm{id} = UA.)

Proof. A single step is multiplication by an elementary matrix, which is invertible. For A=A0⇝A1⇝⋯⇝An=BA = A_0 \rightsquigarrow A_1 \rightsquigarrow \dots \rightsquigarrow A_n = B with Ak=UkAk−1A_k = U_k A_{k-1},

An=UnUn−1⋯U1A=:UA,A_n = U_n U_{n-1} \cdots U_1 A =: UA,

by associativity, and UU is a product of invertible matrices, hence invertible. □\square

Corollary (elimination does not change the solutions). If Ax=bAx = b is a linear system and A′,b′A', b' are obtained by applying the same elementary row operations to AA and bb, then A′x=b′A'x = b' has the same solution set.

Proof. There is an invertible UU with A′=UAA' = UA and b′=Ubb' = Ub. If Ax=bAx = b then A′x=UAx=Ub=b′A'x = UAx = Ub = b'. Conversely, if A′x=b′A'x = b' then (crucially using that UU is invertible) Ax=U−1UAx=U−1A′x=U−1b′=U−1Ub=bAx = U^{-1}UAx = U^{-1}A'x = U^{-1}b' = U^{-1}Ub = b. □\square

3.2 Invertibility criteria and computing the inverse

Theorem. For a square matrix A∈Matn×nA \in \mathrm{Mat}_{n \times n} the following are equivalent:

  1. AA is invertible.
  2. For every b∈Rnb \in \mathbb{R}^n the equation Ax=bAx = b has exactly one solution.
  3. For every b∈Rnb \in \mathbb{R}^n the equation Ax=bAx = b has at most one solution.
  4. The system Ax=0Ax = 0 has only the trivial solution x=0x = 0.
  5. AA can be transformed into idn\mathrm{id}_n by the Gaussian algorithm.
  6. AA is a product of elementary matrices.
  7. There is a matrix BB with AB=idAB = \mathrm{id}.

Proof. We show (1)⇒\Rightarrow(2)⇒\Rightarrow(3)⇒\Rightarrow(4)⇒\Rightarrow(5)⇒\Rightarrow(6)⇒\Rightarrow(7)⇒\Rightarrow(1).

  • (1)⇒\Rightarrow(2): the previous theorem.
  • (2)⇒\Rightarrow(3) and (3)⇒\Rightarrow(4): clear.
  • (4)⇒\Rightarrow(5): bring AA into reduced row echelon form A⇝RA \rightsquigarrow R. If R≠idR \neq \mathrm{id}, then RR (square) contains a zero row, so Rx=0Rx = 0 has at least one free parameter and hence a non-trivial solution. By the corollary above Ax=0Ax = 0 has the same solutions, a contradiction to (4). So R=idR = \mathrm{id}.
  • (5)⇒\Rightarrow(6): UA=idUA = \mathrm{id} with U=U1⋯UnU = U_1 \cdots U_n a product of elementary matrices, so A=U−1UA=U−1=Un−1⋯U1−1A = U^{-1}UA = U^{-1} = U_n^{-1} \cdots U_1^{-1}, again a product of elementary matrices (the inverse of an elementary matrix is elementary).
  • (6)⇒\Rightarrow(7): if A=U1⋯UnA = U_1 \cdots U_n then A Un−1⋯U1−1=idA\,U_n^{-1} \cdots U_1^{-1} = \mathrm{id}.
  • (7)⇒\Rightarrow(1): let AB=idAB = \mathrm{id}. If Bx=0Bx = 0 then x=id x=ABx=A0=0x = \mathrm{id}\,x = ABx = A0 = 0. So BB satisfies (4), and by the already proven implication (4)⇒\Rightarrow(7) applied to BB there is CC with BC=idBC = \mathrm{id}. Then A=A id=A(BC)=(AB)C=id C=CA = A\,\mathrm{id} = A(BC) = (AB)C = \mathrm{id}\, C = C, so BA=idBA = \mathrm{id} as well. □\square

Computing the inverse. If AA is invertible, write the identity to its right to get the n×2nn \times 2n-matrix (A∣idn)(A \mid \mathrm{id}_n), bring it to reduced row echelon form by Gaussian elimination: the result is (idn∣E)(\mathrm{id}_n \mid E) and E=A−1E = A^{-1}. Indeed the row operations that bring AA to id\mathrm{id} bring (A∣id)(A \mid \mathrm{id}) to (UA∣U id)=(id∣U)(UA \mid U\,\mathrm{id}) = (\mathrm{id} \mid U), and U=A−1U = A^{-1}.

Example. A=(10−13−1−3−122)A = \begin{pmatrix} 1 & 0 & -1 \\ 3 & -1 & -3 \\ -1 & 2 & 2 \end{pmatrix}. Start from

(A∣id)=(10−11003−1−3010−122001).(A \mid \mathrm{id}) = \left(\begin{array}{ccc|ccc} 1 & 0 & -1 & 1 & 0 & 0 \\ 3 & -1 & -3 & 0 & 1 & 0 \\ -1 & 2 & 2 & 0 & 0 & 1 \end{array}\right).

Subtract 3 times row 1 from row 2, and add row 1 to row 3:

(10−11000−10−310021101).\left(\begin{array}{ccc|ccc} 1 & 0 & -1 & 1 & 0 & 0 \\ 0 & -1 & 0 & -3 & 1 & 0 \\ 0 & 2 & 1 & 1 & 0 & 1 \end{array}\right).

Add 2 times row 2 to row 3:

(10−11000−10−310001−521).\left(\begin{array}{ccc|ccc} 1 & 0 & -1 & 1 & 0 & 0 \\ 0 & -1 & 0 & -3 & 1 & 0 \\ 0 & 0 & 1 & -5 & 2 & 1 \end{array}\right).

Multiply row 2 by −1-1, then add row 3 to row 1:

(100−4210103−10001−521).\left(\begin{array}{ccc|ccc} 1 & 0 & 0 & -4 & 2 & 1 \\ 0 & 1 & 0 & 3 & -1 & 0 \\ 0 & 0 & 1 & -5 & 2 & 1 \end{array}\right).

Hence AA is invertible and A−1=(−4213−10−521)A^{-1} = \begin{pmatrix} -4 & 2 & 1 \\ 3 & -1 & 0 \\ -5 & 2 & 1 \end{pmatrix}. (Check, first row of AA−1A A^{-1}: (1)(−4)+(−1)(−5)=1(1)(-4) + (-1)(-5) = 1, (1)(2)+(−1)(2)=0(1)(2) + (-1)(2) = 0, (1)(1)+(−1)(1)=0(1)(1) + (-1)(1) = 0.)

Corollary. If AA is square and AB=idAB = \mathrm{id} for some square BB, then also BA=idBA = \mathrm{id}.

Proof. By the theorem AA is invertible, so B=id B=A−1AB=A−1B = \mathrm{id}\,B = A^{-1}AB = A^{-1}, and A−1A=idA^{-1}A = \mathrm{id}. □\square

4. Change of basis

Let VV be a vector space with basis v={v1,…,vn}\mathbf{v} = \{v_1, \dots, v_n\}. Every x∈Vx \in V is uniquely x=α1v1+⋯+αnvnx = \alpha_1 v_1 + \dots + \alpha_n v_n, and (α1,…,αn)v(\alpha_1, \dots, \alpha_n)_{\mathbf{v}} are its coordinates in the basis v\mathbf{v}. For another basis w={w1,…,wn}\mathbf{w} = \{w_1, \dots, w_n\} we get other coordinates x=β1w1+⋯+βnwnx = \beta_1 w_1 + \dots + \beta_n w_n. How do we pass from (αi)v(\alpha_i)_{\mathbf{v}} to (βi)w(\beta_i)_{\mathbf{w}}?

The identity map.

  • With the basis v\mathbf{v} in both domain and codomain, idV(vi)=vi=0v1+⋯+1vi+⋯+0vn\mathrm{id}_V(v_i) = v_i = 0 v_1 + \dots + 1 v_i + \dots + 0 v_n, so MidV,v,v=idnM_{\mathrm{id}_V, \mathbf{v}, \mathbf{v}} = \mathrm{id}_n.
  • With basis v\mathbf{v} in the domain and w\mathbf{w} in the codomain, write idV(vi)=vi=a1iw1+⋯+aniwn\mathrm{id}_V(v_i) = v_i = a_{1i} w_1 + \dots + a_{ni} w_n (the coordinates of viv_i in the basis w\mathbf{w}). The matrix MidV,v,w=(aij)M_{\mathrm{id}_V, \mathbf{v}, \mathbf{w}} = (a_{ij}) is the base change matrix from v\mathbf{v} to w\mathbf{w}; it multiplies the v\mathbf{v}-coordinates of a vector to give its w\mathbf{w}-coordinates.

Example. V=R2V = \mathbb{R}^2, v={e1,e2}\mathbf{v} = \{e_1, e_2\} the standard basis and w={w1,w2}={(1,1),(1,3)}\mathbf{w} = \{w_1, w_2\} = \{(1, 1), (1, 3)\}.

(1,0)=a11(1,1)+a21(1,3)(1, 0) = a_{11}(1, 1) + a_{21}(1, 3) means a11+a21=1a_{11} + a_{21} = 1, a11+3a21=0a_{11} + 3a_{21} = 0, so a11=32a_{11} = \tfrac32, a21=−12a_{21} = -\tfrac12. And (0,1)=a12(1,1)+a22(1,3)(0, 1) = a_{12}(1, 1) + a_{22}(1, 3) gives a12=−12a_{12} = -\tfrac12, a22=12a_{22} = \tfrac12. Hence

MidR2,v,w=(32−12−1212).M_{\mathrm{id}_{\mathbb{R}^2}, \mathbf{v}, \mathbf{w}} = \begin{pmatrix} \tfrac32 & -\tfrac12 \\ -\tfrac12 & \tfrac12 \end{pmatrix}.

For (3,2)=3e1+2e2(3, 2) = 3e_1 + 2e_2: (32−12−1212)(32)=(72−12)w\begin{pmatrix} \tfrac32 & -\tfrac12 \\ -\tfrac12 & \tfrac12 \end{pmatrix} \begin{pmatrix} 3 \\ 2 \end{pmatrix} = \begin{pmatrix} \tfrac72 \\ -\tfrac12 \end{pmatrix}_{\mathbf{w}}, i.e. (3,2)=72w1−12w2(3, 2) = \tfrac72 w_1 - \tfrac12 w_2.

Inverse of a base change matrix. Since composition corresponds to the matrix product, applying idV=idV∘idV\mathrm{id}_V = \mathrm{id}_V \circ \mathrm{id}_V to Vv→Vw→VvV_{\mathbf{v}} \to V_{\mathbf{w}} \to V_{\mathbf{v}} gives

Mid,w,v⋅Mid,v,w=Mid,v,v=idn,soMid,w,v=(Mid,v,w)−1.M_{\mathrm{id}, \mathbf{w}, \mathbf{v}} \cdot M_{\mathrm{id}, \mathbf{v}, \mathbf{w}} = M_{\mathrm{id}, \mathbf{v}, \mathbf{v}} = \mathrm{id}_n, \qquad \text{so} \qquad M_{\mathrm{id}, \mathbf{w}, \mathbf{v}} = \left(M_{\mathrm{id}, \mathbf{v}, \mathbf{w}}\right)^{-1}.

Method (matrix of an endomorphism in another basis). Let f:V→Vf : V \to V be linear, represented by E∈Matn×nE \in \mathrm{Mat}_{n \times n} with respect to the basis v\mathbf{v} (in domain and codomain). The matrix of ff with respect to another basis w\mathbf{w} (in domain and codomain) is

Mf,w,w=A E A−1,A=MidV,v,w.M_{f, \mathbf{w}, \mathbf{w}} = A\,E\,A^{-1}, \qquad A = M_{\mathrm{id}_V, \mathbf{v}, \mathbf{w}}.

Proof. f=idV∘f∘idVf = \mathrm{id}_V \circ f \circ \mathrm{id}_V, but we put different bases on VV:

Vw→  A−1  idVVv→  E  fVv→  A  idVVw.V_{\mathbf{w}} \xrightarrow[\;A^{-1}\;]{\mathrm{id}_V} V_{\mathbf{v}} \xrightarrow[\;E\;]{f} V_{\mathbf{v}} \xrightarrow[\;A\;]{\mathrm{id}_V} V_{\mathbf{w}}.

The first map has matrix Mid,w,v=A−1M_{\mathrm{id}, \mathbf{w}, \mathbf{v}} = A^{-1}, the last Mid,v,w=AM_{\mathrm{id}, \mathbf{v}, \mathbf{w}} = A, and the composite has matrix AEA−1A E A^{-1}. □\square

Example. f:R2→R2f : \mathbb{R}^2 \to \mathbb{R}^2 is multiplication by E=(20−13)E = \begin{pmatrix} 2 & 0 \\ -1 & 3 \end{pmatrix} in the standard basis e\mathbf{e}. Find its matrix with respect to w={w1,w2}={(1,1),(1,−2)}\mathbf{w} = \{w_1, w_2\} = \{(1, 1), (1, -2)\}.

We need A=Mid,e,wA = M_{\mathrm{id}, \mathbf{e}, \mathbf{w}} and A−1=Mid,w,eA^{-1} = M_{\mathrm{id}, \mathbf{w}, \mathbf{e}}. The inverse is easier: its columns are the coordinates of w1,w2w_1, w_2 in the standard basis (id(w1)=1e1+1e2\mathrm{id}(w_1) = 1 e_1 + 1 e_2, id(w2)=1e1−2e2\mathrm{id}(w_2) = 1 e_1 - 2 e_2):

A−1=(111−2).A^{-1} = \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix}.

Compute AA by Gaussian elimination:

(11101−201)⇝(11100−3−11)⇝(11100113−13)⇝(1023130113−13),\left(\begin{array}{cc|cc} 1 & 1 & 1 & 0 \\ 1 & -2 & 0 & 1 \end{array}\right) \rightsquigarrow \left(\begin{array}{cc|cc} 1 & 1 & 1 & 0 \\ 0 & -3 & -1 & 1 \end{array}\right) \rightsquigarrow \left(\begin{array}{cc|cc} 1 & 1 & 1 & 0 \\ 0 & 1 & \tfrac13 & -\tfrac13 \end{array}\right) \rightsquigarrow \left(\begin{array}{cc|cc} 1 & 0 & \tfrac23 & \tfrac13 \\ 0 & 1 & \tfrac13 & -\tfrac13 \end{array}\right),

so A=(231313−13)A = \begin{pmatrix} \tfrac23 & \tfrac13 \\ \tfrac13 & -\tfrac13 \end{pmatrix} and

Mf,w,w=AEA−1=(231313−13)(20−13)(111−2)=(2−103).M_{f, \mathbf{w}, \mathbf{w}} = A E A^{-1} = \begin{pmatrix} \tfrac23 & \tfrac13 \\ \tfrac13 & -\tfrac13 \end{pmatrix} \begin{pmatrix} 2 & 0 \\ -1 & 3 \end{pmatrix} \begin{pmatrix} 1 & 1 \\ 1 & -2 \end{pmatrix} = \begin{pmatrix} 2 & -1 \\ 0 & 3 \end{pmatrix}.

Check by the columns: Ew1=(2,2)=2w1+0w2E w_1 = (2, 2) = 2 w_1 + 0 w_2 gives the first column (2,0)T(2, 0)^T; Ew2=(2,−7)=−1⋅w1+3w2E w_2 = (2, -7) = -1 \cdot w_1 + 3 w_2 gives the second column (−1,3)T(-1, 3)^T.

5. Transposition

Definition. The transpose of an m×nm \times n-matrix A=(aij)A = (a_{ij}) is the n×mn \times m-matrix AT:=(aji)A^T := (a_{ji}), obtained by reflecting the entries along the main diagonal.

Example. A=(123456)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{pmatrix} has AT=(135246)A^T = \begin{pmatrix} 1 & 3 & 5 \\ 2 & 4 & 6 \end{pmatrix}. The transpose of a column vector is a row vector and vice versa, e.g. (xy)T=(x  y)\begin{pmatrix} x \\ y \end{pmatrix}^T = (x\ \ y).

Lemma. Let AA be an m×nm \times n-matrix and r∈Rr \in \mathbb{R}.

  1. (AT)T=A(A^T)^T = A.
  2. For BB of the same size, (A+B)T=AT+BT(A + B)^T = A^T + B^T.
  3. For an n×kn \times k-matrix BB: (AB)T=BTAT(AB)^T = B^T A^T (opposite order).
  4. If the square matrix AA is invertible, so is ATA^T, and (AT)−1=(A−1)T(A^T)^{-1} = (A^{-1})^T.

Proof. (1) and (2) are immediate (reflecting twice along the diagonal gives back the matrix). (3): let C=AB=(cij)C = AB = (c_{ij}) with cij=∑e=1naiebejc_{ij} = \sum_{e=1}^{n} a_{ie} b_{ej}. Then CT=(cji)=(∑e=1najebei)C^T = (c_{ji}) = \left(\sum_{e=1}^{n} a_{je} b_{ei}\right), and this is the (i,j)(i, j) entry of BTATB^T A^T (the ii-th row of BTB^T is the ii-th column of BB, and the jj-th column of ATA^T is the jj-th row of AA). (4): by (3),

AT(A−1)T=(A−1A)T=idT=id,(A−1)TAT=(AA−1)T=idT=id.A^T (A^{-1})^T = (A^{-1}A)^T = \mathrm{id}^T = \mathrm{id}, \qquad (A^{-1})^T A^T = (A A^{-1})^T = \mathrm{id}^T = \mathrm{id}.

So ATA^T and (A−1)T(A^{-1})^T are inverse to each other. □\square

Corollary (more invertibility criteria). For A∈Matn×nA \in \mathrm{Mat}_{n \times n} the following are equivalent:

  1. AA is invertible.
  2. The nn columns of AA are linearly independent.
  3. The rank of AA is nn.
  4. The nn rows of AA are linearly independent.

Proof. (1)  ⟺  \iff(2): by the invertibility theorem, AA is invertible exactly if Ax=0Ax = 0 has only the solution x=0x = 0. With A=(c1…cn)A = (c_1 \dots c_n) we have Ax=x1c1+⋯+xncnAx = x_1 c_1 + \dots + x_n c_n, so this condition says exactly that the columns are linearly independent.

(2)  ⟺  \iff(3): the rank is by definition the dimension of the column space L(c1,…,cn)L(c_1, \dots, c_n). If AA is invertible, then for b∈Rnb \in \mathbb{R}^n the system Ax=bAx = b has a (unique) solution xx, so b=∑kxkckb = \sum_{k} x_k c_k: the columns span Rn\mathbb{R}^n and the rank is nn. Conversely, if the rank is nn then the nn columns span an nn-dimensional space, so they are linearly independent.

(1)  ⟺  \iff(4): AA is invertible if and only if ATA^T is invertible (previous lemma). The rows of AA are the columns of ATA^T, so apply the already proved equivalence (1)  ⟺  \iff(2) to ATA^T. □\square

These criteria are tied to the determinant: a square matrix is invertible if and only if its determinant is non-zero, see DeterminantsThe determinant is the unique function of a square matrix that equals 1 on the identity, changes sign when two rows are swapped and is linear in each row; it is computed by row reduction, Sarrus rule or cofactor expansion, and a matrix is invertible exactly when its determinant is non-zero.Determinants →.

Versione ripasso

Matrix of a linear map. For bases v\mathbf{v} of VV and w\mathbf{w} of WW, Mf,v,wM_{f,\mathbf{v},\mathbf{w}} is the m×nm \times n-matrix whose ii-th column holds the coordinates of f(vi)f(v_i) in the basis w\mathbf{w}, i.e. f(vi)=∑jajiwjf(v_i) = \sum_j a_{ji} w_j. It depends on the chosen bases. In the standard basis, f(v)=Avf(v) = Av and the columns of AA are f(ei)=Aeif(e_i) = Ae_i.

Composition and product. g∘fg \circ f is linear; (AB)ij=∑eaiebej(AB)_{ij} = \sum_e a_{ie} b_{ej} (needs columns of AA = rows of BB); AB=(Ab1…Abk)AB = (Ab_1 \dots Ab_k). The matrix of g∘fg \circ f is BABA (matrix of gg times matrix of ff); v↦Avv \mapsto Av composed with u↦Buu \mapsto Bu is u↦(AB)uu \mapsto (AB)u.

Rules. idA=A id=A\mathrm{id}A = A\,\mathrm{id} = A; distributive; associative; r(AB)=(rA)B=A(rB)r(AB) = (rA)B = A(rB). AB≠BAAB \neq BA in general (e.g. reflection at the x-axis and rotation by 90∘90^\circ).

Elementary matrices. Row swap Ei,j(1)E^{(1)}_{i,j}, scaling Ei,r(2)E^{(2)}_{i,r} (r≠0r \neq 0), adding r⋅r \cdot row jj to row ii: Ei,j,r(3)E^{(3)}_{i,j,r}. Row operation = left multiplication. Inverses: (Ei,j(1))−1=Ei,j(1)\left(E^{(1)}_{i,j}\right)^{-1} = E^{(1)}_{i,j}, (Ei,r(2))−1=Ei,r−1(2)\left(E^{(2)}_{i,r}\right)^{-1} = E^{(2)}_{i,r^{-1}}, (Ei,j,r(3))−1=Ei,j,−r(3)\left(E^{(3)}_{i,j,r}\right)^{-1} = E^{(3)}_{i,j,-r}. Hence A⇝BA \rightsquigarrow B by row operations means B=UAB = UA with UU invertible, so elimination preserves the solution set of Ax=bAx = b.

Inverse. BB with AB=BA=idAB = BA = \mathrm{id}; unique (B=B(AC)=(BA)C=CB = B(AC) = (BA)C = C). Ax=bAx = b with AA invertible has the unique solution x=A−1bx = A^{-1}b. Rules: (A−1)−1=A(A^{-1})^{-1} = A, (AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1} (reversed), (AT)−1=(A−1)T(A^T)^{-1} = (A^{-1})^T. Inverses of the geometric matrices: reflections are self-inverse, diag⁡(r,s)−1=diag⁡(r−1,s−1)\operatorname{diag}(r, s)^{-1} = \operatorname{diag}(r^{-1}, s^{-1}), rotation by rr inverse is rotation by −r-r, shear rr has inverse shear −r-r. A 1×11 \times 1 matrix (a)(a) is invertible iff a≠0a \neq 0; (1224)\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix} is not invertible.

Invertibility theorem (equivalent for A∈Matn×nA \in \mathrm{Mat}_{n \times n}). (1) invertible; (2) Ax=bAx = b has exactly one solution for all bb; (3) at most one; (4) Ax=0Ax = 0 only trivial; (5) A⇝idA \rightsquigarrow \mathrm{id} by Gauss; (6) AA is a product of elementary matrices; (7) AB=idAB = \mathrm{id} for some BB (then also BA=idBA = \mathrm{id}). Also: columns independent; rk⁡A=n\operatorname{rk} A = n; rows independent.

Algorithm. (A∣id)⇝(id∣A−1)(A \mid \mathrm{id}) \rightsquigarrow (\mathrm{id} \mid A^{-1}). Example: (10−13−1−3−122)−1=(−4213−10−521)\begin{pmatrix} 1 & 0 & -1 \\ 3 & -1 & -3 \\ -1 & 2 & 2 \end{pmatrix}^{-1} = \begin{pmatrix} -4 & 2 & 1 \\ 3 & -1 & 0 \\ -5 & 2 & 1 \end{pmatrix}.

Change of basis. Mid,v,wM_{\mathrm{id}, \mathbf{v}, \mathbf{w}} (columns: coordinates of viv_i in w\mathbf{w}) turns v\mathbf{v}-coordinates into w\mathbf{w}-coordinates; Mid,w,v=(Mid,v,w)−1M_{\mathrm{id},\mathbf{w},\mathbf{v}} = (M_{\mathrm{id},\mathbf{v},\mathbf{w}})^{-1}. If ff has matrix EE in the basis v\mathbf{v}, then in the basis w\mathbf{w} it has matrix Mf,w,w=AEA−1M_{f,\mathbf{w},\mathbf{w}} = A E A^{-1} with A=Mid,v,wA = M_{\mathrm{id},\mathbf{v},\mathbf{w}}. Easy way: the columns of A−1A^{-1} are the vectors wiw_i written in the old basis; invert to get AA.

Transpose. AT=(aji)A^T = (a_{ji}); (AT)T=A(A^T)^T = A; (A+B)T=AT+BT(A+B)^T = A^T + B^T; (AB)T=BTAT(AB)^T = B^T A^T (reversed).

Typical mistakes. Writing (AB)−1=A−1B−1(AB)^{-1} = A^{-1}B^{-1} or (AB)T=ATBT(AB)^T = A^T B^T (the order reverses); using the wrong direction AEA−1AEA^{-1} versus A−1EAA^{-1}EA (check with the columns f(wi)f(w_i)); putting coordinates of f(vi)f(v_i) in rows instead of columns; assuming AB=BAAB = BA; concluding invertibility from "non-zero" for matrices larger than 1×11 \times 1.

See also Linear MapsA linear map between vector spaces preserves sums and scalar multiples; its kernel and image are subspaces whose dimensions add up to the dimension of the domain (rank-nullity), and a linear map is determined by its values on a basis.Linear Maps → and DeterminantsThe determinant is the unique function of a square matrix that equals 1 on the identity, changes sign when two rows are swapped and is linear in each row; it is computed by row reduction, Sarrus rule or cofactor expansion, and a matrix is invertible exactly when its determinant is non-zero.Determinants →.

Teoria collegata