Concepts / Linear Subspaces

Linear Subspaces

Each particular input x produces one point in that subspace through UWx.

  • Programming

From Compression to Recovery

PCA can be understood as a reconstruction problem. It searches for two matrices that work together: W compresses an original vector x, and U uses that compressed representation to produce a recovered vector. The recovered vector is not an unrelated replacement for x. It is specifically the result of applying the combined mapping UW to x, written as UWx.

Tracing the Mapping

xoriginal vectorWxcompressed representationUWxrecovered vectorWU
What happens to x as it is first mapped by W and then mapped back by U?

The mapping has two stages. First, W changes x into a compressed representation Wx. Next, U uses Wx to produce UWx. Combining the two stages gives one mapping from the original vector directly to its recovered version: x ↦ UWx. This notation matters because the reconstruction comparison is between x and the output produced by this complete mapping.

Worked example

Following one vector

Given an original vector x, describe the role of W, U, and UWx in the PCA reconstruction process.

  1. 1
    Compression

    W acts on x and produces Wx, the compressed representation of the original vector.

  2. 2
    Recovery

    U acts on Wx and produces UWx, the recovered vector.

  3. 3
    Comparison

    The recovered vector UWx is compared with x when PCA evaluates reconstruction quality.

Result

The recovered vector is UWx because it is the output of applying W first and U second.

The Reconstruction Objective

PCA chooses U and W to minimize the total squared distance between original vectors and their recovered versions. For an original vector x, the recovered version used in that comparison is UWx. Across the data being reconstructed, PCA therefore prefers a matrix pair whose combined mapping produces recovered vectors close to the corresponding originals under the squared-distance objective.

xoriginal vectorUWxrecovered vectorTotal squareddistancequantity minimizedcompare withcompare with
What original and recovered vectors are compared, and how does choosing U and W affect the total squared reconstruction error?
Key point

The optimization does not minimize the distance between x and Wx. Wx is the compressed representation. The reconstruction comparison uses x and UWx, because UWx is the recovered vector in the original output space.

Structure of the Solution

The minimizing solution has two connected properties. First, the columns of U are orthonormal, expressed by UᵀU = I. Second, W is the transpose of U, expressed by W = Uᵀ. Thus W is not an unrelated matrix selected independently from U. The two matrices have a precise relationship, and their combined mapping is UW.

Umatrix with orthonormalcolumnsUᵀU = Iorthonormality conditionUWxcombined reconstructionmappingW = Uᵀtranspose relationshipsatisfiesdeterminespart of solution structureused with U
How are the orthonormality condition on U and the identity W = Uᵀ connected in defining the PCA solution?

The Subspace of Recovered Outputs

Fix U and W, then let x vary over possible input vectors. Every resulting recovered vector has the form UWx. The collection of all such outputs is the range of the mapping UW. The source describes this range as an n-dimensional linear subspace of Rᵈ.

x₁input vectorUWx₁recovered outputRange of UWn-dimensional linearsubspace of Rᵈx₂input vectorUWx₂recovered outputUWUWbelongs tobelongs to
As x varies, how do the encoded-and-recovered vectors UWx form an n-dimensional subspace inside Rᵈ?

This geometric view changes how to interpret PCA. PCA is not merely producing separate recovered vectors one at a time. It selects a matrix structure whose possible recovered outputs occupy one shared n-dimensional linear subspace of Rᵈ. Each particular input x produces one point in that subspace through UWx.

Worked example

Comparing two inputs

Suppose two different inputs, x₁ and x₂, are processed using the same fixed matrices U and W. Describe what can be said about UWx₁ and UWx₂.

  1. 1
    Apply the same mapping

    Each input is sent through the same combined mapping UW, producing UWx₁ and UWx₂.

  2. 2
    Identify the collection

    Both recovered vectors belong to the range of UW, because they are outputs of that mapping.

  3. 3
    Interpret geometrically

    The range containing these outputs is described as an n-dimensional linear subspace of Rᵈ.

Result

Different inputs can produce different recovered vectors, but the recovered outputs are contained in the same n-dimensional linear subspace determined by UW.

Mistakes to Avoid

  • Common mistake

    Treating W and U as independent choices

    What it looks like

    Describing W as a compression matrix without accounting for its relationship to U.

    Why it fails

    The solution requires W = Uᵀ, so W is not an unrelated second choice.

    Do this instead

    State both the orthonormality condition UᵀU = I and the transpose relationship W = Uᵀ.

  • Common mistake

    Calling Wx the recovered vector

    What it looks like

    Comparing the original x directly with Wx as the reconstruction.

    Why it fails

    Wx is the compressed representation. The recovered vector is produced after U acts on that representation.

    Do this instead

    Use UWx for the recovered vector and compare x with UWx.

  • Common mistake

    Describing the subspace as belonging to one input only

    What it looks like

    Saying that the subspace is created by one particular x.

    Why it fails

    The subspace is the collection of all possible outputs of UW as x varies.

    Do this instead

    Relate the subspace to the range of the fixed mapping UW.

  • Common mistake

    Forgetting the objective

    What it looks like

    Explaining PCA only as compression without mentioning reconstruction quality.

    Why it fails

    PCA chooses the matrices to minimize total squared distance between original vectors and recovered vectors.

    Do this instead

    Connect the compression and recovery stages to the total squared reconstruction-distance objective.

Check Your Understanding

MEDIUM

Explain the full path of an input vector x through PCA using W and U. Then state which two expressions define the structure of the solution and describe what set contains all possible outputs UWx.

Hints
  • Start with the compressed representation Wx.
  • Identify the recovered vector after U is applied.
  • Include both UᵀU = I and W = Uᵀ.
  • Use the range of UW to describe the collection of recovered outputs.

What do you think happens?

If U and W remain fixed while x changes, do the recovered outputs remain in the same geometric collection?

  • Yes, because every output is produced by the same mapping UW

  • No, because every new input creates a new subspace

  • Only Wx belongs to a shared collection; UWx does not

Reveal answer
Answer:

Yes, because every output is produced by the same mapping UW.

With U and W fixed, all outputs UWx belong to the range of UW, which is described as an n-dimensional linear subspace of Rᵈ.

Key Takeaways

  1. 1
    PCA chooses U and W to minimize total squared distance between original vectors and their recovered versions.
  2. 2
    W compresses x into Wx, and U maps that representation back to the recovered vector UWx.
  3. 3
    The solution has orthonormal columns in U, expressed as UᵀU = I.
  4. 4
    The compression matrix is the transpose of U, expressed as W = Uᵀ.
  5. 5
    As x varies, the outputs UWx form the range of UW, described as an n-dimensional linear subspace of Rᵈ.

At a glance

  • PCA is a reconstruction optimization: it minimizes total squared distance between original vectors and recovered vectors.
  • The recovered vector is UWx because W compresses x and U uses the compressed representation to recover it.
  • The solution satisfies UᵀU = I and W = Uᵀ.
  • The collection of all outputs UWx is the range of UW, an n-dimensional linear subspace of Rᵈ.

Related concepts

More concepts starting with L