Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5, p. 6 — a synchronizing strongly acyclic automaton over k letters becomes, in polynomial time, a Huffman decoder over k + 2 letters with the same shortest synchronizing length

Proved
SyncPrefix.Huffman.lemma_5

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

huffman-codesp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1reductionssynchronizing-automata

There is a polynomial-time computable map on encodings of automata with the following property. For every synchronizing strongly acyclic automaton AAA with nnn states over an alphabet of size kkk, the map sends the code of AAA to the code of an automaton AHA_HAH​ such that

  1. AHA_HAH​ is a Huffman decoder over an alphabet of size k+2k + 2k+2;
  2. AHA_HAH​ is synchronizing and ℓ(AH)=ℓ(A)\ell(A_H) = \ell(A)ℓ(AH​)=ℓ(A);
  3. n≤nH≤2nn \le n_H \le 2nn≤nH​≤2n, where nHn_HnH​ is the number of states of AHA_HAH​.

In the paper, AHA_HAH​ adds two letters b1,b2b_1, b_2b1​,b2​ and a full binary tree rooted at the sink fff of AAA whose leaves are the states of AAA without incoming transitions. The lemma moves inapproximability from strongly acyclic automata to Huffman decoders (Corollary 6).

Differences from the source:

  • generalization: "there exists a Huffman decoder A_H … with the same length of a shortest synchronizing word" → also n ≤ n_H ≤ 2n; reason: the construction adds fewer than n tree states, and Corollary 6 (iii) needs the bound; dropping the conjunct gives the source's statement.
  • reading: Huffman decoder → strongly connected, with a state whose set of first-return words is finite; reason: the paper introduces first-return codes for strongly connected automata (p. 3), and the construction produces strongly connected decoders; it is the stronger conclusion.
  • encoding: "A_H can be constructed in polynomial time" → a polynomial-time computable map f on encodings with f(code(A)) = code(A_H) for every synchronizing strongly acyclic A; reason: Lean convention; f is unconstrained on other inputs.
Preamble
import Mathlib
import Definitions.Def_SyncPrefix_Huffman_Automata
import Definitions.Def_CookPvsNP_defs
Formal statement
namespace SyncPrefix.Huffman

/-- Lemma 5 (p. 6): a polynomial-time computable map on encodings sends every synchronizing
strongly acyclic automaton over `k` letters to a Huffman decoder over `k + 2` letters with the
same shortest synchronizing word length and between `n` and `2n` states. -/
theorem lemma_5 :
    ∃ f : List (Option Bool) → List (Option Bool), CookPvsNP.PolyTimeComputable f ∧
      ∀ A : Automaton, StronglyAcyclic A.δ → IsSynchronizing A.δ →
        ∃ AH : Automaton, f A.encode = AH.encode ∧ IsHuffmanDecoder AH.δ ∧ AH.k = A.k + 2 ∧
          IsSynchronizing AH.δ ∧ syncLength AH.δ = syncLength A.δ ∧
            A.n ≤ AH.n ∧ AH.n ≤ 2 * A.n := by sorry

end SyncPrefix.Huffman
Source
Ryzhikov & Szykuła, Finding Short Synchronizing Words for Prefix Codes, arXiv:1806.06299v1, p. 6, Lemma 5 (and its proof)
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