Documentation

MIPRE.Foundations.Halting.Paper.Stages

Stages of the class verifier's programs #

The sampler and the decider of the class verifier of the polynomial-time halting reduction (Halting/Paper/ClassVerifier.lean) are chains of stages: polynomial-time functions (PolyTimeFun, run by their code), calls of the universal machine on a program and an input the previous stage produced, and one binary-to-unary conversion of the sampler's dimension. The universal calls and the conversion are not PolyTimeFuns — the first is polynomial in the simulated program's own time, the second in the number it converts — so the chain is assembled at the level of programs and Eval, with forward run lemmas: each stage is a closed program, seq p q runs p then q on its output, and the cost of the chain is the sum of the stages' costs plus the sizes of the intermediate values.

Sequencing, and the universal calls #

Run p, then the closed program q on its output.

Equations
Instances For
    theorem MIPRE.Cost.Prog.seq_wellScoped {p q : Prog} (hp : WellScoped 1 p) (hq : WellScoped 1 q) :
    WellScoped 1 (p.seq q)
    theorem MIPRE.Cost.Prog.seq_runs {p q : Prog} (hq : WellScoped 1 q) {x y r : Data} {t₁ t₂ : ℕ} (hp : p.Runs x y t₁) (hq' : q.Runs y r t₂) :
    (p.seq q).Runs x r (t₁ + (y.size + 1 + t₂ + 1) + 1)

    Run the universal program on the pair in the input's first component, keeping the second: encode ((c, v), s) ↦ encode (s, r) where c on v returns r.

    Equations
    Instances For
      theorem MIPRE.Cost.Prog.runUK_runs {univ : Prog} (hU : WellScoped 1 univ) {A B r : Data} {t : ℕ} (h : univ.Runs A r t) :
      ∃ t' ≤ A.size + B.size + r.size + t + 8, univ.runUK.Runs (A.cons B) (B.cons r) t'

      Convert the second component from binary to unary: encode (s, n) ↦ encode (s, unary n).

      Equations
      Instances For
        theorem MIPRE.Cost.Prog.unaryStage_runs (S : Data) (n : ℕ) :
        ∃ t ≤ S.size + esize n + (n.size + 2) * ((n + 1) * (4 * n + 14) + 7 * esize n + 8 * n + 90) + 5, unaryStage.Runs (S.cons (encode n)) (S.cons (Data.ofNat n)) t

        Polynomial-time pieces #

        u ↦ 2 ^ |u| on unary numerals, by expBitsProg.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          u ↦ unary (K + |u|), by addConstProg.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For