All-size logarithmic upper bound for the rounded balanced cost
ProvedCLRS.Chapter4SubstitutionExamples.balancedCost_logarithmic_upperLet be the constructed total balanced recurrence with , , and for .
For every natural ,
Here the integer logarithm is Nat.log2, with value zero at .
The added one makes the formula valid at both base sizes as well as all
larger sizes, including those not equal to a power of two.
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.
Catalog organization (2026-10-11). This record was retired from the active Chapter 4 catalog to focus the presentation on three algorithms and four reusable recurrence results. Its mathematical statement and proof status are unchanged, and existing imports and links remain valid. The retained results are CLRS.Chapter4Substitution.upper_comparison, CLRS.Chapter4Substitution.lower_comparison. Supporting lemmas needed by the retained results are included in their accepted proof files.
import Definitions.Def_CLRS_Chapter4_Substitution import Definitions.Def_CLRS_Chapter4_SubstitutionExamples 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.Chapter4SubstitutionExamples end CLRS.Chapter4SubstitutionExamples open CLRS.Chapter4SubstitutionExamples open Chapter4Substitution
theorem CLRS.Chapter4SubstitutionExamples.balancedCost_logarithmic_upper (n : Nat) :
balancedCost n ≤ 4*n*(Nat.log2 n+1) := by sorry