Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5 — Polynomial-Time Computability of the Huffman Decoder Encoding Map

Proved
SyncPrefix.Huffman.huffmanOfStronglyAcyclic_encode_polyTime

by kmehltretter82 · Oct 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

automatacomputational-complexityhuffman-codes

There exists a polynomial-time computable function f:List(Option  Bool)→List(Option  Bool)f : \mathrm{List}(\mathrm{Option\;Bool}) \to \mathrm{List}(\mathrm{Option\;Bool})f:List(OptionBool)→List(OptionBool) on unary automaton encodings such that for every strongly acyclic synchronizing automaton AAA,

f(encode(A))=encode(huffmanOfStronglyAcyclic(A)).f(\mathrm{encode}(A)) = \mathrm{encode}(\mathrm{huffmanOfStronglyAcyclic}(A)).f(encode(A))=encode(huffmanOfStronglyAcyclic(A)).

This lemma establishes the complexity-theoretic half of Lemma 5 (Ryzhikov–Szykuła 2018, p. 6): identifying the unique sink state fff and the source set SSS of AAA, and emitting the transition table of the 2n2n2n-state Huffman decoder AHA_HAH​ over k+2k + 2k+2 letters, can be carried out in polynomial time on multi-tape Turing machines.

Preamble
import Definitions.Def_SyncPrefix_Huffman_Automata
import Definitions.Def_SyncPrefix_Huffman_Lemma5Construction
import Definitions.Def_CookPvsNP_defs
Formal statement
namespace SyncPrefix.Huffman

/-- Polynomial-time computability of the encoding transformation in Lemma 5 (p. 6): there is a
polynomial-time computable map `f` on `Option Bool` encodings that sends `A.encode` to
`(huffmanOfStronglyAcyclic A).encode` for every synchronizing strongly acyclic automaton `A`. -/
theorem huffmanOfStronglyAcyclic_encode_polyTime :
    ∃ f : List (Option Bool) → List (Option Bool), CookPvsNP.PolyTimeComputable f ∧
      ∀ A : Automaton, StronglyAcyclic A.δ → IsSynchronizing A.δ →
        f A.encode = (huffmanOfStronglyAcyclic A).encode := by sorry

end SyncPrefix.Huffman
Source
Ryzhikov–Szykuła 2018, Synchronizing Prefix Codes and Huffman’s Algorithm, arXiv:1806.06299v1, p. 6, Lemma 5

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