Nested compressibility criterion (): class-preserving compression yields a halting reduction
ProvedMIPRE.Cost.compressibility_criterion_nestedThroughout, computation is in the ambient cost model of the formalization: programs (Prog) form a small first-order language on binary-tree data (Data), counts the nodes of a value, a bit string , a natural number (in binary) or a pair is a value through a size-faithful encoding , and a program is its own tree encoding, of size . The timed semantics charges one unit per evaluation rule plus the size of every value read, so a run of cost has output of size at most . 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. " halts on the empty input" means that the program , run on the value nil, halts (Halts e nil). The pair of a program and a parameter is a succinct description of (IsSuccinctDesc c m x) when is closed, , and for every the program on the binary input answers the bit query, returning the -th bit of if and the marker otherwise, within cost , where denotes the binary length of . We write for the binary length of and for the size of a program.
Let be families of languages indexed by a level , with for all , and let . Suppose:
- there are strings with and for every ;
- there is a closed program (well-scoped in one variable) semideciding the complement of uniformly in the level: for all and , halts on if and only if ;
- there is a polynomial-time computable such that for all , and with , a succinct description of and , writing : if then , and if then .
Then there are a polynomial-time computable and a constant such that, with ,
This is the form of Lin's compressibility criterion that the direction of needs: there is the class of small commuting-operator value, the class of the main theorem (a perfect PCC strategy, preserved by the completeness of compression) and the class of commuting-operator value , whose complement the upper semidecider recognizes and which no compression theorem preserves. The case 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 , i.e. polylogarithmic in , while a single bit query to costs up to , so it cannot read the string it compresses and can only embed into its output for a later reader whose budget is polynomial in (the decider of a game at index ); the slack keeps that output short, and the hypothesis relates the class of at level to the class of the output at level , which is exactly what the proof uses, the self-referential decider at level compressing the string it itself computes at level . The condition is not an extra demand on but a weakening of what it must cover: the described string is the output of a run whose cost the threshold bounds by .
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 to be at most ; in a model that charges for reading its input this is vacuous for , so the formalization requires instead, the quadratic factor in being what the bit-indexing program bitAtProg achieves (each zero test and decrement of the binary index copies it); any fixed polynomial in and would do, provided the compression theorem for games uses the same one. (ii) The next level is , not : incrementing a binary numeral needs a carry propagation, prepending a one bit is a single node (PolyTimeFun.next); the levels still grow without bound and keeps every overhead polynomial in . (iii) The threshold is explicit: for a constant obtained from the overhead polynomial by the threshold lemma exists_threshold (above it, a polynomial in is at most ), 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 ), so that the decider's code does not depend on the threshold, which is chosen afterwards from the decider's time bound.
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
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