Geometric while-loop exit distributions on the Resizable Word RAM #
Iteration and limiting exit distributions (loopStepRPMF, loopIterRPMF, loopExitRPMF) and
state invariants (RLoopStateInv) on RData r for randomized Las Vegas while loops over the
word-granular Resizable Word RAM (Cslib.WordRAM.Resizable), mirroring the fixed-memory
absorbing while-loop exit calculus in Cslib.WordRAM.Randomized.Expected on RData r (including
the dynamic word frontier frontier).
Main definitions #
Cslib.WordRAM.Resizable.loopStepRPMF,Cslib.WordRAM.Resizable.loopIterRPMF: single-step andK-stepwhile-loop distributions onRData r.Cslib.WordRAM.Resizable.RLoopStateInv: combined active/exit loop invariant onRData r.Cslib.WordRAM.Resizable.loopExitRPMF: limiting exit distribution of a geometricwhileloop.
Main results #
Cslib.WordRAM.Resizable.hasSum_loopExitRDensity: total exit probability equals1whenever each active step exits with probability bounded below byp_exit > 0.Cslib.WordRAM.Resizable.loopExitRPMF_of_holds,Cslib.WordRAM.Resizable.loopExitRPMF_of_not_holds,Cslib.WordRAM.Resizable.mem_support_loopExitRPMF: fixed-point unfolding and support invariant forloopExitRPMF.
References #
- [MU17] Michael Mitzenmacher and Eli Upfal, Probability and Computing, 2nd ed., Cambridge University Press, 2017, Sections 2.1, 2.3, and 2.4.
theorem Cslib.WordRAM.Resizable.loopIterRPMF_support_inv {r : ℕ} {cond : Cond r} {I Q : RData r → Prop} {μ_body : RData r → PMF (RData r)} (hinv : ∀ (x : RData r), I x → cond.Holds x.toData → ∀ y ∈ (μ_body x).support, RLoopStateInv cond I Q y) (K : ℕ) {x : RData r} (hx : RLoopStateInv cond I Q x) (y : RData r) :
theorem Cslib.WordRAM.Resizable.hasSum_loopExitRDensity {r : ℕ} {cond : Cond r} {I Q : RData r → Prop} {μ_body : RData r → PMF (RData r)} {p_exit : ENNReal} (hp_pos : 0 < p_exit) (hp_top : p_exit ≠ ⊤) (hinv : ∀ (x : RData r), I x → cond.Holds x.toData → ∀ y ∈ (μ_body x).support, RLoopStateInv cond I Q y) (hp_exit :
∀ (x : RData r), I x → cond.Holds x.toData → p_exit ≤ (μ_body x).toOuterMeasure {y : RData r | ¬cond.Holds y.toData}) {x : RData r} (hx : RLoopStateInv cond I Q x) :
theorem Cslib.WordRAM.Resizable.loopExitRPMF_of_holds {r : ℕ} {cond : Cond r} {I Q : RData r → Prop} {μ_body : RData r → PMF (RData r)} {p_exit : ENNReal} (hp_pos : 0 < p_exit) (hp_top : p_exit ≠ ⊤) (hinv : ∀ (x : RData r), I x → cond.Holds x.toData → ∀ y ∈ (μ_body x).support, RLoopStateInv cond I Q y) (hp_exit :
∀ (x : RData r), I x → cond.Holds x.toData → p_exit ≤ (μ_body x).toOuterMeasure {y : RData r | ¬cond.Holds y.toData}) {x : RData r} (hIx : I x) (hcx : cond.Holds x.toData) :
theorem Cslib.WordRAM.Resizable.mem_support_loopExitRPMF {r : ℕ} {cond : Cond r} {I Q : RData r → Prop} {μ_body : RData r → PMF (RData r)} {p_exit : ENNReal} (hp_pos : 0 < p_exit) (hp_top : p_exit ≠ ⊤) (hinv : ∀ (x : RData r), I x → cond.Holds x.toData → ∀ y ∈ (μ_body x).support, RLoopStateInv cond I Q y) (hp_exit :
∀ (x : RData r), I x → cond.Holds x.toData → p_exit ≤ (μ_body x).toOuterMeasure {y : RData r | ¬cond.Holds y.toData}) {x : RData r} (hx : RLoopStateInv cond I Q x) {y : RData r} (hy : y ∈ (loopExitRPMF cond μ_body x).support) :