MATH 332 — Fall 2026

Matrix Structure and Transformations
Anton, Rorres, & Kaul §§1.7–1.9
Test 1 · Sep 17

Fred J. Hickernell

October 9, 2026

Course Map

In this deck

Rotate · Reflect · Project · Stretch

\[\begin{gather*} \mat{A}\vct{x}=\vct{b} \;\xrightarrow{\mat{A}=\mat{P}\mat{L}\mat{U}}\; \underbrace{\mat{L}\vct{y}=\mat{P}^{\mathsf T}\vct{b}}_{\text{forward solve}} \;\longrightarrow\; \underbrace{\mat{U}\vct{x}=\vct{y}}_{\text{back solve}} \\ \mat{A}\vct{e}_j=\vct{A}_j \quad\implies\quad \mat{A}\vct{x}=\textstyle\sum_{j=1}^n x_j\vct{A}_j \end{gather*}\]

Matrix Patterns

The pattern of entries can reveal how a matrix behaves before any calculation

Diagonal matrices act one coordinate at a time

For the diagonal matrix

\[ \mat{D}=\begin{bmatrix} d_1&0&\cdots&0\\ 0&d_2&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&d_n \end{bmatrix}, \]

each coordinate is scaled independently:

\[ \mat{D}\vct{x} = \begin{bmatrix} d_1x_1&d_2x_2&\cdots&d_nx_n \end{bmatrix}^{\mathsf T} \]

For a positive integer \(k\), \(\mat{D}^k\) has diagonal entries \(d_i^k\)

 

If every \(d_i\ne0\), \(\mat{D}^{-1}\) has diagonal entries \(1/d_i\)

Triangular matrices expose pivots

Lower triangular

\[ \mat{L}=\begin{bmatrix} \ell_{11}&0&0\\ \ell_{21}&\ell_{22}&0\\ \ell_{31}&\ell_{32}&\ell_{33} \end{bmatrix} \]

Zeros lie above the diagonal

Upper triangular

\[ \mat{U}=\begin{bmatrix} u_{11}&u_{12}&u_{13}\\ 0&u_{22}&u_{23}\\ 0&0&u_{33} \end{bmatrix} \]

Zeros lie below the diagonal

  • Gaussian elimination produces upper-triangular form for square matrices and upper-trapezoidal form for rectangular matrices
  • triangular systems are solved in order by forward or back substitution

A triangular matrix is invertible exactly when every diagonal entry is nonzero

 

Its inverse has the same triangular form

A \(3\times3\) upper-triangular example

\[ \mat{U}= \begin{bmatrix} 1&2&1\\ 0&2&2\\ 0&0&1 \end{bmatrix} \]

  • Diagonal pivots — \(1,2,1\)
  • A pivot in every column — \(\mat{U}\) invertible
  • Inverse from Gauss–Jordan reduction of \([\,\mat{U}\mid\mat{I}\,]\)

\[ \left[ \begin{array}{rrr|rrr} 1&2&1&1&0&0\\ 0&2&2&0&1&0\\ 0&0&1&0&0&1 \end{array} \right] \]

Normalize the second pivot

Start at the bottom and work upward

\[ \left[ \begin{array}{rrr|rrr} 1&2&1&1&0&0\\ 0&2&2&0&1&0\\ 0&0&1&0&0&1 \end{array} \right] \xrightarrow{R_2\leftarrow\tfrac12R_2} \left[ \begin{array}{rrr|rrr} 1&2&1&1&0&0\\ 0&1&1&0&\tfrac12&0\\ 0&0&1&0&0&1 \end{array} \right] \]

All three diagonal pivots now equal \(1\)

Clear above the third pivot

\[ \left[ \begin{array}{rrr|rrr} 1&2&1&1&0&0\\ 0&1&1&0&\tfrac12&0\\ 0&0&1&0&0&1 \end{array} \right] \xrightarrow{\substack{R_1\leftarrow R_1-R_3\\R_2\leftarrow R_2-R_3}} \left[ \begin{array}{rrr|rrr} 1&2&0&1&0&-1\\ 0&1&0&0&\tfrac12&-1\\ 0&0&1&0&0&1 \end{array} \right] \]

Use the third pivot to clear both entries above it

Clear above the second pivot

\[ \left[ \begin{array}{rrr|rrr} 1&2&0&1&0&-1\\ 0&1&0&0&\tfrac12&-1\\ 0&0&1&0&0&1 \end{array} \right] \xrightarrow{R_1\leftarrow R_1-2R_2} \left[ \begin{array}{rrr|rrr} 1&0&0&1&-1&1\\ 0&1&0&0&\tfrac12&-1\\ 0&0&1&0&0&1 \end{array} \right] \]

  • Left block — \(\mat{I}\)
  • Right block — \(\mat{U}^{-1}\)
  • \(\mat{U}^{-1}\) — upper triangular again

Tridiagonal matrices couple neighboring grid values

Consider the linear boundary-value problem

\[ a(x)y''(x)+b(x)y'(x)+c(x)y(x)=d(x), \qquad y(0)=y(1)=0 \]

At the interior grid points \(x_i=ih\), \(i=1,\ldots,n\), where \(h=1/(n+1)\),

\[ y''(x_i)\approx\frac{y_{i-1}-2y_i+y_{i+1}}{h^2}, \qquad y'(x_i)\approx\frac{y_{i+1}-y_{i-1}}{2h} \]

Each centered-difference equation couples only the neighboring values \(y_{i-1}\), \(y_i\), and \(y_{i+1}\)

Three coefficients form three diagonals

Write \(a_i=a(x_i)\), and similarly for \(b_i,c_i,d_i\). Then

\[ \alpha_i y_{i-1}+\beta_i y_i+\gamma_i y_{i+1}=d_i, \]

\[ \alpha_i=\frac{a_i}{h^2}-\frac{b_i}{2h}, \qquad \beta_i=-\frac{2a_i}{h^2}+c_i, \qquad \gamma_i=\frac{a_i}{h^2}+\frac{b_i}{2h} \]

Because \(y_0=y_{n+1}=0\), the unknowns \(\vct{y}=[y_1,\ldots,y_n]^{\mathsf T}\) satisfy

\[ \begin{bmatrix} \beta_1&\gamma_1&&&0\\ \alpha_2&\beta_2&\gamma_2&&\\ &\ddots&\ddots&\ddots&\\ &&\alpha_{n-1}&\beta_{n-1}&\gamma_{n-1}\\ 0&&&\alpha_n&\beta_n \end{bmatrix} \vct{y} = \begin{bmatrix}d_1\\d_2\\\vdots\\d_{n-1}\\d_n\end{bmatrix} \]

A concrete boundary-value problem

Take

\[ -y''(x)+y'(x)+y(x)=x, \qquad y(0)=y(1)=0 \]

With four interior points, \(h=1/5\). Multiplying the centered-difference equations by \(2\) gives

\[ \begin{bmatrix} 102&-45&0&0\\ -55&102&-45&0\\ 0&-55&102&-45\\ 0&0&-55&102 \end{bmatrix} \begin{bmatrix}y_1\\y_2\\y_3\\y_4\end{bmatrix} = \begin{bmatrix}2/5\\4/5\\6/5\\8/5\end{bmatrix} \]

  • Second derivative — main diagonal and both neighboring diagonals
  • First derivative — unequal off-diagonal entries, so this matrix is not symmetric

\(\exstar\) Numerically solve the system for \(\vct{y}=[y_1,y_2,y_3,y_4]^{\mathsf T}\)

Transpose exchanges rows and columns

We already used \(\vct{a}^{\mathsf T}\) for a matrix row in Systems and Matrices

Now transpose any matrix:

For example,

\[ \mat{A}=\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}, \qquad \mat{A}^{\mathsf T}=\begin{bmatrix}1&4\\2&5\\3&6\end{bmatrix} \]

  • entries exchange positions: \((\mat{A}^{\mathsf T})_{ij}=a_{ji}\)
  • products reverse order: \((\mat{A}\mat{B})^{\mathsf T}=\mat{B}^{\mathsf T}\mat{A}^{\mathsf T}\)

The transpose exchanges the roles of rows and columns

Symmetric matrices mirror pairwise relationships

A square matrix is symmetric when

\[ \mat{S}=\mat{S}^{\mathsf T} \]

For example,

\[ \mat{S}=\begin{bmatrix} 4&-1&2\\ -1&3&0\\ 2&0&5 \end{bmatrix} \]

has matching entries \(s_{ij}=s_{ji}\) across its diagonal

  • invertible covariance matrices and their precision matrices are symmetric (Inverses)
  • \(\mat{A}^{\mathsf T}\mat{A}\) and \(\mat{A}\mat{A}^{\mathsf T}\) are always symmetric

Symmetry records the same pairwise value in both directions

Elimination Becomes a Factorization

Elimination separates a matrix into simpler structured factors

Start with LU when no row exchanges are needed
Add a permutation matrix to obtain PLU
Reuse the triangular factors to solve systems

Inverse elimination matrices form \(\mat{L}\)

Recall the coefficient matrix from Systems and Matrices:

\[ \mat{A}= \begin{bmatrix} 1&2&-1\\ 2&-1&1\\ 3&1&2 \end{bmatrix} \]

The two column-elimination stages give

\[ \mat{M}_1= \begin{bmatrix}1&0&0\\-2&1&0\\-3&0&1\end{bmatrix}, \qquad \mat{M}_2= \begin{bmatrix}1&0&0\\0&1&0\\0&-1&1\end{bmatrix} \]

\[ \mat{U}=\mat{M}_2\mat{M}_1\mat{A} =\begin{bmatrix} 1&2&-1\\ 0&-5&3\\ 0&0&2 \end{bmatrix} \]

Undoing the stages produces \(\mat{L}\)

The elimination stages satisfy

\[ \mat{U}=\mat{M}_2\mat{M}_1\mat{A} \]

Undoing them in reverse order gives

\[ \mat{A}= \underbrace{\mat{M}_1^{-1}\mat{M}_2^{-1}}_{\mat{L}}\mat{U}, \qquad \mat{L}=\begin{bmatrix} 1&0&0\\2&1&0\\3&1&1 \end{bmatrix} \]

Without row exchanges, elimination gives \(\mat{A}=\mat{L}\mat{U}\)

 

Next we incorporate row exchanges and derive the general PLU pattern

A permutation matrix records row order

A permutation matrix is obtained by reordering the rows of the identity matrix

Write \(\mat{P}_{jk}\) for one exchange of rows \(j\) and \(k\)

In PLU, \(\mat{P}\) records the combined row ordering

\[ \mat{P}=\begin{bmatrix} 0&0&1\\ 1&0&0\\ 0&1&0 \end{bmatrix}, \qquad \mat{P} \begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix} = \begin{bmatrix}x_3\\x_1\\x_2\end{bmatrix} \]

Every row and column of \(\mat{P}\) contains exactly one \(1\)

\[ \mat{P}^{-1}=\mat{P}^{\mathsf T}, \qquad \mat{P}^{\mathsf T}\mat{P}=\mat{I} \]

A single row-exchange matrix is symmetric

A general permutation matrix need not be

Left permutes rows; right permutes columns

Write the rows of \(\mat{A}\) as \(\vct{a}_i^{\mathsf T}\) and its columns as \(\vct{A}_j\). For the displayed \(\mat{P}\),

\[ \mat{P}\mat{A} = \begin{bmatrix} 0&0&1\\ 1&0&0\\ 0&1&0 \end{bmatrix} \mat{A} = \begin{bmatrix} \vct{a}_3^{\mathsf T}\\ \vct{a}_1^{\mathsf T}\\ \vct{a}_2^{\mathsf T} \end{bmatrix} \]

\[ \mat{A}\mat{P} = \mat{A} \begin{bmatrix} 0&0&1\\ 1&0&0\\ 0&1&0 \end{bmatrix} = \begin{bmatrix}\vct{A}_2&\vct{A}_3&\vct{A}_1\end{bmatrix} \]

  • Left multiplication by a permutation matrix permutes rows
  • Right multiplication by a permutation matrix permutes columns

Because this \(\mat{P}\) is not symmetric, \(\mat{A}\mat{P}^{\mathsf T}\)—not \(\mat{A}\mat{P}\)—uses the same ordering as \(\mat{P}\mat{A}\)

Collect interleaved row exchanges

Rightmost factor acts first

\[ \mat{U}=\mat{M}_2\mat{\Pi}_2\mat{M}_1\mat{\Pi}_1\mat{A} \]

Insert \(\mat{\Pi}_2^{\mathsf T}\mat{\Pi}_2=\mat{I}\)

\[ \mat{\Pi}_2\mat{M}_1 =\mat{\Pi}_2\mat{M}_1 \bigl(\mat{\Pi}_2^{\mathsf T}\mat{\Pi}_2\bigr) = \underbrace{\bigl(\mat{\Pi}_2\mat{M}_1\mat{\Pi}_2^{\mathsf T}\bigr)}_{\widetilde{\mat{M}}_1} \mat{\Pi}_2 \]

Move and relabel the elimination stage—do not commute the factors

Relabeled stages reveal \(\mat{L}\)

The collected factors give

\[ \mat{U} =\mat{M}_2\widetilde{\mat{M}}_1 \underbrace{\bigl(\mat{\Pi}_2\mat{\Pi}_1\bigr)}_{\mat{P}^{\mathsf T}} \mat{A} =\mat{L}^{-1}\mat{P}^{\mathsf T}\mat{A}, \qquad \mat{L}=\widetilde{\mat{M}}_1^{-1}\mat{M}_2^{-1} \]

  • \(\mat{M}_1\longrightarrow\widetilde{\mat{M}}_1\)
  • \(\mat{M}_2\) unchanged
  • \(\widetilde{\mat{M}}_1\) remains unit lower triangular because \(\mat{\Pi}_2\) exchanges only rows below the first pivot

General \(q\)-stage pattern

  • \(\mat{\Pi}_j\) — row exchange before stage \(j\), fixing rows \(1,\ldots,j-1\), or \(\mat{I}\) if none
  • \(\mat{M}_j\) — eliminate below pivot \(j\)

\[ \mat{U} =\mat{M}_q\mat{\Pi}_q \mat{M}_{q-1}\mat{\Pi}_{q-1} \cdots \mat{M}_1\mat{\Pi}_1\mat{A} \]

Every exchange after stage \(j\) acts only among rows \(j+1,\ldots,m\). Set

\[ \widetilde{\mat{M}}_j = \bigl(\mat{\Pi}_q\cdots\mat{\Pi}_{j+1}\bigr) \mat{M}_j \bigl(\mat{\Pi}_q\cdots\mat{\Pi}_{j+1}\bigr)^{\mathsf T} \]

Conjugation applies the same relabeling to rows and columns

The relabeled stages stay lower triangular

Because \(\mat{\Pi}_q\cdots\mat{\Pi}_{j+1}\) fixes the first \(j\) rows and columns, conjugation only reorders the entries below the diagonal in column \(j\)

Therefore \(\widetilde{\mat{M}}_j\) and \(\widetilde{\mat{M}}_j^{-1}\) remain unit lower triangular

\[\begin{align*} \mat{P}^{\mathsf T} &=\mat{\Pi}_q\cdots\mat{\Pi}_1,\\ \mat{U} &=\widetilde{\mat{M}}_q\cdots\widetilde{\mat{M}}_1 \mat{P}^{\mathsf T}\mat{A},\\ \mat{L} &=\widetilde{\mat{M}}_1^{-1}\cdots\widetilde{\mat{M}}_q^{-1} \end{align*}\]

  • Later row exchanges relabel only the unused rows of earlier stages
  • \(\widetilde{\mat{M}}_q=\mat{M}_q\)
  • \(\mat{L}\) is a product of unit lower-triangular matrices and is therefore unit lower triangular

Concrete example — first exchange

\[ \mat{A}= \begin{bmatrix} 0&0&1\\ 2&2&0\\ 1&3&1 \end{bmatrix} \]

  • First pivot candidate is zero
  • \(\mat{\Pi}_1=\mat{P}_{12}\) — exchange rows \(1\) and \(2\)

\[ \mat{\Pi}_1\mat{A} = \begin{bmatrix} 2&2&0\\ 0&0&1\\ 1&3&1 \end{bmatrix} \]

Concrete example — eliminate column 1

Eliminate below the first pivot

\[ \mat{M}_1= \begin{bmatrix} 1&0&0\\ 0&1&0\\ -\tfrac12&0&1 \end{bmatrix}, \qquad \mat{M}_1\mat{\Pi}_1\mat{A} = \begin{bmatrix} 2&2&0\\ 0&0&1\\ 0&2&1 \end{bmatrix} \]

Next pivot candidate is zero — another row exchange

Concrete example — second exchange

\(\mat{\Pi}_2=\mat{P}_{23}\) — exchange rows \(2\) and \(3\)

\[ \mat{U} =\mat{M}_2\mat{\Pi}_2\mat{M}_1\mat{\Pi}_1\mat{A} = \begin{bmatrix} 2&2&0\\ 0&2&1\\ 0&0&1 \end{bmatrix} \]

The entry below the second pivot is already zero, so \(\mat{M}_2=\mat{I}\)

Concrete example — recover \(\mat{L}\)

The later exchange moves the first-stage multiplier from row \(3\) to row \(2\)

\[ \widetilde{\mat{M}}_1 =\mat{\Pi}_2\mat{M}_1\mat{\Pi}_2^{\mathsf T} = \begin{bmatrix} 1&0&0\\ -\tfrac12&1&0\\ 0&0&1 \end{bmatrix} \]

Since \(\mat{L}^{-1}=\mat{M}_2\widetilde{\mat{M}}_1\), invert in reverse order
Then use \(\mat{M}_2=\mat{I}\)

\[ \mat{L} =\bigl(\mat{M}_2\widetilde{\mat{M}}_1\bigr)^{-1} =\widetilde{\mat{M}}_1^{-1}\mat{M}_2^{-1} =\widetilde{\mat{M}}_1^{-1} = \begin{bmatrix} 1&0&0\\ \tfrac12&1&0\\ 0&0&1 \end{bmatrix} \]

Concrete example — collect the row order

The exchange matrices record the final row order

\[ \mat{P}^{\mathsf T} =\mat{\Pi}_2\mat{\Pi}_1 = \begin{bmatrix} 0&1&0\\ 0&0&1\\ 1&0&0 \end{bmatrix} \]

\(\mat{P}^{\mathsf T}\mat{A}=\mat{L}\mat{U}\) \(\qquad\Longleftrightarrow\qquad\) \(\mat{A}=\mat{P}\mat{L}\mat{U}\)

Rectangular PLU uses compact factors

For \(\mat{A}\in\reals^{m\times n}\), set \(k=\min(m,n)\)
Compact PLU factors have shapes

\[ \mat{P}\in\reals^{m\times m}, \qquad \mat{L}\in\reals^{m\times k}, \qquad \mat{U}\in\reals^{k\times n}, \qquad \mat{A}=\mat{P}\mat{L}\mat{U} \]

Wide or square: \(m\le n\)

  • \(\mat{L}\) is square and unit lower triangular
  • \(\mat{U}\) has zeros below its diagonal

Tall: \(m>n\)

  • \(\mat{L}\) has \(1\)’s on its diagonal and zeros above it
  • \(\mat{U}\) is square and upper triangular

For a tall matrix, the compact form omits the guaranteed zero rows at the bottom of full \(\mat{U}\) and the matching columns of full \(\mat{L}\)

Triangular factors organize repeated solves

For a square nonsingular matrix, if \(\mat{A}=\mat{P}\mat{L}\mat{U}\), then

\[ \mat{A}\vct{x}=\vct{b} \qquad\Longleftrightarrow\qquad \mat{L}\mat{U}\vct{x}=\mat{P}^{\mathsf T}\vct{b} \]

Introduce \(\vct{y}=\mat{U}\vct{x}\) and solve two triangular systems:

\[ \underbrace{\mat{L}\vct{y}=\mat{P}^{\mathsf T}\vct{b}}_{\text{forward substitution}}, \qquad \underbrace{\mat{U}\vct{x}=\vct{y}}_{\text{back substitution}} \]

First dense solve — factor and solve: \(O(n^3)\) operations

 

Each new \(\vct{b}\) with saved PLU — permute, forward solve, and back solve: \(O(n^2)\) operations, without forming an inverse

The Lecture 03 companion notebook carries out these steps with SciPy, including packed factors, pivot indices, multiple right-hand sides, residual checks, and measured solve times

Matrices as Linear Transformations

We now study functions, or transformations, from \(\reals^n\) to \(\reals^m\)

Every \(\mat{A}\in\reals^{m\times n}\) defines one:

\[ T_{\mat{A}}:\reals^n\longrightarrow\reals^m, \qquad T_{\mat{A}}(\vct{x})=\mat{A}\vct{x} \]

A matrix turns an input vector into an output vector

One concrete matrix and one input

\[ \mat{A} =\begin{bmatrix}1&2\\3&-1\\-1&1\end{bmatrix}, \qquad \vct{x}=\begin{bmatrix}4\\-2\end{bmatrix}, \qquad \mat{A}\vct{x}=\begin{bmatrix}0\\14\\-6\end{bmatrix}=\vct{b} \]

Input: domain

\(\vct{x}\in\reals^2\)

\(\reals^2\) — real column vectors with two entries

Number of columns \(=\) input dimension \(2\)

Output: codomain

\(\vct{b}=\mat{A}\vct{x}\in\reals^3\)

\(\reals^3\) — real column vectors with three entries

Number of rows \(=\) output dimension \(3\)

\(\mat{A}\in\reals^{3\times2}\) — two-entry inputs to three-entry outputs

Given the output, solve for the column weights

Systems and Matrices — solve \(\mat{A}\vct{x}=\vct{b}\) for \(\vct{x}\)

For the same matrix, \(\mat{A}=[\vct{A}_1\ \vct{A}_2]\)

\[ \mat{A}\vct{x} =x_1\vct{A}_1+x_2\vct{A}_2 =\vct{b} \]

Linear combination — a weighted sum of vectors

\[ 4\begin{bmatrix}1\\3\\-1\end{bmatrix} -2\begin{bmatrix}2\\-1\\1\end{bmatrix} =\begin{bmatrix}0\\14\\-6\end{bmatrix} =\vct{b} \]

Solving \(\mat{A}\vct{x}=\vct{b}\) — finding column weights in a linear combination that produces \(\vct{b}\)

Combine first or transform first—the output agrees

Same \(\mat{A}\), input vectors \(\vct{u}=\vct{e}_1\) and \(\vct{v}=\vct{e}_2\), weights \(2\) and \(3\)

Combine, then transform

\[ 2\vct{u}+3\vct{v} =\begin{bmatrix}2\\3\end{bmatrix} \]

\[ \mat{A}(2\vct{u}+3\vct{v}) =\begin{bmatrix}8\\3\\1\end{bmatrix} \]

Transform, then combine

\[ \mat{A}\vct{u} =\begin{bmatrix}1\\3\\-1\end{bmatrix}, \qquad \mat{A}\vct{v} =\begin{bmatrix}2\\-1\\1\end{bmatrix} \]

\[ 2\mat{A}\vct{u}+3\mat{A}\vct{v} =\begin{bmatrix}8\\3\\1\end{bmatrix} \]

A rule \(T\) is a linear transformation when, for every \(\vct{u},\vct{v}\) and all scalars \(a,b\), \(T(a\vct{u}+b\vct{v})=aT(\vct{u})+bT(\vct{v})\)

Basis images determine the whole transformation

\(j\)th standard basis vector \(\vct{e}_j\) — a \(1\) in position \(j\), zeros elsewhere

Every vector — a linear combination of the standard basis vectors

\[ \vct{x}=x_1\vct{e}_1+\cdots+x_n\vct{e}_n \]

Transform the weighted sum = use the same weights on the transformed basis vectors

\[ T(\vct{x}) =x_1T(\vct{e}_1)+\cdots+x_nT(\vct{e}_n) \]

Basis images — columns of the standard matrix

\[ \mat{A} =\begin{bmatrix} T(\vct{e}_1)&\cdots&T(\vct{e}_n) \end{bmatrix} \]

Basis images — enough to determine every output

Build the standard matrix from basis images

Concrete rule behind the running matrix

\[ T(x,y)=(x+2y,\ 3x-y,\ -x+y) \]

Basis images

\[ T(\vct{e}_1)=T(1,0)=\begin{bmatrix}1\\3\\-1\end{bmatrix}, \qquad T(\vct{e}_2)=T(0,1)=\begin{bmatrix}2\\-1\\1\end{bmatrix} \]

Basis images as columns

\[ \mat{A}=\begin{bmatrix}1&2\\3&-1\\-1&1\end{bmatrix}, \qquad T(\vct{x})=\mat{A}\vct{x} \]

Dimensions \(\reals^2\to\reals^3\) — a \(3\times2\) standard matrix

Geometry of Matrix Transformations

The images of the coordinate directions reveal the geometry

One vector reveals four different actions

x y
\(\vct{v}=(2,1)\)
\(\mat{D}\vct{v}=(4,\tfrac12)\)
\(\mat{H}\vct{v}=(1,2)\)
\(\mat{Q}\vct{v}=(2,0)\)
\(\mat{R}_{90}\vct{v}=(-1,2)\)

Shown above — diagonal stretch \(\mat{D}\), reflection \(\mat{H}\), projection \(\mat{Q}\), and \(90^\circ\) rotation \(\mat{R}_{90}\)

Diagonal actions stretch and flip coordinate directions

Stretch by different amounts

\[ \mat{D}=\begin{bmatrix}2&0\\0&\tfrac12\end{bmatrix}, \qquad \mat{D} \begin{bmatrix}x\\y\end{bmatrix} = \begin{bmatrix}2x\\y/2\end{bmatrix} \]

  • horizontal distances double
  • vertical distances halve

Flip one direction

\[ \begin{bmatrix}-1&0\\0&1\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} = \begin{bmatrix}-x\\y\end{bmatrix} \]

  • the first coordinate reverses
  • the second stays fixed

Diagonal structure — independent actions on the coordinate directions

Reflections reverse one direction while preserving lengths

Reflection across the line \(y=x\) exchanges the coordinates:

\[ \mat{H}=\begin{bmatrix}0&1\\1&0\end{bmatrix}, \qquad \mat{H}\begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}y\\x\end{bmatrix} \]

Its columns are the reflected basis vectors:

\[ \mat{H}\vct{e}_1=\vct{e}_2, \qquad \mat{H}\vct{e}_2=\vct{e}_1 \]

Reflecting twice restores every vector:

\[ \mat{H}^2=\mat{I}, \qquad \mat{H}^{-1}=\mat{H} \]

A reflection changes geometry without losing information

Householder reflections work in any dimension

For a unit vector \(\vct{u}\), the Householder reflection across \(\vct{u}^{\mathsf T}\vct{x}=0\) is

\[ \mat{H}=\mat{I}-2\vct{u}\vct{u}^{\mathsf T}, \qquad \mat{H}\vct{x}=\vct{x}-2\vct{u} \bigl(\vct{u}^{\mathsf T}\vct{x}\bigr) \]

  • the component along \(\vct{u}\) reverses
  • every component perpendicular to \(\vct{u}\) stays fixed
  • \(\mat{H}^{\mathsf T}=\mat{H}\) and \(\mat{H}^{-1}=\mat{H}\)

Householder reflections can zero several vector entries in one step, a key idea behind QR factorization

\(\exstar\) For the Householder matrix \(\mat{H}\) defined above, show that \(\mat{H}^2=\mat{I}\) Use \(\vct{u}^{\mathsf T}\vct{u}=1\)

How to certify a reflection

Every reflection satisfies \(\mat{H}^2=\mat{I}\), but this condition is only necessary:

\[ (-\mat{I}_2)^2=\mat{I}_2, \qquad -\mat{I}_2\text{ is rotation through }180^\circ \]

To prove that \(\mat{A}\) is a reflection, find a unit vector \(\vct{u}\) such that

\[ \mat{A}=\mat{I}-2\vct{u}\vct{u}^{\mathsf T} \]

For reflection across \(y=x\), a unit normal is

\[ \vct{u}=\frac{1}{\sqrt{2}}\begin{bmatrix}1\\-1\end{bmatrix}, \qquad \mat{I}-2\vct{u}\vct{u}^{\mathsf T} =\begin{bmatrix}0&1\\1&0\end{bmatrix} \]

\(\mat{A}^2=\mat{I}\) is necessary; a Householder representation is sufficient

Nonidentity projections discard information

Projection onto the \(x\)-axis keeps the first coordinate and removes the second:

\[ \mat{Q}=\begin{bmatrix}1&0\\0&0\end{bmatrix}, \qquad \mat{Q}\begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}x\\0\end{bmatrix} \]

  • \(\mat{Q}\) is diagonal and symmetric
  • \(\mat{Q}^2=\mat{Q}\): projecting again changes nothing
  • every point on the vertical line through \((x,0)\) has the same image

This projection is singular: it collapses a direction and cannot be undone

Orthogonal projection onto a plane

A plane in \(\reals^3\) with nonzero normal \(\vct{u}\): \(\vct{u}^{\mathsf T}\vct{x}=0\)

Remove the normal component to reach the plane:

\[\begin{align*} \vct{y}&=\vct{x}-\alpha\vct{u}, &0=\vct{u}^{\mathsf T}\vct{y} &=\vct{u}^{\mathsf T}\vct{x}-\alpha\vct{u}^{\mathsf T}\vct{u}, &\alpha&=\frac{\vct{u}^{\mathsf T}\vct{x}}{\vct{u}^{\mathsf T}\vct{u}} \end{align*}\]

Thus \(\vct{y}=\mat{Q}\vct{x}\) with projection matrix

\[ \mat{Q}=\mat{I}-\frac{\vct{u}\vct{u}^{\mathsf T}}{\vct{u}^{\mathsf T}\vct{u}} \]

  • \(\mat{Q}\vct{u}=\vct{0}\), while vectors in the plane stay fixed
  • For unit \(\vct{u}\), \(\mat{Q}=\mat{I}-\vct{u}\vct{u}^{\mathsf T}=\tfrac12(\mat{I}+\mat{H})\),
    where \(\mat{H}\) is the Householder reflection matrix

A rotation matrix is determined by the rotated basis vectors

A counterclockwise rotation through angle \(\theta\) sends

\[ \vct{e}_1\longmapsto \begin{bmatrix}\cos\theta\\\sin\theta\end{bmatrix}, \qquad \vct{e}_2\longmapsto \begin{bmatrix}-\sin\theta\\\cos\theta\end{bmatrix} \]

These images become the columns:

\[ \mat{R}_{\theta} =\begin{bmatrix} \cos\theta&-\sin\theta\\ \sin\theta&\cos\theta \end{bmatrix} \]

The columns show where the two coordinate directions go

The plotted rotation uses \(\theta=90^\circ\)

Since \(\cos 90^\circ=0\) and \(\sin 90^\circ=1\),

\[ \mat{R}_{90} =\begin{bmatrix}0&-1\\1&0\end{bmatrix}, \qquad \mat{R}_{90}\begin{bmatrix}2\\1\end{bmatrix} =\begin{bmatrix}-1\\2\end{bmatrix} \]

Rotating backward undoes the action:

\[ \mat{R}_{90}^{-1} =\mat{R}_{-90} =\mat{R}_{90}^{\mathsf T} \]

This is the purple arrow in the comparison picture

Givens rotations act in one coordinate plane

A Givens rotation changes only coordinates \(i\) and \(j\) and can make one selected component zero:

\[ \mat{G}(i,j,\theta) = \begin{bmatrix} 1&0&\cdots&0&\cdots&\cdots&0\\ 0&\ddots&&\vdots&&&\vdots\\ \vdots&&c&\cdots&-s&&\vdots\\ 0&\cdots&\vdots&\ddots&\vdots&\cdots&0\\ \vdots&&s&\cdots&c&&\vdots\\ \vdots&&&\vdots&&\ddots&0\\ 0&\cdots&\cdots&0&\cdots&0&1 \end{bmatrix} \in\reals^{n\times n} \qquad \begin{matrix} c=\cos\theta\\ s=\sin\theta \end{matrix} \]

  • looks like \(\mat{I}_n\) except for rows and columns \(i\) and \(j\)
  • sequences of Givens rotations are used in algorithms for QR factorizations and SVDs

Orthogonal matrices have orthonormal rows and columns

A real square matrix is orthogonal when

\[ \mat{A}^{-1}=\mat{A}^{\mathsf T} \]

\(\exstar\) For \(\mat{A}\in\reals^{2\times2}\), show that this identity holds exactly when its columns are an orthonormal pair—each has length \(1\), and their dot product is \(0\)
Show that it also holds exactly when its rows are an orthonormal pair Hint: the entries of \(\mat{A}^{\mathsf T}\mat{A}\) are dot products of columns; the entries of \(\mat{A}\mat{A}^{\mathsf T}\) are dot products of rows Verify the identity for the rotation \(\mat{R}_{\theta}\) above and the reflection across \(y=x\), \(\mat{H}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\)

Compose and Undo Transformations

Matrix multiplication records a sequence of actions

Composition is matrix multiplication

Suppose

\[ T_{\mat{A}}:\reals^n\to\reals^k, \qquad T_{\mat{B}}:\reals^k\to\reals^m \]

First apply \(T_{\mat{A}}\), then \(T_{\mat{B}}\):

\[ (T_{\mat{B}}\circ T_{\mat{A}})(\vct{x}) =\mat{B}(\mat{A}\vct{x}) =(\mat{B}\mat{A})\vct{x} \]

The rightmost matrix acts first: \(T_{\mat{B}}\circ T_{\mat{A}}=T_{\mat{B}\mat{A}}\)

Order can change the picture

Let \(\mat{R}\) rotate \(90^\circ\) counterclockwise and let \(\mat{Q}\) project onto the \(x\)-axis:

\[ \mat{R}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}, \qquad \mat{Q}=\begin{bmatrix}1&0\\0&0\end{bmatrix} \]

Rotate, then project

\[ \mat{Q}\mat{R}\begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}-y\\0\end{bmatrix} \]

Project, then rotate

\[ \mat{R}\mat{Q}\begin{bmatrix}x\\y\end{bmatrix} =\begin{bmatrix}0\\x\end{bmatrix} \]

Usually \(\mat{Q}\mat{R}\ne\mat{R}\mat{Q}\)

Planar rotations about the same origin are a useful commuting exception

Inverse transformations undo in reverse order

If \(T_{\mat{A}}\) and \(T_{\mat{B}}\) are invertible operators on \(\reals^n\), then

\[ (T_{\mat{B}}\circ T_{\mat{A}})^{-1} =T_{\mat{A}^{-1}}\circ T_{\mat{B}^{-1}} \]

The corresponding matrix rule from Inverses is

\[ (\mat{B}\mat{A})^{-1} =\mat{A}^{-1}\mat{B}^{-1} \]

  • rotations are undone by rotation through the opposite angle
  • reflections are undone by the same reflection
  • nonidentity projections have no inverse because they lose information

Undo the last action first

A factorization is a composition of simpler actions

The PLU factorization

\[ \mat{A}=\mat{P}\mat{L}\mat{U} \]

describes the action of \(\mat{A}\) as a sequence:

\[ \vct{x} \xrightarrow{\ \mat{U}\ } \mat{U}\vct{x} \xrightarrow{\ \mat{L}\ } \mat{L}\mat{U}\vct{x} \xrightarrow{\ \mat{P}\ } \mat{P}\mat{L}\mat{U}\vct{x} =\mat{A}\vct{x} \]

Factorization is representation by simpler actions

Multiplication composes them

Big Ideas

  • Special matrix patterns reveal behavior before computation
  • With row exchanges, elimination gives \(\mat{P}^{\mathsf T}\mat{A}=\mat{L}\mat{U}\), equivalently \(\mat{A}=\mat{P}\mat{L}\mat{U}\)
  • Linear transformation — combine first or transform first, same result
    Basis images \(\longrightarrow\) standard matrix
  • Rotations and reflections are orthogonal: inverse equals transpose
  • Nonidentity projections discard information and cannot be inverted
  • In a product, the rightmost transformation acts first
  • Inverses undo compositions in reverse order

How Far We Have Come

One matrix, computational and geometric views

  • Systems and Matrices — row operations on \([\,\mat{A}\mid\vct{b}\,]\) preserve solutions; reduction reveals inconsistencies (contradictions) and free variables
  • Inverses — for invertible square \(\mat{A}\), Gauss–Jordan gives \([\,\mat{A}\mid\mat{I}\,]\longrightarrow[\,\mat{I}\mid\mat{A}^{-1}\,]\)
  • Matrix patterns — diagonal scaling, triangular substitution, and tridiagonal neighbor coupling
  • Reusable solves — \(\mat{A}=\mat{P}\mat{L}\mat{U}\) stores row order and elimination; for invertible \(\mat{A}\), solve \(\mat{L}\vct{y}=\mat{P}^{\mathsf T}\vct{b}\), then \(\mat{U}\vct{x}=\vct{y}\)
  • Linear transformations — columns are standard-basis images; \(\mat{A}\mat{B}\vct{x}=\mat{A}(\mat{B}\vct{x})\) applies \(\mat{B}\) first
  • Geometry — orthogonal maps preserve lengths; nonidentity projections lose directions and are singular

Factors decompose the computation; geometric actions explain what it does

What Comes Next

Matrix transformations can

  • stretch or shrink regions
  • preserve or reverse orientation
  • flatten a plane into a line

Determinants will attach one number to a square matrix action and answer:

  • By what factor does area or volume change?
  • Is orientation preserved or reversed?
  • Has a dimension collapsed?
«
»