Pr add split by complement
Pr_add_split_by_complement
Plain-language statement
Law of Total Probability (Partitioning an Event) The probability of an event f r occurring can be calculated by summing the probabilities of two disjoint cases: 1. f r occurs AND g r occurs. 2. f r occurs AND g r does NOT occur. Good to be used with Pr_multi_let_equiv_single_let
Exact Lean statement
theorem Pr_add_split_by_complement {α : Type} (D : PMF α)
(f g : α → Prop) :
Pr_{ let r ← D }[ f r ] =
(D >>= (fun r => pure (g r ∧ f r))) True + Pr_{ let r ← D }[ ¬(g r) ∧ f r ]Formal artifact
Lean source
theorem Pr_add_split_by_complement {α : Type} (D : PMF α) (f g : α → Prop) : Pr_{ let r ← D }[ f r ] = (D >>= (fun r => pure (g r ∧ f r))) True + Pr_{ let r ← D }[ ¬(g r) ∧ f r ] := by classical -- 1. Unroll all three probability statements into their tsum forms rw [prob_tsum_form_singleton D f] rw [prob_tsum_form_singleton D (fun r => g r ∧ f r)] rw [prob_tsum_form_singleton D (fun r => ¬(g r) ∧ f r)] -- 2. Combine the two sums on the RHS using ENNReal.tsum_add -- Need to prove summability for both, which is true in ENNReal rw [← ENNReal.tsum_add] congr 1 funext r rw [←mul_add] congr 1 by_cases hg : g r · simp only [hg, true_and, not_true_eq_false, false_and, ↓reduceIte, add_zero] · simp only [hg, false_and, ↓reduceIte, not_false_eq_true, true_and, zero_add]- Project
- ArkLib
- License
- Apache-2.0
- Commit
- fad5cbf80877
- Source
- ArkLib/Data/Probability/Instances.lean:394-412
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
Affine gaps lifted to interleaved codes
affine_gaps_lifted_to_interleaved_codes
Project documentation
This lemma proves the final algebraic step in the DG25 Theorem 3.1 proof. It shows that if R > e + 1, then e * (R / (R - 1)) < e + 1. The intuition is that the fraction R / (R - 1) is always greater than 1, but as R gets larger, it gets closer to 1. The hypothesis R > e + 1 provides a strong enough bound to ensure the product e * (fraction) do...
Source project: ArkLib
Person-level attribution pending.
Gadget Decompose coeff
ArkLib.Lattices.Ajtai.gadgetDecompose_coeff
Plain-language statement
The k-th coefficient (k < deg φ) of a gadget-decomposition block is exactly the corresponding digit of the corresponding input coefficient.
Source project: ArkLib
Person-level attribution pending.
Gadget Decompose lawful
ArkLib.Lattices.Ajtai.gadgetDecompose_lawful
Plain-language statement
The base-b gadget decomposition is a lawful gadget decomposition.
Source project: ArkLib
Person-level attribution pending.