Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

GreedyRenewal

Abstract

Shortest borders, maximal block-palindrome width, and exact renewal counts.

Definition 1.1 (IsBPFactorization).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.IsBPFactorization (✓ std3).

Citation. D. Gabrić and J. Shallit (2023). Smallest and Largest Block Palindrome Factorizations. DOI: 10.1007/978-3-031-33180-0_14. URL: https://arxiv.org/abs/2302.13147.

Commentary.

The source states (arXiv v2, p. 2): “Let w be a non-empty word. A block palindrome factorization (or BP-factorization) of w is a factorization w = wₘ⋯w₁w₀w₁⋯wₘ of a word such that w₀ is a possibly empty word, and every other factor wᵢ is non-empty for all i with 1 ≤ i ≤ m.” Here bs is [w₁,…,wₘ] and c is w₀. The empty word has width zero.

Definition 1.2 (bpWidth).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.bpWidth (✓ std3).

Citation. D. Gabrić and J. Shallit (2023). Smallest and Largest Block Palindrome Factorizations. DOI: 10.1007/978-3-031-33180-0_14. URL: https://arxiv.org/abs/2302.13147.

Commentary.

The source states (arXiv v2, p. 2): “We say that a BP-factorization wₘ⋯w₁w₀w₁⋯wₘ is of width t where t = 2m+1 if w₀ is non-empty and t = 2m otherwise.” Here m is bs.length and c is w₀.

Definition 1.3 (largestBPWidth).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.largestBPWidth (✓ std3).

Citation. D. Gabrić and J. Shallit (2023). Smallest and Largest Block Palindrome Factorizations. DOI: 10.1007/978-3-031-33180-0_14. URL: https://arxiv.org/abs/2302.13147.

Commentary.

The source states (arXiv v2, p. 2): “The largest BP-factorization of a word w is a BP-factorization w = wₘ⋯w₁w₀w₁⋯wₘ where m is maximized (i.e., where the width of the BP-factorization is maximized).” The supremum is over all valid widths and is bounded by w.length.

Theorem 1.4 (largestBPWidth_le_length).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.largestBPWidth_le_length (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.5 (IsBorder).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.IsBorder (✓ std3).

Citation. D. Gabrić and J. Shallit (2023). Smallest and Largest Block Palindrome Factorizations. DOI: 10.1007/978-3-031-33180-0_14. URL: https://arxiv.org/abs/2302.13147.

Commentary.

The source states (arXiv v2, p. 1): “A border of a word w is a non-empty word that is both a proper prefix and suffix of w.” Properness is expressed by b.length < w.length.

Definition 1.6 (IsUnbordered).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.IsUnbordered (✓ std3).

Citation. D. Gabrić and J. Shallit (2023). Smallest and Largest Block Palindrome Factorizations. DOI: 10.1007/978-3-031-33180-0_14. URL: https://arxiv.org/abs/2302.13147.

Commentary.

The source states (arXiv v2, p. 1): “A word is said to be bordered if it has a border. Otherwise, the word is said to be unbordered.”

Definition 1.7 (IsShortestBorder).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.IsShortestBorder (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of IsShortestBorder.

Theorem 1.8 (shortest_border_unbordered).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.shortest_border_unbordered (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.9 (shortest_border_le_half).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.shortest_border_le_half (✓ std3). ∎

Source. Repository-derived.

Commentary.

An overlapping border would produce a shorter nonempty border, so a shortest border occupies at most half of its word.

Theorem 1.10 (unbordered_outer_shortest).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.unbordered_outer_shortest (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.11 (maximal_outer_unbordered).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.maximal_outer_unbordered (✓ std3). ∎

Source. Repository-derived.

Commentary.

A bordered outer block splits into matching nonempty outer blocks. This increases the width and contradicts maximality.

Definition 1.12 (shortestBorder).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.shortestBorder (✓ std3).

Source. Repository-derived.

Commentary.

Classical.choose selects a shortest border. The displayed choice proof has the exact existential type; proof irrelevance makes the chosen value independent of which proof of that existential is supplied.

Theorem 1.13 (shortestBorder_spec).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.shortestBorder_spec (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.14 (peeledCore).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.peeledCore (✓ std3).

Source. Repository-derived.

Commentary.

Classical.choose selects the central word between the shortest matching outer borders. The existential contains both the concatenation identity and its exact length. Proof irrelevance makes the choice independent of the proof supplied.

Theorem 1.15 (peeledCore_spec).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.peeledCore_spec (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.16 (peeledCore_shorter).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.peeledCore_shorter (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.17 (peelWidth).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.peelWidth (✓ std3).

Source. Repository-derived.

Commentary.

The recursion removes the shortest border pair until the remaining word is empty or unbordered. Every removal increases the width by two.

Theorem 1.18 (largest_eq_peelWidth).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.largest_eq_peelWidth (✓ std3). ∎

Citation. D. Gabrić and J. Shallit (2023). Smallest and Largest Block Palindrome Factorizations. DOI: 10.1007/978-3-031-33180-0_14. URL: https://arxiv.org/abs/2302.13147.

Commentary.

Induction on word length shows that greedy shortest-border peeling realizes the largest factorization width.

Theorem 1.19 (mem_words).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.mem_words (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.20 (card_words).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.card_words (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.21 (ubWords).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.ubWords (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of ubWords.

Definition 1.22 (uCount).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.uCount (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of uCount.

Theorem 1.23 (mem_ubWords).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.mem_ubWords (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.24 (outerWords).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.outerWords (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of outerWords.

Theorem 1.25 (mem_outerWords).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.mem_outerWords (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.26 (outerWords_disjoint).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.outerWords_disjoint (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.27 (borderedWords).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.borderedWords (✓ std3).

Source. Repository-derived.

Commentary.

The fixed-length words that have a nonempty proper border.

Theorem 1.28 (shortest_partition).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.shortest_partition (✓ std3). ∎

Source. Repository-derived.

Commentary.

Every bordered word has one shortest border length. Unbordered words and these outer-block families partition the words of fixed length. Nat.div is division in the natural numbers, rounded down.

Definition 1.29 (q).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.q (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of q.

Theorem 1.30 (unbordered_q_lt_one).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.unbordered_q_lt_one (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.31 (peelPairs).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.peelPairs (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of peelPairs.

Theorem 1.32 (core_of_unbordered_outer).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.core_of_unbordered_outer (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.33 (tailWords).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.tailWords (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of tailWords.

Theorem 1.34 (mem_tailWords).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.mem_tailWords (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.35 (renewal_tail_count).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.renewal_tail_count (✓ std3). ∎

Source. Repository-derived.

Commentary.

A word with at least r+1 peeled pairs has one shortest unbordered outer block and a centre with at least r peeled pairs. Different shortest lengths give disjoint families. Nat.div is division in the natural numbers, rounded down.

Theorem 1.36 (tailWords_zero).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.tailWords_zero (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Definition 1.37 (qCoeff).

Formalization. D5/S1/Words/BlockPalindromes/GreedyRenewal.qCoeff (✓ std3).

Source. Repository-derived.

Commentary.

The defining expression of qCoeff.

Theorem 1.38 (qCoeff_nonneg).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.qCoeff_nonneg (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.39 (qCoeff_summable).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.qCoeff_summable (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.40 (tsum_qCoeff).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.tsum_qCoeff (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.41 (q_nonneg).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.q_nonneg (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments.

Theorem 1.42 (qCoeff_recurrence).

Proof. Machine-checked in Lean as D5/S1/Words/BlockPalindromes/GreedyRenewal.qCoeff_recurrence (✓ std3). ∎

Source. Repository-derived.

Commentary.

The displayed statement holds for all of its quantified arguments. Nat.div is division in the natural numbers, rounded down.

References