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.
runUK univonencode ((c, v), s)runsunivon(c, v)and returnsencode (s, r), keeping the states;runU univreturnsralone.unaryStageonencode (s, n)returnsencode (s, unary n)(toUnaryProg).- The polynomial-time pieces:
expBits(u ↦ 2 ^ |u|),addConstU K(u ↦ unary (K + |u|)),unaryMul D(u ↦ unary (D · |u|)),lenBin(the length of a string, in binary).
Sequencing, and the universal calls #
Run p, then the closed program q on its output.
Equations
- p.seq q = p.let_ (MIPRE.Cost.Prog.callVar 0 q)
Instances For
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
- univ.runUK = MIPRE.Cost.Prog.elim 0 MIPRE.Cost.Prog.nil ((MIPRE.Cost.Prog.callVar 0 univ).let_ ((MIPRE.Cost.Prog.var 2).cons (MIPRE.Cost.Prog.var 0)))
Instances For
Convert the second component from binary to unary: encode (s, n) ↦ encode (s, unary n).
Equations
Instances For
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
u ↦ unary (D · |u|): D copies of u, appended.
Equations
Instances For
The length of a string, in binary.