The compressor's decider: the program #
Obligation O4 of blueprint rem:compression-abstract, the program half. The compressor of the
halting reduction takes a succinct description (c, n) of a string x and returns a string
denoting the compressed verifier of the verifier of x frozen at index 2n + 1: its
parameter is λ(n), and its decider — the datum a string carries — is the program haltProg
below with (c, n, λ(n)) hardcoded. This module is that program and its acceptance
agreement, CompressorSpec.accepts_compr; the accounting is separate.
The decider is the paper's machine 𝓕 (recursive.tex, fig:halt_f) with the recursion
removed: the paper's 𝓕 hardcodes its own description and compresses the verifier it is the
decider of, while here the string to compress is read from the description c by bit
queries — the reading is what the compressibility criterion's succinct descriptions make
possible — and the verifier compressed is the string's own, frozen. The paper's Step 2, running
𝓜 for n steps, is the criterion's business and does not appear.
The program prepProg G U does everything but the last step, and always halts on a succinct
description:
readProg U.univ: readxfromcby bit queries0, 1, 2, …through the universal machine, stopping at the out-of-range marker ofbitQueryAnswer;parseProg, then the two projections andnormBinProg: the parameterencode (descLam x)and the decider datumdescDecD x;G.samplerProg.code: the encoded sampler programsampData G x;wrapBuildProg U.univ: the encoded wrapped deciderdecProgData G U x, which isencode (Vof G U x).decider.prog;freezeBuildProgtwice at index2n + 1: the encoded programs of the frozen verifier;G.compress.codeon((frozen sampler, frozen decider), λ(n)): the encoded compressed decider.
Then haltProg G U runs it through the universal machine on the decider's own input, and
returns what the universal machine does. Forward runs of each stage compose to a forward run
of haltProg; the inversion (haltProg_runs_inv) is three cases and determinism, the
preparation being a single closed program with an unconditional run, and gives the acceptance
agreement haltProg_accepts_iff.
Every stage carries an explicit cost, in the sizes of what it is handed, so that the accounting can be done from these lemmas alone.
Reading a string from its succinct description #
readProg univ on encode c: loop over i = 0, 1, 2, …, running univ on
cons (encode c) (encode i), until the answer is the out-of-range marker ofNat 2; the bits
answered are accumulated in reverse and reversed at the end. On a succinct description of x
the answers are bitQueryAnswer x i, so the result is encode x.
The loop state is cons cD (cons iD acc): the description, the index in binary, and the bits
read so far, most recent first.
The body of the reading loop. After taking the state apart (cD at 2, iD at 0,
acc at 1), it runs univ on cons cD iD. The answer nil is the bit false,
cons nil nil the bit true, and anything else — the marker ofNat 2 = cons nil (cons nil nil)
— stops the loop with the accumulator. On a bit, the index is incremented with incProg and the
bit pushed onto the accumulator.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
readProg univ on encode c: the loop from the state cons (encode c) (cons nil nil)
— index 0, nothing read — followed by the reversal of the accumulator.
Equations
- univ.readProg = ((MIPRE.Cost.Prog.var 0).cons (MIPRE.Cost.Prog.nil.cons MIPRE.Cost.Prog.nil)).let_ (univ.readBody.loop.let_ MIPRE.Cost.Prog.revProg)
Instances For
The state of the reading loop after i bits of x have been read.
Equations
- MIPRE.Cost.Prog.readState cD x i = cD.cons ((MIPRE.Cost.encode i).cons (MIPRE.Cost.encode (List.take i x).reverse))
Instances For
The body on the marker: stop with the accumulator.
The cost of one iteration of the reading loop on a succinct description at parameter n
of a string of length at most L, with the description of size s: the universal machine's
overhead on a bit query, plus the bookkeeping.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The reading loop reads the string. On a succinct description (c, n) of x, from the
initial state, the loop of readBody U.univ stops with encode x.reverse.
readProg reads the string. On a succinct description (c, n) of x, readProg U.univ
on encode c computes encode x.
Building descriptions of programs #
The compressor's decider has to assemble the descriptions of the wrapped decider and of the
two frozen programs: Prog.ProgD.dWrapCore and dFreeze below, at the level of data, with the
sampler program and the string's decider as holes. The programs that build them are the same
trees with cons/const in place of the constructors — pK, pC, pL, pE mirror
ProgD.dK, dC, dL, dE — and their cost is the size of what they build plus one per hole
read.
The description of the frozen program freezeProg k p, at the level of data.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The sizes of the constructors' descriptions.
The size of the wrapper's description: the two holes, the universal machine twice, and a fixed number of nodes.
Instances For
cons (const 6) e: builds dK.
Equations
- e.pK = (MIPRE.Cost.Prog.const (MIPRE.Cost.Data.ofNat 6)).cons e
Instances For
Builds dC.
Equations
- h.pC t = (MIPRE.Cost.Prog.const (MIPRE.Cost.Data.ofNat 2)).cons (h.cons t)
Instances For
Builds dL.
Equations
- e.pL b = (MIPRE.Cost.Prog.const (MIPRE.Cost.Data.ofNat 4)).cons (e.cons b)
Instances For
Builds dE i.
Equations
- MIPRE.Cost.Prog.pE i n c = (MIPRE.Cost.Prog.const (MIPRE.Cost.Data.ofNat 3)).cons ((MIPRE.Cost.Prog.const (MIPRE.Cost.Data.ofNat i)).cons (n.cons c))
Instances For
One length check of the wrapper, as a builder with the continuation as a hole.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The builder builds the wrapper's description, at a cost linear in the sizes involved.
Small pieces #
A pair of two variables, then a closed program on it.
Equations
- MIPRE.Cost.Prog.call2 i j q = ((MIPRE.Cost.Prog.var i).cons (MIPRE.Cost.Prog.var j)).let_ q
Instances For
The preparation: from (c, n, λ) to the compressed decider's description #
Everything the compressor's decider does before running the compressed decider: on
encode (c, n, λ), the description of Compress applied to the verifier of the string c
describes, frozen at 2n + 1, and to λ. The stages are those of the module docstring; the
comments give the environment after each.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The frozen verifier of the string x, at index 2n + 1.
Equations
- MIPRE.Halting.frozen G U x n = (MIPRE.Halting.Vof G U x).freeze (2 * n + 1)
Instances For
The description of the compressed decider the preparation produces.
Equations
- MIPRE.Halting.compressedD G U x n lam = MIPRE.Cost.encode (G.compress.toFun (((MIPRE.Halting.frozen G U x n).sampler.prog, (MIPRE.Halting.frozen G U x n).decider.prog), lam))
Instances For
Equations
Instances For
Equations
Instances For
The sizes of the stages' values, bounded in the length L of the described string and the
level n: the sampler program (sampBound, by its own time bound at a parameter of size at
most L + 1), the wrapped decider (wBound), the frozen index (kBound) and the two frozen
programs together (fBound).
The size of the sampler program at a parameter of size at most L + 1.
Equations
- MIPRE.Halting.sampBound G L = Polynomial.eval (L + 1) G.samplerProg.timeBound
Instances For
The size of the wrapped decider's description.
Equations
- MIPRE.Halting.wBound G U L = MIPRE.Halting.sampBound G L + (L + 1) + 2 * MIPRE.Cost.esize U.univ + MIPRE.Cost.Prog.ProgD.wrapNodes
Instances For
The sizes of the two frozen programs, summed.
Equations
- MIPRE.Halting.fBound G U L n = MIPRE.Halting.sampBound G L + MIPRE.Halting.kBound n + 53 + (MIPRE.Halting.wBound G U L + MIPRE.Halting.kBound n + 53)
Instances For
The parameter a string of length L denotes has an encoding of size at most L + 1.
The sizes of the stages' values, against their bounds.
The two frozen programs fit under fBound.
The cost of the preparation, in the description's size s, the level n, a bound L on
the described string's length, and the size l of the parameter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The preparation computes the compressed decider's description, on a succinct
description (c, n) of x.
The decider #
The compressor's decider, before hardcoding. On cons P d with P = encode (c, n, λ)
and d the decider's own input encode (m, x', y', a, b): prepare the description of the
compressed decider, and run it on d through the universal machine; the result is the
universal machine's.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The run of the preparation, as the decider calls it, with the size of what it produces.
Forward run. A run of the universal machine on the compressed decider's description and the input is a run of the decider, at the cost of the preparation and the copies.
Inversion. The decider halts only if the universal machine does on the compressed decider's description and the input, with the same result.
Acceptance agreement of the decider. On a succinct description (c, n) of x, the
decider with (c, n, λ) in front accepts (m, x', y', a, b) exactly when the compressed
decider of the verifier of x frozen at 2n + 1, at parameter λ, accepts it.
The compressor's output, as a string #
The string the compressor outputs on (c, n) at parameter λ: it denotes λ and the
decider haltProg with (c, n, λ) hardcoded.
Equations
- MIPRE.Halting.comprStr G U c n lam = MIPRE.Halting.descOf lam (MIPRE.Cost.hardcode (MIPRE.Halting.haltProg G U) (MIPRE.Cost.encode (c, n, lam)))
Instances For
The verifier the output denotes: the compressed sampler at λ, and the hardcoded decider
as a program.
The acceptance agreement of the output (the field CompressorSpec.accepts_compr): on a
succinct description (c, n) of x, the decider of the verifier the output denotes accepts, at
every index, exactly what the compressed decider of the verifier of x frozen at 2n + 1
accepts.