Convex Endpoint Matching
Abstract
Convex endpoint matching bounds the sum of inner gaps.
A matching consists of disjoint endpoint pairs in the positions zero through n minus one. For an increasing, discretely convex natural-valued function, nesting the pairs at the extremes bounds every matching cost. All subtraction below is truncated subtraction in Nat.
Definition 1.1 (Disjoint endpoint pairs).
Formalization. D5/S1/Words/Palindromes/ScatteredPalindromeMatching.matchValid (✓ std3).
Source. Repository-derived.
Commentary.
Both endpoints are in range, every lower endpoint is strictly below its upper endpoint, endpoints of the same kind are injective, and a lower endpoint never equals an upper endpoint.
Definition 1.2 (Cost of the nested matching).
Formalization. D5/S1/Words/Palindromes/ScatteredPalindromeMatching.nestSum (✓ std3).
Source. Repository-derived.
Commentary.
The i-th nested pair leaves n−2(i+1) interior positions.
Theorem 1.3 (Removing the outer nested pair).
Proof. Machine-checked in Lean as D5/S1/Words/Palindromes/ScatteredPalindromeMatching.nestSum_succ (✓ std3). ∎
Source. Repository-derived.
Commentary.
The first summand has gap n minus two; the remaining summands form the nested cost on n minus two positions.
Theorem 1.4 (The convex matching inequality).
Proof. Machine-checked in Lean as D5/S1/Words/Palindromes/ScatteredPalindromeMatching.matching_bound (✓ std3). ∎
Source. Repository-derived.
Commentary.
Choose the smallest lower endpoint and largest upper endpoint. When they belong to different pairs, discrete convexity bounds the cost after exchanging partners. Remove the outer pair and shift the remaining endpoints down by one. Strong induction on the number of pairs gives the bound, including the empty matching.
References
- Truth anchor:
D5/S1/Words/Palindromes/ScatteredPalindromeMatching.matchValid - Truth anchor:
D5/S1/Words/Palindromes/ScatteredPalindromeMatching.matching_bound - Truth anchor:
D5/S1/Words/Palindromes/ScatteredPalindromeMatching.nestSum - Truth anchor:
D5/S1/Words/Palindromes/ScatteredPalindromeMatching.nestSum_succ