Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Recursive compression: a compressor for succinct descriptions yields a reduction from the halting problem

Proved
MIPRE.Cost.recursive_compression

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 f:{0,1}∗→N∪{∞}f : \{0,1\}^* \to \mathbb{N} \cup \{\infty\}f:{0,1}∗→N∪{∞} be any function and A⊆{0,1}∗A \subseteq \{0,1\}^*A⊆{0,1}∗ a language, with:

  1. a distinguished element y0∈Ay_0 \in Ay0​∈A;
  2. f(x)<∞f(x) < \inftyf(x)<∞ for every x∈Ax \in Ax∈A;
  3. 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 Compr((c,m),n)∈{0,1}∗\mathrm{Compr}((c,m),n) \in \{0,1\}^*Compr((c,m),n)∈{0,1}∗, such that whenever (c,m)(c, m)(c,m) is a genuine succinct description of some xxx: (a) f(Compr((c,m),n))≥max⁡{f(x),n}f(\mathrm{Compr}((c,m),n)) \ge \max\{f(x), n\}f(Compr((c,m),n))≥max{f(x),n}, and (b) if x∈Ax \in Ax∈A then Compr((c,m),n)∈A\mathrm{Compr}((c,m),n) \in ACompr((c,m),n)∈A.

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 AAA:

∀e∈Prog:(e halts on the empty input⇒g(e)∈A) ∧ (e does not halt on the empty input⇒f(g(e))=∞).\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 f(g(e)) = \infty\bigr).∀e∈Prog:(e halts on the empty input⇒g(e)∈A) ∧ (e does not halt on the empty input⇒f(g(e))=∞).

Nothing is assumed about the computability of fff, nor about the output of Compr\mathrm{Compr}Compr on inputs that are not genuine succinct descriptions, but Compr\mathrm{Compr}Compr must be total and polynomial-time everywhere ([MNY, §7] shows this is essential). This is the entire self-referential part of the proof of MIP∗=RE\mathrm{MIP}^* = \mathrm{RE}MIP∗=RE, isolated as a statement with no quantum content: in the entanglement-form route, AAA is the set of normal-form verifiers with a perfect strategy and finite entanglement requirement, fff the entanglement requirement Ent(⋅,12)\mathrm{Ent}(\cdot, \tfrac12)Ent(⋅,21​), and Compr\mathrm{Compr}Compr the compression theorem for games. Its halting-problem form against Mathlib's Nat.Partrec.Code is recursive_compression_halting; the value-form pipeline of the formalization uses Lin's compressibility criterion instead.

Formalization Note. The statement is MIPRE.Cost.recursive_compression, with fff of type BitStr → ℕ∞, Compr : PolyTimeFun ((Prog × ℕ) × ℕ) BitStr, IsSuccinctDesc c m x as above, and the conclusion ∃ g : PolyTimeFun Prog BitStr, ∀ e, (Halts e .nil → g e ∈ A) ∧ (¬ Halts e .nil → f (g e) = ⊤); the halting problem is that of the ambient model's programs on the input nil. The finiteness hypothesis f(x)<∞f(x) < \inftyf(x)<∞ on AAA is part of the statement of [MNY] (it makes the two conclusions exclusive) but is not used by the proof, which is why it is named _hA. 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.recursive_compression
    (f : BitStr → ℕ∞) (A : Set BitStr)
    (y₀ : BitStr) (hy₀ : y₀ ∈ A)
    (_hA : ∀ x ∈ A, f x < ⊤)
    (Compr : PolyTimeFun ((Prog × ℕ) × ℕ) BitStr)
    (hCompr : ∀ (c : Prog) (m : ℕ) (x : BitStr) (n : ℕ),
      IsSuccinctDesc c m x →
        (max (f x) (n : ℕ∞) ≤ f (Compr ((c, m), n))) ∧
        (x ∈ A → Compr ((c, m), n) ∈ A)) :
    ∃ g : PolyTimeFun Prog BitStr,
      ∀ e : Prog,
        (Halts e .nil → g e ∈ A) ∧
        (¬ Halts e .nil → f (g e) = ⊤) := by sorry
Source
https://github.com/vidick/MIPRE-formalization/blob/70cbf1c52e3d5e1dff1162fdf952c9a9f4bd99ed/MIPRE/Foundations/Compression.lean#L119-L288; blueprint lem:recursive-compression, https://vidick.github.io/MIPRE-formalization/blueprint/; [MNY] A. Marks, S. S. Nezhadi, H. Yuen, The recursive compression method for proving undecidability results, manuscript, Lemma 5.1
Human review
  • Endorsed by Shuze Chen · Oct 15, 2026

    Confirmed by the moderator at approval.

  • Endorsed by thomasvidick · Oct 15, 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