Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 9.18 — the Principal Theorem: the solutions of p(A)f = 0 form a k-dimensional space

Proved
AppliedComb.Recurrence.principal

by mikedeng1 · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

combinatoricslinear-algebrap2o-batch-books5p2o-gran-per-chapterp2o-plan-bookp2o-v1recurrences

Let VVV be the real vector space of all functions f:Z→Rf : \mathbb{Z} \to \mathbb{R}f:Z→R and AAA the advancement operator, Af(n)=f(n+1)Af(n) = f(n+1)Af(n)=f(n+1). Let kkk be a positive integer and let c0,c1,…,ckc_0, c_1, \dots, c_kc0​,c1​,…,ck​ be real constants with c0≠0c_0 \neq 0c0​=0 and ck≠0c_k \neq 0ck​=0. Then the set WWW of all solutions of the homogeneous linear equation

(c0Ak+c1Ak−1+c2Ak−2+⋯+ck)f=0(9.5.1)(c_0 A^k + c_1 A^{k-1} + c_2 A^{k-2} + \cdots + c_k) f = 0 \qquad (9.5.1)(c0​Ak+c1​Ak−1+c2​Ak−2+⋯+ck​)f=0(9.5.1)

is a kkk-dimensional subspace of VVV:

dim⁡RW=k.\dim_{\mathbb{R}} W = k.dimR​W=k.

This is the basic theorem about constant-coefficient linear recurrence equations: solving such an equation amounts to finding a basis of WWW, and every solution is a linear combination of kkk basis functions.

Formalization Note. WWW is solutionSpace k c, the kernel of opPoly k c on ℤ → ℝ, with c 0 =c0= c_0=c0​ and c (Fin.last k) =ck= c_k=ck​. Dimension is Module.rank (a cardinal), so the statement also asserts that WWW is finite-dimensional. On Z\mathbb{Z}Z-indexed functions the hypothesis ck≠0c_k \neq 0ck​=0 is essential (for ck=0c_k = 0ck​=0 the dimension drops); this is not Mathlib's LinearRecurrence.solSpace_rank, which concerns N\mathbb{N}N-indexed sequences and a monic recurrence.

Preamble
import Mathlib
import Definitions.Def_AppliedComb_Recurrence_advance
Formal statement
namespace AppliedComb.Recurrence

/-- Keller–Trotter, Theorem 9.18 (p. 199), the Principal Theorem. Let `k` be a positive integer
and let `c₀, c₁, …, c_k` be real constants with `c₀ ≠ 0` and `c_k ≠ 0`. Then the set `W` of all
solutions `f : ℤ → ℝ` of the homogeneous equation `(c₀ A^k + c₁ A^(k-1) + ⋯ + c_k) f = 0` (9.5.1)
is a `k`-dimensional subspace of `V = (ℤ → ℝ)`: its dimension (`Module.rank`, a cardinal, so
an infinite-dimensional `W` would not satisfy the statement) equals `k`. -/
theorem principal (k : ℕ) (hk : 0 < k) (c : Fin (k + 1) → ℝ) (hc0 : c 0 ≠ 0)
    (hck : c (Fin.last k) ≠ 0) :
    Module.rank ℝ (solutionSpace k c) = k := by sorry

end AppliedComb.Recurrence
Source
Keller & Trotter, Applied Combinatorics (2017 Edition), p. 199, Theorem 9.18
Read-back

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

The theorem is stated for a natural number kkk and a list of real numbers c0,c1,…,ckc_0, c_1, \dots, c_kc0​,c1​,…,ck​, indexed by {0,1,…,k}\{0, 1, \dots, k\}{0,1,…,k}. It has three hypotheses:

  • k>0k > 0k>0, so k≥1k \ge 1k≥1;
  • c0≠0c_0 \neq 0c0​=0, the coefficient at index 000;
  • ck≠0c_k \neq 0ck​=0, the coefficient at the last index kkk.

Under these hypotheses it claims that

rank⁡R(S(k,c))=k.\operatorname{rank}_{\mathbb{R}} \bigl(S(k, c)\bigr) = k .rankR​(S(k,c))=k.

Here S(k,c)S(k, c)S(k,c) is the object the code calls solutionSpace k c. It is defined in a separate imported definitions file whose code is not part of this declaration, so its actual content cannot be read from what is given here. The statement only shows two things about it:

  • it takes kkk and the coefficient list ccc as its only inputs;
  • it has the structure of a vector space over R\mathbb{R}R, since its rank over R\mathbb{R}R is being taken.

A comment attached to the theorem describes S(k,c)S(k, c)S(k,c) as the set of all functions f:Z→Rf : \mathbb{Z} \to \mathbb{R}f:Z→R that satisfy a homogeneous linear recurrence with coefficients c0,…,ckc_0, \dots, c_kc0​,…,ck​. That comment is documentation, not code. Nothing in this declaration checks that S(k,c)S(k, c)S(k,c) really is that set.

The rank is the general rank of a module. It is a cardinal number: the largest possible size of a linearly independent subset of S(k,c)S(k, c)S(k,c) over R\mathbb{R}R, taken as a supremum. The right-hand side is the natural number kkk read as a cardinal. So the equation says S(k,c)S(k, c)S(k,c) has a linearly independent set of exactly kkk elements and none larger. In other words, S(k,c)S(k, c)S(k,c) is finite-dimensional over R\mathbb{R}R with dimension exactly kkk. If S(k,c)S(k, c)S(k,c) were infinite-dimensional, its rank would be an infinite cardinal and the equation would be false. If it were the zero space, its rank would be 000, which also fails the equation because k≥1k \ge 1k≥1.

Degenerate cases.

  • k=0k = 0k=0 is excluded. The hypothesis k>0k > 0k>0 rules it out, so the statement says nothing about a one-coefficient list.
  • k=1k = 1k=1: the coefficients are just c0c_0c0​ and c1c_1c1​, both required to be nonzero, and the claim is that S(1,c)S(1, c)S(1,c) has dimension exactly 111.
  • The two nonzero conditions never coincide. Because k≥1k \ge 1k≥1, index 000 and index kkk are different, so they are two separate conditions on two different coefficients.
  • Coefficients in between are unrestricted. Any of c1,…,ck−1c_1, \dots, c_{k-1}c1​,…,ck−1​ may be zero.
  • The hypotheses can always be met. For example, every ci=1c_i = 1ci​=1 satisfies them, so the theorem is not vacuously true for that reason.
  • No hidden default values. The statement itself uses no division, no subtraction of natural numbers, no integrals and no suprema of empty sets. Any such behaviour could only sit inside the hidden definition of S(k,c)S(k, c)S(k,c), which is not visible here.
Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 2, 2026

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

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

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, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me