Documentation

MIPRE.Tailored.CanonicalCost

The running time of the canonical decider #

P1b deferred the cost of the canonical decider canonProg L LP (MIPRE.Tailored.Canonical): a bound on the running time of a decider in MIPRE.Verifier.TimeBoundAt quantifies over every input (n, d), malformed ones included, while the steps of canonProg are polynomial-time functions, whose bounds hold on encodings only. This file puts a total parse in front (parseDIn, the identity on encodings, canonProgT L LP) and bounds the running time.

What remains for MIPRE.Verifier.IsBounded of the normal form verifier a tailored verifier denotes, at a λ' linear in λ, is the wrapper of Verifier.ofSamplerDecider (the question-length check and the universal machine), whose explicit cost is wrapCore_cost'.

theorem MIPRE.Cost.Prog.pushProg_runs_le {F P : Prog} (hP : WellScoped 1 P) {s v r : Data} {t₁ t₂ : ℕ} (h₁ : F.Runs s v t₁) (h₂ : P.Runs v r t₂) :
∃ t ≤ t₁ + t₂ + v.size + r.size + s.size + 8, (F.pushProg P).Runs s (r.cons s) t

The total parse #

Read a decider's input (n, x, y, a, b) off any data, the identity on encodings.

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

    The parsed index is the index.

    The parsed strings are of size linear in the input.

    noncomputable def MIPRE.Tailored.canonProgT (L P : Cost.Prog) :

    The canonical decider with a total parse in front.

    Equations
    Instances For
      theorem MIPRE.Tailored.canonProgT_runs_iff {L P : Cost.Prog} (hL : Cost.Prog.WellScoped 1 L) (hP : Cost.Prog.WellScoped 1 P) (i : DIn) (out : Cost.Data) :
      (∃ (t : ℕ), (canonProgT L P).Runs (Cost.encode i) out t) ↔ ∃ (t : ℕ), (canonProg L P).Runs (Cost.encode i) out t

      On encoded inputs the parse changes nothing.

      One step: a call of an input program, pushed onto the state #

      theorem MIPRE.Tailored.step_runs {σ : Type u_1} {β : Type u_2} [Cost.SizedEncoding σ] [Cost.SizedEncoding β] (F : Cost.PolyTimeFun σ (ℕ × β)) {Q : Cost.Prog} (hQ : Cost.Prog.WellScoped 1 Q) {n T k : ℕ} (hQt : ∀ (d : Cost.Data), Cost.HaltsWithin Q ((Cost.encode n).cons d) (T * (d.size + 1) ^ k)) (s : σ) (hn : (F.toFun s).1 = n) {Z : ℕ} (hZ : Cost.esize (F.toFun s).2 + 1 ≤ Z) :
      ∃ (r : Cost.Data) (t : ℕ), (F.code.pushProg Q).Runs (Cost.encode s) (Cost.encode (r, s)) t ∧ r.size ≤ T * Z ^ k ∧ t ≤ 2 * Polynomial.eval (Cost.esize s) F.timeBound + 2 * (T * Z ^ k) + Cost.esize s + 8

      A step of the canonical decider, timed: from the state s, build the input F s of a program Q whose first component is the index n, run Q within its time bound, and push the output.

      The running time #

      noncomputable def MIPRE.Tailored.canonBound (T k S Z : ℕ) :

      The explicit bound on the running time, from the time T · Z^k of a call and the sizes: S the size of the input, Z a bound on the calls' argument sizes.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem MIPRE.Tailored.canonProgT_halts {L P : Cost.Prog} (hL : Cost.Prog.WellScoped 1 L) (hP : Cost.Prog.WellScoped 1 P) {n T k : ℕ} (hLt : ∀ (d : Cost.Data), Cost.HaltsWithin L ((Cost.encode n).cons d) (T * (d.size + 1) ^ k)) (hPt : ∀ (d : Cost.Data), Cost.HaltsWithin P ((Cost.encode n).cons d) (T * (d.size + 1) ^ k)) (d : Cost.Data) :

        The canonical decider halts within canonBound on every input (n, d), when L and LP halt within T (|d'| + 1)^k on every input (n, d').

        The bound, dominated #

        One polynomial bounding every stage, evaluated at the largest state size.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          theorem MIPRE.Tailored.dom_canonBound :
          ∃ (c : ℕ) (m : ℕ) (e : ℕ), ∀ (W X K T S Z : ℕ), 1 ≤ X → 10 ^ K ≤ W → T ≤ W → S ≤ W + X → Z ≤ 20 * X → Repeat.Dom W X K c m e (canonBound T K S Z)

          The canonical decider's bound is dominated: c (W + 1)^m X^{e (K + 1)}, for W above the call constant T, 10^K and the index's size, X the input's size plus one.

          theorem MIPRE.Tailored.canonProgT_timeBound :
          ∃ (c : ℕ) (m : ℕ) (e : ℕ), ∀ {L P : Cost.Prog}, Cost.Prog.WellScoped 1 L → Cost.Prog.WellScoped 1 P → ∀ {n T k : ℕ}, (∀ (d : Cost.Data), Cost.HaltsWithin L ((Cost.encode n).cons d) (T * (d.size + 1) ^ k)) → (∀ (d : Cost.Data), Cost.HaltsWithin P ((Cost.encode n).cons d) (T * (d.size + 1) ^ k)) → ∀ (d : Cost.Data), Cost.HaltsWithin (canonProgT L P) ((Cost.encode n).cons d) (c * (T + 10 ^ k + Cost.esize n + 1) ^ m * (d.size + 1) ^ (e * (k + 1)))

          The running time of the canonical decider. There are constants c, m, e such that, when L and LP halt within T (|d| + 1)^k on every input (n, d), the canonical decider (with its total parse) halts within c (T + 10^k + |n| + 1)^m (|d| + 1)^{e (k + 1)} on every input (n, d), malformed ones included.

          The description size #

          The canonical decider's description is linear in those of L and LP: L appears four times and LP once, the rest is fixed.