@@ -18,18 +18,18 @@ the inverse of the measure of `s`: `cond μ s = (μ s)⁻¹ • μ.restrict s`.
1818ensures that this is a probability measure (when `μ` is a finite measure).
1919
2020From this definition, we derive the "axiomatic" definition of conditional probability
21- based on application: for any `s t : Set Ω`, we have `μ[t| s] = (μ s)⁻¹ * μ (s ∩ t)`.
21+ based on application: for any `s t : Set Ω`, we have `μ[t | s] = (μ s)⁻¹ * μ (s ∩ t)`.
2222
2323## Main Statements
2424
2525* `cond_cond_eq_cond_inter`: conditioning on one set and then another is equivalent
2626 to conditioning on their intersection.
27- * `cond_eq_inv_mul_cond_mul`: Bayes' Theorem, `μ[t| s] = (μ s)⁻¹ * μ[s| t] * (μ t)`.
27+ * `cond_eq_inv_mul_cond_mul`: Bayes' Theorem, `μ[t | s] = (μ s)⁻¹ * μ[s | t] * (μ t)`.
2828
2929 ## Notation
3030
3131This file uses the notation `μ[|s]` the measure of `μ` conditioned on `s`,
32- and `μ[t| s]` for the probability of `t` given `s` under `μ` (equivalent to the
32+ and `μ[t | s]` for the probability of `t` given `s` under `μ` (equivalent to the
3333application `μ[|s] t`).
3434
3535These notations are contained in the scope `ProbabilityTheory`.
@@ -99,7 +99,7 @@ meta def condUnexpander : Lean.PrettyPrinter.Unexpander
9999#guard_msgs in
100100#check μ[|s]
101101
102- /-- Delaborator for `μ[t| s]` notation. -/
102+ /-- Delaborator for `μ[t | s]` notation. -/
103103@ [app_delab DFunLike.coe]
104104meta def delabCondApplied : Delab :=
105105 whenNotPPOption getPPExplicit <| whenPPOption getPPNotation <| withOverApp 6 do
@@ -212,17 +212,17 @@ lemma cond_eq_zero_of_meas_eq_zero (hμs : μ s = 0) : μ[|s] = 0 := by simp [h
212212
213213/-- The axiomatic definition of conditional probability derived from a measure-theoretic one. -/
214214theorem cond_apply (hms : MeasurableSet s) (μ : Measure Ω) (t : Set Ω) :
215- μ[t| s] = (μ s)⁻¹ * μ (s ∩ t) := by
215+ μ[t | s] = (μ s)⁻¹ * μ (s ∩ t) := by
216216 rw [cond, Measure.smul_apply, Measure.restrict_apply' hms, Set.inter_comm, smul_eq_mul]
217217
218- theorem cond_apply' (ht : MeasurableSet t) (μ : Measure Ω) : μ[t| s] = (μ s)⁻¹ * μ (s ∩ t) := by
218+ theorem cond_apply' (ht : MeasurableSet t) (μ : Measure Ω) : μ[t | s] = (μ s)⁻¹ * μ (s ∩ t) := by
219219 rw [cond, Measure.smul_apply, Measure.restrict_apply ht, Set.inter_comm, smul_eq_mul]
220220
221- @[simp] lemma cond_apply_self (hs₀ : μ s ≠ 0 ) (hs : μ s ≠ ∞) : μ[s| s] = 1 := by
221+ @[simp] lemma cond_apply_self (hs₀ : μ s ≠ 0 ) (hs : μ s ≠ ∞) : μ[s | s] = 1 := by
222222 simpa [cond] using ENNReal.inv_mul_cancel hs₀ hs
223223
224224theorem cond_inter_self (hms : MeasurableSet s) (t : Set Ω) (μ : Measure Ω) :
225- μ[s ∩ t| s] = μ[t| s] := by
225+ μ[s ∩ t | s] = μ[t | s] := by
226226 rw [cond_apply hms, ← Set.inter_assoc, Set.inter_self, ← cond_apply hms]
227227
228228theorem inter_pos_of_cond_ne_zero (hms : MeasurableSet s) (hcst : μ[t | s] ≠ 0 ) :
@@ -254,24 +254,24 @@ theorem cond_cond_eq_cond_inter (hms : MeasurableSet s) (hmt : MeasurableSet t)
254254 cond_cond_eq_cond_inter' hms hmt (measure_ne_top μ s)
255255
256256theorem cond_mul_eq_inter' (hms : MeasurableSet s) (hcs' : μ s ≠ ∞) (t : Set Ω) :
257- μ[t| s] * μ s = μ (s ∩ t) := by
257+ μ[t | s] * μ s = μ (s ∩ t) := by
258258 obtain hcs | hcs := eq_or_ne (μ s) 0
259259 · simp [hcs, measure_inter_null_of_null_left]
260260 · rw [cond_apply hms, mul_comm, ← mul_assoc, ENNReal.mul_inv_cancel hcs hcs', one_mul]
261261
262262theorem cond_mul_eq_inter (hms : MeasurableSet s) (t : Set Ω) (μ : Measure Ω) [IsFiniteMeasure μ] :
263- μ[t| s] * μ s = μ (s ∩ t) := cond_mul_eq_inter' hms (measure_ne_top _ s) t
263+ μ[t | s] * μ s = μ (s ∩ t) := cond_mul_eq_inter' hms (measure_ne_top _ s) t
264264
265265/-- A version of the law of total probability. -/
266266theorem cond_add_cond_compl_eq (hms : MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
267- μ[t| s] * μ s + μ[t| sᶜ] * μ sᶜ = μ t := by
267+ μ[t | s] * μ s + μ[t | sᶜ] * μ sᶜ = μ t := by
268268 rw [cond_mul_eq_inter hms, cond_mul_eq_inter hms.compl, Set.inter_comm _ t,
269269 Set.inter_comm _ t]
270270 exact measure_inter_add_diff t hms
271271
272272/-- **Bayes' Theorem** -/
273273theorem cond_eq_inv_mul_cond_mul (hms : MeasurableSet s) (hmt : MeasurableSet t) (μ : Measure Ω)
274- [IsFiniteMeasure μ] : μ[t| s] = (μ s)⁻¹ * μ[s| t] * μ t := by
274+ [IsFiniteMeasure μ] : μ[t | s] = (μ s)⁻¹ * μ[s | t] * μ t := by
275275 rw [mul_assoc, cond_mul_eq_inter hmt s, Set.inter_comm, cond_apply hms]
276276
277277end Bayes
0 commit comments