probability.cond_count
⟷
Mathlib.Probability.CondCount
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -147,10 +147,10 @@ theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) :
theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
by
have hsf := finite_of_cond_count_ne_zero (by rw [h]; exact one_ne_zero)
- rw [cond_count, cond_apply _ hsf.measurable_set, mul_comm] at h
+ rw [cond_count, cond_apply _ hsf.measurable_set, mul_comm] at h
replace h := ENNReal.eq_inv_of_mul_eq_one_left h
rw [inv_inv, measure.count_apply_finite _ hsf, measure.count_apply_finite _ (hsf.inter_of_left _),
- Nat.cast_inj] at h
+ Nat.cast_inj] at h
suffices s ∩ t = s by exact this ▸ fun x hx => hx.2
rw [← @Set.Finite.toFinset_inj _ _ _ (hsf.inter_of_left _) hsf]
exact Finset.eq_of_subset_of_card_le (Set.Finite.toFinset_mono <| s.inter_subset_left t) h.ge
@@ -182,7 +182,7 @@ theorem condCount_inter (hs : s.Finite) :
cond_apply _ (hs.inter_of_left _).MeasurableSet, mul_comm _ (measure.count (s ∩ t)), ←
mul_assoc, mul_comm _ (measure.count (s ∩ t)), ← mul_assoc, ENNReal.mul_inv_cancel, one_mul,
mul_comm, Set.inter_assoc]
- · rwa [← measure.count_eq_zero_iff] at hst
+ · rwa [← measure.count_eq_zero_iff] at hst
· exact (measure.count_apply_lt_top.2 <| hs.inter_of_left _).Ne
#align probability_theory.cond_count_inter ProbabilityTheory.condCount_inter
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ Copyright (c) 2022 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying, Bhavik Mehta
-/
-import Mathbin.Probability.ConditionalProbability
+import Probability.ConditionalProbability
#align_import probability.cond_count from "leanprover-community/mathlib"@"bd15ff41b70f5e2cc210f26f25a8d5c53b20d3de"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,14 +2,11 @@
Copyright (c) 2022 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying, Bhavik Mehta
-
-! This file was ported from Lean 3 source module probability.cond_count
-! leanprover-community/mathlib commit bd15ff41b70f5e2cc210f26f25a8d5c53b20d3de
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Probability.ConditionalProbability
+#align_import probability.cond_count from "leanprover-community/mathlib"@"bd15ff41b70f5e2cc210f26f25a8d5c53b20d3de"
+
/-!
# Classical probability
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -68,15 +68,20 @@ theorem condCount_empty_meas : (condCount ∅ : Measure Ω) = 0 := by simp [cond
#align probability_theory.cond_count_empty_meas ProbabilityTheory.condCount_empty_meas
-/
+#print ProbabilityTheory.condCount_empty /-
theorem condCount_empty {s : Set Ω} : condCount s ∅ = 0 := by simp
#align probability_theory.cond_count_empty ProbabilityTheory.condCount_empty
+-/
+#print ProbabilityTheory.finite_of_condCount_ne_zero /-
theorem finite_of_condCount_ne_zero {s t : Set Ω} (h : condCount s t ≠ 0) : s.Finite :=
by
by_contra hs'
simpa [cond_count, cond, measure.count_apply_infinite hs'] using h
#align probability_theory.finite_of_cond_count_ne_zero ProbabilityTheory.finite_of_condCount_ne_zero
+-/
+#print ProbabilityTheory.condCount_univ /-
theorem condCount_univ [Fintype Ω] {s : Set Ω} :
condCount Set.univ s = Measure.count s / Fintype.card Ω :=
by
@@ -86,6 +91,7 @@ theorem condCount_univ [Fintype Ω] {s : Set Ω} :
· simp [Finset.card_univ]
· exact (@Finset.coe_univ Ω _).symm ▸ MeasurableSet.univ
#align probability_theory.cond_count_univ ProbabilityTheory.condCount_univ
+-/
variable [MeasurableSingletonClass Ω]
@@ -101,6 +107,7 @@ theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Non
#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_isProbabilityMeasure
-/
+#print ProbabilityTheory.condCount_singleton /-
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
condCount {ω} t = if ω ∈ t then 1 else 0 :=
by
@@ -110,6 +117,7 @@ theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
· rw [(by simpa : ({ω} : Set Ω) ∩ t = {ω}), measure.count_singleton]
· rw [(by simpa : ({ω} : Set Ω) ∩ t = ∅), measure.count_empty]
#align probability_theory.cond_count_singleton ProbabilityTheory.condCount_singleton
+-/
variable {s t u : Set Ω}
@@ -152,10 +160,12 @@ theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
#align probability_theory.pred_true_of_cond_count_eq_one ProbabilityTheory.pred_true_of_condCount_eq_one
-/
+#print ProbabilityTheory.condCount_eq_zero_iff /-
theorem condCount_eq_zero_iff (hs : s.Finite) : condCount s t = 0 ↔ s ∩ t = ∅ := by
simp [cond_count, cond_apply _ hs.measurable_set, measure.count_apply_eq_top,
Set.not_infinite.2 hs, measure.count_apply_finite _ (hs.inter_of_left _)]
#align probability_theory.cond_count_eq_zero_iff ProbabilityTheory.condCount_eq_zero_iff
+-/
#print ProbabilityTheory.condCount_of_univ /-
theorem condCount_of_univ (hs : s.Finite) (hs' : s.Nonempty) : condCount s Set.univ = 1 :=
@@ -189,6 +199,7 @@ theorem condCount_inter' (hs : s.Finite) :
#align probability_theory.cond_count_inter' ProbabilityTheory.condCount_inter'
-/
+#print ProbabilityTheory.condCount_union /-
theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
condCount s (t ∪ u) = condCount s t + condCount s u :=
by
@@ -196,13 +207,17 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
cond_apply _ hs.measurable_set, Set.inter_union_distrib_left, measure_union, mul_add]
exacts [htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).MeasurableSet]
#align probability_theory.cond_count_union ProbabilityTheory.condCount_union
+-/
+#print ProbabilityTheory.condCount_compl /-
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
condCount s t + condCount s (tᶜ) = 1 := by
rw [← cond_count_union hs disjoint_compl_right, Set.union_compl_self,
(cond_count_is_probability_measure hs hs').measure_univ]
#align probability_theory.cond_count_compl ProbabilityTheory.condCount_compl
+-/
+#print ProbabilityTheory.condCount_disjoint_union /-
theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint s t) :
condCount s u * condCount (s ∪ t) s + condCount t u * condCount (s ∪ t) t =
condCount (s ∪ t) u :=
@@ -225,7 +240,9 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
measure.count_ne_zero ht', (measure.count_apply_lt_top.2 ht).Ne, measure.count_ne_zero hs',
(measure.count_apply_lt_top.2 hs).Ne]
#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_union
+-/
+#print ProbabilityTheory.condCount_add_compl_eq /-
/-- A version of the law of total probability for counting probabilites. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s (uᶜ) = condCount s t :=
@@ -236,6 +253,7 @@ theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
(disjoint_compl_right.mono inf_le_right inf_le_right)]
simp [cond_count_inter_self hs]
#align probability_theory.cond_count_add_compl_eq ProbabilityTheory.condCount_add_compl_eq
+-/
end ProbabilityTheory
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -89,16 +89,16 @@ theorem condCount_univ [Fintype Ω] {s : Set Ω} :
variable [MeasurableSingletonClass Ω]
-#print ProbabilityTheory.condCount_probabilityMeasure /-
-theorem condCount_probabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
- ProbabilityMeasure (condCount s) :=
+#print ProbabilityTheory.condCount_isProbabilityMeasure /-
+theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
+ IsProbabilityMeasure (condCount s) :=
{
measure_univ :=
by
rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_univ, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne }
-#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_probabilityMeasure
+#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_isProbabilityMeasure
-/
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -142,10 +142,10 @@ theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) :
theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
by
have hsf := finite_of_cond_count_ne_zero (by rw [h]; exact one_ne_zero)
- rw [cond_count, cond_apply _ hsf.measurable_set, mul_comm] at h
+ rw [cond_count, cond_apply _ hsf.measurable_set, mul_comm] at h
replace h := ENNReal.eq_inv_of_mul_eq_one_left h
rw [inv_inv, measure.count_apply_finite _ hsf, measure.count_apply_finite _ (hsf.inter_of_left _),
- Nat.cast_inj] at h
+ Nat.cast_inj] at h
suffices s ∩ t = s by exact this ▸ fun x hx => hx.2
rw [← @Set.Finite.toFinset_inj _ _ _ (hsf.inter_of_left _) hsf]
exact Finset.eq_of_subset_of_card_le (Set.Finite.toFinset_mono <| s.inter_subset_left t) h.ge
@@ -175,7 +175,7 @@ theorem condCount_inter (hs : s.Finite) :
cond_apply _ (hs.inter_of_left _).MeasurableSet, mul_comm _ (measure.count (s ∩ t)), ←
mul_assoc, mul_comm _ (measure.count (s ∩ t)), ← mul_assoc, ENNReal.mul_inv_cancel, one_mul,
mul_comm, Set.inter_assoc]
- · rwa [← measure.count_eq_zero_iff] at hst
+ · rwa [← measure.count_eq_zero_iff] at hst
· exact (measure.count_apply_lt_top.2 <| hs.inter_of_left _).Ne
#align probability_theory.cond_count_inter ProbabilityTheory.condCount_inter
-/
@@ -194,7 +194,7 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
by
rw [cond_count, cond_apply _ hs.measurable_set, cond_apply _ hs.measurable_set,
cond_apply _ hs.measurable_set, Set.inter_union_distrib_left, measure_union, mul_add]
- exacts[htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).MeasurableSet]
+ exacts [htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).MeasurableSet]
#align probability_theory.cond_count_union ProbabilityTheory.condCount_union
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
@@ -221,7 +221,7 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
mul_assoc]
rw [ENNReal.mul_inv_cancel, ENNReal.mul_inv_cancel, one_mul, one_mul, ← add_mul, ← measure_union,
Set.union_inter_distrib_right, mul_comm]
- exacts[hst.mono inf_le_left inf_le_left, (ht.inter_of_left _).MeasurableSet,
+ exacts [hst.mono inf_le_left inf_le_left, (ht.inter_of_left _).MeasurableSet,
measure.count_ne_zero ht', (measure.count_apply_lt_top.2 ht).Ne, measure.count_ne_zero hs',
(measure.count_apply_lt_top.2 hs).Ne]
#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_union
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -43,7 +43,7 @@ predicates.
noncomputable section
-open ProbabilityTheory
+open scoped ProbabilityTheory
open MeasureTheory MeasurableSpace
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -68,33 +68,15 @@ theorem condCount_empty_meas : (condCount ∅ : Measure Ω) = 0 := by simp [cond
#align probability_theory.cond_count_empty_meas ProbabilityTheory.condCount_empty_meas
-/
-/- warning: probability_theory.cond_count_empty -> ProbabilityTheory.condCount_empty is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.hasEmptyc.{u1} Ω))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.instEmptyCollectionSet.{u1} Ω))) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_empty ProbabilityTheory.condCount_emptyₓ'. -/
theorem condCount_empty {s : Set Ω} : condCount s ∅ = 0 := by simp
#align probability_theory.cond_count_empty ProbabilityTheory.condCount_empty
-/- warning: probability_theory.finite_of_cond_count_ne_zero -> ProbabilityTheory.finite_of_condCount_ne_zero is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Ne.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) -> (Set.Finite.{u1} Ω s)
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Ne.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) -> (Set.Finite.{u1} Ω s)
-Case conversion may be inaccurate. Consider using '#align probability_theory.finite_of_cond_count_ne_zero ProbabilityTheory.finite_of_condCount_ne_zeroₓ'. -/
theorem finite_of_condCount_ne_zero {s t : Set Ω} (h : condCount s t ≠ 0) : s.Finite :=
by
by_contra hs'
simpa [cond_count, cond, measure.count_apply_infinite hs'] using h
#align probability_theory.finite_of_cond_count_ne_zero ProbabilityTheory.finite_of_condCount_ne_zero
-/- warning: probability_theory.cond_count_univ -> ProbabilityTheory.condCount_univ is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : Fintype.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Set.univ.{u1} Ω)) s) (HDiv.hDiv.{0, 0, 0} ENNReal ENNReal ENNReal (instHDiv.{0} ENNReal (DivInvMonoid.toHasDiv.{0} ENNReal ENNReal.divInvMonoid)) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (MeasureTheory.Measure.count.{u1} Ω _inst_1) s) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat ENNReal (HasLiftT.mk.{1, 1} Nat ENNReal (CoeTCₓ.coe.{1, 1} Nat ENNReal (Nat.castCoe.{0} ENNReal (AddMonoidWithOne.toNatCast.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne))))) (Fintype.card.{u1} Ω _inst_2)))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : Fintype.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Set.univ.{u1} Ω))) s) (HDiv.hDiv.{0, 0, 0} ENNReal ENNReal ENNReal (instHDiv.{0} ENNReal (DivInvMonoid.toDiv.{0} ENNReal ENNReal.instDivInvMonoidENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (MeasureTheory.Measure.count.{u1} Ω _inst_1)) s) (Nat.cast.{0} ENNReal (CanonicallyOrderedCommSemiring.toNatCast.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal) (Fintype.card.{u1} Ω _inst_2)))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_univ ProbabilityTheory.condCount_univₓ'. -/
theorem condCount_univ [Fintype Ω] {s : Set Ω} :
condCount Set.univ s = Measure.count s / Fintype.card Ω :=
by
@@ -119,12 +101,6 @@ theorem condCount_probabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonem
#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_probabilityMeasure
-/
-/- warning: probability_theory.cond_count_singleton -> ProbabilityTheory.condCount_singleton is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] (ω : Ω) (t : Set.{u1} Ω) [_inst_3 : Decidable (Membership.Mem.{u1, u1} Ω (Set.{u1} Ω) (Set.hasMem.{u1} Ω) ω t)], Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Singleton.singleton.{u1, u1} Ω (Set.{u1} Ω) (Set.hasSingleton.{u1} Ω) ω)) t) (ite.{1} ENNReal (Membership.Mem.{u1, u1} Ω (Set.{u1} Ω) (Set.hasMem.{u1} Ω) ω t) _inst_3 (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne))))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] (ω : Ω) (t : Set.{u1} Ω) [_inst_3 : Decidable (Membership.mem.{u1, u1} Ω (Set.{u1} Ω) (Set.instMembershipSet.{u1} Ω) ω t)], Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Singleton.singleton.{u1, u1} Ω (Set.{u1} Ω) (Set.instSingletonSet.{u1} Ω) ω))) t) (ite.{1} ENNReal (Membership.mem.{u1, u1} Ω (Set.{u1} Ω) (Set.instMembershipSet.{u1} Ω) ω t) _inst_3 (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal))) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero)))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_singleton ProbabilityTheory.condCount_singletonₓ'. -/
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
condCount {ω} t = if ω ∈ t then 1 else 0 :=
by
@@ -176,12 +152,6 @@ theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
#align probability_theory.pred_true_of_cond_count_eq_one ProbabilityTheory.pred_true_of_condCount_eq_one
-/
-/- warning: probability_theory.cond_count_eq_zero_iff -> ProbabilityTheory.condCount_eq_zero_iff is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Eq.{succ u1} (Set.{u1} Ω) (Inter.inter.{u1} (Set.{u1} Ω) (Set.hasInter.{u1} Ω) s t) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.hasEmptyc.{u1} Ω))))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Iff (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) (Eq.{succ u1} (Set.{u1} Ω) (Inter.inter.{u1} (Set.{u1} Ω) (Set.instInterSet.{u1} Ω) s t) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.instEmptyCollectionSet.{u1} Ω))))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_eq_zero_iff ProbabilityTheory.condCount_eq_zero_iffₓ'. -/
theorem condCount_eq_zero_iff (hs : s.Finite) : condCount s t = 0 ↔ s ∩ t = ∅ := by
simp [cond_count, cond_apply _ hs.measurable_set, measure.count_apply_eq_top,
Set.not_infinite.2 hs, measure.count_apply_finite _ (hs.inter_of_left _)]
@@ -219,12 +189,6 @@ theorem condCount_inter' (hs : s.Finite) :
#align probability_theory.cond_count_inter' ProbabilityTheory.condCount_inter'
-/
-/- warning: probability_theory.cond_count_union -> ProbabilityTheory.condCount_union is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Disjoint.{u1} (Set.{u1} Ω) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.completeBooleanAlgebra.{u1} Ω)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} Ω) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω))) t u) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) t u)) (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) u)))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Disjoint.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} Ω) (Preorder.toLE.{u1} (Set.{u1} Ω) (PartialOrder.toPreorder.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) t u) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) t u)) (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) u)))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_union ProbabilityTheory.condCount_unionₓ'. -/
theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
condCount s (t ∪ u) = condCount s t + condCount s u :=
by
@@ -233,24 +197,12 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
exacts[htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).MeasurableSet]
#align probability_theory.cond_count_union ProbabilityTheory.condCount_union
-/- warning: probability_theory.cond_count_compl -> ProbabilityTheory.condCount_compl is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Set.Nonempty.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω)) t))) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne))))))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Set.Nonempty.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.instBooleanAlgebraSet.{u1} Ω)) t))) (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal))))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_compl ProbabilityTheory.condCount_complₓ'. -/
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
condCount s t + condCount s (tᶜ) = 1 := by
rw [← cond_count_union hs disjoint_compl_right, Set.union_compl_self,
(cond_count_is_probability_measure hs hs').measure_univ]
#align probability_theory.cond_count_compl ProbabilityTheory.condCount_compl
-/- warning: probability_theory.cond_count_disjoint_union -> ProbabilityTheory.condCount_disjoint_union is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Set.Finite.{u1} Ω t) -> (Disjoint.{u1} (Set.{u1} Ω) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.completeBooleanAlgebra.{u1} Ω)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} Ω) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω))) s t) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) u) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) s t)) s)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 t) u) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) s t)) t))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) s t)) u))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Set.Finite.{u1} Ω t) -> (Disjoint.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} Ω) (Preorder.toLE.{u1} (Set.{u1} Ω) (PartialOrder.toPreorder.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) s t) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) u) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) s t))) s)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 t)) u) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) s t))) t))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) s t))) u))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_unionₓ'. -/
theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint s t) :
condCount s u * condCount (s ∪ t) s + condCount t u * condCount (s ∪ t) t =
condCount (s ∪ t) u :=
@@ -274,12 +226,6 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
(measure.count_apply_lt_top.2 hs).Ne]
#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_union
-/- warning: probability_theory.cond_count_add_compl_eq -> ProbabilityTheory.condCount_add_compl_eq is a dubious translation:
-lean 3 declaration is
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (u : Set.{u1} Ω) (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.hasInter.{u1} Ω) s u)) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) u)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.hasInter.{u1} Ω) s (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω)) u))) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω)) u)))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t))
-but is expected to have type
- forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (u : Set.{u1} Ω) (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.instInterSet.{u1} Ω) s u))) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) u)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.instInterSet.{u1} Ω) s (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.instBooleanAlgebraSet.{u1} Ω)) u)))) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.instBooleanAlgebraSet.{u1} Ω)) u)))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t))
-Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_add_compl_eq ProbabilityTheory.condCount_add_compl_eqₓ'. -/
/-- A version of the law of total probability for counting probabilites. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s (uᶜ) = condCount s t :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -165,11 +165,7 @@ theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) :
#print ProbabilityTheory.pred_true_of_condCount_eq_one /-
theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
by
- have hsf :=
- finite_of_cond_count_ne_zero
- (by
- rw [h]
- exact one_ne_zero)
+ have hsf := finite_of_cond_count_ne_zero (by rw [h]; exact one_ne_zero)
rw [cond_count, cond_apply _ hsf.measurable_set, mul_comm] at h
replace h := ENNReal.eq_inv_of_mul_eq_one_left h
rw [inv_inv, measure.count_apply_finite _ hsf, measure.count_apply_finite _ (hsf.inter_of_left _),
mathlib commit https://github.com/leanprover-community/mathlib/commit/403190b5419b3f03f1a2893ad9352ca7f7d8bff6
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying, Bhavik Mehta
! This file was ported from Lean 3 source module probability.cond_count
-! leanprover-community/mathlib commit 117e93f82b5f959f8193857370109935291f0cc4
+! leanprover-community/mathlib commit bd15ff41b70f5e2cc210f26f25a8d5c53b20d3de
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -13,6 +13,9 @@ import Mathbin.Probability.ConditionalProbability
/-!
# Classical probability
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
The classical formulation of probability states that the probability of an event occurring in a
finite probability space is the ratio of that event to all possible events.
This notion can be expressed with measure theory using
mathlib commit https://github.com/leanprover-community/mathlib/commit/28b2a92f2996d28e580450863c130955de0ed398
@@ -48,6 +48,7 @@ namespace ProbabilityTheory
variable {Ω : Type _} [MeasurableSpace Ω]
+#print ProbabilityTheory.condCount /-
/-- Given a set `s`, `cond_count s` is the counting measure conditioned on `s`. In particular,
`cond_count s t` is the proportion of `s` that is contained in `t`.
@@ -56,20 +57,41 @@ This is a probability measure when `s` is finite and nonempty and is given by
def condCount (s : Set Ω) : Measure Ω :=
Measure.count[|s]
#align probability_theory.cond_count ProbabilityTheory.condCount
+-/
+#print ProbabilityTheory.condCount_empty_meas /-
@[simp]
theorem condCount_empty_meas : (condCount ∅ : Measure Ω) = 0 := by simp [cond_count]
#align probability_theory.cond_count_empty_meas ProbabilityTheory.condCount_empty_meas
+-/
+/- warning: probability_theory.cond_count_empty -> ProbabilityTheory.condCount_empty is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.hasEmptyc.{u1} Ω))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.instEmptyCollectionSet.{u1} Ω))) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_empty ProbabilityTheory.condCount_emptyₓ'. -/
theorem condCount_empty {s : Set Ω} : condCount s ∅ = 0 := by simp
#align probability_theory.cond_count_empty ProbabilityTheory.condCount_empty
+/- warning: probability_theory.finite_of_cond_count_ne_zero -> ProbabilityTheory.finite_of_condCount_ne_zero is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Ne.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) -> (Set.Finite.{u1} Ω s)
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Ne.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) -> (Set.Finite.{u1} Ω s)
+Case conversion may be inaccurate. Consider using '#align probability_theory.finite_of_cond_count_ne_zero ProbabilityTheory.finite_of_condCount_ne_zeroₓ'. -/
theorem finite_of_condCount_ne_zero {s t : Set Ω} (h : condCount s t ≠ 0) : s.Finite :=
by
by_contra hs'
simpa [cond_count, cond, measure.count_apply_infinite hs'] using h
#align probability_theory.finite_of_cond_count_ne_zero ProbabilityTheory.finite_of_condCount_ne_zero
+/- warning: probability_theory.cond_count_univ -> ProbabilityTheory.condCount_univ is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : Fintype.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Set.univ.{u1} Ω)) s) (HDiv.hDiv.{0, 0, 0} ENNReal ENNReal ENNReal (instHDiv.{0} ENNReal (DivInvMonoid.toHasDiv.{0} ENNReal ENNReal.divInvMonoid)) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (MeasureTheory.Measure.count.{u1} Ω _inst_1) s) ((fun (a : Type) (b : Type) [self : HasLiftT.{1, 1} a b] => self.0) Nat ENNReal (HasLiftT.mk.{1, 1} Nat ENNReal (CoeTCₓ.coe.{1, 1} Nat ENNReal (Nat.castCoe.{0} ENNReal (AddMonoidWithOne.toNatCast.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne))))) (Fintype.card.{u1} Ω _inst_2)))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : Fintype.{u1} Ω] {s : Set.{u1} Ω}, Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Set.univ.{u1} Ω))) s) (HDiv.hDiv.{0, 0, 0} ENNReal ENNReal ENNReal (instHDiv.{0} ENNReal (DivInvMonoid.toDiv.{0} ENNReal ENNReal.instDivInvMonoidENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (MeasureTheory.Measure.count.{u1} Ω _inst_1)) s) (Nat.cast.{0} ENNReal (CanonicallyOrderedCommSemiring.toNatCast.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal) (Fintype.card.{u1} Ω _inst_2)))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_univ ProbabilityTheory.condCount_univₓ'. -/
theorem condCount_univ [Fintype Ω] {s : Set Ω} :
condCount Set.univ s = Measure.count s / Fintype.card Ω :=
by
@@ -82,6 +104,7 @@ theorem condCount_univ [Fintype Ω] {s : Set Ω} :
variable [MeasurableSingletonClass Ω]
+#print ProbabilityTheory.condCount_probabilityMeasure /-
theorem condCount_probabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
ProbabilityMeasure (condCount s) :=
{
@@ -91,7 +114,14 @@ theorem condCount_probabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonem
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne }
#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_probabilityMeasure
+-/
+/- warning: probability_theory.cond_count_singleton -> ProbabilityTheory.condCount_singleton is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] (ω : Ω) (t : Set.{u1} Ω) [_inst_3 : Decidable (Membership.Mem.{u1, u1} Ω (Set.{u1} Ω) (Set.hasMem.{u1} Ω) ω t)], Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Singleton.singleton.{u1, u1} Ω (Set.{u1} Ω) (Set.hasSingleton.{u1} Ω) ω)) t) (ite.{1} ENNReal (Membership.Mem.{u1, u1} Ω (Set.{u1} Ω) (Set.hasMem.{u1} Ω) ω t) _inst_3 (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne))))) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero))))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] (ω : Ω) (t : Set.{u1} Ω) [_inst_3 : Decidable (Membership.mem.{u1, u1} Ω (Set.{u1} Ω) (Set.instMembershipSet.{u1} Ω) ω t)], Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Singleton.singleton.{u1, u1} Ω (Set.{u1} Ω) (Set.instSingletonSet.{u1} Ω) ω))) t) (ite.{1} ENNReal (Membership.mem.{u1, u1} Ω (Set.{u1} Ω) (Set.instMembershipSet.{u1} Ω) ω t) _inst_3 (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal))) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero)))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_singleton ProbabilityTheory.condCount_singletonₓ'. -/
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
condCount {ω} t = if ω ∈ t then 1 else 0 :=
by
@@ -104,17 +134,22 @@ theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
variable {s t u : Set Ω}
+#print ProbabilityTheory.condCount_inter_self /-
theorem condCount_inter_self (hs : s.Finite) : condCount s (s ∩ t) = condCount s t := by
rw [cond_count, cond_inter_self _ hs.measurable_set]
#align probability_theory.cond_count_inter_self ProbabilityTheory.condCount_inter_self
+-/
+#print ProbabilityTheory.condCount_self /-
theorem condCount_self (hs : s.Finite) (hs' : s.Nonempty) : condCount s s = 1 :=
by
rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_self, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne
#align probability_theory.cond_count_self ProbabilityTheory.condCount_self
+-/
+#print ProbabilityTheory.condCount_eq_one_of /-
theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) : condCount s t = 1 :=
by
haveI := cond_count_is_probability_measure hs hs'
@@ -122,7 +157,9 @@ theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) :
rw [not_lt, ← cond_count_self hs hs']
exact measure_mono ht
#align probability_theory.cond_count_eq_one_of ProbabilityTheory.condCount_eq_one_of
+-/
+#print ProbabilityTheory.pred_true_of_condCount_eq_one /-
theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
by
have hsf :=
@@ -138,16 +175,26 @@ theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
rw [← @Set.Finite.toFinset_inj _ _ _ (hsf.inter_of_left _) hsf]
exact Finset.eq_of_subset_of_card_le (Set.Finite.toFinset_mono <| s.inter_subset_left t) h.ge
#align probability_theory.pred_true_of_cond_count_eq_one ProbabilityTheory.pred_true_of_condCount_eq_one
+-/
+/- warning: probability_theory.cond_count_eq_zero_iff -> ProbabilityTheory.condCount_eq_zero_iff is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Iff (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (OfNat.ofNat.{0} ENNReal 0 (OfNat.mk.{0} ENNReal 0 (Zero.zero.{0} ENNReal ENNReal.hasZero)))) (Eq.{succ u1} (Set.{u1} Ω) (Inter.inter.{u1} (Set.{u1} Ω) (Set.hasInter.{u1} Ω) s t) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.hasEmptyc.{u1} Ω))))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Iff (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (OfNat.ofNat.{0} ENNReal 0 (Zero.toOfNat0.{0} ENNReal instENNRealZero))) (Eq.{succ u1} (Set.{u1} Ω) (Inter.inter.{u1} (Set.{u1} Ω) (Set.instInterSet.{u1} Ω) s t) (EmptyCollection.emptyCollection.{u1} (Set.{u1} Ω) (Set.instEmptyCollectionSet.{u1} Ω))))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_eq_zero_iff ProbabilityTheory.condCount_eq_zero_iffₓ'. -/
theorem condCount_eq_zero_iff (hs : s.Finite) : condCount s t = 0 ↔ s ∩ t = ∅ := by
simp [cond_count, cond_apply _ hs.measurable_set, measure.count_apply_eq_top,
Set.not_infinite.2 hs, measure.count_apply_finite _ (hs.inter_of_left _)]
#align probability_theory.cond_count_eq_zero_iff ProbabilityTheory.condCount_eq_zero_iff
+#print ProbabilityTheory.condCount_of_univ /-
theorem condCount_of_univ (hs : s.Finite) (hs' : s.Nonempty) : condCount s Set.univ = 1 :=
condCount_eq_one_of hs hs' s.subset_univ
#align probability_theory.cond_count_of_univ ProbabilityTheory.condCount_of_univ
+-/
+#print ProbabilityTheory.condCount_inter /-
theorem condCount_inter (hs : s.Finite) :
condCount s (t ∩ u) = condCount (s ∩ t) u * condCount s t :=
by
@@ -162,14 +209,23 @@ theorem condCount_inter (hs : s.Finite) :
· rwa [← measure.count_eq_zero_iff] at hst
· exact (measure.count_apply_lt_top.2 <| hs.inter_of_left _).Ne
#align probability_theory.cond_count_inter ProbabilityTheory.condCount_inter
+-/
+#print ProbabilityTheory.condCount_inter' /-
theorem condCount_inter' (hs : s.Finite) :
condCount s (t ∩ u) = condCount (s ∩ u) t * condCount s u :=
by
rw [← Set.inter_comm]
exact cond_count_inter hs
#align probability_theory.cond_count_inter' ProbabilityTheory.condCount_inter'
+-/
+/- warning: probability_theory.cond_count_union -> ProbabilityTheory.condCount_union is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Disjoint.{u1} (Set.{u1} Ω) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.completeBooleanAlgebra.{u1} Ω)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} Ω) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω))) t u) -> (Eq.{1} ENNReal (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) t u)) (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) u)))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Disjoint.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} Ω) (Preorder.toLE.{u1} (Set.{u1} Ω) (PartialOrder.toPreorder.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) t u) -> (Eq.{1} ENNReal (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) t u)) (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) u)))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_union ProbabilityTheory.condCount_unionₓ'. -/
theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
condCount s (t ∪ u) = condCount s t + condCount s u :=
by
@@ -178,12 +234,24 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
exacts[htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).MeasurableSet]
#align probability_theory.cond_count_union ProbabilityTheory.condCount_union
+/- warning: probability_theory.cond_count_compl -> ProbabilityTheory.condCount_compl is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Set.Nonempty.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω)) t))) (OfNat.ofNat.{0} ENNReal 1 (OfNat.mk.{0} ENNReal 1 (One.one.{0} ENNReal (AddMonoidWithOne.toOne.{0} ENNReal (AddCommMonoidWithOne.toAddMonoidWithOne.{0} ENNReal ENNReal.addCommMonoidWithOne))))))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Set.Nonempty.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.instBooleanAlgebraSet.{u1} Ω)) t))) (OfNat.ofNat.{0} ENNReal 1 (One.toOfNat1.{0} ENNReal (CanonicallyOrderedCommSemiring.toOne.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal))))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_compl ProbabilityTheory.condCount_complₓ'. -/
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
condCount s t + condCount s (tᶜ) = 1 := by
rw [← cond_count_union hs disjoint_compl_right, Set.union_compl_self,
(cond_count_is_probability_measure hs hs').measure_univ]
#align probability_theory.cond_count_compl ProbabilityTheory.condCount_compl
+/- warning: probability_theory.cond_count_disjoint_union -> ProbabilityTheory.condCount_disjoint_union is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Set.Finite.{u1} Ω t) -> (Disjoint.{u1} (Set.{u1} Ω) (CompleteSemilatticeInf.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.toCompleteSemilatticeInf.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.completeBooleanAlgebra.{u1} Ω)))))) (GeneralizedBooleanAlgebra.toOrderBot.{u1} (Set.{u1} Ω) (BooleanAlgebra.toGeneralizedBooleanAlgebra.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω))) s t) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) u) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) s t)) s)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 t) u) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) s t)) t))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.hasUnion.{u1} Ω) s t)) u))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} {t : Set.{u1} Ω} {u : Set.{u1} Ω}, (Set.Finite.{u1} Ω s) -> (Set.Finite.{u1} Ω t) -> (Disjoint.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) (BoundedOrder.toOrderBot.{u1} (Set.{u1} Ω) (Preorder.toLE.{u1} (Set.{u1} Ω) (PartialOrder.toPreorder.{u1} (Set.{u1} Ω) (OmegaCompletePartialOrder.toPartialOrder.{u1} (Set.{u1} Ω) (CompleteLattice.instOmegaCompletePartialOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))))) (CompleteLattice.toBoundedOrder.{u1} (Set.{u1} Ω) (Order.Coframe.toCompleteLattice.{u1} (Set.{u1} Ω) (CompleteDistribLattice.toCoframe.{u1} (Set.{u1} Ω) (CompleteBooleanAlgebra.toCompleteDistribLattice.{u1} (Set.{u1} Ω) (Set.instCompleteBooleanAlgebraSet.{u1} Ω)))))) s t) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) u) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) s t))) s)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 t)) u) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) s t))) t))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Union.union.{u1} (Set.{u1} Ω) (Set.instUnionSet.{u1} Ω) s t))) u))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_unionₓ'. -/
theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint s t) :
condCount s u * condCount (s ∪ t) s + condCount t u * condCount (s ∪ t) t =
condCount (s ∪ t) u :=
@@ -207,6 +275,12 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
(measure.count_apply_lt_top.2 hs).Ne]
#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_union
+/- warning: probability_theory.cond_count_add_compl_eq -> ProbabilityTheory.condCount_add_compl_eq is a dubious translation:
+lean 3 declaration is
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (u : Set.{u1} Ω) (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toHasAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.hasInter.{u1} Ω) s u)) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) u)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (Distrib.toHasMul.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.canonicallyOrderedCommSemiring)))))))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.hasInter.{u1} Ω) s (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω)) u))) t) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.booleanAlgebra.{u1} Ω)) u)))) (coeFn.{succ u1, succ u1} (MeasureTheory.Measure.{u1} Ω _inst_1) (fun (_x : MeasureTheory.Measure.{u1} Ω _inst_1) => (Set.{u1} Ω) -> ENNReal) (MeasureTheory.Measure.instCoeFun.{u1} Ω _inst_1) (ProbabilityTheory.condCount.{u1} Ω _inst_1 s) t))
+but is expected to have type
+ forall {Ω : Type.{u1}} [_inst_1 : MeasurableSpace.{u1} Ω] [_inst_2 : MeasurableSingletonClass.{u1} Ω _inst_1] {s : Set.{u1} Ω} (u : Set.{u1} Ω) (t : Set.{u1} Ω), (Set.Finite.{u1} Ω s) -> (Eq.{1} ENNReal (HAdd.hAdd.{0, 0, 0} ENNReal ENNReal ENNReal (instHAdd.{0} ENNReal (Distrib.toAdd.{0} ENNReal (NonUnitalNonAssocSemiring.toDistrib.{0} ENNReal (NonAssocSemiring.toNonUnitalNonAssocSemiring.{0} ENNReal (Semiring.toNonAssocSemiring.{0} ENNReal (OrderedSemiring.toSemiring.{0} ENNReal (OrderedCommSemiring.toOrderedSemiring.{0} ENNReal (CanonicallyOrderedCommSemiring.toOrderedCommSemiring.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)))))))) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.instInterSet.{u1} Ω) s u))) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) u)) (HMul.hMul.{0, 0, 0} ENNReal ENNReal ENNReal (instHMul.{0} ENNReal (CanonicallyOrderedCommSemiring.toMul.{0} ENNReal ENNReal.instCanonicallyOrderedCommSemiringENNReal)) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 (Inter.inter.{u1} (Set.{u1} Ω) (Set.instInterSet.{u1} Ω) s (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.instBooleanAlgebraSet.{u1} Ω)) u)))) t) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) (HasCompl.compl.{u1} (Set.{u1} Ω) (BooleanAlgebra.toHasCompl.{u1} (Set.{u1} Ω) (Set.instBooleanAlgebraSet.{u1} Ω)) u)))) (MeasureTheory.OuterMeasure.measureOf.{u1} Ω (MeasureTheory.Measure.toOuterMeasure.{u1} Ω _inst_1 (ProbabilityTheory.condCount.{u1} Ω _inst_1 s)) t))
+Case conversion may be inaccurate. Consider using '#align probability_theory.cond_count_add_compl_eq ProbabilityTheory.condCount_add_compl_eqₓ'. -/
/-- A version of the law of total probability for counting probabilites. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s (uᶜ) = condCount s t :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/d4437c68c8d350fc9d4e95e1e174409db35e30d7
@@ -82,15 +82,15 @@ theorem condCount_univ [Fintype Ω] {s : Set Ω} :
variable [MeasurableSingletonClass Ω]
-theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
- IsProbabilityMeasure (condCount s) :=
+theorem condCount_probabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
+ ProbabilityMeasure (condCount s) :=
{
measure_univ :=
by
rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_univ, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne }
-#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_isProbabilityMeasure
+#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_probabilityMeasure
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
condCount {ω} t = if ω ∈ t then 1 else 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/92c69b77c5a7dc0f7eeddb552508633305157caa
@@ -82,7 +82,7 @@ theorem condCount_univ [Fintype Ω] {s : Set Ω} :
variable [MeasurableSingletonClass Ω]
-theorem condCountIsProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
+theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
IsProbabilityMeasure (condCount s) :=
{
measure_univ :=
@@ -90,7 +90,7 @@ theorem condCountIsProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.None
rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_univ, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne }
-#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCountIsProbabilityMeasure
+#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_isProbabilityMeasure
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
condCount {ω} t = if ω ∈ t then 1 else 0 :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/3180fab693e2cee3bff62675571264cb8778b212
@@ -153,7 +153,7 @@ theorem condCount_inter (hs : s.Finite) :
by
by_cases hst : s ∩ t = ∅
·
- rw [hst, cond_count_empty_meas, measure.coe_zero, Pi.zero_apply, zero_mul,
+ rw [hst, cond_count_empty_meas, measure.coe_zero, Pi.zero_apply, MulZeroClass.zero_mul,
cond_count_eq_zero_iff hs, ← Set.inter_assoc, hst, Set.empty_inter]
rw [cond_count, cond_count, cond_apply _ hs.measurable_set, cond_apply _ hs.measurable_set,
cond_apply _ (hs.inter_of_left _).MeasurableSet, mul_comm _ (measure.count (s ∩ t)), ←
mathlib commit https://github.com/leanprover-community/mathlib/commit/eb0cb4511aaef0da2462207b67358a0e1fe1e2ee
@@ -73,9 +73,9 @@ theorem finite_of_condCount_ne_zero {s t : Set Ω} (h : condCount s t ≠ 0) : s
theorem condCount_univ [Fintype Ω] {s : Set Ω} :
condCount Set.univ s = Measure.count s / Fintype.card Ω :=
by
- rw [cond_count, cond_apply _ MeasurableSet.univ, ← Ennreal.div_eq_inv_mul, Set.univ_inter]
+ rw [cond_count, cond_apply _ MeasurableSet.univ, ← ENNReal.div_eq_inv_mul, Set.univ_inter]
congr
- rw [← Finset.coe_univ, measure.count_apply, finset.univ.tsum_subtype' fun _ => (1 : Ennreal)]
+ rw [← Finset.coe_univ, measure.count_apply, finset.univ.tsum_subtype' fun _ => (1 : ENNReal)]
· simp [Finset.card_univ]
· exact (@Finset.coe_univ Ω _).symm ▸ MeasurableSet.univ
#align probability_theory.cond_count_univ ProbabilityTheory.condCount_univ
@@ -87,7 +87,7 @@ theorem condCountIsProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.None
{
measure_univ :=
by
- rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_univ, Ennreal.inv_mul_cancel]
+ rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_univ, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne }
#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCountIsProbabilityMeasure
@@ -110,7 +110,7 @@ theorem condCount_inter_self (hs : s.Finite) : condCount s (s ∩ t) = condCount
theorem condCount_self (hs : s.Finite) (hs' : s.Nonempty) : condCount s s = 1 :=
by
- rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_self, Ennreal.inv_mul_cancel]
+ rw [cond_count, cond_apply _ hs.measurable_set, Set.inter_self, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| measure.empty_of_count_eq_zero h
· exact (measure.count_apply_lt_top.2 hs).Ne
#align probability_theory.cond_count_self ProbabilityTheory.condCount_self
@@ -131,7 +131,7 @@ theorem pred_true_of_condCount_eq_one (h : condCount s t = 1) : s ⊆ t :=
rw [h]
exact one_ne_zero)
rw [cond_count, cond_apply _ hsf.measurable_set, mul_comm] at h
- replace h := Ennreal.eq_inv_of_mul_eq_one_left h
+ replace h := ENNReal.eq_inv_of_mul_eq_one_left h
rw [inv_inv, measure.count_apply_finite _ hsf, measure.count_apply_finite _ (hsf.inter_of_left _),
Nat.cast_inj] at h
suffices s ∩ t = s by exact this ▸ fun x hx => hx.2
@@ -157,7 +157,7 @@ theorem condCount_inter (hs : s.Finite) :
cond_count_eq_zero_iff hs, ← Set.inter_assoc, hst, Set.empty_inter]
rw [cond_count, cond_count, cond_apply _ hs.measurable_set, cond_apply _ hs.measurable_set,
cond_apply _ (hs.inter_of_left _).MeasurableSet, mul_comm _ (measure.count (s ∩ t)), ←
- mul_assoc, mul_comm _ (measure.count (s ∩ t)), ← mul_assoc, Ennreal.mul_inv_cancel, one_mul,
+ mul_assoc, mul_comm _ (measure.count (s ∩ t)), ← mul_assoc, ENNReal.mul_inv_cancel, one_mul,
mul_comm, Set.inter_assoc]
· rwa [← measure.count_eq_zero_iff] at hst
· exact (measure.count_apply_lt_top.2 <| hs.inter_of_left _).Ne
@@ -200,7 +200,7 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
mul_comm (measure.count (s ∪ t))⁻¹, mul_comm (measure.count (s ∪ t))⁻¹, ← mul_assoc, ←
mul_assoc, mul_comm _ (measure.count s), mul_comm _ (measure.count t), ← mul_assoc, ←
mul_assoc]
- rw [Ennreal.mul_inv_cancel, Ennreal.mul_inv_cancel, one_mul, one_mul, ← add_mul, ← measure_union,
+ rw [ENNReal.mul_inv_cancel, ENNReal.mul_inv_cancel, one_mul, one_mul, ← add_mul, ← measure_union,
Set.union_inter_distrib_right, mul_comm]
exacts[hst.mono inf_le_left inf_le_left, (ht.inter_of_left _).MeasurableSet,
measure.count_ne_zero ht', (measure.count_apply_lt_top.2 ht).Ne, measure.count_ne_zero hs',
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
MulZeroClass.
in mul_zero
/zero_mul
(#6682)
Search&replace MulZeroClass.mul_zero
-> mul_zero
, MulZeroClass.zero_mul
-> zero_mul
.
These were introduced by Mathport, as the full name of mul_zero
is actually MulZeroClass.mul_zero
(it's exported with the short name).
@@ -138,7 +138,7 @@ theorem condCount_of_univ (hs : s.Finite) (hs' : s.Nonempty) : condCount s Set.u
theorem condCount_inter (hs : s.Finite) :
condCount s (t ∩ u) = condCount (s ∩ t) u * condCount s t := by
by_cases hst : s ∩ t = ∅
- · rw [hst, condCount_empty_meas, Measure.coe_zero, Pi.zero_apply, MulZeroClass.zero_mul,
+ · rw [hst, condCount_empty_meas, Measure.coe_zero, Pi.zero_apply, zero_mul,
condCount_eq_zero_iff hs, ← Set.inter_assoc, hst, Set.empty_inter]
rw [condCount, condCount, cond_apply _ hs.measurableSet, cond_apply _ hs.measurableSet,
cond_apply _ (hs.inter_of_left _).measurableSet, mul_comm _ (Measure.count (s ∩ t)),
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -44,7 +44,7 @@ open MeasureTheory MeasurableSpace
namespace ProbabilityTheory
-variable {Ω : Type _} [MeasurableSpace Ω]
+variable {Ω : Type*} [MeasurableSpace Ω]
/-- Given a set `s`, `condCount s` is the counting measure conditioned on `s`. In particular,
`condCount s t` is the proportion of `s` that is contained in `t`.
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying, Bhavik Mehta
-/
import Mathlib.Probability.ConditionalProbability
+import Mathlib.MeasureTheory.Measure.Count
#align_import probability.cond_count from "leanprover-community/mathlib"@"117e93f82b5f959f8193857370109935291f0cc4"
@@ -2,14 +2,11 @@
Copyright (c) 2022 Kexing Ying. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kexing Ying, Bhavik Mehta
-
-! This file was ported from Lean 3 source module probability.cond_count
-! leanprover-community/mathlib commit 117e93f82b5f959f8193857370109935291f0cc4
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Probability.ConditionalProbability
+#align_import probability.cond_count from "leanprover-community/mathlib"@"117e93f82b5f959f8193857370109935291f0cc4"
+
/-!
# Classical probability
@@ -164,7 +164,7 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
#align probability_theory.cond_count_union ProbabilityTheory.condCount_union
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
- condCount s t + condCount s (tᶜ) = 1 := by
+ condCount s t + condCount s tᶜ = 1 := by
rw [← condCount_union hs disjoint_compl_right, Set.union_compl_self,
(condCount_isProbabilityMeasure hs hs').measure_univ]
#align probability_theory.cond_count_compl ProbabilityTheory.condCount_compl
@@ -193,7 +193,7 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
/-- A version of the law of total probability for counting probabilities. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
- condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s (uᶜ) =
+ condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s uᶜ =
condCount s t := by
-- Porting note: The original proof used `conv_rhs`. However, that tactic timed out.
have : condCount s t = (condCount (s ∩ u) t * condCount (s ∩ u ∪ s ∩ uᶜ) (s ∩ u) +
@@ -17,7 +17,7 @@ The classical formulation of probability states that the probability of an event
finite probability space is the ratio of that event to all possible events.
This notion can be expressed with measure theory using
the counting measure. In particular, given the sets `s` and `t`, we define the probability of `t`
-occurring in `s` to be `|s|⁻¹ * |s ∩ t|`. With this definition, we recover the the probability over
+occurring in `s` to be `|s|⁻¹ * |s ∩ t|`. With this definition, we recover the probability over
the entire sample space when `s = Set.univ`.
Classical probability is often used in combinatorics and we prove some useful lemmas in this file
@@ -160,7 +160,7 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
condCount s (t ∪ u) = condCount s t + condCount s u := by
rw [condCount, cond_apply _ hs.measurableSet, cond_apply _ hs.measurableSet,
cond_apply _ hs.measurableSet, Set.inter_union_distrib_left, measure_union, mul_add]
- exacts[htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).measurableSet]
+ exacts [htu.mono inf_le_right inf_le_right, (hs.inter_of_left _).measurableSet]
#align probability_theory.cond_count_union ProbabilityTheory.condCount_union
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
@@ -186,7 +186,7 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
← mul_assoc]
rw [ENNReal.mul_inv_cancel, ENNReal.mul_inv_cancel, one_mul, one_mul, ← add_mul, ← measure_union,
Set.union_inter_distrib_right, mul_comm]
- exacts[hst.mono inf_le_left inf_le_left, (ht.inter_of_left _).measurableSet,
+ exacts [hst.mono inf_le_left inf_le_left, (ht.inter_of_left _).measurableSet,
Measure.count_ne_zero ht', (Measure.count_apply_lt_top.2 ht).ne, Measure.count_ne_zero hs',
(Measure.count_apply_lt_top.2 hs).ne]
#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_union
Is
of Foo
which is ported from is_foo
(#4639)
I have misported is_foo
to Foo
because I misunderstood the rule for IsLawfulFoo
.
This PR recover Is
of Foo
which is ported from is_foo
.
This PR also renames some misported theorems.
@@ -52,7 +52,7 @@ variable {Ω : Type _} [MeasurableSpace Ω]
`condCount s t` is the proportion of `s` that is contained in `t`.
This is a probability measure when `s` is finite and nonempty and is given by
-`ProbabilityTheory.condCount_probabilityMeasure`. -/
+`ProbabilityTheory.condCount_isProbabilityMeasure`. -/
def condCount (s : Set Ω) : Measure Ω :=
Measure.count[|s]
#align probability_theory.cond_count ProbabilityTheory.condCount
@@ -80,13 +80,13 @@ theorem condCount_univ [Fintype Ω] {s : Set Ω} :
variable [MeasurableSingletonClass Ω]
-theorem condCount_probabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
- ProbabilityMeasure (condCount s) :=
+theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
+ IsProbabilityMeasure (condCount s) :=
{ measure_univ := by
rw [condCount, cond_apply _ hs.measurableSet, Set.inter_univ, ENNReal.inv_mul_cancel]
· exact fun h => hs'.ne_empty <| Measure.empty_of_count_eq_zero h
· exact (Measure.count_apply_lt_top.2 hs).ne }
-#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_probabilityMeasure
+#align probability_theory.cond_count_is_probability_measure ProbabilityTheory.condCount_isProbabilityMeasure
theorem condCount_singleton (ω : Ω) (t : Set Ω) [Decidable (ω ∈ t)] :
condCount {ω} t = if ω ∈ t then 1 else 0 := by
@@ -111,7 +111,7 @@ theorem condCount_self (hs : s.Finite) (hs' : s.Nonempty) : condCount s s = 1 :=
theorem condCount_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) :
condCount s t = 1 := by
- haveI := condCount_probabilityMeasure hs hs'
+ haveI := condCount_isProbabilityMeasure hs hs'
refine' eq_of_le_of_not_lt prob_le_one _
rw [not_lt, ← condCount_self hs hs']
exact measure_mono ht
@@ -166,7 +166,7 @@ theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
theorem condCount_compl (t : Set Ω) (hs : s.Finite) (hs' : s.Nonempty) :
condCount s t + condCount s (tᶜ) = 1 := by
rw [← condCount_union hs disjoint_compl_right, Set.union_compl_self,
- (condCount_probabilityMeasure hs hs').measure_univ]
+ (condCount_isProbabilityMeasure hs hs').measure_univ]
#align probability_theory.cond_count_compl ProbabilityTheory.condCount_compl
theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint s t) :
@@ -17,7 +17,7 @@ The classical formulation of probability states that the probability of an event
finite probability space is the ratio of that event to all possible events.
This notion can be expressed with measure theory using
the counting measure. In particular, given the sets `s` and `t`, we define the probability of `t`
-occuring in `s` to be `|s|⁻¹ * |s ∩ t|`. With this definition, we recover the the probability over
+occurring in `s` to be `|s|⁻¹ * |s ∩ t|`. With this definition, we recover the the probability over
the entire sample space when `s = Set.univ`.
Classical probability is often used in combinatorics and we prove some useful lemmas in this file
@@ -191,7 +191,7 @@ theorem condCount_disjoint_union (hs : s.Finite) (ht : t.Finite) (hst : Disjoint
(Measure.count_apply_lt_top.2 hs).ne]
#align probability_theory.cond_count_disjoint_union ProbabilityTheory.condCount_disjoint_union
-/-- A version of the law of total probability for counting probabilites. -/
+/-- A version of the law of total probability for counting probabilities. -/
theorem condCount_add_compl_eq (u t : Set Ω) (hs : s.Finite) :
condCount (s ∩ u) t * condCount s u + condCount (s ∩ uᶜ) t * condCount s (uᶜ) =
condCount s t := by
The unported dependencies are
algebra.order.module
init.core
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
init.data.list.default
algebra.order.monoid.cancel.basic
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file