-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d16785
commit 4f39147
Showing
24 changed files
with
282 additions
and
421 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...Probability/Independence/Conditional.lean → PFR/ForMathlib/ConditionalIndependence.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Mathlib.Probability.ConditionalProbability | ||
import PFR.ForMathlib.FiniteRange.Defs | ||
|
||
open MeasureTheory Set | ||
|
||
namespace ProbabilityTheory | ||
variable {Ω α : Type*} {m : MeasurableSpace Ω} (μ : Measure Ω) | ||
[MeasurableSpace α] [MeasurableSingletonClass α] | ||
|
||
-- TODO: Replace `sum_meas_smul_cond_fiber` once `FiniteRange` is in Mathlib. | ||
/-- The **law of total probability** for a random variable taking finitely many values: a measure | ||
`μ` can be expressed as a linear combination of its conditional measures `μ[|X ← x]` on fibers of a | ||
random variable `X` valued in a fintype. -/ | ||
lemma sum_meas_smul_cond_fiber' {X : Ω → α} (hX : Measurable X) [finX : FiniteRange X] | ||
(μ : Measure Ω) [IsFiniteMeasure μ] : | ||
∑ x ∈ finX.toFinset, μ (X ⁻¹' {x}) • μ[|X ← x] = μ := by | ||
ext E hE | ||
calc | ||
_ = ∑ x ∈ finX.toFinset, μ (X ⁻¹' {x} ∩ E) := by | ||
simp only [Measure.coe_finset_sum, Measure.coe_smul, Finset.sum_apply, | ||
Pi.smul_apply, smul_eq_mul] | ||
simp_rw [mul_comm (μ _), cond_mul_eq_inter _ (hX (.singleton _))] | ||
_ = _ := by | ||
have : ⋃ x ∈ finX.toFinset, X ⁻¹' {x} ∩ E = E := by ext _; simp | ||
rw [← measure_biUnion_finset _ fun _ _ ↦ (hX (.singleton _)).inter hE, this] | ||
aesop (add simp [PairwiseDisjoint, Set.Pairwise, Function.onFun, disjoint_left]) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.