Positive Directions and Subspaces
A real quadratic form can be positive on some vectors, negative on others, and zero on still others. Its positive index counts the positive entries in a diagonal representation of the form. That count has a geometric interpretation: it is the largest dimension a subspace can have while the form remains strictly positive on every nonzero vector in that subspace. Establishing this interpretation explains why the positive index is an invariant of the form, rather than a feature of a particular diagonalizing basis.
Let \(D=\operatorname{diag}(d_1,\dots,d_n)\) be a real diagonal matrix, and let \(q:\mathbb{R}^n\to\mathbb{R}\) be the quadratic form \(q(\mathbf{x})=\mathbf{x}^{\top}D\mathbf{x}\). Reordering coordinates if necessary, write its entries so the positive ones come first, then the negative ones, then the zero entries. Let \(p\) be the number of positive entries, \(m\) the number of negative entries, and \(r\) the number of zero entries, so \(p+m+r=n\). In these coordinates, write \(\mathbf{x}=(\mathbf{x}_+,\mathbf{x}_-,\mathbf{x}_0)\). Then
The zero coordinates do not appear in the value of \(q\). The positive index is \(p\); the negative index is \(m\), and the number of zero entries is \(r\). We will focus on the positive index.
The condition on a subspace concerns every nonzero vector in it, not merely a selected list of vectors. This matters because combinations of vectors can change the value of the form. In particular, showing that each vector in a basis has positive value does not by itself show that the subspace they span is positive definite.
The Largest Possible Dimension
Proof. First we construct a positive-definite subspace of dimension \(p\). Let \(U_+\) be the span of the standard basis vectors in the \(p\) coordinates corresponding to positive entries. If \(\mathbf{x}\in U_+\) is nonzero, then at least one of its first \(p\) coordinates is nonzero, and
because each \(d_i>0\) and each \(x_i^2\ge 0\). Thus \(U_+\) is positive definite, and its dimension is \(p\).
Now let \(U\) be any positive-definite subspace. Project each vector onto its first \(p\) coordinates, defining the linear map \(\pi_+:U\to\mathbb{R}^p\) by \(\pi_+(\mathbf{x})=\mathbf{x}_+\). We show this map is injective. If \(\mathbf{x}\in U\) satisfies \(\pi_+(\mathbf{x})=\mathbf{0}\), then its positive coordinates all vanish, so
since every \(d_i\) in this sum is negative and every square is nonnegative. If \(\mathbf{x}\ne\mathbf{0}\), positive definiteness of \(U\) instead requires \(q(\mathbf{x})>0\). Therefore \(\mathbf{x}=\mathbf{0}\), and \(\pi_+\) is injective. An injective linear map sends a basis of \(U\) to a linearly independent list in \(\mathbb{R}^p\), which has at most \(p\) vectors. Hence \(\dim U\le p\). Together, the constructed subspace and this upper bound show that the largest possible dimension is exactly \(p\). If \(p=0\), the same argument maps \(U\) injectively into the zero-dimensional space \(\mathbb{R}^0\), so \(U=\{\mathbf{0}\}\); the conclusion still holds. \(\square\)
The construction proves that the bound can be attained, while the projection argument proves that no positive-definite subspace can be larger. The upper bound is the key step: negative and zero coordinates cannot provide additional independent directions while preserving strict positivity on every nonzero vector.
Worked Examples
Worked Example: A Diagonal Form with a Zero Direction
Consider \(q(\mathbf{x})=4x_1^2+x_2^2-2x_3^2\) on \(\mathbb{R}^4\). Its matrix is \(D=\operatorname{diag}(4,1,-2,0)\). Find its positive index and exhibit a subspace of maximal positive dimension.
The diagonal entries are \(4,1,-2,0\), so the positive index is \(p=2\). Take \(U=\operatorname{span}\{\mathbf{e}_1,\mathbf{e}_2\}\). A vector in \(U\) has the form \(\mathbf{x}=(a,b,0,0)^{\top}\), and
If \(\mathbf{x}\ne\mathbf{0}\), then at least one of \(a,b\) is nonzero, so \(4a^2+b^2>0\). Thus \(U\) is positive definite and has dimension \(2\). The maximal positive dimension theorem shows that no positive-definite subspace can have dimension greater than \(2\), even though the full space has dimension \(4\). The fourth coordinate contributes zero to the form and does not create another positive direction.
Check: \(q(\mathbf{e}_1)=4\), \(q(\mathbf{e}_2)=1\), and \(q(\mathbf{e}_3)=-2\), while \(q(\mathbf{e}_4)=0\). These values agree with the signs of the diagonal entries.
Worked Example: A Positive Subspace Not Spanned by Coordinate Axes
For \(q(x_1,x_2,x_3)=x_1^2+x_2^2-x_3^2\), find a two-dimensional positive-definite subspace and verify its dimension is maximal.
The matrix is \(\operatorname{diag}(1,1,-1)\), so the positive index is \(2\). Consider \(\mathbf{u}=(1,0,\tfrac12)^{\top}\) and \(\mathbf{v}=(0,1,\tfrac12)^{\top}\), and let \(U=\operatorname{span}\{\mathbf{u},\mathbf{v}\}\). If \(a\mathbf{u}+b\mathbf{v}=\mathbf{0}\), then its first two coordinates give \(a=0\) and \(b=0\). Thus \(\mathbf{u},\mathbf{v}\) are independent and \(\dim U=2\).
An arbitrary vector of \(U\) is
Substituting into the form gives
For \((a,b)\ne(0,0)\), \(2a^2+2b^2>0\), so the last expression is positive. Therefore \(U\) is positive definite. Its dimension \(2\) equals the positive index, so the theorem confirms that it has maximal possible dimension.
Check: \(q(\mathbf{u})=1-\tfrac14=\tfrac34\) and \(q(\mathbf{v})=1-\tfrac14=\tfrac34\). More importantly, the calculation for arbitrary \(a,b\) verifies positivity on the whole subspace, not just on its two basis vectors.
Why the Positive Index Is Intrinsic
A diagonal matrix represents a form in a chosen coordinate system. Changing basis for a bilinear form changes its matrix by congruence: if \(\mathbf{P}\) is the change-of-coordinates matrix, the new matrix is \(\mathbf{P}^{\top}D\mathbf{P}\). The vector coordinates change, but the underlying subspaces and the values of the form correspond under the invertible coordinate map. The maximal-dimension characterization therefore gives a way to compare positive counts from different diagonal representations.
Proof. Let \(D\) and \(D'\) be the two diagonal matrices, with coordinates related by an invertible matrix \(\mathbf{P}\), so \(D'=\mathbf{P}^{\top}D\mathbf{P}\). For each coordinate vector \(\mathbf{y}\) in the \(D'\) coordinates, its corresponding vector in the \(D\) coordinates is \(\mathbf{P}\mathbf{y}\), and
The map \(\mathbf{y}\mapsto\mathbf{P}\mathbf{y}\) is a linear isomorphism: it sends subspaces to subspaces of the same dimension, and the displayed equality shows that a subspace is positive definite in one coordinate system exactly when its image is positive definite in the other. Consequently, the largest positive-definite subspace dimension is the same for both diagonal matrices. By the maximal positive dimension theorem, that dimension is the number of positive entries in each matrix. The two counts are therefore equal. \(\square\)
This is the positive-index part of the invariance behind Sylvester’s law of inertia. The same maximal-dimension idea can be applied to \(-q\) to interpret the negative index. The zero count requires a separate argument; equality of positive counts alone does not establish it.
Worked Example: Two Diagonal Representations with the Same Positive Index
Let \(D=\operatorname{diag}(1,-1)\) and \(\mathbf{P}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\). Compute the congruent matrix \(D'=\mathbf{P}^{\top}D\mathbf{P}\), and check the positive counts.
First, multiply \(D\mathbf{P}\):
Since \(\mathbf{P}^{\top}=\begin{bmatrix}1&0\\1&1\end{bmatrix}\), multiplication gives
This matrix is not diagonal, so it is not yet a second diagonal representation. To keep the computation focused on diagonal forms, take instead \(\mathbf{P}=\begin{bmatrix}0&1\\1&0\end{bmatrix}\), which swaps the two coordinates. Then
Both diagonal matrices have exactly one positive entry. The coordinate change is invertible because \(\mathbf{P}^2=\mathbf{I}_2\). Thus the computation agrees with the corollary: the positive index does not depend on the order in which the diagonal coordinates are listed.
Check: \(\mathbf{P}^{\top}=\mathbf{P}\), and \(\mathbf{P}D\mathbf{P}=\begin{bmatrix}-1&0\\0&1\end{bmatrix}\), as claimed.
Common Pitfall: Checking Only Basis Vectors
Consider \(q(x,y)=x^2-y^2\), with diagonal matrix \(\operatorname{diag}(1,-1)\). Let \(\mathbf{u}=(1,0)^{\top}\) and \(\mathbf{v}=(2,1)^{\top}\). These vectors are independent: if \(a\mathbf{u}+b\mathbf{v}=\mathbf{0}\), then \((a+2b,b)=(0,0)\), which gives \(b=0\) and then \(a=0\). Both basis vectors have positive value:
A mistaken test would conclude that their span is positive definite. But the combination \(\mathbf{v}-2\mathbf{u}=(0,1)^{\top}\) is nonzero and
So the span is not positive definite. This example shows why positivity must be checked for every nonzero linear combination, or established by a valid argument that covers them all. Here the positive index is \(1\), and the theorem also rules out any positive-definite subspace of dimension \(2\).
Also distinguish a subspace of maximal dimension from one that is merely maximal under inclusion. The theorem concerns the greatest dimension among all positive-definite subspaces. It does not assert that the positive coordinate subspace is the only subspace attaining that dimension; the second worked example exhibited another one.
Check Your Understanding
Use the definition of positive definiteness and the maximal positive dimension theorem to answer these questions.
- For \(q(\mathbf{x})=2x_1^2-5x_2^2+3x_3^2\), what is the positive index, and give a positive-definite subspace of that dimension.
- For \(q(x,y,z)=x^2+y^2-z^2\), why can no three-dimensional subspace be positive definite?
- In the proof of the upper bound, why does a vector in the kernel of the projection onto the positive coordinates have form value at most zero?
- Give an example showing why positive values on each vector of a basis do not guarantee positivity on the whole span.
- Explain why an invertible change of coordinates preserves the maximum dimension of a positive-definite subspace.