Documentation

MIPRE.Foundations.Cost.While

Iterating a polynomial-time step, and running programs in sequence #

Two program combinators for routines whose running time is not polynomial in the size of their input, such as the computation of (λn + 1)^μ from binary λ, n, μ:

Iterate the step f until it stops.

Equations
Instances For
    theorem MIPRE.Cost.whileProg_runs (f : PolyTimeFun Data (Bool × Data)) (N : ℕ) (s : ℕ → Data) (r : Data) (hcont : ∀ i < N, f.toFun (s i) = (true, s (i + 1))) (hstop : f.toFun (s N) = (false, r)) :
    ∃ t ≤ ∑ i ∈ Finset.range (N + 1), (Polynomial.eval (s i).size f.timeBound + 1), (whileProg f).Runs (s 0) r t

    A run of the loop through the states s 0, …, s N, stopping at s N with r.

    Run q on the output of p.

    Equations
    Instances For
      theorem MIPRE.Cost.seqProg_runs {p q : Prog} (hq : Prog.WellScoped 1 q) {x y r : Data} {s t : ℕ} (hp : p.Runs x y s) (hq' : q.Runs y r t) :
      (seqProg p q).Runs x r (s + t + 1)