Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

A subspace and its orthogonal complement split the space

Proved
HefferonLinAlg.orthogonal_projection_decomposition

by tianyipeng · Aug 5, 2026 · Mathlib c5ea003 (Lean v4.30.0)

gram-schmidtinner-productlinear-algebraorthogonal-projection

Let SSS be a subspace of a finite-dimensional real inner product space VVV. Then SSS and its orthogonal complement S⊥S^{\perp}S⊥ are complementary: they intersect only in the zero vector and together span VVV. Equivalently, every vector splits uniquely as its orthogonal projection into SSS plus a vector orthogonal to SSS — the payoff of Gram-Schmidt and the result behind the least-squares Topic that closes Hefferon's Chapter Three.

Preamble
import Mathlib

open Matrix
Formal statement
namespace HefferonLinAlg

theorem orthogonal_projection_decomposition
    {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] [FiniteDimensional ℝ V]
    (S : Submodule ℝ V) :
    IsCompl S Sᗮ := by
  sorry

end HefferonLinAlg
Source
Jim Hefferon, *Linear Algebra*, Saint Michael's College, 2020 printing, Chapter Three, Section VI.3, Theorem 3.4, p. 298
Read-back

What the Lean code literally says, in plain math · claude-opus-5

The statement asserts the following, for every choice of the data it quantifies over: let VVV be a type carrying a normed additive commutative group structure together with a real inner product space structure ⟨⋅,⋅⟩:V×V→R\langle\cdot,\cdot\rangle : V \times V \to \mathbb{R}⟨⋅,⋅⟩:V×V→R compatible with that norm, and assume in addition that VVV is finite-dimensional as a vector space over R\mathbb{R}R (these three structural assumptions are hypotheses of the claim; no completeness beyond what finite-dimensionality gives is assumed separately, and VVV is not assumed nonzero — the zero space is included); and let SSS be an arbitrary R\mathbb{R}R-linear subspace of VVV (an arbitrary element of the lattice of submodules, so the degenerate choices S={0}S = \{0\}S={0} and S=VS = VS=V are both included). Write

S⊥  =  { v∈V  :  ⟨u,v⟩=0 for all u∈S }S^{\perp} \;=\; \{\, v \in V \;:\; \langle u, v\rangle = 0 \text{ for all } u \in S \,\}S⊥={v∈V:⟨u,v⟩=0 for all u∈S}

for the orthogonal complement of SSS, itself a subspace. Then the claim is that SSS and S⊥S^{\perp}S⊥ are complements of each other in the lattice of subspaces of VVV, which unfolds to the conjunction of exactly two conditions:

  • Disjointness: every subspace contained in both SSS and S⊥S^{\perp}S⊥ is the zero subspace; equivalently S∩S⊥={0}S \cap S^{\perp} = \{0\}S∩S⊥={0}.
  • Codisjointness: every subspace containing both SSS and S⊥S^{\perp}S⊥ is all of VVV; equivalently the subspace sum satisfies S+S⊥=VS + S^{\perp} = VS+S⊥=V, i.e. every v∈Vv \in Vv∈V can be written as v=s+tv = s + tv=s+t with s∈Ss \in Ss∈S and t∈S⊥t \in S^{\perp}t∈S⊥.

Nothing further is asserted: the statement is a bare lattice-complementation claim about the pair (S,S⊥)(S, S^{\perp})(S,S⊥). In particular it does not itself name, construct, or characterize a projection map, states no uniqueness of the decomposition v=s+tv = s + tv=s+t as a separate clause (uniqueness follows from the two conditions above but is not written), asserts no formula such as a Pythagorean identity ∥v∥2=∥s∥2+∥t∥2\|v\|^2 = \|s\|^2 + \|t\|^2∥v∥2=∥s∥2+∥t∥2 or a dimension count dim⁡S+dim⁡S⊥=dim⁡V\dim S + \dim S^{\perp} = \dim VdimS+dimS⊥=dimV, and says nothing about the second orthogonal complement S⊥⊥S^{\perp\perp}S⊥⊥. The two degenerate instances are covered and are asserted along with the rest: for S={0}S = \{0\}S={0} the claim says {0}\{0\}{0} and VVV are complementary, and for S=VS = VS=V it says VVV and {0}\{0\}{0} are. The hypotheses are satisfiable (e.g. V=RnV = \mathbb{R}^nV=Rn with the standard inner product), so the assertion is not vacuous.

Human review
  • Endorsed by Shuze Chen · Aug 5, 2026

  • Endorsed by tianyipeng · Aug 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeLaunch a missionPropose a formalization projectFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions.

How Prove2Me works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me