This file packages the CLRS substitution method as reusable induction
principles for one-step recurrence bounds. The core idea is intentionally
small: a guessed bound is a loop invariant over the recurrence index.
Main results:
Theorem CLRS.Chapter04.substitution_upper_bound: base plus step
preservation proves an upper bound.
Theorem CLRS.Chapter04.substitution_lower_bound: the corresponding
lower-bound principle.
Theorem CLRS.Chapter04.substitution_sandwich: simultaneous lower and
upper bounds.
Theorems CLRS.Chapter04.linear_substitution_upper_bound and
CLRS.Chapter04.geometric_substitution_upper_bound: ready-to-use
CLRS-style templates for common recurrence guesses.
Current gaps:
These lemmas model the substitution proof method, not a full recurrence
parser. Later divide-and-conquer sections can instantiate them after
deriving the appropriate one-step inequality from floors, ceilings, or
exact-power reductions.
namespaceCLRSnamespaceChapter04
A proposed upper bound for a cost function.
defIsUpperBound(TB:ℕ→ℝ):Prop:=∀n,Tn≤Bn
A proposed lower bound for a cost function.
defIsLowerBound(TB:ℕ→ℝ):Prop:=∀n,Bn≤Tn
The basic substitution-method upper-bound principle: prove the proposed bound
at the base case, then prove that one recurrence step preserves it.
The lower-bound form of the substitution method. It has the same proof shape
as the upper-bound theorem, but the guessed function is below the recurrence.