Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Corollary 8, p. 8 — composing with a finite maximal prefix code multiplies the shortest synchronizing length by a factor between m and M, plus an additive term

Proved
SyncPrefix.Huffman.composition_bounds

by mikedeng1 · Oct 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

composition-of-codeshuffman-codesp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1synchronizing-automata

Let HYH_YHY​ be a synchronizing complete automaton over ΣY\Sigma_YΣY​ whose shortest synchronizing word has length ℓ\ellℓ. Let ZZZ be a finite maximal prefix code over ΣZ\Sigma_ZΣZ​ with shortest and longest codeword lengths mmm and MMM, let β:ΣY→Z\beta : \Sigma_Y \to Zβ:ΣY​→Z be a bijection, and let wZw_ZwZ​ be a word over ΣZ\Sigma_ZΣZ​ with ΣZ∗ wZ⊆Z∗\Sigma_Z^*\, w_Z \subseteq Z^*ΣZ∗​wZ​⊆Z∗ (a synchronizing word of ZZZ). Let HXH_XHX​ be the composition decoder (the tree of ZZZ substituted for the transitions of HYH_YHY​). Then HXH_XHX​ is synchronizing, and the length ℓX\ell_XℓX​ of its shortest synchronizing word satisfies

m ℓ≤ℓX≤M ℓ+∣wZ∣.m\,\ell \le \ell_X \le M\,\ell + |w_Z|.mℓ≤ℓX​≤Mℓ+∣wZ​∣.

For the Wielandt code ZLZ_LZL​ (m=Lm = Lm=L, M=L+1M = L + 1M=L+1, ∣wZ∣≤L2|w_Z| \le L^2∣wZ​∣≤L2) this gives Lℓ≤ℓX≤(L+1)ℓ+L2L\ell \le \ell_X \le (L+1)\ell + L^2Lℓ≤ℓX​≤(L+1)ℓ+L2, which contains the bracket ℓlog⁡k≤ℓX≤2(log⁡k+1)ℓ+Θ((log⁡k)2)\ell \log k \le \ell_X \le 2(\log k + 1)\ell + \Theta((\log k)^2)ℓlogk≤ℓX​≤2(logk+1)ℓ+Θ((logk)2) printed in the proof of Corollary 8 with L=log⁡kL = \log kL=logk. The proof cites Theorem 7, which is about absorbing pairs of codes rather than synchronizing words of decoders; the statement here is the decoder version the argument needs.

Differences from the source:

  • generalization: the bracket ℓ log k ≤ ℓ_X ≤ 2(log k + 1)ℓ + Θ((log k)²) for the code Z of the proof → m ℓ ≤ ℓ_X ≤ M ℓ + |w_Z| for every finite maximal prefix code Z and every w_Z with Σw_Z ⊆ Z; reason: with Z = Z_L (m = L, M = L + 1, |w_Z| ≤ L²) it implies the printed bracket.
  • generalization: the original automaton, a synchronizing Huffman decoder obtained from Corollary 6 (iii) → any synchronizing complete automaton δY on any state type; reason: the Huffman property is not used by the bracket, and the source's decoder is an instance.
  • encoding: "the result of the composition" → the decoder composeDecoder of the composition (pp. 7–8); reason: the object the proof composes.
Preamble
import Mathlib
import Definitions.Def_SyncPrefix_Huffman_Constructions
Formal statement
namespace SyncPrefix.Huffman

open Computability

/-- The composition bounds of the proof of Corollary 8 (p. 8), in decoder form. Let `δY` be a
synchronizing complete automaton over `β`, `Z` a finite maximal prefix code over `α` with
shortest and longest codeword lengths `m` and `M`, `e : β → Z` a bijection, and `w_Z` a word
with `u w_Z ∈ Z∗` for every word `u`. Then the composition decoder is synchronizing and
`m ℓ ≤ ℓ_X ≤ M ℓ + |w_Z|`, where `ℓ` and `ℓ_X` are the lengths of shortest synchronizing words of
`δY` and of the decoder. -/
theorem composition_bounds {σ α β : Type} [DecidableEq α] (δY : σ → β → σ)
    (Z : Finset (List α)) (hZ : IsMaximalPrefixCode (lang Z)) (e : β ≃ {z // z ∈ Z})
    (m M : ℕ) (hm : IsLeast ((fun z : List α => z.length) '' (Z : Set (List α))) m)
    (hM : IsGreatest ((fun z : List α => z.length) '' (Z : Set (List α))) M)
    (wZ : List α) (hwZ : ∀ u : List α, u ++ wZ ∈ (lang Z)∗) (hY : IsSynchronizing δY) :
    IsSynchronizing (composeDecoder δY Z e) ∧
      m * syncLength δY ≤ syncLength (composeDecoder δY Z e) ∧
      syncLength (composeDecoder δY Z e) ≤ M * syncLength δY + wZ.length := by sorry

end SyncPrefix.Huffman
Source
Ryzhikov & Szykuła, Finding Short Synchronizing Words for Prefix Codes, arXiv:1806.06299v1, p. 8, proof of Corollary 8 (second paragraph)
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me