← Module 03 / Understanding matrices

Lesson 03.7 · §3.11

When is every nonzero direction uphill?

Prove the eigenvalue criteria and explain why a positive diagonal shift removes singularity.

In this lesson 6 ideas
  1. Check all directions
  2. Proposition 5: eigenvalue test
  3. Proposition 6: a common source of semidefinite matrices
  4. Proposition 7: lift a flat direction
  5. Explore in three dimensions
  6. Transfer

Source scope: §3.11. Worked numerical examples, experiments, and practice are teaching supplements unless identified as source results.

Check all directions

For A=diag⁡(2,0)A=\operatorname{diag}(2,0), the form is 2x122x_1^2. It is never negative, but the entire vertical direction has value zero. Replacing zero by one makes the value positive at every nonzero input.

A symmetric matrix is positive semidefinite, written A⪰0A\succeq0, if xTAx≥0x^TAx\ge0 for every xx. It is positive definite, written A≻0A\succ0, if xTAx>0x^TAx>0 for every nonzero xx. Positive definite implies positive semidefinite; the converse fails. These definitions use symmetry throughout.

Proposition 5: eigenvalue test

Source statement. A real symmetric matrix is positive semidefinite iff all eigenvalues are nonnegative, and positive definite iff all eigenvalues are positive.

Source proof. For an eigenvector xx with eigenvalue λ\lambda,

xTAx=λxTx=λ∥x∥22.x^TAx=\lambda x^Tx=\lambda\|x\|_2^2.

Since x≠0x\ne0, divide by its positive squared length. Nonnegativity of the form forces λ≥0\lambda\ge0; strict positivity forces λ>0\lambda>0. Conversely if all eigenvalues are nonnegative, the Rayleigh bound gives RA(x)≥λmin⁡≥0R_A(x)\ge\lambda_{\min}\ge0 for x≠0x\ne0. The numerator has the same sign as the quotient, so the form is nonnegative, including zero input. If all eigenvalues are positive, the bound is strictly positive at nonzero inputs, proving positive definiteness.

Proposition 6: a common source of semidefinite matrices

For any A∈Rm×nA\in\mathbb R^{m\times n}, ATAA^TA is positive semidefinite. It is positive definite if null⁡(A)={0}\operatorname{null}(A)=\{0\}.

Source proof. Symmetry follows by transposing. For every xx,

xT(ATA)x=(Ax)T(Ax)=∥Ax∥22≥0.x^T(A^TA)x=(Ax)^T(Ax)=\|Ax\|_2^2\ge0.

If the nullspace is trivial, nonzero xx implies Ax≠0Ax\ne0, giving strict positivity. Conversely, as a teaching observation, any nonzero null vector prevents strict positivity. A positive definite matrix is invertible because it has no zero eigenvalue; a positive semidefinite matrix may be singular.

Proposition 7: lift a flat direction

If A⪰0A\succeq0 and ϵ>0\epsilon>0, then A+ϵI≻0A+\epsilon I\succ0.

Source proof. For x≠0x\ne0,

xT(A+ϵI)x=xTAx⏟≥0+ϵ∥x∥22⏟>0>0.x^T(A+\epsilon I)x=\underbrace{x^TAx}_{\ge0}+\underbrace{\epsilon\|x\|_2^2}_{>0}>0.

Combining Propositions 6 and 7 shows that ATA+ϵIA^TA+\epsilon I is positive definite, hence invertible, for every real rectangular AA and ϵ>0\epsilon>0. The positivity of ϵ\epsilon is essential.

Explore it yourself

Turn a unit vector

Predict the quadratic value before aligning x with an eigenvector.

Preparing interactive controls…

x₁x₂-4-4-3-3-2-2-1-1011223344q₁q₂xAx

A = [[2.500, 0.866], [0.866, 1.500]]. xᵀAx = R(x) = 3.000; bounds [1, 3]. trace = 4.000; determinant = 3.000. Positive definite.

Axes: first and second real coordinates, in unit steps. Endpoints and labels identify each vector.

Explore in three dimensions

Explore it yourself

A bowl, a flat direction, or a saddle?

Change the eigenvalues of a two-variable quadratic form. Then add εI and watch both curvatures shift.

Preparing interactive controls…

Teaching supplement · interactive 3D projection · one grid interval = one coordinate unit

f = 1 contour on basexyf / 20

Change the mathematics

f(x,y) = 2.000 u² + 1.000 v², where (u,v) = Qᵀ(x,y) and Q turns by 30°. Shifted eigenvalues = (2.000, 1.000). Positive definite: a bowl.

The green surface samples −0.8 ≤ x,y ≤ 0.8. To fit the view its vertical coordinate is f(x,y)/2; x and y remain in ordinary units. When positive definite, the blue base-plane curve is the contour f = 1, including portions outside the sampled square. Adding ε shifts both eigenvalues; an indefinite matrix needs a large enough shift.

Camera controls · change only the view

Drag the diagram with a mouse, or use these sliders with a keyboard or touch. Projection can make perpendicular directions look oblique; the coordinate readout is unchanged.

Red: input or first direction. Blue: second direction or reference. Green: result. Amber: residual, normal, or third direction. Labels distinguish overlapping objects.

Transfer

Does adding 0.1I0.1I make diag⁡(−2,1)\operatorname{diag}(-2,1) positive definite?

Check the hypothesis

No. The shifted eigenvalues are −1.9-1.9 and 1.11.1. Proposition 7 starts with a positive semidefinite matrix. For an arbitrary symmetric matrix, the shift must exceed the negative of its smallest eigenvalue.