NLA-lib Explorer

NLAlib.Ops.Algorithm.failsAtMost_iff_exec

Library · theorem

A randomized guarantee read with the evaluator: with exactly the same admitted inputs, interpretation assumptions, tape law, event and bound, the probability that canonical execution fails, exceeds a resource bound or misses the event is at most the bound.

NLAlib.Ops.Algorithm.failsAtMost_iff_exec {Op Tst K : Type} {r b : ℕ} {P : Ops.Problem K r b}
  {M : Ops.AccessModel Op Tst P} {S : Ops.Specification Op Tst P} (A : Ops.Algorithm M S)
  (law : (d : Fin r → ℕ) → P.Input d → Ops.TapeModel K)
  (admits : (d : Fin r → ℕ) → P.Input d → Prop)
  (interprets : (d : Fin r → ℕ) → P.Input d → Ops.Interp Op Tst K → Prop)
  (event :
    (d : Fin r → ℕ) →
      P.Input d → Ops.Tape K → Ops.Count (Op ⊕ Ops.Bookkeeping) Tst → Ops.Mem K → Prop)
  (bound : (d : Fin r → ℕ) → P.Input d → ℝ) :
  A.FailsAtMost law admits interprets event bound ↔
    ∀ (d : Fin r → ℕ),
      P.valid d →
        ∀ (x : P.Input d),
          admits d x →
            ∀ (I : Ops.Interp Op Tst K),
              M.contracts d x I →
                interprets d x I →
                  ∀ (Ω : Type) [inst : MeasurableSpace Ω] (μ : Measure Ω) [IsFiniteMeasure μ]
                    (tape : Ω → Ops.Tape K),
                    law d x Ω μ tape →
                      μ.real
                          {ω |
                            ¬∃ st,
                                Ops.exec A.program I M.resources P.formats (tape ω) d
                                      (P.initial d x) =
                                    some st ∧
                                  st.peak ≤ S.scratch d ∧
                                    st.cost ≤ S.budget d ∧
                                      M.resources.work st.cost ≤ S.work d ∧
                                        M.resources.span st.cost ≤ S.span d ∧
                                          P.initialBytes d x + st.peak ≤ S.memory d ∧
                                            event d x (tape ω) st.cost st.mem} ≤
                        bound d x

Full source on GitHub

Import NLAlib.Ops.Reference.Probability.