Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Nested compressibility criterion (B0⊆B1B_0 \subseteq B_1B0​⊆B1​): class-preserving compression yields a halting reduction

Proved
MIPRE.Cost.compressibility_criterion_nested

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. We write ℓ(n)\ell(n)ℓ(n) for the binary length of nnn and ∣c∣|c|∣c∣ for the size of a program.

Let A,B0,B1:N→P({0,1}∗)A, B_0, B_1 : \mathbb{N} \to \mathcal{P}(\{0,1\}^*)A,B0​,B1​:N→P({0,1}∗) be families of languages indexed by a level nnn, with B0(n)⊆B1(n)B_0(n) \subseteq B_1(n)B0​(n)⊆B1​(n) for all nnn, and let n0∈Nn_0 \in \mathbb{N}n0​∈N. Suppose:

  1. there are strings yyes,ynoy_{\mathrm{yes}}, y_{\mathrm{no}}yyes​,yno​ with yyes∈A(n)y_{\mathrm{yes}} \in A(n)yyes​∈A(n) and yno∈B0(n)y_{\mathrm{no}} \in B_0(n)yno​∈B0​(n) for every n≥n0n \ge n_0n≥n0​;
  2. there is a closed program SSS (well-scoped in one variable) semideciding the complement of B1B_1B1​ uniformly in the level: for all x∈{0,1}∗x \in \{0,1\}^*x∈{0,1}∗ and nnn, SSS halts on encode((x,n))\mathrm{encode}((x, n))encode((x,n)) if and only if x∉B1(n)x \notin B_1(n)x∈/B1​(n);
  3. there is a polynomial-time computable Compr:Prog×N→{0,1}∗\mathrm{Compr} : \mathrm{Prog} \times \mathbb{N} \to \{0,1\}^*Compr:Prog×N→{0,1}∗ such that for all ccc, xxx and n≥n0n \ge n_0n≥n0​ with 2∣c∣≤n2|c| \le n2∣c∣≤n, (c,n)(c, n)(c,n) a succinct description of xxx and ∣x∣≤n+1|x| \le n+1∣x∣≤n+1, writing y=Compr(c,n)y = \mathrm{Compr}(c, n)y=Compr(c,n): if x∈A(2n+1)x \in A(2n+1)x∈A(2n+1) then y∈A(n)y \in A(n)y∈A(n), and if x∈B0(2n+1)x \in B_0(2n+1)x∈B0​(2n+1) then y∈B0(n)y \in B_0(n)y∈B0​(n).

Then there are a polynomial-time computable g:Prog→{0,1}∗g : \mathrm{Prog} \to \{0,1\}^*g:Prog→{0,1}∗ and a constant K∈NK \in \mathbb{N}K∈N such that, with r(e)=2K+1+∣e∣r(e) = 2^{K+1+|e|}r(e)=2K+1+∣e∣,

∀e∈Prog:n0≤r(e) ∧ (e halts on the empty input⇒g(e)∈A(r(e))) ∧ (e does not halt on the empty input⇒g(e)∈B1(r(e))).\forall e \in \mathrm{Prog}:\quad n_0 \le r(e)\ \wedge\ \bigl(e \text{ halts on the empty input} \Rightarrow g(e) \in A(r(e))\bigr)\ \wedge\ \bigl(e \text{ does not halt on the empty input} \Rightarrow g(e) \in B_1(r(e))\bigr).∀e∈Prog:n0​≤r(e) ∧ (e halts on the empty input⇒g(e)∈A(r(e))) ∧ (e does not halt on the empty input⇒g(e)∈B1​(r(e))).

This is the form of Lin's compressibility criterion that the coRE\mathrm{coRE}coRE direction of MIPco=coRE\mathrm{MIP}^{\mathrm{co}} = \mathrm{coRE}MIPco=coRE needs: there AAA is the class of small commuting-operator value, B0B_0B0​ the class of the main theorem (a perfect PCC strategy, preserved by the completeness of compression) and B1B_1B1​ the class of commuting-operator value 111, whose complement the upper semidecider recognizes and which no compression theorem preserves. The case B0=B1B_0 = B_1B0​=B1​ is compressibility_criterion_levels, from which the level-free criterion compressibility_criterion and its Mathlib form compressibility_criterion_halting follow; the whole proof lives here. The level bookkeeping is what an instantiation by gap-preserving compression needs: the compressor runs in time polynomial in the size of its input (c,n)(c, n)(c,n), i.e. polylogarithmic in nnn, while a single bit query to ccc costs up to nnn, so it cannot read the string xxx it compresses and can only embed ccc into its output for a later reader whose budget is polynomial in nnn (the decider of a game at index nnn); the slack 2∣c∣≤n2|c| \le n2∣c∣≤n keeps that output short, and the hypothesis relates the class of xxx at level 2n+12n+12n+1 to the class of the output at level nnn, which is exactly what the proof uses, the self-referential decider at level nnn compressing the string it itself computes at level 2n+12n+12n+1. The condition ∣x∣≤n+1|x| \le n+1∣x∣≤n+1 is not an extra demand on Compr\mathrm{Compr}Compr but a weakening of what it must cover: the described string is the output of a run whose cost the threshold bounds by n+1n+1n+1.

Formalization Note. The statement is MIPRE.Cost.compressibility_criterion_nested, with Compr : PolyTimeFun (Prog × ℕ) BitStr (the succinctness parameter of the description is the level itself), the semidecider hypothesis hS an equivalence Halts S (encode (x, n)) ↔ x ∉ B₁ n (both directions are used), and the conclusion ∃ g K, ∀ e, n₀ ≤ 2 ^ (K + 1 + esize e) ∧ (Halts e .nil → g e ∈ A (2 ^ (K + 1 + esize e))) ∧ (¬ Halts e .nil → g e ∈ B₁ (2 ^ (K + 1 + esize e))). The halting problem is that of the ambient model's programs on the input nil. 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. In addition, the start level of the recursion is carried as data next to the current level (the decider's input is (c′,(e,(m,n)))(c', (e, (m, n)))(c′,(e,(m,n)))), so that the decider's code does not depend on the threshold, which is chosen afterwards from the decider's time bound.

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_nested
    (A B₀ B₁ : ℕ → Set BitStr) (n₀ : ℕ) (hsub : ∀ n, B₀ n ⊆ B₁ n)
    (yYes : BitStr) (hyes : ∀ n, n₀ ≤ n → yYes ∈ A n)
    (yNo : BitStr) (hno : ∀ n, n₀ ≤ n → yNo ∈ B₀ n)
    (S : Prog) (hSws : S.WellScoped 1)
    (hS : ∀ (x : BitStr) (n : ℕ), Halts S (encode (x, n)) ↔ x ∉ B₁ n)
    (Compr : PolyTimeFun (Prog × ℕ) BitStr)
    (hCompr : ∀ (c : Prog) (x : BitStr) (n : ℕ), n₀ ≤ n → 2 * esize c ≤ n →
      IsSuccinctDesc c n x → x.length ≤ n + 1 →
        (x ∈ A (2 * n + 1) → Compr (c, n) ∈ A n) ∧ (x ∈ B₀ (2 * n + 1) → Compr (c, n) ∈ B₀ n)) :
    ∃ (g : PolyTimeFun Prog BitStr) (K : ℕ),
      ∀ e : Prog, n₀ ≤ 2 ^ (K + 1 + esize e) ∧
        (Halts e .nil → g e ∈ A (2 ^ (K + 1 + esize e))) ∧
        (¬ Halts e .nil → g e ∈ B₁ (2 ^ (K + 1 + esize e))) := by sorry
Source
https://github.com/vidick/MIPRE-formalization/blob/70cbf1c52e3d5e1dff1162fdf952c9a9f4bd99ed/MIPRE/Foundations/Compression.lean#L456-L770; blueprint lem:compressible-criterion-nested, 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