Abstract Linear Algebra 16 | Gramian Matrix [dark version]
Based on The Bright Side of Mathematics's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Orthogonal projection p of X onto a K-dimensional subspace U can be written as p = Σ(i=1..K) Λi Bi using any basis B = {B1,…,BK} of U.
Briefing
Orthogonal projection onto a finite-dimensional subspace can be computed by solving a linear system built from inner products—using a special matrix called the Gramian (often written as G(B,B)). The core idea is to express the projection p of a vector X onto a K-dimensional subspace U as a linear combination of a chosen basis B = {B1, …, BK}. The coefficients in that combination aren’t guessed; they’re determined by enforcing orthogonality between the residual X − p and every basis direction in U.
Start with the standard decomposition X = p + n, where p lies in U and n lies in the orthogonal complement U⊥. Because n is orthogonal to all vectors in U, the inner product ⟨Bj, X⟩ equals ⟨Bj, p⟩ for each basis vector Bj. Writing p = Σ(i=1..K) Λi Bi and using linearity of the inner product in the second argument turns each condition ⟨Bj, X⟩ = ⟨Bj, p⟩ into a linear equation in the unknown scalars Λ1, …, ΛK.
Collecting these K equations produces a matrix-vector system. The Gramian matrix G(B,B) has entries Gij = ⟨Bi, Bj⟩, so each row corresponds to one basis vector Bj tested against the linear combination defining p. The unknown coefficients Λ form a column vector, and the right-hand side is the vector of inner products ⟨Bj, X⟩. Solving G(B,B)Λ = (⟨B1, X⟩, …, ⟨BK, X⟩)ᵀ yields the coefficients Λi, and therefore the orthogonal projection p.
A key question is whether this system has a unique solution. Uniqueness comes down to whether the Gramian matrix is invertible. For square G(B,B), invertibility is equivalent to having a trivial kernel. The transcript shows this by assuming a coefficient vector β in the kernel and forming the linear combination Y = Σ(i=1..K) βi Bi. Kernel membership implies ⟨Bj, Y⟩ = 0 for every basis vector Bj, which forces Y to be orthogonal to all of U. But Y also lies in U by construction, so Y must lie in U ∩ U⊥. That intersection contains only the zero vector, so Y = 0, and because the basis vectors are linearly independent, all βi must be zero. Hence the kernel is trivial and G(B,B) is invertible, guaranteeing a unique orthogonal projection for any K-dimensional subspace in an inner-product space.
An example in R³ illustrates the method. Take U as the yz-plane, spanned by two vectors (the transcript uses basis vectors whose Gramian entries become 2, 1, and 1). The Gramian is a 2×2 matrix built from inner products of the basis with itself, while the right-hand side uses inner products with X. Solving the resulting 2×2 linear system produces coefficients that reconstruct p as a combination of the basis vectors; the resulting projection removes the x-component, matching the geometric expectation that projecting onto the yz-plane kills the x direction.
Cornell Notes
Orthogonal projection onto a K-dimensional subspace U is obtained by writing the projection p of X as a linear combination of a basis B = {B1,…,BK}. Orthogonality of the residual X − p to U forces ⟨Bj, X⟩ = ⟨Bj, p⟩ for every basis vector Bj, which becomes a linear system in the unknown coefficients Λi. The system uses the Gramian matrix G(B,B) with entries ⟨Bi, Bj⟩ and a right-hand side made of ⟨Bj, X⟩. The Gramian is invertible because any vector in its kernel would generate a vector lying in both U and U⊥, forcing it to be zero. That guarantees a unique solution and therefore a unique orthogonal projection.
How does the condition “X − p is orthogonal to U” translate into equations for the coefficients Λi?
What exactly is the Gramian matrix G(B,B), and where do its entries come from?
Why does solving G(B,B)Λ = (⟨B1,X⟩,…,⟨BK,X⟩)ᵀ produce the orthogonal projection p?
What guarantees the solution is unique—why must G(B,B) be invertible?
In the R³ example projecting onto the yz-plane, what does the computed projection accomplish?
Review Questions
- Given a basis B = {B1,…,BK} for U, write the linear system whose solution gives the coefficients of the orthogonal projection of X onto U.
- Explain why orthogonality to all basis vectors implies orthogonality to the entire subspace U.
- What does it mean for the Gramian matrix G(B,B) to be invertible, and how does that relate to uniqueness of the orthogonal projection?
Key Points
- 1
Orthogonal projection p of X onto a K-dimensional subspace U can be written as p = Σ(i=1..K) Λi Bi using any basis B = {B1,…,BK} of U.
- 2
Enforcing orthogonality of the residual X − p to U yields K linear equations: ⟨Bj, X⟩ = ⟨Bj, p⟩ for each j = 1,…,K.
- 3
Those equations assemble into the matrix system G(B,B)Λ = (⟨B1,X⟩,…,⟨BK,X⟩)ᵀ, where G(B,B) has entries ⟨Bi,Bj⟩.
- 4
The Gramian matrix G(B,B) is invertible because any vector in its kernel would generate a nonzero vector lying in both U and U⊥, which is impossible.
- 5
Invertibility of G(B,B) guarantees a unique solution for the coefficients Λ and therefore a unique orthogonal projection.
- 6
In R³, projecting onto the yz-plane via the Gramian method produces a vector with the x-component equal to zero, matching geometric intuition.