CLRS §4.4: exact recurrence cost is the work on a finite tree
ProvedCLRS.Chapter4RecursionTree.recurrence_tree_accountingFix a finite ordered child-size list at every natural size, natural-valued toll and base-work functions, and a natural cutoff. A tree is consistent when sizes below the cutoff are leaves with their base work, and every other node has its toll as local work and the prescribed ordered list of child root sizes.
Assume every non-base child is strictly smaller than its parent. Let a natural-valued function match the base work and the exact toll-plus-child recurrence. For every natural input , there is a finite consistent tree rooted at for which
This unites tree existence and exact accounting without balance assumptions. It applies to a numerical recurrence; a source-program runtime claim must separately identify its completed execution's cost with that recurrence.
Platform namespace. The imported Chapter 4 source declarations live under CLRS in this upload to avoid collisions with independently published compiler versions. The immutable source reference retains the original declaration names.
import Definitions.Def_CLRS_Chapter4_RecursionTree import Definitions.Def_CLRS_Chapter4_Substitution import Std set_option autoImplicit false set_option backward.isDefEq.respectTransparency false set_option backward.defeqAttrib.useBackward true namespace CLRS end CLRS open CLRS namespace CLRS.Chapter4RecursionTree end CLRS.Chapter4RecursionTree open CLRS.Chapter4RecursionTree
theorem CLRS.Chapter4RecursionTree.recurrence_tree_accounting (children : Nat → List Nat) (toll base : Nat → Nat) (cutoff : Nat)
(cost : Nat → Nat) (smaller : Chapter4Substitution.SmallerChildren children cutoff)
(baseCost : ∀ n, n < cutoff → cost n = base n)
(recurrence : Chapter4Substitution.ExactRecurrence children toll cutoff cost) (size : Nat) :
∃ tree, tree.rootSize = size ∧ Consistent children toll base cutoff tree ∧
cost size = tree.totalCost ∧ cost size = sumBelow tree.height tree.levelCost := by sorry