All proofs
Project-declaredLean 4.32.0 · mathlib@81a5d257

Tv Dist bind left le const

tvDist_bind_left_le_const

Plain-language statement

Total-variation distance is convex over a shared bind: if tvDist (f a) (g a) ≤ c for every a ∈ support mx, then tvDist (mx >>= f) (mx >>= g) ≤ c. The real-valued root of the const bound, with ℝ≥0∞ companion ofReal_tvDist_bind_left_le_const.

Exact Lean statement

theorem tvDist_bind_left_le_const
    {m : Type u → Type v} [Monad m] [LawfulMonad m] [MonadLiftT m PMF] [LawfulMonadLiftT m PMF]
    [MonadLiftT m SetM] [EvalDistCompatible m]
    {α β : Type u} (mx : m α) (f g : α → m β) (c : ℝ)
    (hfg : ∀ a, a ∈ support mx → tvDist (f a) (g a) ≤ c) :
    tvDist (mx >>= f) (mx >>= g) ≤ c

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem tvDist_bind_left_le_const    {m : Type u  Type v} [Monad m] [LawfulMonad m] [MonadLiftT m PMF] [LawfulMonadLiftT m PMF]    [MonadLiftT m SetM] [EvalDistCompatible m]    {α β : Type u} (mx : m α) (f g : α  m β) (c : )    (hfg :  a, a  support mx  tvDist (f a) (g a)  c) :    tvDist (mx >>= f) (mx >>= g)  c := by  classical  have hprob_ne_top :  a : α, Pr[= a | mx] := fun a =>    ne_top_of_le_ne_top one_ne_top (probOutput_le_one (mx := mx) (x := a))  have hp_sum_ne_top : (∑' a : α, Pr[= a | mx]) := by    rw [tsum_probOutput_of_liftM_PMF]; exact one_ne_top  have hp_summable : Summable (fun a : α => Pr[= a | mx].toReal) :=    ENNReal.summable_toReal hp_sum_ne_top  have hp_sum_toReal : (∑' a : α, Pr[= a | mx].toReal) = 1 := by    rw [ ENNReal.tsum_toReal_eq hprob_ne_top, tsum_probOutput_of_liftM_PMF, ENNReal.toReal_one]  have hlhs_nonneg :  a : α, 0  Pr[= a | mx].toReal * tvDist (f a) (g a) :=    fun _ => mul_nonneg ENNReal.toReal_nonneg (tvDist_nonneg _ _)  have hlhs_le_p :  a : α,      Pr[= a | mx].toReal * tvDist (f a) (g a)  Pr[= a | mx].toReal :=    fun _ => mul_le_of_le_one_right ENNReal.toReal_nonneg (tvDist_le_one _ _)  have hlhs_summable :      Summable (fun a : α => Pr[= a | mx].toReal * tvDist (f a) (g a)) :=    Summable.of_nonneg_of_le hlhs_nonneg hlhs_le_p hp_summable  have hrhs_summable : Summable (fun a : α => Pr[= a | mx].toReal * c) :=    Summable.mul_right _ hp_summable  refine (tvDist_bind_left_le mx f g).trans ?_  calc    (∑' a : α, Pr[= a | mx].toReal * tvDist (f a) (g a))         ∑' a : α, Pr[= a | mx].toReal * c :=          Summable.tsum_le_tsum            (fun a => by              by_cases ha : a  support mx              · exact mul_le_mul_of_nonneg_left (hfg a ha) ENNReal.toReal_nonneg              · rw [probOutput_eq_zero_of_not_mem_support ha]; simp)            hlhs_summable hrhs_summable    _ = (∑' a : α, Pr[= a | mx].toReal) * c := Summable.tsum_mul_right _ hp_summable    _ = c := by rw [hp_sum_toReal, one_mul]
Project
VCVio
License
Apache-2.0
Commit
2ceb2d825ee3
Source
VCVio/EvalDist/TVDist.lean:228-264

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.32.0

Expected Cost Nat eq sum tail probs of pathwise Cost At Most

AddWriterT.expectedCostNat_eq_sum_tail_probs_of_pathwiseCostAtMost

Plain-language statement

Finite tail-sum formula for natural-valued writer cost under a pathwise upper bound. If every execution path of oa incurs cost at most n, then the tail probabilities vanish above n, so the infinite tail sum truncates to Finset.range n.

program verificationseparation logiccryptography

Source project: VCVio

Person-level attribution pending.

View proof record
Project-declaredLean 4.32.0

IND CPA advantage to Real le sum step signed Advantage Real abs

AsymmEncAlg.IND_CPA_advantage_toReal_le_sum_step_signedAdvantageReal_abs

Plain-language statement

Planned generic one-time-to-many-time lift: bounded multi-query IND-CPA advantage is at most the sum of the extracted one-time signed advantages over the first q fresh LR queries.

program verificationseparation logiccryptography

Source project: VCVio

Person-level attribution pending.

View proof record