Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lin's compressibility criterion: a compressor preserving two classes yields a reduction from the halting problem

Proved
MIPRE.Cost.compressibility_criterion

by thomasvidick · Oct 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

computabilitymip-remipre-formalizationrecursive-compressionundecidability

Throughout, computation is in the ambient cost model of the formalization: programs (Prog) form a small first-order language on binary-tree data (Data), size\mathrm{size}size counts the nodes of a value, a bit string x∈{0,1}∗x \in \{0,1\}^*x∈{0,1}∗, a natural number (in binary) or a pair is a value through a size-faithful encoding encode\mathrm{encode}encode, and a program is its own tree encoding, of size ∣e∣|e|∣e∣. The timed semantics charges one unit per evaluation rule plus the size of every value read, so a run of cost ttt has output of size at most ttt. A polynomial-time computable function (PolyTimeFun α β) is a function together with a closed program computing it on encodings and an explicit polynomial bounding the cost in the size of the encoded input. "eee halts on the empty input" means that the program eee, run on the value nil, halts (Halts e nil). The pair (c,m)(c, m)(c,m) of a program and a parameter is a succinct description of x∈{0,1}∗x \in \{0,1\}^*x∈{0,1}∗ (IsSuccinctDesc c m x) when ccc is closed, ∣x∣≤2m|x| \le 2^m∣x∣≤2m, and for every k∈Nk \in \mathbb{N}k∈N the program ccc on the binary input kkk answers the bit query, returning the kkk-th bit of xxx if k<∣x∣k < |x|k<∣x∣ and the marker 222 otherwise, within cost (m+1)(ℓ(k)+1)2(m+1)(\ell(k)+1)^2(m+1)(ℓ(k)+1)2, where ℓ(k)\ell(k)ℓ(k) denotes the binary length of kkk.

Let A,B⊆{0,1}∗A, B \subseteq \{0,1\}^*A,B⊆{0,1}∗ be languages. Suppose:

  1. there are distinguished strings yyes∈Ay_{\mathrm{yes}} \in Ayyes​∈A and yno∈By_{\mathrm{no}} \in Byno​∈B;
  2. the complement of BBB is recursively enumerable, witnessed by a closed program SSS (well-scoped in one variable) with: SSS halts on encode(x)\mathrm{encode}(x)encode(x) if and only if x∉Bx \notin Bx∈/B;
  3. there is a polynomial-time computable compression procedure Compr\mathrm{Compr}Compr, taking a claimed succinct description (c,m)(c, m)(c,m) and a target parameter n∈Nn \in \mathbb{N}n∈N to a string, such that whenever (c,m)(c, m)(c,m) is a genuine succinct description of xxx: if x∈Ax \in Ax∈A then Compr((c,m),n)∈A\mathrm{Compr}((c,m),n) \in ACompr((c,m),n)∈A, and if x∈Bx \in Bx∈B then Compr((c,m),n)∈B\mathrm{Compr}((c,m),n) \in BCompr((c,m),n)∈B.

Then there is a polynomial-time computable g:Prog→{0,1}∗g : \mathrm{Prog} \to \{0,1\}^*g:Prog→{0,1}∗ reducing the halting problem to the pair (A,B)(A, B)(A,B):

∀e∈Prog:(e halts on the empty input⇒g(e)∈A) ∧ (e does not halt on the empty input⇒g(e)∈B).\forall e \in \mathrm{Prog}:\qquad \bigl(e \text{ halts on the empty input} \Rightarrow g(e) \in A\bigr)\ \wedge\ \bigl(e \text{ does not halt on the empty input} \Rightarrow g(e) \in B\bigr).∀e∈Prog:(e halts on the empty input⇒g(e)∈A) ∧ (e does not halt on the empty input⇒g(e)∈B).

This is Lin's compression criterion for RE\mathrm{RE}RE-complete problems (the direction "weakly compressible implies RE\mathrm{RE}RE-complete"), in the succinct-description formulation of Marks, Nezhadi and Yuen, and the level-free form of the lemma the formalization's main theorem uses: AAA the normal-form verifiers with a perfect PCC strategy, BBB those of value at most 12\tfrac1221​, SSS the lower semidecider for the value. Compared with the recursive compression lemma, the growth hypothesis on a measure fff is replaced by a second preserved class whose complement is semidecidable. Its form against Mathlib's halting problem is compressibility_criterion_halting; the per-level form compressibility_criterion_levels, of which this is a special case, is the one an instantiation by gap-preserving compression can satisfy.

Formalization Note. The statement is MIPRE.Cost.compressibility_criterion, with Compr : PolyTimeFun ((Prog × ℕ) × ℕ) BitStr, hS : ∀ x, Halts S (encode x) ↔ x ∉ B (an equivalence; both directions are used), and the conclusion ∃ g : PolyTimeFun Prog BitStr, ∀ e, (Halts e .nil → g e ∈ A) ∧ (¬ Halts e .nil → g e ∈ B), the halting problem being that of ambient programs on the input nil. It is derived from compressibility_criterion_levels with constant families, n0=0n_0 = 0n0​=0, the semidecider precomposed with the first projection, and the compressor (c,n)↦Compr((c,n),n)(c, n) \mapsto \mathrm{Compr}((c, n), n)(c,n)↦Compr((c,n),n); the extra hypotheses of the per-level form (n≥n0n \ge n_0n≥n0​, 2∣c∣≤n2|c| \le n2∣c∣≤n, ∣x∣≤n+1|x| \le n+1∣x∣≤n+1, the levels) are simply dropped. Three departures from the paper's statement and proof are recorded in the module docstring of MIPRE/Foundations/Compression.lean. (i) Succinctness time bound: [MNY, Definition 2.4] requires the runtime of the description on every query kkk to be at most nnn; in a model that charges for reading its input this is vacuous for ℓ(k)>n\ell(k) > nℓ(k)>n, so the formalization requires (n+1)(ℓ(k)+1)2(n+1)(\ell(k)+1)^2(n+1)(ℓ(k)+1)2 instead, the quadratic factor in ℓ(k)\ell(k)ℓ(k) being what the bit-indexing program bitAtProg achieves (each zero test and decrement of the binary index copies it); any fixed polynomial in nnn and ℓ(k)\ell(k)ℓ(k) would do, provided the compression theorem for games uses the same one. (ii) The next level is 2n+12n+12n+1, not n+1n+1n+1: incrementing a binary numeral needs a carry propagation, prepending a one bit is a single node (PolyTimeFun.next); the levels n,2n+1,4n+3,…n, 2n+1, 4n+3, \dotsn,2n+1,4n+3,… still grow without bound and ℓ(2n+1)=ℓ(n)+1\ell(2n+1) = \ell(n)+1ℓ(2n+1)=ℓ(n)+1 keeps every overhead polynomial in ∣e∣+ℓ(n)|e| + \ell(n)∣e∣+ℓ(n). (iii) The threshold is explicit: r(e)=2K+1+∣e∣r(e) = 2^{K+1+|e|}r(e)=2K+1+∣e∣ for a constant KKK obtained from the overhead polynomial by the threshold lemma exists_threshold (above it, a polynomial in ∣e∣+ℓ(n)|e| + \ell(n)∣e∣+ℓ(n) is at most n+1n+1n+1), and it is computed in polynomial time by PolyTimeFun.threshold K.

Preamble
import Mathlib.Algebra.Polynomial.Eval.Defs
import Mathlib.Algebra.Polynomial.Eval.Degree
import Mathlib.Computability.Halting
import Mathlib.Computability.Partrec
import Mathlib.Computability.PartrecCode
import Mathlib.Computability.Primrec.List
import Mathlib.Computability.TuringMachine.Config
import Mathlib.Data.ENat.Lattice
import Mathlib.Data.List.Basic
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Notation
import Mathlib.Data.Nat.Size
import Mathlib.Logic.Denumerable
import Mathlib.Logic.Function.Iterate
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
import Definitions.Def_MIPRE_Foundations_Cost_Basic
import Definitions.Def_MIPRE_Foundations_Cost_Encoding
import Definitions.Def_MIPRE_Foundations_Cost_PolyTime
import Definitions.Def_MIPRE_Foundations_Cost_Closure
import Definitions.Def_MIPRE_Foundations_Cost_Loops
import Definitions.Def_MIPRE_Foundations_Cost_Unary
import Definitions.Def_MIPRE_Foundations_Cost_Numeric
import Definitions.Def_MIPRE_Foundations_Cost_BitQuery
import Definitions.Def_MIPRE_Foundations_Cost_Toolkit
import Definitions.Def_MIPRE_Foundations_Cost_Succinct
import Definitions.Def_MIPRE_Foundations_Cost_Clocked
import Definitions.Def_MIPRE_Foundations_Cost_Threshold
import Definitions.Def_MIPRE_Foundations_Cost_Machine
import Definitions.Def_MIPRE_Foundations_Cost_Codable
import Definitions.Def_MIPRE_Foundations_Cost_MachineData
import Definitions.Def_MIPRE_Foundations_Cost_Interpreter
import Definitions.Def_MIPRE_Foundations_Cost_MachineBound
import Definitions.Def_MIPRE_Foundations_Cost_Universal
import Definitions.Def_MIPRE_Foundations_Cost_Kleene
import Definitions.Def_MIPRE_Foundations_Cost_Partrec
import Definitions.Def_MIPRE_Foundations_Cost_FromPartrec
import Definitions.Def_MIPRE_Foundations_Compression

open MIPRE
open MIPRE.Cost
open Polynomial
Formal statement
theorem MIPRE.Cost.compressibility_criterion
    (A B : Set BitStr)
    (yYes : BitStr) (hyes : yYes ∈ A) (yNo : BitStr) (hno : yNo ∈ B)
    (S : Prog) (hSws : S.WellScoped 1) (hS : ∀ x : BitStr, Halts S (encode x) ↔ x ∉ B)
    (Compr : PolyTimeFun ((Prog × ℕ) × ℕ) BitStr)
    (hCompr : ∀ (c : Prog) (m : ℕ) (x : BitStr) (n : ℕ),
      IsSuccinctDesc c m x →
        (x ∈ A → Compr ((c, m), n) ∈ A) ∧ (x ∈ B → Compr ((c, m), n) ∈ B)) :
    ∃ g : PolyTimeFun Prog BitStr,
      ∀ e : Prog,
        (Halts e .nil → g e ∈ A) ∧
        (¬ Halts e .nil → g e ∈ B) := by sorry
Source
https://github.com/vidick/MIPRE-formalization/blob/70cbf1c52e3d5e1dff1162fdf952c9a9f4bd99ed/MIPRE/Foundations/Compression.lean#L827-L875; blueprint lem:compressible-criterion, https://vidick.github.io/MIPRE-formalization/blueprint/; [Lin25] J. Lin, MIP^co = coRE, Proc. 58th STOC, 2026, arXiv:2510.07162, the compression criterion for RE-complete problems (direction "weakly compressible implies RE-complete"), in the succinct-description formulation of [MNY] A. Marks, S. S. Nezhadi, H. Yuen, The recursive compression method for proving undecidability results, manuscript

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