Quadratic reset bounds for finite maximal prefix codes
arXiv:2611.05675
Abstract
Let be a finite maximal prefix code of maximum codeword length . We prove that, whenever the literal decoder of is synchronizing, it has a reset word of length at most . The bound is independent of the alphabet and the number of decoder states. Its main ingredient is a short-detection theorem: a linear observation of the decoder, with terminal weight constant on states of depth , is either identically zero or nonzero on a word of length at most . The proof uses a first-return decomposition in noncommuting variables and cancellation of a highest-degree coefficient. For codes whose codeword lengths are and , we prove the sharper bound and characterize equality. The binary code with the single short word attains this bound for every ; an age representation and a potential on circular arcs give the matching lower bound. Both upper bounds yield polynomial-time constructions in the explicit code size. The mathematical results and the algorithms are formalized in Lean, with polynomial work bounds in a specified binary cost model.