4 Inverse of a Matrix

Transforming by B first then A is written as AB

If AA is an invertible nร—nn\times n matrix, then for each ๐’™\mathbf{x} in โ„n\mathbb{R}^n, the equation A๐’™=๐’ƒA\mathbf{x} = \mathbf{b} has the unique solution ๐’™=Aโˆ’1๐’ƒ\mathbf{x} = A^{-1}\mathbf{b} Proof

  1. Show that solution exists
    Substitute Aโˆ’1๐’ƒA^{-1}\mathbf{b} into A๐’™=๐’ƒA\mathbf{x}=\mathbf{b},
    LHS = A๐’™=A(Aโˆ’1)๐’ƒ=(AAโˆ’1)๐’ƒ=I๐’ƒ=๐’ƒA\mathbf{x}=A(A^{-1})\mathbf{b}=(AA^{-1})\mathbf{b}=I\mathbf{b}=\mathbf{b} = RHS.

  2. Show that solution is unique.
    Suppose there is some vector uu such that A๐’–=๐’ƒA\mathbf{u}=\mathbf{b},
    then Aโˆ’1A๐’–=Aโˆ’1๐’ƒโ‡’I๐’–=Aโˆ’1๐’ƒโ‡’๐’–=Aโˆ’1๐’ƒA^{-1}A\mathbf{u}=A^{-1}\mathbf{b} \Rightarrow I\mathbf{u}=A^{-1}\mathbf{b} \Rightarrow \mathbf{u}=A^{-1}\mathbf{b}.

Property: If AA is invertible, then Aโˆ’1A^{-1} is invertible, and (Aโˆ’1)โˆ’1=A(A^{-1})^{-1}=A

Property: If AA and BB are nร—nn\times n invertible matrices, then so is ABAB and (AB)โˆ’1=Bโˆ’1Aโˆ’1(AB)^{-1}=B^{-1}A^{-1}

Proof
To find some matrix CC s.t. (AB)C=I(AB)C=I and C(AB)=I.C(AB)=I.
If C=Bโˆ’1Aโˆ’1C=B^{-1}A^{-1}, then AB(Bโˆ’1Aโˆ’1)=A(BBโˆ’1)Aโˆ’1=AIAโˆ’1=AAโˆ’1=IAB(B^{-1}A^{-1})=A(BB^{-1})A^{-1}=AIA^{-1}=AA^{-1}=I.
Similar argument applies for (Bโˆ’1Aโˆ’1)(AB)=I(B^{-1}A^{-1})(AB)=I.

Property: If AA is an invertible matrix, then so is ATA^T, and (AT)โˆ’1=(Aโˆ’1)T(A^T)^{-1}=(A^{-1})^T Proof
To show that (Aโˆ’1)T(A^{-1})^T is the inverse of ATA^T.
Considering the product of ATA^T and (Aโˆ’1)T(A^{-1})^T, AT(Aโˆ’1)T=(Aโˆ’1A)T=IT=IA^T(A^{-1})^T=(A^{-1}A)^T=I^T=I and the product of (Aโˆ’1)T(A^{-1})^T and ATA^T, (Aโˆ’1)TAT=(AAโˆ’1)T=IT=I(A^{-1})^TA^T=(AA^{-1})^T=I^T=I

4.1 Elementary matrix

An elementary matrix EE is created by performing exactly one elementary row operation on an identity matrix II.
Multiplying a matrix AA by EE on the left (EAEA) performs that same row operation on AA.

For example, E=[010100001] and A=[abcdefghi]โ‡’EA=[defabcghi]E = \begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \text{ and }A=\begin{bmatrix} a & b & c \\ d & e & f \\ g & h & i \end{bmatrix}\Rightarrow EA=\begin{bmatrix} d & e & f \\ a & b & c \\ g & h & i \end{bmatrix} Every elementary matrix is invertible, and the inverse is another elementary matrix that reverses the original transformation. For example, E1=[010100001]โ‡’E1โˆ’1=[010100001]E_1=\begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} \Rightarrow E_1^{-1}=\begin{bmatrix} 0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} E2=[100010โˆ’401]โ‡’E2โˆ’1=[100010401]E_2=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ -4 & 0 & 1 \end{bmatrix} \Rightarrow E_2^{-1}=\begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 4 & 0 & 1 \end{bmatrix}

An nร—nn\times n matrix AA is invertible iff AA is row equivalent to InI_n. The same sequence of EROs that reduces AA to InI_n transforms InI_n to Aโˆ’1A^{-1}.

Proof
Suppose AA is an invertible nร—nn\times n matrix, then A๐’™=๐’ƒA\mathbf{x}=\mathbf{b} has a unique solution for any ๐’ƒ\mathbf{b}. This means the RREF form of AA has a pivot in every row and column. For a nร—nn\times n matrix, this has to be InI_n. Therefore AA is row equivalent to InI_n.
There exists some sequence of EROs that transforms AA to InI_n, and each row operation corresponds to multiplication by an elementary matrix. This can be expressed as (Ekโ‹ฏE2E1)A=In(E_k\cdots E_2E_1)A=I_n AA is invertible since RHS=InI_n is invertible and the product of elementary matrices is invertible.
Multiplying by Aโˆ’1A^{-1} on the right on both sides, (Ekโ‹ฏE2E1)=Aโˆ’1(E_k\cdots E_2E_1)=A^{-1} Therefore, (Ekโ‹ฏE2E1)In=Aโˆ’1(E_k\cdots E_2E_1)I_n=A^{-1}

4.1.1 Example

To find the inverse of A=[0121034โˆ’38]A = \begin{bmatrix} 0 & 1 & 2 \\ 1 & 0 & 3 \\ 4 & -3 & 8 \end{bmatrix}, we augment it with the identity matrix II and perform Gauss-Jordan elimination:

[0121001030104โˆ’38001]\left[ \begin{array}{ccc|ccc} 0 & 1 & 2 & 1 & 0 & 0 \\ 1 & 0 & 3 & 0 & 1 & 0 \\ 4 & -3 & 8 & 0 & 0 & 1 \end{array} \right]

Step 1: Interchange R1R_1 and R2R_2 (R1โ†”R2R_1 \leftrightarrow R_2) โ†’R1โ†”R2[1030100121004โˆ’38001]\xrightarrow{R_1 \leftrightarrow R_2} \left[ \begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 4 & -3 & 8 & 0 & 0 & 1 \end{array} \right]

Step 2: Eliminate a31a_{31} (R3โ†R3โˆ’4R1R_3 \leftarrow R_3 - 4R_1) โ†’R3โˆ’4R1[1030100121000โˆ’3โˆ’40โˆ’41]\xrightarrow{R_3 - 4R_1} \left[ \begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & -3 & -4 & 0 & -4 & 1 \end{array} \right]

Step 3: Eliminate a32a_{32} (R3โ†R3+3R2R_3 \leftarrow R_3 + 3R_2) โ†’R3+3R2[1030100121000023โˆ’41]\xrightarrow{R_3 + 3R_2} \left[ \begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & 0 & 2 & 3 & -4 & 1 \end{array} \right]

Step 4: Scale R3R_3 to get a leading 1 (R3โ†12R3R_3 \leftarrow \frac{1}{2}R_3) โ†’12R3[1030100121000011.5โˆ’20.5]\xrightarrow{\frac{1}{2}R_3} \left[ \begin{array}{ccc|ccc} 1 & 0 & 3 & 0 & 1 & 0 \\ 0 & 1 & 2 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1.5 & -2 & 0.5 \end{array} \right]

Step 5: Eliminate a13a_{13} and a23a_{23} (R1โ†R1โˆ’3R3R_1 \leftarrow R_1 - 3R_3 and R2โ†R2โˆ’2R3R_2 \leftarrow R_2 - 2R_3) โ†’R1โˆ’3R3R2โˆ’2R3[100โˆ’4.57โˆ’1.5010โˆ’24โˆ’10011.5โˆ’20.5]\xrightarrow{\substack{R_1 - 3R_3 \\ R_2 - 2R_3}} \left[ \begin{array}{ccc|ccc} 1 & 0 & 0 & -4.5 & 7 & -1.5 \\ 0 & 1 & 0 & -2 & 4 & -1 \\ 0 & 0 & 1 & 1.5 & -2 & 0.5 \end{array} \right]

Therefore, the inverse matrix is Aโˆ’1=[โˆ’4.57โˆ’1.5โˆ’24โˆ’11.5โˆ’20.5]A^{-1} = \begin{bmatrix} -4.5 & 7 & -1.5 \\ -2 & 4 & -1 \\ 1.5 & -2 & 0.5 \end{bmatrix}

4.1.2 Invertible Matrix Theorem

Let AA be an nร—nn\times n matrix. Then the following statements are logically equivalent:

  1. AA is an invertible (non-singular) matrix.

  2. AA is row equivalent to InI_n.

  3. AA has nn pivot positions.

  4. A๐’™=๐ŸŽA\mathbf{x}=\mathbf{0} has only the trivial solution.

  5. The columns of AA form a linearly independent set.

  6. A๐’™=๐’ƒA\mathbf{x}=\mathbf{b} has at least one (in fact, unique) solution for each ๐’ƒ\mathbf{b} in โ„n\mathbb{R}^n.

  7. The columns of AA span โ„n\mathbb{R}^n.

  8. There is an nร—nn\times n matrix CC such that CA=ICA=I.

  9. There is an nร—nn\times n matrix DD such that AD=IAD=I.

  10. ATA^T is an invertible matrix.

  11. The columns of AA form a basis for โ„n\mathbb{R}^n.

  12. ๐‘ช(A)=โ„n\mathbf{C}(A) = \mathbb{R}^n.

  13. dim⁡๐‘ช(A)=n\dim \mathbf{C}(A) = n.

  14. Rank of A=nA = n.

  15. ๐‘ต(A)={๐ŸŽ}\mathbf{N}(A) = \{\mathbf{0}\}.

  16. dim⁡๐‘ต(A)=0\dim \mathbf{N}(A) = 0.

The links between the statements of invertible matrix theorem.

: A๐’™=๐ŸŽโ‡’๐’™=Aโˆ’1๐ŸŽA\mathbf{x}=\mathbf{0}\Rightarrow\mathbf{x}=A^{-1}\mathbf{0}.

8โ‡’48\Rightarrow 4: Given CC such that CA=ICA=I, CA๐’™=C๐ŸŽโ‡’I๐’™=๐ŸŽโ‡’๐’™=๐ŸŽCA\mathbf{x}=C\mathbf{0}\Rightarrow I\mathbf{x}=\mathbf{0}\Rightarrow\mathbf{x}=\mathbf{0} 9โ‡’69\Rightarrow 6: Given DD such that AD=IAD=I, choose ๐’™=D๐’ƒ\mathbf{x}=D\mathbf{b}, A๐’™=AD๐’ƒ=I๐’ƒ=๐’ƒA\mathbf{x}=AD\mathbf{b}=I\mathbf{b}=\mathbf{b}

5 Matrix Factorisation

To solve sequence of equations like Ax=b1,Ax=b2,โ€ฆ,Ax=bpAx=b_1, Ax=b_2,\ldots, Ax=b_p, it is inefficient to first compute the inverse Aโˆ’1A^{-1} and then multiply it by each vector, Aโˆ’1b1,...,Aโˆ’1bpA^{-1}b_{1}, ..., A^{-1}b_{p}.

Instead, the efficient solution is to decompose Amร—nA_{m \times n} into Lmร—mUmร—nL_{m \times m}U_{m \times n}.

L=[10โ‹ฏ0l211โ‹ฏ0โ‹ฎโ‹ฎโ‹ฑโ‹ฎlm1lm2โ‹ฏ1],U=[u11u12โ‹ฏu1n0u22โ‹ฏu2nโ‹ฎโ‹ฎโ‹ฑโ‹ฎ00โ‹ฏumn]L = \begin{bmatrix} 1 & 0 & \cdots & 0 \\ l_{21} & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ l_{m1} & l_{m2} & \cdots & 1 \end{bmatrix}, \qquad U = \begin{bmatrix} u_{11} & u_{12} & \cdots & u_{1n} \\ 0 & u_{22} & \cdots & u_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & u_{mn} \end{bmatrix} where LL is unit lower triangular matrix, UU is upper triangular matrix.

5.1 Deriving L & U

Assumption AA can be reduced to echelon form without requiring any row interchanges.

First reduce matrix AA to UU, using elementary row operations. Multiply AA by a sequence of unit lower triangular elementary matrices (E1,โ€ฆ,EpE_{1}, \dots, E_{p}), such that

Epโ€ฆE1A=UโŸนA=(Epโ€ฆE1)โˆ’1U\begin{align*} & E_{p} \dots E_{1}A = U \\ \implies & A = (E_{p} \dots E_{1})^{-1}U \end{align*} Then L=Epโ€ฆE1L = E_{p} \dots E_{1}.

Example Consider a 3ร—33 \times 3 matrix: A=[๐Ÿโˆ’23๐Ÿ”โˆ’714๐Ÿ’โˆ’830]A = \begin{bmatrix} \mathbf{2} & -2 & 3 \\ \mathbf{6} & -7 & 14 \\ \mathbf{4} & -8 & 30 \end{bmatrix}

Step 1: Row Reduction to find UU. Apply elementary row operations to eliminate the entries below the pivots to reach echelon form.

First Column: The first pivot is the ๐Ÿ\mathbf{2} in row 1, column 1. Eliminate the entries below it. Multiply by E21E_{21} (which represents R2โˆ’3R1R_2 - 3R_1): E21A=[2โˆ’230โˆ’๐Ÿ54โˆ’830]E_{21}A = \begin{bmatrix} 2 & -2 & 3 \\ 0 & \mathbf{-1} & 5 \\ 4 & -8 & 30 \end{bmatrix} Multiply by E31E_{31} (which represents R3โˆ’2R1R_3 - 2R_1): E31(E21A)=[2โˆ’230โˆ’๐Ÿ50โˆ’๐Ÿ’24]E_{31}(E_{21}A) = \begin{bmatrix} 2 & -2 & 3 \\ 0 & \mathbf{-1} & 5 \\ 0 & \mathbf{-4} & 24 \end{bmatrix}

Second Column: The new pivot is the โˆ’๐Ÿ\mathbf{-1} in row 2, column 2. Eliminate the entry below it. * Multiply by E32E_{32} (which represents R3โˆ’4R2R_3 - 4R_2): E32(E31E21A)=[2โˆ’230โˆ’15004]=UE_{32}(E_{31}E_{21}A) = \begin{bmatrix} 2 & -2 & 3 \\ 0 & -1 & 5 \\ 0 & 0 & 4 \end{bmatrix} = U

Step 2: Two Methods to Construct LL

Since AA has 3 rows, LL will be a 3ร—33 \times 3 unit lower triangular matrix.

Method 1: The "Multiplier" Method (Fastest).

At each pivot column, divide the eliminated entries by the pivot for that column, and place the result directly into LL.

Column 1 Multipliers: The pivot is ๐Ÿ\mathbf{2}. Divide 6 and 4 by 2 respectively.

Column 2 Multipliers: The new pivot is โˆ’๐Ÿ\mathbf{-1}. Divide -4 by -1.

Placing these multipliers below the diagonal of 1s gives you LL: L=[100๐Ÿ‘10๐Ÿ๐Ÿ’1]L = \begin{bmatrix} 1 & 0 & 0 \\ \mathbf{3} & 1 & 0 \\ \mathbf{2} & \mathbf{4} & 1 \end{bmatrix}

Method 2: The Elementary Inverse Method. Mathematically, LL is formed by the inverse of the elementary matrices used to reach UU: L=E21โˆ’1E31โˆ’1E32โˆ’1L = E_{21}^{-1}E_{31}^{-1}E_{32}^{-1}.

Construct LL by simply taking the nonzero off-diagonal elements of the elementary inverse matrices and placing them into the appropriate positions in LL.

L=[100๐Ÿ‘10001][100010๐Ÿ01][1000100๐Ÿ’1]=[100๐Ÿ‘10๐Ÿ๐Ÿ’1]L = \begin{bmatrix} 1 & 0 & 0 \\ \mathbf{3} & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ \mathbf{2} & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & \mathbf{4} & 1 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 \\ \mathbf{3} & 1 & 0 \\ \mathbf{2} & \mathbf{4} & 1 \end{bmatrix}

5.2 Solving using LL & UU

Ax=bโŸนLUx=b\begin{align*} & Ax = b \\ \implies & LUx = b \end{align*} Forward substitution Defining y=Uxy= Ux, solve for Ly=bLy=b

Backward substitution Solve Ux=yUx=y

Example

Given the linear system Ax=bAx = b, where: A=[3โˆ’7โˆ’22โˆ’35106โˆ’40โˆ’5โˆ’95โˆ’512],b=[โˆ’95711]A = \begin{bmatrix} 3 & -7 & -2 & 2 \\ -3 & 5 & 1 & 0 \\ 6 & -4 & 0 & -5 \\ -9 & 5 & -5 & 12 \end{bmatrix}, \qquad b = \begin{bmatrix} -9 \\ 5 \\ 7 \\ 11 \end{bmatrix}

Matrix AA has been factored into LL and UU: L=[1000โˆ’11002โˆ’510โˆ’3831],U=[3โˆ’7โˆ’220โˆ’2โˆ’1200โˆ’11000โˆ’1]L = \begin{bmatrix} 1 & 0 & 0 & 0 \\ -1 & 1 & 0 & 0 \\ 2 & -5 & 1 & 0 \\ -3 & 8 & 3 & 1 \end{bmatrix}, \qquad U = \begin{bmatrix} 3 & -7 & -2 & 2 \\ 0 & -2 & -1 & 2 \\ 0 & 0 & -1 & 1 \\ 0 & 0 & 0 & -1 \end{bmatrix}

Forward Substitution (Ly=bLy = b)

Set up the lower triangular system to solve for the intermediate vector yy: [1000โˆ’11002โˆ’510โˆ’3831][y1y2y3y4]=[โˆ’95711]\begin{bmatrix} 1 & 0 & 0 & 0 \\ -1 & 1 & 0 & 0 \\ 2 & -5 & 1 & 0 \\ -3 & 8 & 3 & 1 \end{bmatrix} \begin{bmatrix} y_1 \\ y_2 \\ y_3 \\ y_4 \end{bmatrix} = \begin{bmatrix} -9 \\ 5 \\ 7 \\ 11 \end{bmatrix}

Solve the equations sequentially from top to bottom: y1=โˆ’9โˆ’y1+y2=5โŸนy2=โˆ’42y1โˆ’5y2+y3=7โŸนy3=5โˆ’3y1+8y2+3y3+y4=11โŸนy4=1\begin{aligned} y_1 &= -9 \\ -y_1 + y_2 &= 5 &&\implies y_2 = -4 \\ 2y_1 - 5y_2 + y_3 &= 7 &&\implies y_3 = 5 \\ -3y_1 + 8y_2 + 3y_3 + y_4 &= 11 &&\implies y_4 = 1 \end{aligned}

This gives us our intermediate vector yy: y=[โˆ’9โˆ’451]y = \begin{bmatrix} -9 \\ -4 \\ 5 \\ 1 \end{bmatrix}

Step 2: Backward Substitution (Ux=yUx = y)

Set up the upper triangular system using the newly found vector yy to solve for xx: [3โˆ’7โˆ’220โˆ’2โˆ’1200โˆ’11000โˆ’1][x1x2x3x4]=[โˆ’9โˆ’451]\begin{bmatrix} 3 & -7 & -2 & 2 \\ 0 & -2 & -1 & 2 \\ 0 & 0 & -1 & 1 \\ 0 & 0 & 0 & -1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = \begin{bmatrix} -9 \\ -4 \\ 5 \\ 1 \end{bmatrix}

Solve the equations sequentially from bottom to top: โˆ’x4=1โŸนx4=โˆ’1โˆ’x3+x4=5โŸนx3=โˆ’6โˆ’2x2โˆ’x3+2x4=โˆ’4โŸนx2=43x1โˆ’7x2โˆ’2x3+2x4=โˆ’9โŸนx1=3\begin{aligned} -x_4 &= 1 &&\implies x_4 = -1 \\ -x_3 + x_4 &= 5 &&\implies x_3 = -6 \\ -2x_2 - x_3 + 2x_4 &= -4 &&\implies x_2 = 4 \\ 3x_1 - 7x_2 - 2x_3 + 2x_4 &= -9 &&\implies x_1 = 3 \end{aligned}

Final Solution: x=[34โˆ’6โˆ’1]x = \begin{bmatrix} 3 \\ 4 \\ -6 \\ -1 \end{bmatrix}

5.3 Zero Pivots: PA=LUPA = LU Factorization

The standard A=LUA = LU factorization assumes matrix AA can be reduced to echelon form without row interchanges. If a pivot becomes zero, you must swap rows, which breaks the standard algorithm.

To solve this, we pre-swap the rows of AA using a Permutation Matrix PP, which is an Identity matrix with its rows swapped. This yields the generalized factorization: PA=LUPA = LU

Example: Given matrix AA: A=[11111โˆ’12โˆ’1โˆ’1]A = \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & -1 \\ 2 & -1 & -1 \end{bmatrix}

If we attempt standard row reduction (R2โˆ’R1R_2 - R_1 and R3โˆ’2R1R_3 - 2R_1), we hit a zero pivot in the second column: [1110๐ŸŽโˆ’20โˆ’3โˆ’3]\begin{bmatrix} 1 & 1 & 1 \\ 0 & \mathbf{0} & -2 \\ 0 & -3 & -3 \end{bmatrix}

To fix this, we swap Row 2 and Row 3 using permutation matrix P23P_{23}: P=[100001010]P = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix}

Calculate PAPA to generate the row-swapped matrix: PA=[100001010][11111โˆ’12โˆ’1โˆ’1]=[1112โˆ’1โˆ’111โˆ’1]PA = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{bmatrix} \begin{bmatrix} 1 & 1 & 1 \\ 1 & 1 & -1 \\ 2 & -1 & -1 \end{bmatrix} = \begin{bmatrix} 1 & 1 & 1 \\ 2 & -1 & -1 \\ 1 & 1 & -1 \end{bmatrix}

Now, factor PAPA normally into LL and UU: Using pivot 1 in column 1: R2โˆ’๐ŸR1โŸนl21=2R_2 - \mathbf{2}R_1 \implies l_{21} = 2, and R3โˆ’๐ŸR1โŸนl31=1R_3 - \mathbf{1}R_1 \implies l_{31} = 1. The entry below the second pivot (โˆ’3-3) is already 0โŸนl32=00 \implies l_{32} = 0.

This gives our final LL and UU matrices for PAPA: L=[100210101],U=[1110โˆ’3โˆ’300โˆ’2]L = \begin{bmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 1 & 0 & 1 \end{bmatrix}, \qquad U = \begin{bmatrix} 1 & 1 & 1 \\ 0 & -3 & -3 \\ 0 & 0 & -2 \end{bmatrix}