Evanalysis
3.4Estimated reading time: 21 min

3.4 Special matrices

Meet diagonal, triangular, identity, and elementary matrices, and see why their special shapes shorten later arguments.

Course contents

Not every matrix deserves a special name. The families in this note do because their visible patterns impose algebraic restrictions. Once those restrictions are translated into index notation, they let us predict products, transposes, and row operations without expanding every entry.

Throughout the note, entries come from a field F\mathbb F, usually R\mathbb R in this course. Statements about diagonal and triangular matrices concern square matrices unless another size is stated explicitly.

What a zero pattern lets us predict

A general n×nn \times n matrix contains n2n^2 entries, and none of them is forced by shape alone. A special matrix carries extra information before any calculation begins. For example, knowing that a matrix is lower triangular immediately tells us that every entry aija_{ij} with i<ji\lt j is zero. That single condition controls many later computations.

The point of naming matrix families is therefore not classification for its own sake. A good name compresses a useful hypothesis:

  • diagonal means that only the main diagonal can contain nonzero entries;
  • upper or lower triangular means that an entire side of the main diagonal is already zero;
  • identity means that multiplication leaves every compatible matrix unchanged;
  • elementary means that one elementary row operation has been encoded as matrix multiplication.

These descriptions are related rather than disjoint. In particular, a diagonal matrix is simultaneously upper triangular and lower triangular. The identity matrix is diagonal, hence belongs to both triangular families as well. A matrix can therefore carry several useful labels at once.

The advantage becomes clearest in proofs. To show that a product of two lower triangular matrices is lower triangular, we do not need to calculate all n2n^2 entries. We only examine an arbitrary entry above the diagonal and show, by splitting its row-by-column sum into two index ranges, that every term must vanish. This is a model for how structural information replaces brute force.

Recognize the matrix families

Definition

Diagonal, triangular, identity, and elementary matrices

Let A=(aij)∈Fn×nA=(a_{ij})\in\mathbb F^{n\times n}.

The matrix AA is diagonal when aij=0a_{ij}=0 whenever i≠ji\ne j. We write

A=diag⁡(a11,a22,…,ann).A=\operatorname{diag}(a_{11},a_{22},\ldots,a_{nn}).

It is upper triangular when aij=0a_{ij}=0 for i>ji\gt j, so every entry below the main diagonal is zero. It is lower triangular when aij=0a_{ij}=0 for i<ji\lt j, so every entry above the main diagonal is zero. Consequently, a matrix is diagonal exactly when it is both upper triangular and lower triangular.

The identity matrix InI_n is the diagonal matrix diag⁡(1,…,1)\operatorname{diag}(1,\ldots,1).

An elementary matrix of order nn is obtained from InI_n by exactly one elementary row operation: interchanging two rows, multiplying one row by a nonzero scalar, or adding a scalar multiple of one row to another.

The words “above” and “below” refer to indices, not to the signs of the entries: (i,j)(i,j) is above the diagonal when i<ji\lt j, on it when i=ji=j, and below it when i>ji\gt j. Diagonal entries themselves are unrestricted in a triangular matrix; in particular, they may be zero.

The sequence below organizes these names by the visible information they carry: where zeros must appear, why identity multiplication leaves a matrix unchanged, and how one row operation becomes an elementary matrix. Use it as a fixed map before experimenting with the live classifier.

Special matrix families

Classify special matrix families by their visible shape, then connect diagonal and triangular closure, the identity law, and elementary matrices as row-operation packages.

  1. Family map

    Diagonal, triangular, identity, zero, and elementary matrices are useful because their shape carries algebraic information.

  2. Diagonal pattern

    A diagonal matrix has all off-diagonal entries equal to zero, and the product of two diagonal matrices is still diagonal.

  3. Triangular pattern

    An upper triangular matrix has zeros below the main diagonal, and multiplying upper triangular matrices preserves that zero side.

  4. Identity action

    The identity matrix is diagonal with ones on the diagonal; compatible products satisfy AI_n = A and I_mA = A.

  5. Elementary bridge

    An elementary matrix is obtained by applying one elementary row operation to an identity matrix.

  6. Side matters

    Multiplying by E on the left performs the matching row operation on A, while multiplying on the right performs the corresponding column operation.

Special matrix families are not just names. Diagonal, triangular, identity, zero, and elementary matrices package visible structure, so you should classify the shape before deciding how much computation is really needed.

The following widget concentrates on diagonal, identity, symmetric, and skew-symmetric recognition. Its labels are intentionally not an exhaustive list of matrix families: a matrix shown as “neither” in that narrower comparison may still be upper or lower triangular. Use the entries themselves, rather than a single label, when applying the definitions in this note.

Read and try

Classify matrix families by transpose comparison

The live checker compares A with A^T so readers can distinguish symmetric, skew-symmetric, diagonal, identity, and neither cases.

Matrix A

2-1
-15

Transpose A^T

2-1
-15

Matrix family

Symmetric

The transpose matches the original matrix entry by entry, so A^T = A.

Which structures survive an operation?

Theorem

Transpose exchanges the two triangular families

Let A∈Fn×nA\in\mathbb F^{n\times n}. Then AA is upper triangular if and only if ATA^T is lower triangular. Likewise, AA is lower triangular if and only if ATA^T is upper triangular. A diagonal matrix therefore remains diagonal after transposition.

Theorem

Triangular matrices are closed under multiplication

Let A,B∈Fn×nA,B\in\mathbb F^{n\times n}. If both matrices are lower triangular, then ABAB is lower triangular. If both are upper triangular, then ABAB is upper triangular.

As a special case, the product of two diagonal matrices of order nn is diagonal.

Theorem

Elementary left multiplication performs a row operation

Suppose E∈Fn×nE\in\mathbb F^{n\times n} is obtained by applying one elementary row operation R\mathcal R to InI_n. For every A∈Fn×pA\in\mathbb F^{n\times p}, the product EAEA is defined and is exactly the matrix obtained by applying R\mathcal R to the rows of AA.

The size conditions are part of these statements. Closure under multiplication requires matrices of the same order, while the elementary-matrix theorem only requires the number of rows of AA to equal the order of EE.

Use the forced zeros in each proof

For the transpose theorem, suppose AA is upper triangular. To prove that ATA^T is lower triangular, choose a position above its diagonal, so i<ji\lt j. By the definition of transpose,

(AT)ij=aji.(A^T)_{ij}=a_{ji}.

Since j>ij\gt i, the entry ajia_{ji} lies below the diagonal of the upper triangular matrix AA, and is therefore zero. Hence every entry above the diagonal of ATA^T vanishes. The reverse implication follows by applying the same argument to ATA^T and using (AT)T=A(A^T)^T=A. Interchanging “upper” and “lower” gives the second equivalence.

The multiplication theorem needs a little more care. Let AA and BB be lower triangular n×nn\times n matrices. Fix any position (i,j)(i,j) above the diagonal; thus i<ji\lt j. The corresponding entry of the product is

(AB)ij=∑k=1naikbkj.(AB)_{ij}=\sum_{k=1}^{n}a_{ik}b_{kj}.

Split the possible values of kk into the two exhaustive cases k≤ik\le i and k>ik\gt i.

  • If k≤ik\le i, then k≤i<jk\le i\lt j, so k<jk\lt j. The entry bkjb_{kj} is above the diagonal of the lower triangular matrix BB, hence bkj=0b_{kj}=0.
  • If k>ik\gt i, then aika_{ik} is above the diagonal of the lower triangular matrix AA, hence aik=0a_{ik}=0.

Thus every term aikbkja_{ik}b_{kj} in the sum is zero, regardless of kk. Therefore (AB)ij=0(AB)_{ij}=0 for every i<ji\lt j, proving that ABAB is lower triangular for arbitrary nn, not merely in the 3×33\times3 case. The upper triangular result follows either from the analogous index argument or from (AB)T=BTAT(AB)^T=B^TA^T and the transpose theorem.

Because a diagonal matrix is both upper and lower triangular, the product of two diagonal matrices is also both, hence diagonal. More explicitly,

diag⁡(d1,…,dn)diag⁡(e1,…,en)=diag⁡(d1e1,…,dnen).\operatorname{diag}(d_1,\ldots,d_n) \operatorname{diag}(e_1,\ldots,e_n) = \operatorname{diag}(d_1e_1,\ldots,d_ne_n).

This formula also shows that two diagonal matrices of the same order commute. It does not imply that arbitrary upper or lower triangular matrices commute.

There is a second consequence hidden in the same index structure. If AA and BB are both lower triangular, then for a diagonal position (i,i)(i,i),

(AB)ii=∑k=1naikbki=aiibii.(AB)_{ii}=\sum_{k=1}^{n}a_{ik}b_{ki}=a_{ii}b_{ii}.

Indeed, when k<ik\lt i, the factor bkib_{ki} is above the diagonal of BB and is zero; when k>ik\gt i, the factor aika_{ik} is above the diagonal of AA and is zero. Only k=ik=i can contribute. The same diagonal-entry formula holds for products of upper triangular matrices. This observation will later connect triangular shape with determinants and invertibility.

Finally, the elementary-matrix theorem follows from how matrix multiplication forms rows. The rows of InI_n are the standard row vectors. Performing R\mathcal R on those rows produces the rows of EE. When EE multiplies AA, the same coefficients form the rows of EAEA from the rows of AA. Checking the three elementary operation types gives respectively a row interchange, a nonzero row scaling, and a row replacement.

Read structure before calculating

Worked example

Identify every applicable matrix family

Consider

D=[3000−10005],U=[12−3041002].D = \begin{bmatrix} 3 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 5 \end{bmatrix}, \qquad U = \begin{bmatrix} 1 & 2 & -3 \\ 0 & 4 & 1 \\ 0 & 0 & 2 \end{bmatrix}.

The matrix DD is diagonal because all six off-diagonal entries are zero. It is therefore both upper triangular and lower triangular. It is also symmetric because DT=DD^T=D.

The matrix UU is upper triangular because its entries with i>ji\gt j are zero. It is not diagonal, since entries such as u12=2u_{12}=2 above the diagonal are nonzero, and it is not lower triangular for the same reason.

The identity matrix

I3=[100010001]I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

is an especially important diagonal matrix. Hence it is upper triangular, lower triangular, and symmetric. None of these classifications requires a separate calculation once the defining zero pattern has been read correctly.

Worked example

Transpose a triangular matrix and track its indices

Let

U=[123045006].U = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 4 & 5 \\ 0 & 0 & 6 \end{bmatrix}.

Then

UT=[100240356].U^T = \begin{bmatrix} 1 & 0 & 0 \\ 2 & 4 & 0 \\ 3 & 5 & 6 \end{bmatrix}.

The zero u31=0u_{31}=0, for example, becomes (UT)13=0(U^T)_{13}=0. In general, every below-diagonal position i>ji\gt j of UU becomes the above-diagonal position (j,i)(j,i) of UTU^T. Thus the displayed calculation illustrates the index proof rather than replacing it.

As a quick numerical closure check, take

L1=[1023],L2=[−1045].L_1=\begin{bmatrix}1&0\\2&3\end{bmatrix}, \qquad L_2=\begin{bmatrix}-1&0\\4&5\end{bmatrix}.

Then

L1L2=[−101015],L_1L_2 = \begin{bmatrix} -1&0\\ 10&15 \end{bmatrix},

which is lower triangular. This one example is evidence, while the arbitrary index proof establishes the theorem for every order nn.

Worked example

Diagonal matrices and an elementary matrix: rows versus columns

Let

A=[1−20345],D2=diag⁡(2,−1),D3=diag⁡(4,1,−2).A= \begin{bmatrix} 1&-2&0\\ 3&4&5 \end{bmatrix}, \quad D_2=\operatorname{diag}(2,-1), \quad D_3=\operatorname{diag}(4,1,-2).

The dimensions determine which diagonal matrix can appear on each side: D2AD_2A is 2×22\times2 times 2×32\times3, whereas AD3AD_3 is 2×32\times3 times 3×33\times3. Direct multiplication gives

D2A=[2−40−3−4−5],AD3=[4−20124−10].D_2A= \begin{bmatrix} 2&-4&0\\ -3&-4&-5 \end{bmatrix}, \qquad AD_3= \begin{bmatrix} 4&-2&0\\ 12&4&-10 \end{bmatrix}.

Left multiplication by a diagonal matrix scales rows: the two diagonal entries of D2D_2 multiply rows 1 and 2. Right multiplication scales columns: the three diagonal entries of D3D_3 multiply columns 1, 2, and 3.

Now form the elementary matrix

E=[10−31],E= \begin{bmatrix} 1&0\\ -3&1 \end{bmatrix},

obtained from I2I_2 by R2←R2−3R1R_2\leftarrow R_2-3R_1. Then

EA=[1−200105].EA= \begin{bmatrix} 1&-2&0\\ 0&10&5 \end{bmatrix}.

The first row is unchanged and the second is −3[1,−2,0]+[3,4,5]=[0,10,5]-3[1,-2,0]+[3,4,5]=[0,10,5], exactly as the elementary left multiplication theorem predicts. Right multiplication by EE would not even be defined here, because the inner dimensions 33 and 22 do not match.

Consequences and boundary cases

The zero pattern also survives addition and scalar multiplication. If AA and BB are lower triangular of order nn, then for every i<ji\lt j,

(A+B)ij=aij+bij=0+0=0.(A+B)_{ij}=a_{ij}+b_{ij}=0+0=0.

For any scalar cc, (cA)ij=caij=0(cA)_{ij}=ca_{ij}=0 in the same positions. Thus the sum, difference, and scalar multiple of lower triangular matrices remain lower triangular; the upper triangular and diagonal families have the analogous property. These statements require the matrices being added to have the same dimensions. They are simpler than the multiplication theorem because addition compares matching entries, whereas multiplication mixes an entire row with an entire column.

Closure must not be confused with commutativity. Consider the two upper triangular matrices

P=[1101],Q=[2003].P=\begin{bmatrix}1&1\\0&1\end{bmatrix}, \qquad Q=\begin{bmatrix}2&0\\0&3\end{bmatrix}.

Both products remain upper triangular, as the theorem promises, but

PQ=[2303],QP=[2203].PQ=\begin{bmatrix}2&3\\0&3\end{bmatrix}, \qquad QP=\begin{bmatrix}2&2\\0&3\end{bmatrix}.

Hence PQ≠QPPQ\ne QP. Diagonal matrices commute with one another because their products are computed entry by entry on the diagonal; a diagonal matrix does not necessarily commute with a nondiagonal triangular matrix.

Nor does the theorem cover a product of different triangular types. For

U=[1101],L=[1011],U=\begin{bmatrix}1&1\\0&1\end{bmatrix}, \qquad L=\begin{bmatrix}1&0\\1&1\end{bmatrix},

we obtain

UL=[2111],UL=\begin{bmatrix}2&1\\1&1\end{bmatrix},

which is neither upper nor lower triangular. The closure theorem assumes that both factors belong to the same triangular family; a mixed product must be analysed from its actual entries.

Repeated multiplication gives another immediate consequence. If TT is upper triangular, then every positive power TrT^r is upper triangular: start with T1=TT^1=T and apply multiplication closure at each step. The same is true for lower triangular and diagonal matrices. This is an induction argument; it does not say that unrelated operations preserve the same orientation. Transposition, for instance, turns upper triangular shape into lower triangular shape unless the matrix has further restrictions.

Identity and elementary matrices in context

The identity matrix behaves in matrix multiplication as the scalar 11 does in ordinary multiplication, but its order must match the side on which it appears. If AA is m×nm\times n, then

ImA=A,AIn=A.I_mA=A,\qquad AI_n=A.

The two identity matrices need not have the same size when m≠nm\ne n. Entrywise, let δij=1\delta_{ij}=1 when i=ji=j and δij=0\delta_{ij}=0 otherwise. Then

(ImA)ij=∑k=1mδikakj=aij,(AIn)ij=∑k=1naikδkj=aij.(I_mA)_{ij}=\sum_{k=1}^{m}\delta_{ik}a_{kj}=a_{ij}, \qquad (AI_n)_{ij}=\sum_{k=1}^{n}a_{ik}\delta_{kj}=a_{ij}.

This explains why identity matrices occur in inverse problems: a square matrix AA is invertible precisely when another matrix A−1A^{-1} satisfies A−1A=AA−1=InA^{-1}A=AA^{-1}=I_n. Triangular shape alone does not guarantee invertibility; a triangular matrix with a zero diagonal entry is singular.

Every elementary matrix is invertible because its defining row operation can be undone by another elementary row operation. The detailed construction of all three types, products of several elementary matrices, and their inverses continues in 3.5 Elementary row-operation matrices.

Common mistakes

Common mistake

Using “triangular” as if it meant “diagonal”

Every diagonal matrix is both upper triangular and lower triangular. A matrix that is only upper triangular or only lower triangular may have nonzero entries off the diagonal, so the converse is false.

Common mistake

Testing the wrong side of the diagonal

For an upper triangular matrix, entries with i>ji\gt j—below the diagonal—must vanish. For a lower triangular matrix, entries with i<ji\lt j—above the diagonal—must vanish.

Common mistake

Assuming triangular means invertible

A triangular matrix may have zero diagonal entries. Triangular shape by itself does not imply invertibility; the later determinant criterion will require every diagonal entry to be nonzero.

Common mistake

Ignoring dimensions or the side of multiplication

For A∈Fm×nA\in\mathbb F^{m\times n}, the valid identity equations are ImA=AI_mA=A and AIn=AAI_n=A. Likewise, left multiplication by an elementary matrix performs a row operation; right multiplication, when defined, acts on columns instead.

Common mistake

Treating an elementary matrix as an arbitrary matrix

An elementary matrix is obtained from an identity matrix by exactly one elementary row operation. A product of several elementary matrices is invertible, but need not itself be elementary.

From matrix shape to algebra

Special matrices turn visible zero patterns into reusable algebra. A diagonal matrix has all off-diagonal entries equal to zero and is therefore both upper and lower triangular. Transposition exchanges the upper and lower triangular families. Multiplication preserves each triangular family: for a lower triangular product, the split k≤ik\le i or k>ik\gt i forces one factor in every term above the diagonal to be zero.

Identity matrices preserve compatible matrices on either side, with ImI_m acting on the rows of an m×nm\times n matrix and InI_n acting on its columns. Diagonal left and right multipliers scale rows and columns respectively. An elementary matrix goes further by recording one reversible row operation, and left multiplication applies that operation to every column of the target matrix at once.

Quick checks

Checkpoint

Why is every diagonal matrix automatically upper triangular and lower triangular?

Answer by referring to the off-diagonal entries.

Solution · Answer

In a diagonal matrix, every off-diagonal entry is zero. Thus all entries below the diagonal satisfy the upper triangular condition, and all entries above the diagonal satisfy the lower triangular condition.

Checkpoint

What does the identity matrix do when you multiply a compatible matrix by it?

State the effect in words and remember that the order depends on the side.

Solution · Answer

It leaves the matrix unchanged: if AA is m×nm\times n, then ImA=AI_mA=A and AIn=AAI_n=A.

Exercises

Checkpoint

Why does the product of two lower triangular 3×33 \times 3 matrices remain lower triangular?

Do not multiply every entry. Explain why the entries above the diagonal stay zero.

Solution · Guided solution

For an entry (i,j)(i,j) above the diagonal, i<ji\lt j. In (AB)ij=∑k=13aikbkj(AB)_{ij}=\sum_{k=1}^{3}a_{ik}b_{kj}, if k≤ik\le i, then k<jk\lt j and bkj=0b_{kj}=0; if k>ik\gt i, then aik=0a_{ik}=0. Every summand is therefore zero, so every entry above the diagonal of ABAB is zero. The same argument works with 33 replaced by any nn.

Checkpoint

Give one reason the identity matrix belongs to more than one matrix family.

Name at least two families and justify the classification from the entries.

Solution · Guided solution

The identity matrix is diagonal because every off-diagonal entry is zero. Therefore it is also both upper triangular and lower triangular. It is symmetric as well, since InT=InI_n^T=I_n.

Review 3.3 Transpose, symmetric, and skew-symmetric matrices for the transpose rules used above.

Continue to 3.5 Elementary row-operation matrices for the full algebra of elementary matrices.

Key terms in this unit