Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

General = particular + homogeneous

Proved
HefferonLinAlg.general_eq_particular_plus_homogeneous

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

affine-subspacelinear-algebralinear-systems

Let AAA be an m×nm \times nm×n matrix over a field KKK, let b∈Kmb \in K^mb∈Km, and suppose p∈Knp \in K^np∈Kn is one particular solution, Ap=bAp = bAp=b. Then the solution set of Ax=bAx = bAx=b is exactly { p+h:Ah=0 }\{\, p + h : Ah = 0 \,\}{p+h:Ah=0}. Every solution is the particular solution plus a solution of the associated homogeneous system, and conversely every such sum solves the system. This is the structural description of a solution set that Hefferon returns to throughout the book.

Preamble
import Mathlib

open Matrix
Formal statement
namespace HefferonLinAlg

theorem general_eq_particular_plus_homogeneous
    {K : Type*} [Field K] {m n : ℕ}
    (A : Matrix (Fin m) (Fin n) K) (b : Fin m → K) (p : Fin n → K) (hp : A *ᵥ p = b) :
    {x : Fin n → K | A *ᵥ x = b} = {x : Fin n → K | ∃ h, A *ᵥ h = 0 ∧ x = p + h} := by
  sorry

end HefferonLinAlg
Source
Jim Hefferon, *Linear Algebra*, Saint Michael's College, 2020 printing, Chapter One, Section I.3, Theorem 3.1, p. 33
Read-back

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

The declaration HefferonLinAlg.general_eq_particular_plus_homogeneous asserts the following. Let KKK be an arbitrary type carrying a field structure (in particular 0≠10 \neq 10=1; no assumption of finiteness, of characteristic, or of algebraic closure is made), and let m,nm, nm,n be arbitrary natural numbers — both are implicit and unconstrained, so the statement includes the degenerate cases m=0m = 0m=0 (a matrix with no rows) and n=0n = 0n=0 (a matrix with no columns, where KnK^{n}Kn is the one-point space consisting of the empty vector). Let

  • A∈Km×nA \in K^{m \times n}A∈Km×n be a matrix whose rows are indexed by {0,…,m−1}\{0, \dots, m-1\}{0,…,m−1} and whose columns are indexed by {0,…,n−1}\{0, \dots, n-1\}{0,…,n−1},
  • b∈Kmb \in K^{m}b∈Km be a vector (a function from the row index set to KKK),
  • p∈Knp \in K^{n}p∈Kn be a vector (a function from the column index set to KKK),

and assume the single hypothesis that ppp satisfies the system, i.e.

Ap=b,where (Av)i  =  ∑j=0n−1Ai,j vj  for each row index i,A p = b, \qquad \text{where } (A v)_i \;=\; \sum_{j=0}^{n-1} A_{i,j}\, v_j \ \text{ for each row index } i,Ap=b,where (Av)i​=j=0∑n−1​Ai,j​vj​  for each row index i,

this being the usual matrix–vector product, with equality of vectors meaning equality at every row index. Nothing else is assumed about ppp: it is merely some solution, not required to be unique, nonzero, or distinguished in any way, and no assumption is made that AAA is injective, surjective, square, or of any particular rank. Under these assumptions the theorem concludes an equality of two subsets of KnK^{n}Kn (equality of sets of vectors, i.e. the two sets have exactly the same members):

{ x∈Kn  :  Ax=b }  =  { x∈Kn  :  ∃ h∈Kn, Ah=0  and  x=p+h }.\{\, x \in K^{n} \;:\; A x = b \,\} \;=\; \{\, x \in K^{n} \;:\; \exists\, h \in K^{n},\ A h = 0 \ \text{ and } \ x = p + h \,\}.{x∈Kn:Ax=b}={x∈Kn:∃h∈Kn, Ah=0  and  x=p+h}.

Here 000 on the right denotes the zero vector of KmK^{m}Km (the function that is 000 at every row index), the existential quantifier ranges over all vectors h∈Knh \in K^{n}h∈Kn and is a plain "there exists" with no uniqueness claim, the conjunction requires both that hhh solve the homogeneous system and that xxx be exactly p+hp + hp+h, and p+hp + hp+h denotes coordinatewise addition, (p+h)j=pj+hj(p+h)_j = p_j + h_j(p+h)j​=pj​+hj​. The claim is a full set equality (both inclusions), not one inclusion or a mere characterization up to some equivalence. In the degenerate case m=0m = 0m=0 the hypothesis Ap=bA p = bAp=b holds automatically (equality of two vectors with no coordinates), and both sides of the conclusion are then all of KnK^{n}Kn; in the case n=0n = 0n=0 both sides are subsets of a one-element space. The statement is closed with sorry, so no proof is supplied.

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