Documentation

SampCert.Samplers.Laplace.Properties

DiscreteLaplaceSample Properties #

This file proves evaluation and normalization properties of DiscreteLaplaceSample.

theorem SLang.DiscreteLaplaceSampleLoopIn1Aux_apply_true (t : ℕ+) (n : ) :
SLang.DiscreteLaplaceSampleLoopIn1Aux t (n, true) = if n < t then ENNReal.ofReal (Real.exp (-(n / t))) / t else 0
theorem SLang.DiscreteLaplaceSampleLoopIn1Aux_apply_false (t : ℕ+) (n : ) :
SLang.DiscreteLaplaceSampleLoopIn1Aux t (n, false) = if n < t then (1 - ENNReal.ofReal (Real.exp (-(n / t)))) / t else 0
theorem SLang.DiscreteLaplaceSampleLoopIn1_apply (t : ℕ+) (n : ) (support : n < t) :
SLang.DiscreteLaplaceSampleLoopIn1 t n = ENNReal.ofReal (Real.exp (-(n / t).toReal) * ((1 - Real.exp (-1 / t)) / (1 - Real.exp (-1))))
@[simp]
theorem SLang.DiscreteLaplaceSampleLoop_apply (num : ℕ+) (den : ℕ+) (n : ) (b : Bool) :
SLang.DiscreteLaplaceSampleLoop num den (b, n) = ENNReal.ofReal (Real.exp (-(den / num))) ^ n * (1 - ENNReal.ofReal (Real.exp (-(den / num)))) * (2)⁻¹
@[simp]
theorem SLang.ite_simpl_1 (x : ) (y : ) (a : ENNReal) :
(if x = y then 0 else if y = x then a else 0) = 0
@[simp]
theorem SLang.ite_simpl_2 (x : ) (y : ) (a : ENNReal) :
(if x = 0 then 0 else if y = -x then a else 0) = 0
@[simp]
theorem SLang.ite_simpl_3 (x : ) (y : ) (a : ENNReal) :
(if x = y + 1 then 0 else if x = 0 then 0 else if y = x - 1 then a else 0) = 0
@[simp]
theorem SLang.ite_simpl_4 (x : ) (y : ) (a : ENNReal) :
(if x = -y then if y = 0 then 0 else a else 0) = 0
@[simp]
theorem SLang.ite_simpl_5 (n : ) (c : ) (a : ENNReal) (h : n 0) :
(if -n = c then a else 0) = 0
theorem SLang.avoid_double_counting (num : ℕ+) (den : ℕ+) :
(∑' (x : Bool × ), if x.1 = true¬x.2 = 0 then SLang.DiscreteLaplaceSampleLoop num den x else 0) = (2)⁻¹ * (1 + ENNReal.ofReal (Real.exp (-(den / num))))
theorem SLang.laplace_normalizer_swap (num : ℕ+) (den : ℕ+) :
(1 - Real.exp (-(den / num))) * (1 + Real.exp (-(den / num)))⁻¹ = (Real.exp (den / num) - 1) * (Real.exp (den / num) + 1)⁻¹
@[simp]
theorem SLang.DiscreteLaplaceSample_apply (num : ℕ+) (den : ℕ+) (x : ) :
SLang.DiscreteLaplaceSample num den x = ENNReal.ofReal ((Real.exp (1 / (num / den)) - 1) / (Real.exp (1 / (num / den)) + 1) * Real.exp (-(|x| / (num / den))))

Closed form for the evaluation of the SLang Laplace sampler.

@[simp]
theorem SLang.DiscreteLaplaceSample_normalizes (num : ℕ+) (den : ℕ+) :
∑' (x : ), SLang.DiscreteLaplaceSample num den x = 1

SLang Laplace sampler is a proper distribution.