Get AI summaries of any video or article — Sign up free
Abstract Linear Algebra 16 | Gramian Matrix [dark version] thumbnail

Abstract Linear Algebra 16 | Gramian Matrix [dark version]

5 min read

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.

TL;DR

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?

With X = p + n and n ∈ U⊥, orthogonality means ⟨Bj, n⟩ = 0 for each basis vector Bj. Since X = p + n, this gives ⟨Bj, X⟩ = ⟨Bj, p⟩. Writing p = Σ(i=1..K) Λi Bi turns each equality into a linear equation: ⟨Bj, X⟩ = Σ(i=1..K) Λi ⟨Bj, Bi⟩ (equivalently ⟨Bj, Bi⟩ depending on which argument is treated as linear).

What exactly is the Gramian matrix G(B,B), and where do its entries come from?

For a basis B = {B1,…,BK} of U, the Gramian matrix is the K×K matrix with entries Gij = ⟨Bi, Bj⟩. Each row corresponds to testing the projection formula against one basis vector via inner products, so the matrix is built entirely from inner products among the basis vectors.

Why does solving G(B,B)Λ = (⟨B1,X⟩,…,⟨BK,X⟩)ᵀ produce the orthogonal projection p?

The coefficient vector Λ determines p = Σ(i=1..K) Λi Bi. The linear system enforces ⟨Bj, X⟩ = ⟨Bj, p⟩ for every j = 1,…,K. That means the residual X − p is orthogonal to every basis vector, and by the earlier proposition (orthogonality to a basis implies orthogonality to the whole subspace), X − p is orthogonal to all of U. Therefore p is the orthogonal projection.

What guarantees the solution is unique—why must G(B,B) be invertible?

Uniqueness requires the kernel of G(B,B) to be trivial. If G(B,B)β = 0 for some coefficient vector β, then the linear combination Y = Σ(i=1..K) βi Bi satisfies ⟨Bj, Y⟩ = 0 for all basis vectors Bj. That forces Y ∈ U⊥. But Y also lies in U by construction, so Y ∈ U ∩ U⊥. The intersection contains only the zero vector, so Y = 0, and linear independence of the basis implies β = 0. Hence the kernel is {0} and G(B,B) is invertible.

In the R³ example projecting onto the yz-plane, what does the computed projection accomplish?

The method yields p as a linear combination of the two basis vectors spanning the yz-plane. Solving the 2×2 system gives coefficients (in the transcript, Λ2 = −1 and Λ1 = 2), so p = 2·(first basis vector) − 1·(second basis vector). The resulting projection has the x-component removed, matching the geometric fact that orthogonal projection onto the yz-plane eliminates the x direction.

Review Questions

  1. 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.
  2. Explain why orthogonality to all basis vectors implies orthogonality to the entire subspace U.
  3. 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. 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. 2

    Enforcing orthogonality of the residual X − p to U yields K linear equations: ⟨Bj, X⟩ = ⟨Bj, p⟩ for each j = 1,…,K.

  3. 3

    Those equations assemble into the matrix system G(B,B)Λ = (⟨B1,X⟩,…,⟨BK,X⟩)ᵀ, where G(B,B) has entries ⟨Bi,Bj⟩.

  4. 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. 5

    Invertibility of G(B,B) guarantees a unique solution for the coefficients Λ and therefore a unique orthogonal projection.

  6. 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.

Highlights

The Gramian matrix G(B,B) is built purely from inner products among the basis vectors: Gij = ⟨Bi, Bj⟩.
Orthogonal projection reduces to solving a linear system whose right-hand side is made of inner products ⟨Bj, X⟩.
Uniqueness hinges on invertibility: a nontrivial kernel would force a vector to lie in both U and U⊥, contradicting that their intersection is {0}.
A concrete R³ computation shows the method automatically removes the component orthogonal to the chosen subspace (the x-component for the yz-plane).