Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 9.22 — the general solution of (A − r)^k f = 0 is (c₁ + c₂n + ⋯ + c_k n^(k−1)) rⁿ

Proved
AppliedComb.Recurrence.repeated_root

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 space of functions f:Z→Rf : \mathbb{Z} \to \mathbb{R}f:Z→R and AAA the advancement operator. Let k≥1k \ge 1k≥1 be an integer and rrr a nonzero real number, and consider the equation

(A−r)kf=0.(9.5.7)(A - r)^k f = 0. \qquad (9.5.7)(A−r)kf=0.(9.5.7)

Then the general solution of (9.5.7) is

f(n)=c1rn+c2nrn+c3n2rn+c4n3rn+⋯+cknk−1rn,(9.5.8)f(n) = c_1 r^n + c_2 n r^n + c_3 n^2 r^n + c_4 n^3 r^n + \cdots + c_k n^{k-1} r^n, \qquad (9.5.8)f(n)=c1​rn+c2​nrn+c3​n2rn+c4​n3rn+⋯+ck​nk−1rn,(9.5.8)

that is, a function f∈Vf \in Vf∈V solves (9.5.7) if and only if there are real constants c1,…,ckc_1, \dots, c_kc1​,…,ck​ with (9.5.8) for every n∈Zn \in \mathbb{Z}n∈Z.

This handles a repeated root of the characteristic polynomial; combined with Theorem 9.21 it gives the general solution of any constant-coefficient linear recurrence whose characteristic polynomial splits over R\mathbb{R}R.

Formalization Note. The book's statement does not repeat r≠0r \neq 0r=0; it is the standing assumption of Section 9.5.2 (p. 200, "an equation of the form (A−r)f=0(A - r)f = 0(A−r)f=0 where r≠0r \neq 0r=0") and is added as a hypothesis. "General solution" is read as an equality of sets, so the Lean statement is an iff. The constant c i for i : Fin k is the book's ci+1c_{i+1}ci+1​ and multiplies nirnn^i r^nnirn (with n0=1n^0 = 1n0=1); nnn is cast to R\mathbb{R}R and rnr^nrn is the integer power.

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

/-- Keller–Trotter, Lemma 9.22 (p. 201). Let `k ≥ 1` and `r ≠ 0` (the standing assumption of
Section 9.5.2, p. 200: the book's lemma is stated for a root `r` of an equation `(A − r) f = 0`
with `r ≠ 0`). Then the general solution `f : ℤ → ℝ` of `(A − r)^k f = 0` (9.5.7) is
`f(n) = c₁ rⁿ + c₂ n rⁿ + c₃ n² rⁿ + ⋯ + c_k n^(k-1) rⁿ` (9.5.8): a function solves (9.5.7) if and
only if it has this form for some real constants `c₁, …, c_k` (here `c i` for `i : Fin k`
multiplies `n^i rⁿ`, so `c 0` is the book's `c₁`). -/
theorem repeated_root (k : ℕ) (hk : 1 ≤ k) (r : ℝ) (hr : r ≠ 0) (f : ℤ → ℝ) :
    ((advance - r • (1 : Module.End ℝ (ℤ → ℝ))) ^ k) f = 0 ↔
      ∃ c : Fin k → ℝ, ∀ n : ℤ, f n = ∑ i : Fin k, c i * (n : ℝ) ^ (i : ℕ) * r ^ n := by sorry

end AppliedComb.Recurrence
Source
Keller & Trotter, Applied Combinatorics (2017 Edition), p. 201, Lemma 9.22
Read-back

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

Let VVV be the space of all functions Z→R\mathbb{Z}\to\mathbb{R}Z→R. Let AAA be the advancement operator, (Af)(n)=f(n+1)(Af)(n)=f(n+1)(Af)(n)=f(n+1), and III the identity operator. The statement has these inputs:

  • a natural number kkk with k≥1k \ge 1k≥1;
  • a real number rrr with r≠0r \neq 0r=0;
  • a function f:Z→Rf:\mathbb{Z}\to\mathbb{R}f:Z→R.

The theorem asserts an equivalence. The left side is

(A−rI)kf=0.(A - rI)^k f = 0.(A−rI)kf=0.

Here (A−rI)k(A - rI)^k(A−rI)k is the operator A−rIA - rIA−rI composed with itself kkk times. The right side says there exist real constants c0,c1,…,ck−1c_0, c_1, \dots, c_{k-1}c0​,c1​,…,ck−1​ such that

f(n)=∑i=0k−1ci ni rnfor every n∈Z.f(n) = \sum_{i=0}^{k-1} c_i \, n^{i}\, r^{n} \qquad \text{for every } n\in\mathbb{Z}.f(n)=i=0∑k−1​ci​nirnfor every n∈Z.

In this formula:

  • nin^ini is the integer nnn, viewed as a real number, raised to the natural power iii, with n0=1n^0 = 1n0=1;
  • rnr^nrn is an integer power, well defined for negative nnn because r≠0r \neq 0r=0.

The equivalence runs in both directions: every such combination solves the equation, and every solution has this form. Uniqueness of the constants is not asserted.

Degenerate cases:

  • k=0k = 0k=0: excluded by the hypothesis k≥1k \ge 1k≥1.
  • k=1k = 1k=1: the equation is f(n+1)=rf(n)f(n+1) = r f(n)f(n+1)=rf(n) for all nnn. The form is f(n)=c0rnf(n) = c_0 r^nf(n)=c0​rn.
  • n=0n = 0n=0: the power 000^000 is taken to be 111, so the i=0i = 0i=0 term is c0⋅1⋅r0=c0c_0 \cdot 1 \cdot r^0 = c_0c0​⋅1⋅r0=c0​. Every term with i≥1i \ge 1i≥1 vanishes, so the formula gives f(0)=c0f(0) = c_0f(0)=c0​.
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