In ML almost every "energy", "loss curvature", "covariance", or "kernel" is a symmetric matrix, and we constantly need to know: does this thing behave like a valid bowl-shaped cost?
Optimization: a function's Hessian being PD ⇒ a strict local minimum, so gradient descent converges nicely.
Covariance matrices are always PSD (variance can't be negative).
Kernels (SVMs, Gaussian processes) must be PSD (Mercer's condition) to correspond to a valid inner product.
Cholesky / solving Ax=b is fast and stable exactly when A is PD.
So this single concept quietly powers loss landscapes, statistics, and kernel methods.
We claim: for symmetric A, "x⊤Ax>0 for all x=0" ⟺ "all eigenvalues >0".
Step 1 — Spectral theorem. A real symmetric matrix can be written
A=QΛQ⊤,Q⊤Q=I,Λ=diag(λ1,…,λn).Why this step? Symmetric matrices have real eigenvalues and an orthonormal eigenbasis — this is the key structural fact that lets us change coordinates without distortion.
Step 2 — Change of variables. Let y=Q⊤x. Since Q is orthogonal, x=0⟺y=0. Then
x⊤Ax=x⊤QΛQ⊤x=(Q⊤x)⊤Λ(Q⊤x)=y⊤Λy.Why this step? Rotating into the eigenbasis makes the matrix diagonal — the "cross terms" disappear.
Step 3 — Diagonal form.y⊤Λy=∑i=1nλiyi2.Why this step? A diagonal quadratic form is just a weighted sum of squares — trivially readable.
Step 4 — Conclude. Each yi2≥0.
If all λi>0, the sum is >0 whenever some yi=0 ⇒ PD.
If some λj≤0, pick y=ej (i.e. x=Qej, the j-th eigenvector): the sum equals λj≤0 ⇒ not PD.
■ Same argument with ≥ gives the PSD ⟺ λi≥0 result.
Imagine a skateboard bowl. Drop a marble anywhere: if the ground curves up in every direction, the marble always rolls back to the bottom — that's a positive definite bowl. If part of the bowl is a flat gutter, the marble can sit still along that gutter (not roll down but not fall either) — that's semidefinite. If it's a mountain-pass saddle, it rolls down one way and up the other — that's indefinite. The "x⊤Ax" number is just the height of the ground when you walk in direction x; positive definite means that height is always positive except right at the center.
Dekho, ek symmetric matrix A ko samajhne ka asaan tareeka hai uska "bowl shape". Har direction x ke liye ek number nikalta hai x⊤Ax — ye us direction mein ground ki height jaisa hai. Agar ye number har non-zero direction mein positive hai, to matrix positive definite hai — matlab ek perfect bowl jahan marble kahin se bhi choro to neeche center pe hi aayega. Agar kuch directions mein number zero ho sakta hai (flat gutter), tab wo positive semidefinite hai. Aur agar kabhi positive kabhi negative, to wo saddle yaani indefinite.
Test kaise karein? Sabse pakka tareeka: eigenvalues nikalo. Saare positive ⇒ PD, saare non-negative ⇒ PSD, mixed ⇒ indefinite. Chhote matrices ke liye Sylvester shortcut hai: saare leading principal minors positive ⇒ PD. Ek badi galti se bachna — entries ka positive hona kaafi nahi hai, jaise [1221] ke entries positive hain par eigenvalue −1 aata hai, to wo indefinite hai.
Ye cheez ML mein har jagah chhupi hai. Covariance matrix hamesha PSD hoti hai kyunki variance negative nahi ho sakta — aur wo X⊤X form mein hoti hai jo automatically ∥Xv∥2≥0 deta hai. Kernels (SVM, Gaussian process) valid tabhi hote hain jab unki Gram matrix PSD ho. Aur optimization mein, agar Hessian kisi point pe PD hai, to wahan strict minimum hai — gradient descent aaraam se converge karega. Isliye ye ek chhota concept poore loss landscape aur statistics ko chalata hai.