Documentation

MIPRE.Foundations.Compression

The abstract compression lemmas #

Two abstract compression lemmas, each turning a compression procedure on succinct descriptions into a reduction from the halting problem, together with their halting-problem corollaries in the form consumed by MIPRE.HaltingGameValue:

Everything is stated in the ambient cost model (Cost.Basic): programs are Cost.Prog, "polynomial-time computable" is Cost.PolyTimeFun, runtimes are Cost.Eval. The proof is the fixed-point construction of [MNY, Lemma 3.1/5.1] and uses precisely the toolkit of Cost.Toolkit: hardcode (efficient s-m-n) and PolyTimeFun.smn to build the self-referential decider, a ClockedUniversalMachine to run "e for log n steps" (PolyTimeFun.haltsWithin), a UniversalMachine to answer bit-queries within the succinctness budget (Prog.bitQueryProg), and efficient_fixed_point to close the self-reference; the time-transfer clauses are what make the constructed program a succinct description at every recursion level (planning/compression-track.md, K3).

Departures from the paper's statement and proof #

The self-referential decider #

The decider of the recursive compression argument, as a polynomial-time function of (c', (e, n)): if e halts on the empty input within Nat.size n steps, the fixed string y₀; otherwise Compr applied to the succinct description (hardcode β ((c', e), 2n + 1), n) — where β is the bit-query program — with parameter n. The self-referential program c of the proof is a Kleene fixed point of c' ↦ hardcode (decFun …).code (encode c'), so that c on (e, n) computes decFun (c, (e, n)), and the hardcoded description is of the string that c itself computes at the next level.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem MIPRE.Cost.decFun_apply (U : UniversalMachine) (UT : ClockedUniversalMachine) (Compr : PolyTimeFun ((Prog × ) × ) BitStr) (y₀ : BitStr) (c' e : Prog) (n : ) :
    (decFun U UT Compr y₀).toFun (c', e, n) = if (evalWithin e Data.nil n.size).isSome = true then y₀ else Compr.toFun ((hardcode U.univ.bitQueryProg (encode ((c', e), 2 * n + 1)), n), n)

    The compression lemma #

    theorem MIPRE.Cost.recursive_compression (f : BitStrℕ∞) (A : Set BitStr) (y₀ : BitStr) (hy₀ : y₀ A) (_hA : xA, f x < ) (Compr : PolyTimeFun ((Prog × ) × ) BitStr) (hCompr : ∀ (c : Prog) (m : ) (x : BitStr) (n : ), IsSuccinctDesc c m xmax (f x) n f (Compr.toFun ((c, m), n)) (x ACompr.toFun ((c, m), n) A)) :
    ∃ (g : PolyTimeFun Prog BitStr), ∀ (e : Prog), (Halts e Data.nilg.toFun e A) (¬Halts e Data.nilf (g.toFun e) = )

    Recursive compression lemma ([MNY, Lemma 5.1]; blueprint lem:recursive-compression).

    Data: f : {0,1}* → ℕ∞, a nonempty language A on which f is finite, and a polynomial-time compression procedure Compr taking a (claimed) succinct description (c, m) and a target parameter n, such that whenever (c, m) genuinely describes x:

    1. f (Compr ((c, m), n)) ≥ max (f x) n, and
    2. x ∈ A → Compr ((c, m), n) ∈ A.

    Conclusion: a polynomial-time reduction g from the halting problem (of the ambient model, on the empty input nil) to A, with f (g e) = ∞ on non-halting e.

    There are no computability assumptions on f, and no assumptions on the output of Compr off succinct descriptions (but Compr is total and fast everywhere — [MNY, §7] shows this is essential). The finiteness hypothesis hA is part of the statement of [MNY] (it makes the two conclusions exclusive) but is not needed for the proof.

    Lin's compressibility criterion #

    The value-form abstract lemma (blueprint lem:compressible-criterion): Lin's compression criterion for RE-complete problems ([Lin, MIP^co = coRE, "Compression criteria for RE-complete problems", direction (3) ⇒ (1)]), in the succinct-description formulation of [MNY]. Compared with recursive_compression, the growth hypothesis on a measure f is replaced by a second preserved class B whose complement is semidecidable, and the self-referential decider gains a search branch: at level n it also runs, for Nat.size n steps, the semidecision procedure on the string at the start of the recursion. The start level m is carried as data next to the level n (the decider's input is (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 exactly as in recursive_compression.

    def MIPRE.Cost.levels (R : ) :

    The levels of the recursion started at R: R, 2R + 1, 4R + 3, ….

    Equations
    Instances For
      @[simp]
      theorem MIPRE.Cost.levels_zero (R : ) :
      levels R 0 = R
      @[simp]
      theorem MIPRE.Cost.levels_succ (R k : ) :
      levels R (k + 1) = 2 * levels R k + 1
      theorem MIPRE.Cost.le_levels (R k : ) :
      R levels R k
      theorem MIPRE.Cost.levels_mono (R : ) {j k : } (h : j k) :
      levels R j levels R k
      theorem MIPRE.Cost.two_pow_le_levels {R : } (hR : 1 R) (k : ) :
      2 ^ k levels R k

      The program of the search branch. On the pair (d, input) with d = encode (c', (e, (m, m))) (the input is ignored), run univ on d — that is, c' on encode (e, (m, m)), the string at the start level m — and then S on the result. Hardcoding d (hardcode (searchProg univ S) d) gives the program the search branch tests for halting.

      Equations
      Instances For
        theorem MIPRE.Cost.Prog.searchProg_wellScoped {univ S : Prog} (hU : WellScoped 1 univ) (hS : WellScoped 1 S) :
        theorem MIPRE.Cost.Prog.searchProg_runs (U : UniversalMachine) {S : Prog} (hS : WellScoped 1 S) {c' e : Prog} {m : } {x r : Data} {tx ts : } (hx : c'.Runs (encode (e, m, m)) x tx) (hSr : S.Runs x r ts) :
        ∃ (T : ), (hardcode (U.univ.searchProg S) (encode (c', e, m, m))).Runs Data.nil r T

        Forward: if c' on encode (e, (m, m)) produces x and S halts on x, then the hardcoded search program halts on the empty input.

        theorem MIPRE.Cost.Prog.searchProg_halts_of (U : UniversalMachine) {S : Prog} (hS : WellScoped 1 S) {c' e : Prog} {m : } {r : Data} {T : } (h : (hardcode (U.univ.searchProg S) (encode (c', e, m, m))).Runs Data.nil r T) :
        ∃ (x : Data) (tx : ), c'.Runs (encode (e, m, m)) x tx Halts S x

        Backward: a run of the hardcoded search program on the empty input yields a run of c' on encode (e, (m, m)) to some x on which S halts.

        The decider of the compressibility-criterion argument, as a polynomial-time function of (c', (e, (m, n))): if e halts on the empty input within Nat.size n steps, the fixed string yYes; else if the search program for the string at the start level m halts within Nat.size n steps, the fixed string yNo; otherwise Compr applied to the succinct description (hardcode β ((c', e), (m, 2n + 1)), n) — where β is the bit-query program — with parameter n. As for decFun, the self-referential program c of the proof is a Kleene fixed point of c' ↦ hardcode (decFunV …).code (encode c').

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem MIPRE.Cost.decFunV_apply (U : UniversalMachine) (UT : ClockedUniversalMachine) (S : Prog) (Compr : PolyTimeFun ((Prog × ) × ) BitStr) (yYes yNo : BitStr) (c' e : Prog) (m n : ) :
          (decFunV U UT S Compr yYes yNo).toFun (c', e, m, n) = if (evalWithin e Data.nil n.size).isSome = true then yYes else if (evalWithin (hardcode (U.univ.searchProg S) (encode (c', e, m, m))) Data.nil n.size).isSome = true then yNo else Compr.toFun ((hardcode U.univ.bitQueryProg (encode ((c', e), m, 2 * n + 1)), n), n)
          theorem MIPRE.Cost.compressibility_criterion (A B : Set BitStr) (yYes : BitStr) (hyes : yYes A) (yNo : BitStr) (hno : yNo B) (S : Prog) (hSws : Prog.WellScoped 1 S) (hS : ∀ (x : BitStr), Halts S (encode x) xB) (Compr : PolyTimeFun ((Prog × ) × ) BitStr) (hCompr : ∀ (c : Prog) (m : ) (x : BitStr) (n : ), IsSuccinctDesc c m x(x ACompr.toFun ((c, m), n) A) (x BCompr.toFun ((c, m), n) B)) :
          ∃ (g : PolyTimeFun Prog BitStr), ∀ (e : Prog), (Halts e Data.nilg.toFun e A) (¬Halts e Data.nilg.toFun e B)

          Compressibility criterion (Lin; blueprint lem:compressible-criterion), the value-form abstract compression lemma.

          Data: two languages A, B with distinguished elements yYes ∈ A and yNo ∈ B; a semidecision procedure S for the complement of B (a closed program halting on encode x exactly when x ∉ B); and a polynomial-time compression procedure Compr taking a (claimed) succinct description (c, m) and a target parameter n, such that whenever (c, m) genuinely describes x:

          1. x ∈ A → Compr ((c, m), n) ∈ A, and
          2. x ∈ B → Compr ((c, m), n) ∈ B.

          Conclusion: a polynomial-time reduction g from the halting problem (of the ambient model, on the empty input nil) with g e ∈ A on halting e and g e ∈ B on non-halting e. There is no measure and no growth hypothesis: the self-referential decider at level n compresses the next level 2n + 1, unless e halts within Nat.size n steps (output yYes) or the semidecision procedure, run on the string at the start level of the recursion, halts within Nat.size n steps (output yNo). Non-halting e: if the start string were outside B, the search branch would eventually fire, and preservation of B down the levels would put the start string in B. Halting e: the search branch can never fire before e halts, by the same downward argument, so preservation of A down from the level where e halts applies.

          Interface with Mathlib computability #

          The project's headline statement (MIPRE.HaltingGameValue) is phrased for Nat.Partrec.Code and Mathlib's Computable. Two bridges close the gap, both computability-only (no time bounds): ambient evaluation is partial recursive, so a polynomial-time function of the model is Mathlib-computable on computably encoded inputs (PolyTimeFun.computable_comp, Cost/Partrec.lean), and the halting problem of Nat.Partrec.Code compiles into the model along a map that is computable on descriptions (exists_compile, Cost/FromPartrec.lean). Both work at the level of Data: no Primcodable instance for Prog is needed, since programs are their own descriptions.

          theorem MIPRE.Cost.recursive_compression_halting (f : BitStrℕ∞) (A : Set BitStr) (y₀ : BitStr) (hy₀ : y₀ A) (hA : xA, f x < ) (Compr : PolyTimeFun ((Prog × ) × ) BitStr) (hCompr : ∀ (c : Prog) (m : ) (x : BitStr) (n : ), IsSuccinctDesc c m xmax (f x) n f (Compr.toFun ((c, m), n)) (x ACompr.toFun ((c, m), n) A)) :
          ∃ (g : Nat.Partrec.CodeBitStr), Computable g ∀ (pc : Nat.Partrec.Code), ((pc.eval 0).Domg pc A) (¬(pc.eval 0).Domf (g pc) = )

          The compression lemma, repackaged against Mathlib's halting problem — the form that will feed MIPRE.HaltingGameValue.halting_reduces_to_gameValue once A and f are instantiated with normal-form-verifier games and the entanglement requirement (blueprint rem:compression-abstract and thm:halting).

          theorem MIPRE.Cost.compressibility_criterion_halting (A B : Set BitStr) (yYes : BitStr) (hyes : yYes A) (yNo : BitStr) (hno : yNo B) (S : Prog) (hSws : Prog.WellScoped 1 S) (hS : ∀ (x : BitStr), Halts S (encode x) xB) (Compr : PolyTimeFun ((Prog × ) × ) BitStr) (hCompr : ∀ (c : Prog) (m : ) (x : BitStr) (n : ), IsSuccinctDesc c m x(x ACompr.toFun ((c, m), n) A) (x BCompr.toFun ((c, m), n) B)) :
          ∃ (g : Nat.Partrec.CodeBitStr), Computable g ∀ (pc : Nat.Partrec.Code), ((pc.eval 0).Domg pc A) (¬(pc.eval 0).Domg pc B)

          The compressibility criterion, repackaged against Mathlib's halting problem — the form that feeds MIPRE.HaltingGameValue.halting_reduces_to_gameValue once A and B are instantiated with normal-form-verifier games having a perfect PCC strategy, respectively value at most 1/2 (blueprint rem:compression-abstract and thm:halting).