Section 4.5 proves the exact-power Master-theorem core for values
T(b^i). The full CLRS theorem needs a second bridge from exact powers
to arbitrary natural input sizes, including floor and ceiling recurrences.
This file proves the reusable transfer layer for that bridge. It first keeps
the power-sandwich facts as explicit hypotheses, then gives a reusable way to
discharge them from a monotonicity hypothesis plus a one-step scale bound
between adjacent powers of the base. It also proves a real-log comparison
bridge that connects the discrete scale a^(⌊log_b n⌋) to the textbook
scale n^(log_b a) for all a ≥ 1 and b > 1.
namespaceCLRSnamespaceChapter04
Monotone and sandwich interfaces
Absolute-value monotonicity for a cost function.
defMonotoneAbs(T:ℕ→ℝ):Prop:=∀{mn:ℕ},m≤n→|Tm|≤|Tn|
Eventual one-step control for a comparison scale across one multiplication by
the Master-theorem base. This is the local regularity assumption that turns
the adjacent-power interval b^i ≤ n < b^(i+1) into the global power-sandwich
hypotheses below.
Discrete critical-power scale for the exact-power Master theorem case 1. On
exact powers it satisfies
criticalPowerScale a b (b^i) = a^i; between exact powers it is the
step function determined by Nat.log b n.
This, criticalPowerLogScale, and tailDominatedScale are
deliberately weaker and cleaner than the analytic scales
n^(log_b a), but it is enough to make the exact-power-to-all-input
bridge concrete for the three Master cases.
Discrete case-3 Master scale. On exact powers this is the scale from
master_case3_tail_dominated; between exact powers it is again the
step function determined by Nat.log b n.
The polynomial-logarithmic comparison scale
(⌊log_b n⌋ + 1)n^p. It is a discrete-log version of the CLRS
case-2 scale n^p log n, chosen so that it connects directly to the
all-input exact-power bridge.
When a = b^p, the discrete critical-power scale is asymptotic to the
ordinary polynomial scale n^p. This is the main comparison lemma that
turns case-1 all-input Master wrappers into textbook-looking statements
whenever log_b a is a natural number.
When a = b^p, the discrete case-2 Master scale is asymptotic to
(⌊log_b n⌋ + 1)n^p. This keeps the statement discrete while matching
the standard n^p log n shape used in CLRS.
The real-valued exponent log_b a = log a / log b. This is the exponent that
appears in the standard CLRS Master-theorem statement as n^(log_b a).
When a = b^p for natural p, this reduces to (p : ℝ), and the
criticalPowerScale_isBigTheta_polynomialScale comparison above is a
special case of the general comparison proved here.
The real-log comparison scale n^(log_b a). This is the textbook scale used in
the standard CLRS statement of the Master theorem: the homogeneous-solution
growth rate without floors and ceilings.
For integer exponents it coincides with the ordinary polynomial scale
polynomialScale.
When 1 ≤ a and 1 < b, the discrete critical-power scale
a^(⌊log_b n⌋) is asymptotically equivalent to the real-log scale
n^(log_b a).
This is the main bridge between the discrete all-input Master-theorem proof
and the standard CLRS statement in terms of n^(log_b a). The constant
factor is at most a in the Ω direction and 1 in the O direction, so the
asymptotic class is exact.
Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.Try this:[apply]ring_nfThe `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.