1.1.6Linear Algebra Essentials

Identity, diagonal, symmetric, and orthogonal matrices

1,683 words8 min readdifficulty · medium

1. Identity matrix

WHY it matters: II is the multiplicative identity: IA=AI=AIA = AI = A. It is the "11" of matrix algebra.


2. Diagonal matrix


3. Symmetric matrix


4. Orthogonal matrix

Figure — Identity, diagonal, symmetric, and orthogonal matrices

5. Forecast-then-Verify

Recall Forecast before you compute

Q: Is the product of two diagonal matrices always diagonal? Forecast, then verify. A: Yes. (D1D2)ij=k(D1)ik(D2)kj(D_1 D_2)_{ij}=\sum_k (D_1)_{ik}(D_2)_{kj}; nonzero needs i=ki=k and k=jk=j, so i=ji=j. Off-diagonal entries vanish ⇒ diagonal, with entries di(1)di(2)d_i^{(1)}d_i^{(2)}.

Q: Is the product of two symmetric matrices symmetric? A: NOT in general! (AB)=BA=BAAB(AB)^\top=B^\top A^\top=BA\neq AB unless A,BA,B commute. Steel-manned below.


Common mistakes


Flashcards

What entrywise formula defines the identity matrix?
Iij=δijI_{ij}=\delta_{ij} (Kronecker delta: 1 if i=ji=j, else 0).
What does left-multiplying AA by a diagonal DD do?
Scales row ii of AA by did_i (since (DA)ij=diAij(DA)_{ij}=d_iA_{ij}).
Determinant of diag(d1,,dn)\operatorname{diag}(d_1,\dots,d_n)?
idi\prod_i d_i.
Definition of a symmetric matrix?
A=AA=A^\top, i.e. Aij=AjiA_{ij}=A_{ji}.
Why is XXX^\top X always symmetric?
(XX)=XX(X^\top X)^\top = X^\top X by the transpose-of-product rule.
Defining condition for an orthogonal matrix?
QQ=IQ^\top Q=I, equivalently Q1=QQ^{-1}=Q^\top.
What geometric property does an orthogonal matrix preserve?
Lengths and angles (it's a rotation/reflection).
Possible values of detQ\det Q for orthogonal QQ?
±1\pm 1 (+1 rotation, −1 reflection).
Is the product of two symmetric matrices symmetric?
Only if they commute (AB=BAAB=BA); not in general.
Split any square matrix into two named parts.
A=12(A+A)A=\tfrac12(A+A^\top) symmetric + 12(AA)+\ \tfrac12(A-A^\top) skew-symmetric.
Which theorem guarantees real eigenvalues + orthonormal eigenbasis for symmetric matrices?
The Spectral Theorem.

Recall Feynman: explain to a 12-year-old

Imagine a stretchy sheet of graph paper with dots on it.

  • The identity matrix leaves the paper exactly as it is — a "do nothing" button.
  • A diagonal matrix stretches the paper only left-right and up-down, each direction by its own amount, never tilting.
  • A symmetric matrix stretches along some special slanted directions but never "twists" — like squishing dough straight, not swirling it.
  • An orthogonal matrix spins or flips the whole paper but never stretches it, so every dot stays the same distance from every other dot. That's why computers love them: nothing gets exaggerated.

Connections

  • Matrix Multiplication and Transpose — the rules (AB)=BA (AB)^\top=B^\top A^\top used throughout.
  • Eigenvalues and Eigenvectors — diagonal & symmetric feed directly into eigen-decomposition.
  • Spectral Theorem and PCA — symmetric covariance ⇒ orthogonal eigenvectors.
  • Determinants and InvertibilitydetQ=±1\det Q=\pm1, detD=di\det D=\prod d_i.
  • QR Decomposition — factor A=QRA=QR with QQ orthogonal.
  • Vector Norms and Dot Products — length preservation of orthogonal maps.

Concept Map

special family

special family

special family

special family

defined by

gives

action

allows

arises as

guarantees

action

eigenbasis for

Matrices as transformations

Identity I

Diagonal D

Symmetric A eq A transpose

Orthogonal Q

Kronecker delta

IA eq AI eq A

Scale axes independently

Trivial powers and inverse

Covariance and Gram matrices

Real eigenvalues orthonormal basis

Rotate or reflect preserve lengths

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, matrix ko ek "transformation machine" samjho jo space (grid) ko badalti hai. Char special families yaad rakhni zaroori hain kyunki ML mein har jagah aati hain. Identity matrix ka matlab hai "kuch mat karo" — jaise number 11, IA=AIA=A. Diagonal matrix har axis ko alag-alag stretch karti hai, koi mixing nahi; isliye iske powers aur inverse bilkul aasan — bas har diagonal entry ka power/reciprocal le lo.

Symmetric matrix woh hai jahan A=AA=A^\top, yaani diagonal ke aar-paar mirror image. ML mein covariance matrix (XXX^\top X) hamesha symmetric hoti hai, aur Spectral Theorem kehta hai iske eigenvalues real honge aur eigenvectors perpendicular — PCA ki asli jaan yahi hai. Orthogonal matrix QQ mein QQ=IQ^\top Q=I hota hai; ye sirf rotate ya reflect karti hai, length aur angle same rehte hain. Isliye numerically bahut stable hoti hai — error blow-up nahi hota.

Ek important galti se bacho: do symmetric matrices ka product zaroori nahi symmetric ho — sirf tab hoga jab woh commute karein (AB=BAAB=BA). Aur "orthogonal" ka matlab strictly square matrix hai; agar sirf columns orthonormal hain lekin matrix tall hai, toh QQ=IQ^\top Q=I hoga par QQQQ^\top ek projection banega, identity nahi. Yaad rakhne ka mantra: "I Do So Often" — Identity, Diagonal, Symmetric, Orthogonal.

Test yourself — Linear Algebra Essentials

Connections