probability.kernel.cond_cdf
⟷
Mathlib.Probability.Kernel.CondCdf
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)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -499,7 +499,7 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
simp_rw [F, dif_pos ha]
exact ha.some_spec
have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, tendsto (fun n : ℕ => pre_cdf ρ n a) at_top (𝓝 (F a)) := by
- filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_nat_cast_atTop_atTop
+ filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_natCast_atTop_atTop
have hF_ae_meas : AEMeasurable F ρ.fst :=
by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
@@ -530,7 +530,7 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, 1 ∂ρ.fst)) :=
by
rw [lintegral_one, measure.fst_univ]
- exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_nat_cast_atTop_atTop
+ exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_natCast_atTop_atTop
exact tendsto_nhds_unique h_lintegral h_lintegral'
have : ∫⁻ a, 1 - F a ∂ρ.fst = 0 :=
by
@@ -1119,8 +1119,8 @@ theorem integrable_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x :
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.set_integral_condCDF /-
-theorem set_integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
+#print ProbabilityTheory.setIntegral_condCDF /-
+theorem setIntegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
(hs : MeasurableSet s) : ∫ a in s, condCDF ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
by
have h := set_lintegral_cond_cdf ρ x hs
@@ -1129,7 +1129,7 @@ theorem set_integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
exact integral_nonneg fun _ => cond_cdf_nonneg _ _ _
· exact (integrable_cond_cdf _ _).IntegrableOn
· exact eventually_of_forall fun _ => cond_cdf_nonneg _ _ _
-#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCDF
+#align probability_theory.set_integral_cond_cdf ProbabilityTheory.setIntegral_condCDF
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -415,7 +415,6 @@ theorem monotone_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCDF
-/
-#print ProbabilityTheory.set_lintegral_iInf_gt_preCDF /-
theorem set_lintegral_iInf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
(hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCDF ρ r x ∂ρ.fst = ρ.IicSnd t s :=
by
@@ -437,7 +436,6 @@ theorem set_lintegral_iInf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure
· filter_upwards [monotone_pre_cdf] with a ha_mono
exact fun _ => le_iInf fun r => ha_mono (le_of_lt r.Prop)
#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCDF
--/
#print ProbabilityTheory.preCDF_le_one /-
theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
@@ -452,7 +450,6 @@ theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCDF_le_one
-/
-#print ProbabilityTheory.tendsto_lintegral_preCDF_atTop /-
theorem tendsto_lintegral_preCDF_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
Tendsto (fun r => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) :=
by
@@ -461,9 +458,7 @@ theorem tendsto_lintegral_preCDF_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasu
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
· exact measure.fst_univ.symm
#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCDF_atTop
--/
-#print ProbabilityTheory.tendsto_lintegral_preCDF_atBot /-
theorem tendsto_lintegral_preCDF_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
Tendsto (fun r => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atBot (𝓝 0) :=
by
@@ -471,9 +466,7 @@ theorem tendsto_lintegral_preCDF_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasu
ext1 r
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCDF_atBot
--/
-#print ProbabilityTheory.tendsto_preCDF_atTop_one /-
theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 1) :=
by
@@ -552,11 +545,9 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCDF_atTop_one
--/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.tendsto_preCDF_atBot_zero /-
theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0) :=
by
@@ -635,9 +626,7 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
exact_mod_cast hij
exact tendsto_nhds_unique h_lintegral h_lintegral'
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCDF_atBot_zero
--/
-#print ProbabilityTheory.inf_gt_preCDF /-
theorem inf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, ∀ t : ℚ, (⨅ r : Ioi t, preCDF ρ r a) = preCDF ρ t a :=
by
@@ -647,92 +636,72 @@ theorem inf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
intro s hs hs_fin
rw [set_lintegral_infi_gt_pre_cdf ρ t hs, set_lintegral_pre_cdf_fst ρ t hs]
#align probability_theory.inf_gt_pre_cdf ProbabilityTheory.inf_gt_preCDF
--/
section HasCondCdf
-#print ProbabilityTheory.HasCondCDF /-
/-- A product measure on `α × ℝ` is said to have a conditional cdf at `a : α` if `pre_cdf` is
monotone with limit 0 at -∞ and 1 at +∞, and is right continuous.
This property holds almost everywhere (see `has_cond_cdf_ae`). -/
-structure HasCondCDF (ρ : Measure (α × ℝ)) (a : α) : Prop where
+structure HasCondCdf (ρ : Measure (α × ℝ)) (a : α) : Prop where
mono : Monotone fun r => preCDF ρ r a
le_one : ∀ r, preCDF ρ r a ≤ 1
tendsto_atTop_one : Tendsto (fun r => preCDF ρ r a) atTop (𝓝 1)
tendsto_atBot_zero : Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0)
iInf_rat_gt_eq : ∀ t : ℚ, (⨅ r : Ioi t, preCDF ρ r a) = preCDF ρ t a
-#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCDF
--/
+#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCdf
-#print ProbabilityTheory.hasCondCDF_ae /-
-theorem hasCondCDF_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCDF ρ a :=
+theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a :=
by
filter_upwards [monotone_pre_cdf ρ, pre_cdf_le_one ρ, tendsto_pre_cdf_at_top_one ρ,
tendsto_pre_cdf_at_bot_zero ρ, inf_gt_pre_cdf ρ] with a h1 h2 h3 h4 h5
exact ⟨h1, h2, h3, h4, h5⟩
-#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCDF_ae
--/
+#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCdf_ae
-#print ProbabilityTheory.condCDFSet /-
/-- A measurable set of elements of `α` such that `ρ` has a conditional cdf at all
`a ∈ cond_cdf_set`. -/
-def condCDFSet (ρ : Measure (α × ℝ)) : Set α :=
- toMeasurable ρ.fst {b | ¬HasCondCDF ρ b}ᶜ
-#align probability_theory.cond_cdf_set ProbabilityTheory.condCDFSet
--/
+def condCdfSet (ρ : Measure (α × ℝ)) : Set α :=
+ toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}ᶜ
+#align probability_theory.cond_cdf_set ProbabilityTheory.condCdfSet
-#print ProbabilityTheory.measurableSet_condCDFSet /-
-theorem measurableSet_condCDFSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCDFSet ρ) :=
+theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCdfSet ρ) :=
(measurableSet_toMeasurable _ _).compl
-#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCDFSet
--/
+#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCdfSet
-#print ProbabilityTheory.hasCondCDF_of_mem_condCDFSet /-
-theorem hasCondCDF_of_mem_condCDFSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCDFSet ρ) :
- HasCondCDF ρ a := by
+theorem hasCondCdfOfMemCondCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
+ HasCondCdf ρ a := by
rw [cond_cdf_set, mem_compl_iff] at h
have h_ss := subset_to_measurable ρ.fst {b | ¬has_cond_cdf ρ b}
by_contra ha
exact h (h_ss ha)
-#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCDF_of_mem_condCDFSet
--/
+#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCdfOfMemCondCdfSet
-#print ProbabilityTheory.mem_condCDFSet_ae /-
-theorem mem_condCDFSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, a ∈ condCDFSet ρ :=
+theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ :=
by
simp_rw [ae_iff, cond_cdf_set, not_mem_compl_iff, set_of_mem_eq, measure_to_measurable]
exact has_cond_cdf_ae ρ
-#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCDFSet_ae
--/
+#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCdfSet_ae
end HasCondCdf
open scoped Classical
-#print ProbabilityTheory.condCDFRat /-
/-- Conditional cdf of the measure given the value on `α`, restricted to the rationals.
It is defined to be `pre_cdf` if `a ∈ cond_cdf_set`, and a default cdf-like function
otherwise. This is an auxiliary definition used to define `cond_cdf`. -/
-noncomputable def condCDFRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
- if a ∈ condCDFSet ρ then fun r => (preCDF ρ r a).toReal else fun r => if r < 0 then 0 else 1
-#align probability_theory.cond_cdf_rat ProbabilityTheory.condCDFRat
--/
+noncomputable def condCdfRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
+ if a ∈ condCdfSet ρ then fun r => (preCDF ρ r a).toReal else fun r => if r < 0 then 0 else 1
+#align probability_theory.cond_cdf_rat ProbabilityTheory.condCdfRat
-#print ProbabilityTheory.condCDFRat_of_not_mem /-
-theorem condCDFRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCDFSet ρ) {r : ℚ} :
- condCDFRat ρ a r = if r < 0 then 0 else 1 := by simp only [cond_cdf_rat, h, if_false]
-#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCDFRat_of_not_mem
--/
+theorem condCdfRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCdfSet ρ) {r : ℚ} :
+ condCdfRat ρ a r = if r < 0 then 0 else 1 := by simp only [cond_cdf_rat, h, if_false]
+#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCdfRat_of_not_mem
-#print ProbabilityTheory.condCDFRat_of_mem /-
-theorem condCDFRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCDFSet ρ) (r : ℚ) :
- condCDFRat ρ a r = (preCDF ρ r a).toReal := by simp only [cond_cdf_rat, h, if_true]
-#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCDFRat_of_mem
--/
+theorem condCdfRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCdfSet ρ) (r : ℚ) :
+ condCdfRat ρ a r = (preCDF ρ r a).toReal := by simp only [cond_cdf_rat, h, if_true]
+#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCdfRat_of_mem
-#print ProbabilityTheory.monotone_condCDFRat /-
-theorem monotone_condCDFRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCDFRat ρ a) :=
+theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) :=
by
by_cases h : a ∈ cond_cdf_set ρ
· simp only [cond_cdf_rat, h, if_true, forall_const, and_self_iff]
@@ -747,28 +716,22 @@ theorem monotone_condCDFRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (cond
dsimp only
split_ifs
exacts [le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
-#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCDFRat
--/
+#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCdfRat
-#print ProbabilityTheory.measurable_condCDFRat /-
-theorem measurable_condCDFRat (ρ : Measure (α × ℝ)) (q : ℚ) :
- Measurable fun a => condCDFRat ρ a q :=
+theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
+ Measurable fun a => condCdfRat ρ a q :=
by
simp_rw [cond_cdf_rat, ite_apply]
exact
Measurable.ite (measurable_set_cond_cdf_set ρ) measurable_pre_cdf.ennreal_to_real
measurable_const
-#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCDFRat
--/
+#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCdfRat
-#print ProbabilityTheory.condCDFRat_nonneg /-
-theorem condCDFRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCDFRat ρ a r := by
+theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
unfold cond_cdf_rat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
-#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCDFRat_nonneg
--/
+#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCdfRat_nonneg
-#print ProbabilityTheory.condCDFRat_le_one /-
-theorem condCDFRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCDFRat ρ a r ≤ 1 :=
+theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 :=
by
unfold cond_cdf_rat
split_ifs with h
@@ -776,12 +739,10 @@ theorem condCDFRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCD
rw [ENNReal.ofReal_one]
exact (has_cond_cdf_of_mem_cond_cdf_set h).le_one r
exacts [zero_le_one, le_rfl]
-#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCDFRat_le_one
--/
+#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCdfRat_le_one
-#print ProbabilityTheory.tendsto_condCDFRat_atBot /-
-theorem tendsto_condCDFRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCDFRat ρ a) atBot (𝓝 0) :=
+theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCdfRat ρ a) atBot (𝓝 0) :=
by
unfold cond_cdf_rat
split_ifs with h
@@ -794,12 +755,10 @@ theorem tendsto_condCDFRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
rw [eventually_eq, eventually_at_bot]
refine' ⟨-1, fun q hq => (if_pos (hq.trans_lt _)).symm⟩
linarith
-#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCDFRat_atBot
--/
+#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCdfRat_atBot
-#print ProbabilityTheory.tendsto_condCDFRat_atTop /-
-theorem tendsto_condCDFRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCDFRat ρ a) atTop (𝓝 1) :=
+theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCdfRat ρ a) atTop (𝓝 1) :=
by
unfold cond_cdf_rat
split_ifs with h
@@ -811,29 +770,23 @@ theorem tendsto_condCDFRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
· refine' (tendsto_congr' _).mp tendsto_const_nhds
rw [eventually_eq, eventually_at_top]
exact ⟨0, fun q hq => (if_neg (not_lt.mpr hq)).symm⟩
-#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCDFRat_atTop
--/
+#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCdfRat_atTop
-#print ProbabilityTheory.condCDFRat_ae_eq /-
-theorem condCDFRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => condCDFRat ρ a r) =ᵐ[ρ.fst] fun a => (preCDF ρ r a).toReal := by
+theorem condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => condCdfRat ρ a r) =ᵐ[ρ.fst] fun a => (preCDF ρ r a).toReal := by
filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using cond_cdf_rat_of_mem ρ a ha r
-#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCDFRat_ae_eq
--/
+#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCdfRat_ae_eq
-#print ProbabilityTheory.ofReal_condCDFRat_ae_eq /-
-theorem ofReal_condCDFRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => ENNReal.ofReal (condCDFRat ρ a r)) =ᵐ[ρ.fst] preCDF ρ r :=
+theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => ENNReal.ofReal (condCdfRat ρ a r)) =ᵐ[ρ.fst] preCDF ρ r :=
by
filter_upwards [cond_cdf_rat_ae_eq ρ r, pre_cdf_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
-#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCDFRat_ae_eq
--/
+#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCdfRat_ae_eq
-#print ProbabilityTheory.inf_gt_condCDFRat /-
-theorem inf_gt_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
- (⨅ r : Ioi t, condCDFRat ρ a r) = condCDFRat ρ a t :=
+theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
+ (⨅ r : Ioi t, condCdfRat ρ a r) = condCdfRat ρ a t :=
by
by_cases ha : a ∈ cond_cdf_set ρ
· simp_rw [cond_cdf_rat_of_mem ρ a ha]
@@ -870,26 +823,20 @@ theorem inf_gt_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
rw [if_neg]
rw [not_lt] at h ⊢
exact h.trans (mem_Ioi.mp x.prop).le
-#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCDFRat
--/
+#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCdfRat
-#print ProbabilityTheory.condCDF' /-
/-- Conditional cdf of the measure given the value on `α`, as a plain function. This is an auxiliary
definition used to define `cond_cdf`. -/
-noncomputable irreducible_def condCDF' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
- ⨅ r : { r' : ℚ // t < r' }, condCDFRat ρ a r
-#align probability_theory.cond_cdf' ProbabilityTheory.condCDF'
--/
+noncomputable irreducible_def condCdf' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
+ ⨅ r : { r' : ℚ // t < r' }, condCdfRat ρ a r
+#align probability_theory.cond_cdf' ProbabilityTheory.condCdf'
-#print ProbabilityTheory.condCDF'_def' /-
-theorem condCDF'_def' {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
- condCDF' ρ a x = ⨅ r : { r : ℚ // x < r }, condCDFRat ρ a r := by rw [cond_cdf']
-#align probability_theory.cond_cdf'_def ProbabilityTheory.condCDF'_def'
--/
+theorem condCdf'_def {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
+ condCdf' ρ a x = ⨅ r : { r : ℚ // x < r }, condCdfRat ρ a r := by rw [cond_cdf']
+#align probability_theory.cond_cdf'_def ProbabilityTheory.condCdf'_def
-#print ProbabilityTheory.condCDF'_eq_condCDFRat /-
-theorem condCDF'_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
- condCDF' ρ a r = condCDFRat ρ a r :=
+theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
+ condCdf' ρ a r = condCdfRat ρ a r :=
by
rw [← inf_gt_cond_cdf_rat ρ a r, cond_cdf']
refine' Equiv.iInf_congr _ _
@@ -901,11 +848,9 @@ theorem condCDF'_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
right_inv := fun t => by simp only [Subtype.val_eq_coe, Subtype.coe_eta] }
· intro t
simp only [Subtype.val_eq_coe, Equiv.coe_fn_mk, Subtype.coe_mk]
-#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCDF'_eq_condCDFRat
--/
+#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCdf'_eq_condCdfRat
-#print ProbabilityTheory.condCDF'_nonneg /-
-theorem condCDF'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF' ρ a r :=
+theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf' ρ a r :=
by
have : Nonempty { r' : ℚ // r < ↑r' } :=
by
@@ -913,18 +858,14 @@ theorem condCDF'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ co
exact ⟨⟨r, hrx⟩⟩
rw [cond_cdf'_def]
exact le_ciInf fun r' => cond_cdf_rat_nonneg ρ a _
-#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCDF'_nonneg
--/
+#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCdf'_nonneg
-#print ProbabilityTheory.bddBelow_range_condCDFRat_gt /-
-theorem bddBelow_range_condCDFRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCDFRat ρ a r) := by
+theorem bddBelow_range_condCdfRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCdfRat ρ a r) := by
refine' ⟨0, fun z => _⟩; rintro ⟨u, rfl⟩; exact cond_cdf_rat_nonneg ρ a _
-#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCDFRat_gt
--/
+#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCdfRat_gt
-#print ProbabilityTheory.monotone_condCDF' /-
-theorem monotone_condCDF' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCDF' ρ a) :=
+theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdf' ρ a) :=
by
intro x y hxy
have : Nonempty { r' : ℚ // y < ↑r' } :=
@@ -936,12 +877,10 @@ theorem monotone_condCDF' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCD
· exact ⟨r.1, hxy.trans_lt r.prop⟩
· exact bdd_below_range_cond_cdf_rat_gt ρ a x
· rfl
-#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCDF'
--/
+#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCdf'
-#print ProbabilityTheory.continuousWithinAt_condCDF'_Ici /-
-theorem continuousWithinAt_condCDF'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- ContinuousWithinAt (condCDF' ρ a) (Ici x) x :=
+theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ ContinuousWithinAt (condCdf' ρ a) (Ici x) x :=
by
rw [← continuousWithinAt_Ioi_iff_Ici]
convert Monotone.tendsto_nhdsWithin_Ioi (monotone_cond_cdf' ρ a) x
@@ -961,8 +900,7 @@ theorem continuousWithinAt_condCDF'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
rw [h', h'', ContinuousWithinAt]
congr
exact cond_cdf'_def
-#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCDF'_Ici
--/
+#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCdf'_Ici
/-! ### Conditional cdf -/
@@ -971,23 +909,21 @@ theorem continuousWithinAt_condCDF'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
/-- Conditional cdf of the measure given the value on `α`, as a Stieltjes function. -/
noncomputable def condCDF (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunction
where
- toFun := condCDF' ρ a
- mono' := monotone_condCDF' ρ a
- right_continuous' x := continuousWithinAt_condCDF'_Ici ρ a x
+ toFun := condCdf' ρ a
+ mono' := monotone_condCdf' ρ a
+ right_continuous' x := continuousWithinAt_condCdf'_Ici ρ a x
#align probability_theory.cond_cdf ProbabilityTheory.condCDF
-/
-#print ProbabilityTheory.condCDF_eq_condCDFRat /-
-theorem condCDF_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
- condCDF ρ a r = condCDFRat ρ a r :=
- condCDF'_eq_condCDFRat ρ a r
-#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCDF_eq_condCDFRat
--/
+theorem condCDF_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
+ condCDF ρ a r = condCdfRat ρ a r :=
+ condCdf'_eq_condCdfRat ρ a r
+#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCDF_eq_condCdfRat
#print ProbabilityTheory.condCDF_nonneg /-
/-- The conditional cdf is non-negative for all `a : α`. -/
theorem condCDF_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF ρ a r :=
- condCDF'_nonneg ρ a r
+ condCdf'_nonneg ρ a r
#align probability_theory.cond_cdf_nonneg ProbabilityTheory.condCDF_nonneg
-/
@@ -1083,7 +1019,6 @@ theorem measurable_condCDF (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.set_lintegral_condCDF_rat /-
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
theorem set_lintegral_condCDF_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
(hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic r) :=
@@ -1093,7 +1028,6 @@ theorem set_lintegral_condCDF_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
rw [set_lintegral_congr_fun hs this, set_lintegral_pre_cdf_fst ρ r hs]
exact ρ.Iic_snd_apply r hs
#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCDF_rat
--/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -327,9 +327,9 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
ext1 x
simp only [Rat.cast_eq_id, id.def, mem_Inter, mem_prod, mem_Iic]
refine' ⟨fun h i => ⟨(h i).1, _⟩, fun h i => ⟨(h i).1, _⟩⟩ <;> have h' := h (-i)
- · rw [neg_neg] at h' ; exact h'.2
+ · rw [neg_neg] at h'; exact h'.2
· exact h'.2
- rw [h_inter_eq] at h_neg
+ rw [h_inter_eq] at h_neg
have h_fun_eq : (fun r : ℚ => ρ (s ×ˢ Iic (r : ℝ))) = fun r => ρ (s ×ˢ Iic ↑(- -r)) := by
simp_rw [neg_neg]
rw [h_fun_eq]
@@ -492,7 +492,7 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) :=
tendsto_of_monotone ha_mono
cases' h_tendsto with h_absurd h_tendsto
- · rw [Monotone.tendsto_atTop_atTop_iff ha_mono] at h_absurd
+ · rw [Monotone.tendsto_atTop_atTop_iff ha_mono] at h_absurd
obtain ⟨r, hr⟩ := h_absurd 2
exact absurd (hr.trans (ha_le_one r)) ennreal.one_lt_two.not_le
· exact h_tendsto
@@ -517,7 +517,7 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
suffices ∀ᵐ a ∂ρ.fst, F a = 1
by
filter_upwards [h_tendsto_ℚ, this] with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
+ rwa [ha_eq] at ha_tendsto
-- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
-- us that `F` is 1 a.e.
have h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst :=
@@ -547,9 +547,9 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
_ = ρ.fst univ := lintegral_one
_ = ρ univ := measure.fst_univ
_ ≠ ∞ := measure_ne_top ρ _
- rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
+ rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
- rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
+ rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCDF_atTop_one
-/
@@ -594,9 +594,9 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
exact measurable_pre_cdf.ae_measurable
- rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
+ rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
filter_upwards [h_tendsto, h_lintegral_eq] with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
+ rwa [ha_eq] at ha_tendsto
have h_lintegral :
tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
by
@@ -690,7 +690,7 @@ theorem measurableSet_condCDFSet (ρ : Measure (α × ℝ)) : MeasurableSet (con
#print ProbabilityTheory.hasCondCDF_of_mem_condCDFSet /-
theorem hasCondCDF_of_mem_condCDFSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCDFSet ρ) :
HasCondCDF ρ a := by
- rw [cond_cdf_set, mem_compl_iff] at h
+ rw [cond_cdf_set, mem_compl_iff] at h
have h_ss := subset_to_measurable ρ.fst {b | ¬has_cond_cdf ρ b}
by_contra ha
exact h (h_ss ha)
@@ -1015,7 +1015,7 @@ theorem tendsto_condCDF_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
refine' fun q => ⟨q - 1, fun y hy => _⟩
have h_le : ↑(qs y) ≤ (q : ℝ) - 1 + 1 :=
(h_exists y).choose_spec.2.le.trans (add_le_add hy le_rfl)
- rw [sub_add_cancel] at h_le
+ rw [sub_add_cancel] at h_le
exact_mod_cast h_le
refine'
tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds
@@ -1036,7 +1036,7 @@ theorem tendsto_condCDF_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
rw [tendsto_at_top_at_top]
refine' fun q => ⟨q + 1, fun y hy => _⟩
have h_le : y - 1 ≤ qs y := (h_exists y).choose_spec.1.le
- rw [sub_le_iff_le_add] at h_le
+ rw [sub_le_iff_le_add] at h_le
exact_mod_cast le_of_add_le_add_right (hy.trans h_le)
refine'
tendsto_of_tendsto_of_tendsto_of_le_of_le ((tendsto_cond_cdf_rat_at_top ρ a).comp hqs_tendsto)
@@ -1190,7 +1190,7 @@ theorem set_integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
(hs : MeasurableSet s) : ∫ a in s, condCDF ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
by
have h := set_lintegral_cond_cdf ρ x hs
- rw [← of_real_integral_eq_lintegral_of_real] at h
+ rw [← of_real_integral_eq_lintegral_of_real] at h
· rw [← h, ENNReal.toReal_ofReal]
exact integral_nonneg fun _ => cond_cdf_nonneg _ _ _
· exact (integrable_cond_cdf _ _).IntegrableOn
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -159,10 +159,10 @@ theorem ENNReal.ofReal_cinfi (f : α → ℝ) [Nonempty α] :
#align ennreal.of_real_cinfi ENNReal.ofReal_cinfi
-/
-#print lintegral_iInf_directed_of_measurable /-
+#print MeasureTheory.lintegral_iInf_directed_of_measurable /-
-- todo: move to measure_theory/measurable_space
/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
-theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
+theorem MeasureTheory.lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
{f : β → α → ℝ≥0∞} {μ : Measure α} (hμ : μ ≠ 0) (hf : ∀ b, Measurable (f b))
(hf_int : ∀ b, ∫⁻ a, f b a ∂μ ≠ ∞) (h_directed : Directed (· ≥ ·) f) :
∫⁻ a, ⨅ b, f b a ∂μ = ⨅ b, ∫⁻ a, f b a ∂μ :=
@@ -191,7 +191,7 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
refine' le_antisymm (le_iInf fun b => _) (le_iInf fun n => _)
· exact iInf_le_of_le (Encodable.encode b + 1) (lintegral_mono <| h_directed.sequence_le b)
· exact iInf_le (fun b => ∫⁻ a, f b a ∂μ) _
-#align lintegral_infi_directed_of_measurable lintegral_iInf_directed_of_measurable
+#align lintegral_infi_directed_of_measurable MeasureTheory.lintegral_iInf_directed_of_measurable
-/
#print isPiSystem_Iic /-
@@ -1125,7 +1125,7 @@ theorem set_lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
rw [h]
simp_rw [ENNReal.ofReal_cinfi]
have h_coe : ∀ b : { r' : ℚ // x < ↑r' }, (b : ℝ) = ((b : ℚ) : ℝ) := fun _ => by congr
- rw [lintegral_iInf_directed_of_measurable hρ_zero fun q : { r' : ℚ // x < ↑r' } =>
+ rw [MeasureTheory.lintegral_iInf_directed_of_measurable hρ_zero fun q : { r' : ℚ // x < ↑r' } =>
(measurable_cond_cdf ρ q).ennreal_ofReal]
rotate_left
· intro b
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -497,17 +497,66 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
exact absurd (hr.trans (ha_le_one r)) ennreal.one_lt_two.not_le
· exact h_tendsto
classical
+ -- let `F` be the pointwise limit of `pre_cdf` where it exists, and 0 elsewhere.
+ let F : α → ℝ≥0∞ := fun a =>
+ if h : ∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) then h.some else 0
+ have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 (F a)) :=
+ by
+ filter_upwards [h_exists] with a ha
+ simp_rw [F, dif_pos ha]
+ exact ha.some_spec
+ have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, tendsto (fun n : ℕ => pre_cdf ρ n a) at_top (𝓝 (F a)) := by
+ filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_nat_cast_atTop_atTop
+ have hF_ae_meas : AEMeasurable F ρ.fst :=
+ by
+ refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
+ exact measurable_pre_cdf.ae_measurable
+ have hF_le_one : ∀ᵐ a ∂ρ.fst, F a ≤ 1 := by
+ filter_upwards [h_tendsto_ℚ, h_le_one] with a ha ha_le using le_of_tendsto' ha ha_le
+ -- it suffices to show that the limit `F` is 1 a.e.
+ suffices ∀ᵐ a ∂ρ.fst, F a = 1
+ by
+ filter_upwards [h_tendsto_ℚ, this] with a ha_tendsto ha_eq
+ rwa [ha_eq] at ha_tendsto
+ -- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
+ -- us that `F` is 1 a.e.
+ have h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst :=
+ by
+ have h_lintegral :
+ tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
+ by
+ refine'
+ lintegral_tendsto_of_tendsto_of_monotone
+ (-- does this exist only for ℕ?
+ fun _ => measurable_pre_cdf.ae_measurable)
+ _ h_tendsto_ℕ
+ filter_upwards [h_mono] with a ha
+ refine' fun n m hnm => ha _
+ exact_mod_cast hnm
+ have h_lintegral' :
+ tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, 1 ∂ρ.fst)) :=
+ by
+ rw [lintegral_one, measure.fst_univ]
+ exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_nat_cast_atTop_atTop
+ exact tendsto_nhds_unique h_lintegral h_lintegral'
+ have : ∫⁻ a, 1 - F a ∂ρ.fst = 0 :=
+ by
+ rw [lintegral_sub' hF_ae_meas _ hF_le_one, h_lintegral_eq, tsub_self]
+ calc
+ ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst := h_lintegral_eq
+ _ = ρ.fst univ := lintegral_one
+ _ = ρ univ := measure.fst_univ
+ _ ≠ ∞ := measure_ne_top ρ _
+ rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
+ filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
+ rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
+ exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCDF_atTop_one
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
#print ProbabilityTheory.tendsto_preCDF_atBot_zero /-
--- let `F` be the pointwise limit of `pre_cdf` where it exists, and 0 elsewhere.
--- it suffices to show that the limit `F` is 1 a.e.
--- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
--- us that `F` is 1 a.e.
--- does this exist only for ℕ?
theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0) :=
by
@@ -533,6 +582,58 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
· exact ⟨0, tendsto.mono_right h_bot atBot_le_nhds_bot⟩
· exact h_tendsto
classical
+ let F : α → ℝ≥0∞ := fun a =>
+ if h : ∃ l, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 l) then h.some else 0
+ have h_tendsto : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 (F a)) :=
+ by
+ filter_upwards [h_exists] with a ha
+ simp_rw [F, dif_pos ha]
+ exact ha.some_spec
+ suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0
+ · have hF_ae_meas : AEMeasurable F ρ.fst :=
+ by
+ refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
+ exact measurable_pre_cdf.ae_measurable
+ rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
+ filter_upwards [h_tendsto, h_lintegral_eq] with a ha_tendsto ha_eq
+ rwa [ha_eq] at ha_tendsto
+ have h_lintegral :
+ tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
+ by
+ refine'
+ tendsto_lintegral_filter_of_dominated_convergence (fun _ => 1)
+ (eventually_of_forall fun _ => measurable_pre_cdf) (eventually_of_forall fun _ => _) _
+ h_tendsto
+ · filter_upwards [pre_cdf_le_one ρ] with a ha using ha _
+ · rw [lintegral_one]
+ exact measure_ne_top _ _
+ have h_lintegral' : tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 0) :=
+ by
+ have h_lintegral_eq :
+ (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) = fun r => ρ (univ ×ˢ Iic (-r)) :=
+ by
+ ext1 n
+ rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ,
+ measure.Iic_snd_univ]
+ norm_cast
+ rw [h_lintegral_eq]
+ have h_zero_eq_measure_Inter : (0 : ℝ≥0∞) = ρ (⋂ r : ℚ, univ ×ˢ Iic (-r)) :=
+ by
+ suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by
+ rwa [← Set.prod_iInter, this, prod_empty, measure_empty]
+ ext1 x
+ simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, Classical.not_forall,
+ not_le]
+ simp_rw [neg_lt]
+ exact exists_rat_gt _
+ rw [h_zero_eq_measure_Inter]
+ refine'
+ tendsto_measure_Inter (fun n => measurable_set.univ.prod measurableSet_Iic)
+ (fun i j hij x => _) ⟨0, measure_ne_top ρ _⟩
+ simp only [mem_prod, mem_univ, mem_Iic, true_and_iff]
+ refine' fun hxj => hxj.trans (neg_le_neg _)
+ exact_mod_cast hij
+ exact tendsto_nhds_unique h_lintegral h_lintegral'
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCDF_atBot_zero
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -497,66 +497,17 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
exact absurd (hr.trans (ha_le_one r)) ennreal.one_lt_two.not_le
· exact h_tendsto
classical
- -- let `F` be the pointwise limit of `pre_cdf` where it exists, and 0 elsewhere.
- let F : α → ℝ≥0∞ := fun a =>
- if h : ∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) then h.some else 0
- have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 (F a)) :=
- by
- filter_upwards [h_exists] with a ha
- simp_rw [F, dif_pos ha]
- exact ha.some_spec
- have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, tendsto (fun n : ℕ => pre_cdf ρ n a) at_top (𝓝 (F a)) := by
- filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_nat_cast_atTop_atTop
- have hF_ae_meas : AEMeasurable F ρ.fst :=
- by
- refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
- exact measurable_pre_cdf.ae_measurable
- have hF_le_one : ∀ᵐ a ∂ρ.fst, F a ≤ 1 := by
- filter_upwards [h_tendsto_ℚ, h_le_one] with a ha ha_le using le_of_tendsto' ha ha_le
- -- it suffices to show that the limit `F` is 1 a.e.
- suffices ∀ᵐ a ∂ρ.fst, F a = 1
- by
- filter_upwards [h_tendsto_ℚ, this] with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
- -- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
- -- us that `F` is 1 a.e.
- have h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst :=
- by
- have h_lintegral :
- tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
- by
- refine'
- lintegral_tendsto_of_tendsto_of_monotone
- (-- does this exist only for ℕ?
- fun _ => measurable_pre_cdf.ae_measurable)
- _ h_tendsto_ℕ
- filter_upwards [h_mono] with a ha
- refine' fun n m hnm => ha _
- exact_mod_cast hnm
- have h_lintegral' :
- tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, 1 ∂ρ.fst)) :=
- by
- rw [lintegral_one, measure.fst_univ]
- exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_nat_cast_atTop_atTop
- exact tendsto_nhds_unique h_lintegral h_lintegral'
- have : ∫⁻ a, 1 - F a ∂ρ.fst = 0 :=
- by
- rw [lintegral_sub' hF_ae_meas _ hF_le_one, h_lintegral_eq, tsub_self]
- calc
- ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst := h_lintegral_eq
- _ = ρ.fst univ := lintegral_one
- _ = ρ univ := measure.fst_univ
- _ ≠ ∞ := measure_ne_top ρ _
- rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
- filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
- rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
- exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCDF_atTop_one
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
#print ProbabilityTheory.tendsto_preCDF_atBot_zero /-
+-- let `F` be the pointwise limit of `pre_cdf` where it exists, and 0 elsewhere.
+-- it suffices to show that the limit `F` is 1 a.e.
+-- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
+-- us that `F` is 1 a.e.
+-- does this exist only for ℕ?
theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0) :=
by
@@ -582,58 +533,6 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
· exact ⟨0, tendsto.mono_right h_bot atBot_le_nhds_bot⟩
· exact h_tendsto
classical
- let F : α → ℝ≥0∞ := fun a =>
- if h : ∃ l, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 l) then h.some else 0
- have h_tendsto : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 (F a)) :=
- by
- filter_upwards [h_exists] with a ha
- simp_rw [F, dif_pos ha]
- exact ha.some_spec
- suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0
- · have hF_ae_meas : AEMeasurable F ρ.fst :=
- by
- refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
- exact measurable_pre_cdf.ae_measurable
- rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
- filter_upwards [h_tendsto, h_lintegral_eq] with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
- have h_lintegral :
- tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
- by
- refine'
- tendsto_lintegral_filter_of_dominated_convergence (fun _ => 1)
- (eventually_of_forall fun _ => measurable_pre_cdf) (eventually_of_forall fun _ => _) _
- h_tendsto
- · filter_upwards [pre_cdf_le_one ρ] with a ha using ha _
- · rw [lintegral_one]
- exact measure_ne_top _ _
- have h_lintegral' : tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 0) :=
- by
- have h_lintegral_eq :
- (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) = fun r => ρ (univ ×ˢ Iic (-r)) :=
- by
- ext1 n
- rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ,
- measure.Iic_snd_univ]
- norm_cast
- rw [h_lintegral_eq]
- have h_zero_eq_measure_Inter : (0 : ℝ≥0∞) = ρ (⋂ r : ℚ, univ ×ˢ Iic (-r)) :=
- by
- suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by
- rwa [← Set.prod_iInter, this, prod_empty, measure_empty]
- ext1 x
- simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, Classical.not_forall,
- not_le]
- simp_rw [neg_lt]
- exact exists_rat_gt _
- rw [h_zero_eq_measure_Inter]
- refine'
- tendsto_measure_Inter (fun n => measurable_set.univ.prod measurableSet_Iic)
- (fun i j hij x => _) ⟨0, measure_ne_top ρ _⟩
- simp only [mem_prod, mem_univ, mem_Iic, true_and_iff]
- refine' fun hxj => hxj.trans (neg_le_neg _)
- exact_mod_cast hij
- exact tendsto_nhds_unique h_lintegral h_lintegral'
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCDF_atBot_zero
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -75,14 +75,14 @@ end Directed
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print prod_iInter /-
+#print Set.prod_iInter /-
-- todo: move to data/set/lattice next to prod_Union or prod_sInter
-theorem prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
+theorem Set.prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
(s ×ˢ ⋂ i, t i) = ⋂ i, s ×ˢ t i := by
ext x
simp only [mem_prod, mem_Inter]
exact ⟨fun h i => ⟨h.1, h.2 i⟩, fun h => ⟨(h hι.some).1, fun i => (h i).2⟩⟩
-#align prod_Inter prod_iInter
+#align prod_Inter Set.prod_iInter
-/
#print Real.iUnion_Iic_rat /-
@@ -277,7 +277,7 @@ theorem iInf_IicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMe
by
simp_rw [ρ.Iic_snd_apply _ hs]
rw [← measure_Inter_eq_infi]
- · rw [← prod_iInter]
+ · rw [← Set.prod_iInter]
congr with x : 1
simp only [mem_Inter, mem_Iic, Subtype.forall, Subtype.coe_mk]
refine' ⟨fun h => _, fun h a hta => h.trans _⟩
@@ -319,7 +319,7 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
by
simp_rw [ρ.Iic_snd_apply _ hs]
have h_empty : ρ (s ×ˢ ∅) = 0 := by simp only [prod_empty, measure_empty]
- rw [← h_empty, ← Real.iInter_Iic_rat, prod_iInter]
+ rw [← h_empty, ← Real.iInter_Iic_rat, Set.prod_iInter]
suffices h_neg :
tendsto (fun r : ℚ => ρ (s ×ˢ Iic ↑(-r))) at_top (𝓝 (ρ (⋂ r : ℚ, s ×ˢ Iic ↑(-r))))
· have h_inter_eq : (⋂ r : ℚ, s ×ˢ Iic ↑(-r)) = ⋂ r : ℚ, s ×ˢ Iic (r : ℝ) :=
@@ -619,7 +619,8 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
rw [h_lintegral_eq]
have h_zero_eq_measure_Inter : (0 : ℝ≥0∞) = ρ (⋂ r : ℚ, univ ×ˢ Iic (-r)) :=
by
- suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by rwa [← prod_iInter, this, prod_empty, measure_empty]
+ suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by
+ rwa [← Set.prod_iInter, this, prod_empty, measure_empty]
ext1 x
simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, Classical.not_forall,
not_le]
@@ -1136,7 +1137,7 @@ theorem set_lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
exact_mod_cast hij
simp_rw [h_coe, set_lintegral_cond_cdf_rat ρ _ hs]
rw [← measure_Inter_eq_infi]
- · rw [← prod_iInter]
+ · rw [← Set.prod_iInter]
congr with y
simp only [mem_Inter, mem_Iic, Subtype.forall, Subtype.coe_mk]
exact ⟨le_of_forall_lt_rat_imp_le, fun hyx q hq => hyx.trans hq.le⟩
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -360,7 +360,7 @@ everywhere. We then introduce `probability_theory.cond_cdf_rat`, a function on `
the properties of a cdf for all `a : α`. We finally extend to `ℝ`. -/
-#print ProbabilityTheory.preCdf /-
+#print ProbabilityTheory.preCDF /-
/-- `pre_cdf` is the Radon-Nikodym derivative of `ρ.Iic_snd` with respect to `ρ.fst` at each
`r : ℚ`. This function `ℚ → α → ℝ≥0∞` is such that for almost all `a : α`, the function `ℚ → ℝ≥0∞`
satisfies the properties of a cdf (monotone with limit 0 at -∞ and 1 at +∞, right-continuous).
@@ -368,27 +368,27 @@ satisfies the properties of a cdf (monotone with limit 0 at -∞ and 1 at +∞,
We define this function on `ℚ` and not `ℝ` because `ℚ` is countable, which allows us to prove
properties of the form `∀ᵐ a ∂ρ.fst, ∀ q, P (pre_cdf q a)`, instead of the weaker
`∀ q, ∀ᵐ a ∂ρ.fst, P (pre_cdf q a)`. -/
-noncomputable def preCdf (ρ : Measure (α × ℝ)) (r : ℚ) : α → ℝ≥0∞ :=
+noncomputable def preCDF (ρ : Measure (α × ℝ)) (r : ℚ) : α → ℝ≥0∞ :=
Measure.rnDeriv (ρ.IicSnd r) ρ.fst
-#align probability_theory.pre_cdf ProbabilityTheory.preCdf
+#align probability_theory.pre_cdf ProbabilityTheory.preCDF
-/
-#print ProbabilityTheory.measurable_preCdf /-
-theorem measurable_preCdf {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (preCdf ρ r) :=
+#print ProbabilityTheory.measurable_preCDF /-
+theorem measurable_preCDF {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (preCDF ρ r) :=
Measure.measurable_rnDeriv _ _
-#align probability_theory.measurable_pre_cdf ProbabilityTheory.measurable_preCdf
+#align probability_theory.measurable_pre_cdf ProbabilityTheory.measurable_preCDF
-/
-#print ProbabilityTheory.withDensity_preCdf /-
-theorem withDensity_preCdf (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
- ρ.fst.withDensity (preCdf ρ r) = ρ.IicSnd r :=
+#print ProbabilityTheory.withDensity_preCDF /-
+theorem withDensity_preCDF (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
+ ρ.fst.withDensity (preCDF ρ r) = ρ.IicSnd r :=
Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq.mp (Measure.IicSnd_ac_fst ρ r)
-#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCdf
+#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCDF
-/
-#print ProbabilityTheory.set_lintegral_preCdf_fst /-
-theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
- [IsFiniteMeasure ρ] : ∫⁻ x in s, preCdf ρ r x ∂ρ.fst = ρ.IicSnd r s :=
+#print ProbabilityTheory.set_lintegral_preCDF_fst /-
+theorem set_lintegral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
+ [IsFiniteMeasure ρ] : ∫⁻ x in s, preCDF ρ r x ∂ρ.fst = ρ.IicSnd r s :=
by
have : ∀ r, ∫⁻ x in s, pre_cdf ρ r x ∂ρ.fst = ∫⁻ x in s, (pre_cdf ρ r * 1) x ∂ρ.fst := by
simp only [mul_one, eq_self_iff_true, forall_const]
@@ -398,12 +398,12 @@ theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set
MeasurableSet.univ, univ_inter]
· rw [(_ : (1 : α → ℝ≥0∞) = fun _ => 1)]
exacts [measurable_const, rfl]
-#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCdf_fst
+#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCDF_fst
-/
-#print ProbabilityTheory.monotone_preCdf /-
-theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, Monotone fun r => preCdf ρ r a :=
+#print ProbabilityTheory.monotone_preCDF /-
+theorem monotone_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, Monotone fun r => preCDF ρ r a :=
by
simp_rw [Monotone, ae_all_iff]
refine' fun r r' hrr' =>
@@ -412,12 +412,12 @@ theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
rw [set_lintegral_pre_cdf_fst ρ r hs, set_lintegral_pre_cdf_fst ρ r' hs]
refine' measure.Iic_snd_mono ρ _ s hs
exact_mod_cast hrr'
-#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCdf
+#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCDF
-/
-#print ProbabilityTheory.set_lintegral_iInf_gt_preCdf /-
-theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
- (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst = ρ.IicSnd t s :=
+#print ProbabilityTheory.set_lintegral_iInf_gt_preCDF /-
+theorem set_lintegral_iInf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
+ (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCDF ρ r x ∂ρ.fst = ρ.IicSnd t s :=
by
refine' le_antisymm _ _
· have h : ∀ q : Ioi t, ∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst ≤ ρ.Iic_snd q s :=
@@ -436,12 +436,12 @@ theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure
· exact measurable_iInf fun _ => measurable_pre_cdf
· filter_upwards [monotone_pre_cdf] with a ha_mono
exact fun _ => le_iInf fun r => ha_mono (le_of_lt r.Prop)
-#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCdf
+#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCDF
-/
-#print ProbabilityTheory.preCdf_le_one /-
-theorem preCdf_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, ∀ r, preCdf ρ r a ≤ 1 := by
+#print ProbabilityTheory.preCDF_le_one /-
+theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, ∀ r, preCDF ρ r a ≤ 1 := by
rw [ae_all_iff]
refine' fun r =>
ae_le_of_forall_set_lintegral_le_of_sigma_finite measurable_pre_cdf measurable_const
@@ -449,33 +449,33 @@ theorem preCdf_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
rw [set_lintegral_pre_cdf_fst ρ r hs]
simp only [Pi.one_apply, lintegral_one, measure.restrict_apply, MeasurableSet.univ, univ_inter]
exact measure.Iic_snd_le_fst ρ r s hs
-#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCdf_le_one
+#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCDF_le_one
-/
-#print ProbabilityTheory.tendsto_lintegral_preCdf_atTop /-
-theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) :=
+#print ProbabilityTheory.tendsto_lintegral_preCDF_atTop /-
+theorem tendsto_lintegral_preCDF_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ Tendsto (fun r => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) :=
by
convert ρ.tendsto_Iic_snd_at_top MeasurableSet.univ
· ext1 r
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
· exact measure.fst_univ.symm
-#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCdf_atTop
+#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCDF_atTop
-/
-#print ProbabilityTheory.tendsto_lintegral_preCdf_atBot /-
-theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atBot (𝓝 0) :=
+#print ProbabilityTheory.tendsto_lintegral_preCDF_atBot /-
+theorem tendsto_lintegral_preCDF_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ Tendsto (fun r => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atBot (𝓝 0) :=
by
convert ρ.tendsto_Iic_snd_at_bot MeasurableSet.univ
ext1 r
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
-#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCdf_atBot
+#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCDF_atBot
-/
-#print ProbabilityTheory.tendsto_preCdf_atTop_one /-
-theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1) :=
+#print ProbabilityTheory.tendsto_preCDF_atTop_one /-
+theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 1) :=
by
-- We show first that `pre_cdf` has a limit almost everywhere. That limit has to be at most 1.
-- We then show that the integral of `pre_cdf` tends to the integral of 1, and that it also tends
@@ -551,14 +551,14 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
exact le_antisymm h_le_one h_one_sub_eq_zero
-#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCdf_atTop_one
+#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCDF_atTop_one
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.tendsto_preCdf_atBot_zero /-
-theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0) :=
+#print ProbabilityTheory.tendsto_preCDF_atBot_zero /-
+theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0) :=
by
-- We show first that `pre_cdf` has a limit in ℝ≥0∞ almost everywhere.
-- We then show that the integral of `pre_cdf` tends to 0, and that it also tends
@@ -633,105 +633,105 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
refine' fun hxj => hxj.trans (neg_le_neg _)
exact_mod_cast hij
exact tendsto_nhds_unique h_lintegral h_lintegral'
-#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCdf_atBot_zero
+#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCDF_atBot_zero
-/
-#print ProbabilityTheory.inf_gt_preCdf /-
-theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a :=
+#print ProbabilityTheory.inf_gt_preCDF /-
+theorem inf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, (⨅ r : Ioi t, preCDF ρ r a) = preCDF ρ t a :=
by
rw [ae_all_iff]
refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigma_finite _ measurable_pre_cdf _
· exact measurable_iInf fun i => measurable_pre_cdf
intro s hs hs_fin
rw [set_lintegral_infi_gt_pre_cdf ρ t hs, set_lintegral_pre_cdf_fst ρ t hs]
-#align probability_theory.inf_gt_pre_cdf ProbabilityTheory.inf_gt_preCdf
+#align probability_theory.inf_gt_pre_cdf ProbabilityTheory.inf_gt_preCDF
-/
section HasCondCdf
-#print ProbabilityTheory.HasCondCdf /-
+#print ProbabilityTheory.HasCondCDF /-
/-- A product measure on `α × ℝ` is said to have a conditional cdf at `a : α` if `pre_cdf` is
monotone with limit 0 at -∞ and 1 at +∞, and is right continuous.
This property holds almost everywhere (see `has_cond_cdf_ae`). -/
-structure HasCondCdf (ρ : Measure (α × ℝ)) (a : α) : Prop where
- mono : Monotone fun r => preCdf ρ r a
- le_one : ∀ r, preCdf ρ r a ≤ 1
- tendsto_atTop_one : Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1)
- tendsto_atBot_zero : Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0)
- iInf_rat_gt_eq : ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a
-#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCdf
+structure HasCondCDF (ρ : Measure (α × ℝ)) (a : α) : Prop where
+ mono : Monotone fun r => preCDF ρ r a
+ le_one : ∀ r, preCDF ρ r a ≤ 1
+ tendsto_atTop_one : Tendsto (fun r => preCDF ρ r a) atTop (𝓝 1)
+ tendsto_atBot_zero : Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0)
+ iInf_rat_gt_eq : ∀ t : ℚ, (⨅ r : Ioi t, preCDF ρ r a) = preCDF ρ t a
+#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCDF
-/
-#print ProbabilityTheory.hasCondCdf_ae /-
-theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a :=
+#print ProbabilityTheory.hasCondCDF_ae /-
+theorem hasCondCDF_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCDF ρ a :=
by
filter_upwards [monotone_pre_cdf ρ, pre_cdf_le_one ρ, tendsto_pre_cdf_at_top_one ρ,
tendsto_pre_cdf_at_bot_zero ρ, inf_gt_pre_cdf ρ] with a h1 h2 h3 h4 h5
exact ⟨h1, h2, h3, h4, h5⟩
-#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCdf_ae
+#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCDF_ae
-/
-#print ProbabilityTheory.condCdfSet /-
+#print ProbabilityTheory.condCDFSet /-
/-- A measurable set of elements of `α` such that `ρ` has a conditional cdf at all
`a ∈ cond_cdf_set`. -/
-def condCdfSet (ρ : Measure (α × ℝ)) : Set α :=
- toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}ᶜ
-#align probability_theory.cond_cdf_set ProbabilityTheory.condCdfSet
+def condCDFSet (ρ : Measure (α × ℝ)) : Set α :=
+ toMeasurable ρ.fst {b | ¬HasCondCDF ρ b}ᶜ
+#align probability_theory.cond_cdf_set ProbabilityTheory.condCDFSet
-/
-#print ProbabilityTheory.measurableSet_condCdfSet /-
-theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCdfSet ρ) :=
+#print ProbabilityTheory.measurableSet_condCDFSet /-
+theorem measurableSet_condCDFSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCDFSet ρ) :=
(measurableSet_toMeasurable _ _).compl
-#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCdfSet
+#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCDFSet
-/
-#print ProbabilityTheory.hasCondCdf_of_mem_condCdfSet /-
-theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
- HasCondCdf ρ a := by
+#print ProbabilityTheory.hasCondCDF_of_mem_condCDFSet /-
+theorem hasCondCDF_of_mem_condCDFSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCDFSet ρ) :
+ HasCondCDF ρ a := by
rw [cond_cdf_set, mem_compl_iff] at h
have h_ss := subset_to_measurable ρ.fst {b | ¬has_cond_cdf ρ b}
by_contra ha
exact h (h_ss ha)
-#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCdf_of_mem_condCdfSet
+#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCDF_of_mem_condCDFSet
-/
-#print ProbabilityTheory.mem_condCdfSet_ae /-
-theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ :=
+#print ProbabilityTheory.mem_condCDFSet_ae /-
+theorem mem_condCDFSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, a ∈ condCDFSet ρ :=
by
simp_rw [ae_iff, cond_cdf_set, not_mem_compl_iff, set_of_mem_eq, measure_to_measurable]
exact has_cond_cdf_ae ρ
-#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCdfSet_ae
+#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCDFSet_ae
-/
end HasCondCdf
open scoped Classical
-#print ProbabilityTheory.condCdfRat /-
+#print ProbabilityTheory.condCDFRat /-
/-- Conditional cdf of the measure given the value on `α`, restricted to the rationals.
It is defined to be `pre_cdf` if `a ∈ cond_cdf_set`, and a default cdf-like function
otherwise. This is an auxiliary definition used to define `cond_cdf`. -/
-noncomputable def condCdfRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
- if a ∈ condCdfSet ρ then fun r => (preCdf ρ r a).toReal else fun r => if r < 0 then 0 else 1
-#align probability_theory.cond_cdf_rat ProbabilityTheory.condCdfRat
+noncomputable def condCDFRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
+ if a ∈ condCDFSet ρ then fun r => (preCDF ρ r a).toReal else fun r => if r < 0 then 0 else 1
+#align probability_theory.cond_cdf_rat ProbabilityTheory.condCDFRat
-/
-#print ProbabilityTheory.condCdfRat_of_not_mem /-
-theorem condCdfRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCdfSet ρ) {r : ℚ} :
- condCdfRat ρ a r = if r < 0 then 0 else 1 := by simp only [cond_cdf_rat, h, if_false]
-#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCdfRat_of_not_mem
+#print ProbabilityTheory.condCDFRat_of_not_mem /-
+theorem condCDFRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCDFSet ρ) {r : ℚ} :
+ condCDFRat ρ a r = if r < 0 then 0 else 1 := by simp only [cond_cdf_rat, h, if_false]
+#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCDFRat_of_not_mem
-/
-#print ProbabilityTheory.condCdfRat_of_mem /-
-theorem condCdfRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCdfSet ρ) (r : ℚ) :
- condCdfRat ρ a r = (preCdf ρ r a).toReal := by simp only [cond_cdf_rat, h, if_true]
-#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCdfRat_of_mem
+#print ProbabilityTheory.condCDFRat_of_mem /-
+theorem condCDFRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCDFSet ρ) (r : ℚ) :
+ condCDFRat ρ a r = (preCDF ρ r a).toReal := by simp only [cond_cdf_rat, h, if_true]
+#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCDFRat_of_mem
-/
-#print ProbabilityTheory.monotone_condCdfRat /-
-theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) :=
+#print ProbabilityTheory.monotone_condCDFRat /-
+theorem monotone_condCDFRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCDFRat ρ a) :=
by
by_cases h : a ∈ cond_cdf_set ρ
· simp only [cond_cdf_rat, h, if_true, forall_const, and_self_iff]
@@ -746,28 +746,28 @@ theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (cond
dsimp only
split_ifs
exacts [le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
-#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCdfRat
+#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCDFRat
-/
-#print ProbabilityTheory.measurable_condCdfRat /-
-theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
- Measurable fun a => condCdfRat ρ a q :=
+#print ProbabilityTheory.measurable_condCDFRat /-
+theorem measurable_condCDFRat (ρ : Measure (α × ℝ)) (q : ℚ) :
+ Measurable fun a => condCDFRat ρ a q :=
by
simp_rw [cond_cdf_rat, ite_apply]
exact
Measurable.ite (measurable_set_cond_cdf_set ρ) measurable_pre_cdf.ennreal_to_real
measurable_const
-#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCdfRat
+#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCDFRat
-/
-#print ProbabilityTheory.condCdfRat_nonneg /-
-theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
+#print ProbabilityTheory.condCDFRat_nonneg /-
+theorem condCDFRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCDFRat ρ a r := by
unfold cond_cdf_rat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
-#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCdfRat_nonneg
+#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCDFRat_nonneg
-/
-#print ProbabilityTheory.condCdfRat_le_one /-
-theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 :=
+#print ProbabilityTheory.condCDFRat_le_one /-
+theorem condCDFRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCDFRat ρ a r ≤ 1 :=
by
unfold cond_cdf_rat
split_ifs with h
@@ -775,12 +775,12 @@ theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCd
rw [ENNReal.ofReal_one]
exact (has_cond_cdf_of_mem_cond_cdf_set h).le_one r
exacts [zero_le_one, le_rfl]
-#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCdfRat_le_one
+#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCDFRat_le_one
-/
-#print ProbabilityTheory.tendsto_condCdfRat_atBot /-
-theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCdfRat ρ a) atBot (𝓝 0) :=
+#print ProbabilityTheory.tendsto_condCDFRat_atBot /-
+theorem tendsto_condCDFRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCDFRat ρ a) atBot (𝓝 0) :=
by
unfold cond_cdf_rat
split_ifs with h
@@ -793,12 +793,12 @@ theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
rw [eventually_eq, eventually_at_bot]
refine' ⟨-1, fun q hq => (if_pos (hq.trans_lt _)).symm⟩
linarith
-#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCdfRat_atBot
+#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCDFRat_atBot
-/
-#print ProbabilityTheory.tendsto_condCdfRat_atTop /-
-theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCdfRat ρ a) atTop (𝓝 1) :=
+#print ProbabilityTheory.tendsto_condCDFRat_atTop /-
+theorem tendsto_condCDFRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCDFRat ρ a) atTop (𝓝 1) :=
by
unfold cond_cdf_rat
split_ifs with h
@@ -810,29 +810,29 @@ theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
· refine' (tendsto_congr' _).mp tendsto_const_nhds
rw [eventually_eq, eventually_at_top]
exact ⟨0, fun q hq => (if_neg (not_lt.mpr hq)).symm⟩
-#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCdfRat_atTop
+#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCDFRat_atTop
-/
-#print ProbabilityTheory.condCdfRat_ae_eq /-
-theorem condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => condCdfRat ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
+#print ProbabilityTheory.condCDFRat_ae_eq /-
+theorem condCDFRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => condCDFRat ρ a r) =ᵐ[ρ.fst] fun a => (preCDF ρ r a).toReal := by
filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using cond_cdf_rat_of_mem ρ a ha r
-#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCdfRat_ae_eq
+#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCDFRat_ae_eq
-/
-#print ProbabilityTheory.ofReal_condCdfRat_ae_eq /-
-theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => ENNReal.ofReal (condCdfRat ρ a r)) =ᵐ[ρ.fst] preCdf ρ r :=
+#print ProbabilityTheory.ofReal_condCDFRat_ae_eq /-
+theorem ofReal_condCDFRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => ENNReal.ofReal (condCDFRat ρ a r)) =ᵐ[ρ.fst] preCDF ρ r :=
by
filter_upwards [cond_cdf_rat_ae_eq ρ r, pre_cdf_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
-#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCdfRat_ae_eq
+#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCDFRat_ae_eq
-/
-#print ProbabilityTheory.inf_gt_condCdfRat /-
-theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
- (⨅ r : Ioi t, condCdfRat ρ a r) = condCdfRat ρ a t :=
+#print ProbabilityTheory.inf_gt_condCDFRat /-
+theorem inf_gt_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
+ (⨅ r : Ioi t, condCDFRat ρ a r) = condCDFRat ρ a t :=
by
by_cases ha : a ∈ cond_cdf_set ρ
· simp_rw [cond_cdf_rat_of_mem ρ a ha]
@@ -869,26 +869,26 @@ theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
rw [if_neg]
rw [not_lt] at h ⊢
exact h.trans (mem_Ioi.mp x.prop).le
-#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCdfRat
+#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCDFRat
-/
-#print ProbabilityTheory.condCdf' /-
+#print ProbabilityTheory.condCDF' /-
/-- Conditional cdf of the measure given the value on `α`, as a plain function. This is an auxiliary
definition used to define `cond_cdf`. -/
-noncomputable irreducible_def condCdf' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
- ⨅ r : { r' : ℚ // t < r' }, condCdfRat ρ a r
-#align probability_theory.cond_cdf' ProbabilityTheory.condCdf'
+noncomputable irreducible_def condCDF' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
+ ⨅ r : { r' : ℚ // t < r' }, condCDFRat ρ a r
+#align probability_theory.cond_cdf' ProbabilityTheory.condCDF'
-/
-#print ProbabilityTheory.condCdf'_def' /-
-theorem condCdf'_def' {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
- condCdf' ρ a x = ⨅ r : { r : ℚ // x < r }, condCdfRat ρ a r := by rw [cond_cdf']
-#align probability_theory.cond_cdf'_def ProbabilityTheory.condCdf'_def'
+#print ProbabilityTheory.condCDF'_def' /-
+theorem condCDF'_def' {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
+ condCDF' ρ a x = ⨅ r : { r : ℚ // x < r }, condCDFRat ρ a r := by rw [cond_cdf']
+#align probability_theory.cond_cdf'_def ProbabilityTheory.condCDF'_def'
-/
-#print ProbabilityTheory.condCdf'_eq_condCdfRat /-
-theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
- condCdf' ρ a r = condCdfRat ρ a r :=
+#print ProbabilityTheory.condCDF'_eq_condCDFRat /-
+theorem condCDF'_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
+ condCDF' ρ a r = condCDFRat ρ a r :=
by
rw [← inf_gt_cond_cdf_rat ρ a r, cond_cdf']
refine' Equiv.iInf_congr _ _
@@ -900,11 +900,11 @@ theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
right_inv := fun t => by simp only [Subtype.val_eq_coe, Subtype.coe_eta] }
· intro t
simp only [Subtype.val_eq_coe, Equiv.coe_fn_mk, Subtype.coe_mk]
-#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCdf'_eq_condCdfRat
+#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCDF'_eq_condCDFRat
-/
-#print ProbabilityTheory.condCdf'_nonneg /-
-theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf' ρ a r :=
+#print ProbabilityTheory.condCDF'_nonneg /-
+theorem condCDF'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF' ρ a r :=
by
have : Nonempty { r' : ℚ // r < ↑r' } :=
by
@@ -912,18 +912,18 @@ theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ co
exact ⟨⟨r, hrx⟩⟩
rw [cond_cdf'_def]
exact le_ciInf fun r' => cond_cdf_rat_nonneg ρ a _
-#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCdf'_nonneg
+#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCDF'_nonneg
-/
-#print ProbabilityTheory.bddBelow_range_condCdfRat_gt /-
-theorem bddBelow_range_condCdfRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCdfRat ρ a r) := by
+#print ProbabilityTheory.bddBelow_range_condCDFRat_gt /-
+theorem bddBelow_range_condCDFRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCDFRat ρ a r) := by
refine' ⟨0, fun z => _⟩; rintro ⟨u, rfl⟩; exact cond_cdf_rat_nonneg ρ a _
-#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCdfRat_gt
+#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCDFRat_gt
-/
-#print ProbabilityTheory.monotone_condCdf' /-
-theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdf' ρ a) :=
+#print ProbabilityTheory.monotone_condCDF' /-
+theorem monotone_condCDF' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCDF' ρ a) :=
by
intro x y hxy
have : Nonempty { r' : ℚ // y < ↑r' } :=
@@ -935,12 +935,12 @@ theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCd
· exact ⟨r.1, hxy.trans_lt r.prop⟩
· exact bdd_below_range_cond_cdf_rat_gt ρ a x
· rfl
-#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCdf'
+#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCDF'
-/
-#print ProbabilityTheory.continuousWithinAt_condCdf'_Ici /-
-theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- ContinuousWithinAt (condCdf' ρ a) (Ici x) x :=
+#print ProbabilityTheory.continuousWithinAt_condCDF'_Ici /-
+theorem continuousWithinAt_condCDF'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ ContinuousWithinAt (condCDF' ρ a) (Ici x) x :=
by
rw [← continuousWithinAt_Ioi_iff_Ici]
convert Monotone.tendsto_nhdsWithin_Ioi (monotone_cond_cdf' ρ a) x
@@ -960,51 +960,51 @@ theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
rw [h', h'', ContinuousWithinAt]
congr
exact cond_cdf'_def
-#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCdf'_Ici
+#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCDF'_Ici
-/
/-! ### Conditional cdf -/
-#print ProbabilityTheory.condCdf /-
+#print ProbabilityTheory.condCDF /-
/-- Conditional cdf of the measure given the value on `α`, as a Stieltjes function. -/
-noncomputable def condCdf (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunction
+noncomputable def condCDF (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunction
where
- toFun := condCdf' ρ a
- mono' := monotone_condCdf' ρ a
- right_continuous' x := continuousWithinAt_condCdf'_Ici ρ a x
-#align probability_theory.cond_cdf ProbabilityTheory.condCdf
+ toFun := condCDF' ρ a
+ mono' := monotone_condCDF' ρ a
+ right_continuous' x := continuousWithinAt_condCDF'_Ici ρ a x
+#align probability_theory.cond_cdf ProbabilityTheory.condCDF
-/
-#print ProbabilityTheory.condCdf_eq_condCdfRat /-
-theorem condCdf_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
- condCdf ρ a r = condCdfRat ρ a r :=
- condCdf'_eq_condCdfRat ρ a r
-#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCdf_eq_condCdfRat
+#print ProbabilityTheory.condCDF_eq_condCDFRat /-
+theorem condCDF_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
+ condCDF ρ a r = condCDFRat ρ a r :=
+ condCDF'_eq_condCDFRat ρ a r
+#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCDF_eq_condCDFRat
-/
-#print ProbabilityTheory.condCdf_nonneg /-
+#print ProbabilityTheory.condCDF_nonneg /-
/-- The conditional cdf is non-negative for all `a : α`. -/
-theorem condCdf_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf ρ a r :=
- condCdf'_nonneg ρ a r
-#align probability_theory.cond_cdf_nonneg ProbabilityTheory.condCdf_nonneg
+theorem condCDF_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF ρ a r :=
+ condCDF'_nonneg ρ a r
+#align probability_theory.cond_cdf_nonneg ProbabilityTheory.condCDF_nonneg
-/
-#print ProbabilityTheory.condCdf_le_one /-
+#print ProbabilityTheory.condCDF_le_one /-
/-- The conditional cdf is lower or equal to 1 for all `a : α`. -/
-theorem condCdf_le_one (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) : condCdf ρ a x ≤ 1 :=
+theorem condCDF_le_one (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) : condCDF ρ a x ≤ 1 :=
by
obtain ⟨r, hrx⟩ := exists_rat_gt x
rw [← StieltjesFunction.iInf_rat_gt_eq]
simp_rw [coe_coe, cond_cdf_eq_cond_cdf_rat]
refine' ciInf_le_of_le (bdd_below_range_cond_cdf_rat_gt ρ a x) _ (cond_cdf_rat_le_one _ _ _)
exact ⟨r, hrx⟩
-#align probability_theory.cond_cdf_le_one ProbabilityTheory.condCdf_le_one
+#align probability_theory.cond_cdf_le_one ProbabilityTheory.condCDF_le_one
-/
-#print ProbabilityTheory.tendsto_condCdf_atBot /-
+#print ProbabilityTheory.tendsto_condCDF_atBot /-
/-- The conditional cdf tends to 0 at -∞ for all `a : α`. -/
-theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (condCdf ρ a) atBot (𝓝 0) :=
+theorem tendsto_condCDF_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (condCDF ρ a) atBot (𝓝 0) :=
by
have h_exists : ∀ x : ℝ, ∃ q : ℚ, x < q ∧ ↑q < x + 1 := fun x => exists_rat_btwn (lt_add_one x)
let qs : ℝ → ℚ := fun x => (h_exists x).some
@@ -1021,12 +1021,12 @@ theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
((tendsto_cond_cdf_rat_at_bot ρ a).comp hqs_tendsto) (cond_cdf_nonneg ρ a) fun x => _
rw [Function.comp_apply, ← cond_cdf_eq_cond_cdf_rat]
exact (cond_cdf ρ a).mono (h_exists x).choose_spec.1.le
-#align probability_theory.tendsto_cond_cdf_at_bot ProbabilityTheory.tendsto_condCdf_atBot
+#align probability_theory.tendsto_cond_cdf_at_bot ProbabilityTheory.tendsto_condCDF_atBot
-/
-#print ProbabilityTheory.tendsto_condCdf_atTop /-
+#print ProbabilityTheory.tendsto_condCDF_atTop /-
/-- The conditional cdf tends to 1 at +∞ for all `a : α`. -/
-theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (condCdf ρ a) atTop (𝓝 1) :=
+theorem tendsto_condCDF_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (condCDF ρ a) atTop (𝓝 1) :=
by
have h_exists : ∀ x : ℝ, ∃ q : ℚ, x - 1 < q ∧ ↑q < x := fun x => exists_rat_btwn (sub_one_lt x)
let qs : ℝ → ℚ := fun x => (h_exists x).some
@@ -1043,30 +1043,30 @@ theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
intro x
rw [Function.comp_apply, ← cond_cdf_eq_cond_cdf_rat]
exact (cond_cdf ρ a).mono (le_of_lt (h_exists x).choose_spec.2)
-#align probability_theory.tendsto_cond_cdf_at_top ProbabilityTheory.tendsto_condCdf_atTop
+#align probability_theory.tendsto_cond_cdf_at_top ProbabilityTheory.tendsto_condCDF_atTop
-/
-#print ProbabilityTheory.condCdf_ae_eq /-
-theorem condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => condCdf ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
+#print ProbabilityTheory.condCDF_ae_eq /-
+theorem condCDF_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => condCDF ρ a r) =ᵐ[ρ.fst] fun a => (preCDF ρ r a).toReal := by
filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using
(cond_cdf_eq_cond_cdf_rat ρ a r).trans (cond_cdf_rat_of_mem ρ a ha r)
-#align probability_theory.cond_cdf_ae_eq ProbabilityTheory.condCdf_ae_eq
+#align probability_theory.cond_cdf_ae_eq ProbabilityTheory.condCDF_ae_eq
-/
-#print ProbabilityTheory.ofReal_condCdf_ae_eq /-
-theorem ofReal_condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => ENNReal.ofReal (condCdf ρ a r)) =ᵐ[ρ.fst] preCdf ρ r :=
+#print ProbabilityTheory.ofReal_condCDF_ae_eq /-
+theorem ofReal_condCDF_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => ENNReal.ofReal (condCDF ρ a r)) =ᵐ[ρ.fst] preCDF ρ r :=
by
filter_upwards [cond_cdf_ae_eq ρ r, pre_cdf_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
-#align probability_theory.of_real_cond_cdf_ae_eq ProbabilityTheory.ofReal_condCdf_ae_eq
+#align probability_theory.of_real_cond_cdf_ae_eq ProbabilityTheory.ofReal_condCDF_ae_eq
-/
-#print ProbabilityTheory.measurable_condCdf /-
+#print ProbabilityTheory.measurable_condCDF /-
/-- The conditional cdf is a measurable function of `a : α` for all `x : ℝ`. -/
-theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun a => condCdf ρ a x :=
+theorem measurable_condCDF (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun a => condCDF ρ a x :=
by
have : (fun a => cond_cdf ρ a x) = fun a => ⨅ r : { r' // x < ↑r' }, cond_cdf_rat ρ a ↑r :=
by
@@ -1078,27 +1078,27 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
exact
measurable_cinfi (fun q => measurable_cond_cdf_rat ρ q) fun a =>
bdd_below_range_cond_cdf_rat_gt ρ a _
-#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCdf
+#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCDF
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.set_lintegral_condCdf_rat /-
+#print ProbabilityTheory.set_lintegral_condCDF_rat /-
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
-theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
- (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic r) :=
+theorem set_lintegral_condCDF_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
+ (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic r) :=
by
have : ∀ᵐ a ∂ρ.fst, a ∈ s → ENNReal.ofReal (cond_cdf ρ a r) = pre_cdf ρ r a := by
filter_upwards [of_real_cond_cdf_ae_eq ρ r] with a ha using fun _ => ha
rw [set_lintegral_congr_fun hs this, set_lintegral_pre_cdf_fst ρ r hs]
exact ρ.Iic_snd_apply r hs
-#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCdf_rat
+#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCDF_rat
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.set_lintegral_condCdf /-
-theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
- (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x) :=
+#print ProbabilityTheory.set_lintegral_condCDF /-
+theorem set_lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
+ (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x) :=
by
-- We have the result for `x : ℚ` thanks to `set_lintegral_cond_cdf_rat`. We use the equality
-- `cond_cdf ρ a x = ⨅ r : {r' : ℚ // x < r'}, cond_cdf ρ a r` and a monotone convergence
@@ -1145,28 +1145,28 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
refine' prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr _⟩)
exact_mod_cast hij
· exact ⟨h_nonempty.some, measure_ne_top _ _⟩
-#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCdf
+#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCDF
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.lintegral_condCdf /-
-theorem lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- ∫⁻ a, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x) := by
+#print ProbabilityTheory.lintegral_condCDF /-
+theorem lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
+ ∫⁻ a, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x) := by
rw [← set_lintegral_univ, set_lintegral_cond_cdf ρ _ MeasurableSet.univ]
-#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCdf
+#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCDF
-/
-#print ProbabilityTheory.stronglyMeasurable_condCdf /-
+#print ProbabilityTheory.stronglyMeasurable_condCDF /-
/-- The conditional cdf is a strongly measurable function of `a : α` for all `x : ℝ`. -/
-theorem stronglyMeasurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) :
- StronglyMeasurable fun a => condCdf ρ a x :=
- (measurable_condCdf ρ x).StronglyMeasurable
-#align probability_theory.strongly_measurable_cond_cdf ProbabilityTheory.stronglyMeasurable_condCdf
+theorem stronglyMeasurable_condCDF (ρ : Measure (α × ℝ)) (x : ℝ) :
+ StronglyMeasurable fun a => condCDF ρ a x :=
+ (measurable_condCDF ρ x).StronglyMeasurable
+#align probability_theory.strongly_measurable_cond_cdf ProbabilityTheory.stronglyMeasurable_condCDF
-/
-#print ProbabilityTheory.integrable_condCdf /-
-theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- Integrable (fun a => condCdf ρ a x) ρ.fst :=
+#print ProbabilityTheory.integrable_condCDF /-
+theorem integrable_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
+ Integrable (fun a => condCDF ρ a x) ρ.fst :=
by
refine' integrable_of_forall_fin_meas_le _ (measure_lt_top ρ.fst univ) _ fun t ht hρt => _
· exact (strongly_measurable_cond_cdf ρ _).AEStronglyMeasurable
@@ -1180,13 +1180,13 @@ theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x :
_
simp only [Pi.one_apply, lintegral_one, measure.restrict_apply, MeasurableSet.univ, univ_inter]
exact measure_mono (subset_univ _)
-#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCdf
+#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCDF
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.set_integral_condCdf /-
-theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
- (hs : MeasurableSet s) : ∫ a in s, condCdf ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
+#print ProbabilityTheory.set_integral_condCDF /-
+theorem set_integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
+ (hs : MeasurableSet s) : ∫ a in s, condCDF ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
by
have h := set_lintegral_cond_cdf ρ x hs
rw [← of_real_integral_eq_lintegral_of_real] at h
@@ -1194,43 +1194,43 @@ theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
exact integral_nonneg fun _ => cond_cdf_nonneg _ _ _
· exact (integrable_cond_cdf _ _).IntegrableOn
· exact eventually_of_forall fun _ => cond_cdf_nonneg _ _ _
-#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCdf
+#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCDF
-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-#print ProbabilityTheory.integral_condCdf /-
-theorem integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- ∫ a, condCdf ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal := by
+#print ProbabilityTheory.integral_condCDF /-
+theorem integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
+ ∫ a, condCDF ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal := by
rw [← set_integral_cond_cdf ρ _ MeasurableSet.univ, measure.restrict_univ]
-#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCdf
+#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCDF
-/
section Measure
-#print ProbabilityTheory.measure_condCdf_Iic /-
-theorem measure_condCdf_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- (condCdf ρ a).Measure (Iic x) = ENNReal.ofReal (condCdf ρ a x) :=
+#print ProbabilityTheory.measure_condCDF_Iic /-
+theorem measure_condCDF_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ (condCDF ρ a).Measure (Iic x) = ENNReal.ofReal (condCDF ρ a x) :=
by
rw [← sub_zero (cond_cdf ρ a x)]
exact (cond_cdf ρ a).measure_Iic (tendsto_cond_cdf_at_bot ρ a) _
-#align probability_theory.measure_cond_cdf_Iic ProbabilityTheory.measure_condCdf_Iic
+#align probability_theory.measure_cond_cdf_Iic ProbabilityTheory.measure_condCDF_Iic
-/
-#print ProbabilityTheory.measure_condCdf_univ /-
-theorem measure_condCdf_univ (ρ : Measure (α × ℝ)) (a : α) : (condCdf ρ a).Measure univ = 1 :=
+#print ProbabilityTheory.measure_condCDF_univ /-
+theorem measure_condCDF_univ (ρ : Measure (α × ℝ)) (a : α) : (condCDF ρ a).Measure univ = 1 :=
by
rw [← ENNReal.ofReal_one, ← sub_zero (1 : ℝ)]
exact StieltjesFunction.measure_univ _ (tendsto_cond_cdf_at_bot ρ a) (tendsto_cond_cdf_at_top ρ a)
-#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCdf_univ
+#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCDF_univ
-/
-instance (ρ : Measure (α × ℝ)) (a : α) : IsProbabilityMeasure (condCdf ρ a).Measure :=
- ⟨measure_condCdf_univ ρ a⟩
+instance (ρ : Measure (α × ℝ)) (a : α) : IsProbabilityMeasure (condCDF ρ a).Measure :=
+ ⟨measure_condCDF_univ ρ a⟩
-#print ProbabilityTheory.measurable_measure_condCdf /-
+#print ProbabilityTheory.measurable_measure_condCDF /-
/-- The function `a ↦ (cond_cdf ρ a).measure` is measurable. -/
-theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
- Measurable fun a => (condCdf ρ a).Measure :=
+theorem measurable_measure_condCDF (ρ : Measure (α × ℝ)) :
+ Measurable fun a => (condCDF ρ a).Measure :=
by
rw [measure.measurable_measure]
refine' fun s hs =>
@@ -1251,7 +1251,7 @@ theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
· intro f hf_disj hf_meas hf_cd_meas
simp_rw [measure_Union hf_disj hf_meas]
exact Measurable.ennreal_tsum hf_cd_meas
-#align probability_theory.measurable_measure_cond_cdf ProbabilityTheory.measurable_measure_condCdf
+#align probability_theory.measurable_measure_cond_cdf ProbabilityTheory.measurable_measure_condCDF
-/
end Measure
mathlib commit https://github.com/leanprover-community/mathlib/commit/b1abe23ae96fef89ad30d9f4362c307f72a55010
@@ -99,7 +99,7 @@ theorem Real.iUnion_Iic_rat : (⋃ r : ℚ, Iic (r : ℝ)) = univ :=
theorem Real.iInter_Iic_rat : (⋂ r : ℚ, Iic (r : ℝ)) = ∅ :=
by
ext1
- simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
+ simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, Classical.not_forall, not_le]
exact exists_rat_lt x
#align real.Inter_Iic_rat Real.iInter_Iic_rat
-/
@@ -621,7 +621,8 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
by
suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by rwa [← prod_iInter, this, prod_empty, measure_empty]
ext1 x
- simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
+ simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, Classical.not_forall,
+ not_le]
simp_rw [neg_lt]
exact exists_rat_gt _
rw [h_zero_eq_measure_Inter]
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,9 +3,9 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
-import Mathbin.MeasureTheory.Measure.Stieltjes
-import Mathbin.Probability.Kernel.Composition
-import Mathbin.MeasureTheory.Decomposition.RadonNikodym
+import MeasureTheory.Measure.Stieltjes
+import Probability.Kernel.Composition
+import MeasureTheory.Decomposition.RadonNikodym
#align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
mathlib commit https://github.com/leanprover-community/mathlib/commit/442a83d738cb208d3600056c489be16900ba701d
@@ -1075,7 +1075,7 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
rw [coe_coe, cond_cdf_eq_cond_cdf_rat]
rw [this]
exact
- measurable_ciInf (fun q => measurable_cond_cdf_rat ρ q) fun a =>
+ measurable_cinfi (fun q => measurable_cond_cdf_rat ρ q) fun a =>
bdd_below_range_cond_cdf_rat_gt ρ a _
#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCdf
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/32a7e535287f9c73f2e4d2aef306a39190f0b504
@@ -946,7 +946,7 @@ theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
rw [sInf_image']
have h' : (⨅ r : Ioi x, cond_cdf' ρ a r) = ⨅ r : { r' : ℚ // x < r' }, cond_cdf' ρ a r :=
by
- refine' iInf_Ioi_eq_iInf_rat_gt x _ (monotone_cond_cdf' ρ a)
+ refine' Real.iInf_Ioi_eq_iInf_rat_gt x _ (monotone_cond_cdf' ρ a)
refine' ⟨0, fun z => _⟩
rintro ⟨u, hux, rfl⟩
exact cond_cdf'_nonneg ρ a u
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,16 +2,13 @@
Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.kernel.cond_cdf
-! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.MeasureTheory.Measure.Stieltjes
import Mathbin.Probability.Kernel.Composition
import Mathbin.MeasureTheory.Decomposition.RadonNikodym
+#align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"2a0ce625dbb0ffbc7d1316597de0b25c1ec75303"
+
/-!
# Conditional cumulative distribution function
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -62,18 +62,23 @@ namespace Directed
-- todo after the port: move this to logic.encodable.basic near sequence_mono
variable [Encodable α] [Inhabited α] [Preorder β] {f : α → β} (hf : Directed (· ≥ ·) f)
+#print Directed.sequence_anti /-
theorem sequence_anti : Antitone (f ∘ hf.sequence f) :=
antitone_nat_of_succ_le <| hf.sequence_mono_nat
#align directed.sequence_anti Directed.sequence_anti
+-/
+#print Directed.sequence_le /-
theorem sequence_le (a : α) : f (hf.sequence f (Encodable.encode a + 1)) ≤ f a :=
hf.rel_sequence a
#align directed.sequence_le Directed.sequence_le
+-/
end Directed
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print prod_iInter /-
-- todo: move to data/set/lattice next to prod_Union or prod_sInter
theorem prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
(s ×ˢ ⋂ i, t i) = ⋂ i, s ×ˢ t i := by
@@ -81,7 +86,9 @@ theorem prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
simp only [mem_prod, mem_Inter]
exact ⟨fun h i => ⟨h.1, h.2 i⟩, fun h => ⟨(h hι.some).1, fun i => (h i).2⟩⟩
#align prod_Inter prod_iInter
+-/
+#print Real.iUnion_Iic_rat /-
theorem Real.iUnion_Iic_rat : (⋃ r : ℚ, Iic (r : ℝ)) = univ :=
by
ext1
@@ -89,14 +96,18 @@ theorem Real.iUnion_Iic_rat : (⋃ r : ℚ, Iic (r : ℝ)) = univ :=
obtain ⟨r, hr⟩ := exists_rat_gt x
exact ⟨r, hr.le⟩
#align real.Union_Iic_rat Real.iUnion_Iic_rat
+-/
+#print Real.iInter_Iic_rat /-
theorem Real.iInter_Iic_rat : (⋂ r : ℚ, Iic (r : ℝ)) = ∅ :=
by
ext1
simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
exact exists_rat_lt x
#align real.Inter_Iic_rat Real.iInter_Iic_rat
+-/
+#print atBot_le_nhds_bot /-
-- todo after the port: move to order/filter/at_top_bot
theorem atBot_le_nhds_bot {α : Type _} [TopologicalSpace α] [LinearOrder α] [OrderBot α]
[OrderTopology α] : (atBot : Filter α) ≤ 𝓝 ⊥ :=
@@ -113,20 +124,26 @@ theorem atBot_le_nhds_bot {α : Type _} [TopologicalSpace α] [LinearOrder α] [
refine' ⟨⊥, trivial, subset_trans _ h_Iio_a_subset_s⟩
simpa only [Iic_bot, singleton_subset_iff, mem_Iio]
#align at_bot_le_nhds_bot atBot_le_nhds_bot
+-/
+#print atTop_le_nhds_top /-
-- todo after the port: move to order/filter/at_top_bot
theorem atTop_le_nhds_top {α : Type _} [TopologicalSpace α] [LinearOrder α] [OrderTop α]
[OrderTopology α] : (atTop : Filter α) ≤ 𝓝 ⊤ :=
@atBot_le_nhds_bot αᵒᵈ _ _ _ _
#align at_top_le_nhds_top atTop_le_nhds_top
+-/
+#print tendsto_of_antitone /-
-- todo: move to topology/algebra/order/monotone_convergence
theorem tendsto_of_antitone {ι α : Type _} [Preorder ι] [TopologicalSpace α]
[ConditionallyCompleteLinearOrder α] [OrderTopology α] {f : ι → α} (h_mono : Antitone f) :
Tendsto f atTop atBot ∨ ∃ l, Tendsto f atTop (𝓝 l) :=
@tendsto_of_monotone ι αᵒᵈ _ _ _ _ _ h_mono
#align tendsto_of_antitone tendsto_of_antitone
+-/
+#print ENNReal.ofReal_cinfi /-
-- todo: move to data/real/ennreal
theorem ENNReal.ofReal_cinfi (f : α → ℝ) [Nonempty α] :
ENNReal.ofReal (⨅ i, f i) = ⨅ i, ENNReal.ofReal (f i) :=
@@ -143,7 +160,9 @@ theorem ENNReal.ofReal_cinfi (f : α → ℝ) [Nonempty α] :
refine' fun x hx => ⟨i, _⟩
rwa [ENNReal.ofReal_of_nonpos hy_neg.le]
#align ennreal.of_real_cinfi ENNReal.ofReal_cinfi
+-/
+#print lintegral_iInf_directed_of_measurable /-
-- todo: move to measure_theory/measurable_space
/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
@@ -176,16 +195,21 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
· exact iInf_le_of_le (Encodable.encode b + 1) (lintegral_mono <| h_directed.sequence_le b)
· exact iInf_le (fun b => ∫⁻ a, f b a ∂μ) _
#align lintegral_infi_directed_of_measurable lintegral_iInf_directed_of_measurable
+-/
+#print isPiSystem_Iic /-
-- todo: move to measure_theory/pi_system
theorem isPiSystem_Iic [SemilatticeInf α] : @IsPiSystem α (range Iic) := by
rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _; rw [Iic_inter_Iic]; exact ⟨us ⊓ ut, rfl⟩
#align is_pi_system_Iic isPiSystem_Iic
+-/
+#print isPiSystem_Ici /-
-- todo: move to measure_theory/pi_system
theorem isPiSystem_Ici [SemilatticeSup α] : @IsPiSystem α (range Ici) := by
rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _; rw [Ici_inter_Ici]; exact ⟨us ⊔ ut, rfl⟩
#align is_pi_system_Ici isPiSystem_Ici
+-/
end AuxLemmasToBeMoved
@@ -194,50 +218,65 @@ namespace MeasureTheory.Measure
variable {α β : Type _} {mα : MeasurableSpace α} (ρ : Measure (α × ℝ))
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print MeasureTheory.Measure.IicSnd /-
/-- Measure on `α` such that for a measurable set `s`, `ρ.Iic_snd r s = ρ (s ×ˢ Iic r)`. -/
-noncomputable def iicSnd (r : ℝ) : Measure α :=
+noncomputable def IicSnd (r : ℝ) : Measure α :=
(ρ.restrict (univ ×ˢ Iic r)).fst
-#align measure_theory.measure.Iic_snd MeasureTheory.Measure.iicSnd
+#align measure_theory.measure.Iic_snd MeasureTheory.Measure.IicSnd
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem iicSnd_apply (r : ℝ) {s : Set α} (hs : MeasurableSet s) : ρ.iicSnd r s = ρ (s ×ˢ Iic r) :=
+#print MeasureTheory.Measure.IicSnd_apply /-
+theorem IicSnd_apply (r : ℝ) {s : Set α} (hs : MeasurableSet s) : ρ.IicSnd r s = ρ (s ×ˢ Iic r) :=
by
rw [Iic_snd, fst_apply hs,
restrict_apply' (measurable_set.univ.prod (measurableSet_Iic : MeasurableSet (Iic r))), ←
prod_univ, prod_inter_prod, inter_univ, univ_inter]
-#align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.iicSnd_apply
+#align measure_theory.measure.Iic_snd_apply MeasureTheory.Measure.IicSnd_apply
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem iicSnd_univ (r : ℝ) : ρ.iicSnd r univ = ρ (univ ×ˢ Iic r) :=
- iicSnd_apply ρ r MeasurableSet.univ
-#align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.iicSnd_univ
+#print MeasureTheory.Measure.IicSnd_univ /-
+theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ ×ˢ Iic r) :=
+ IicSnd_apply ρ r MeasurableSet.univ
+#align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ
+-/
-theorem iicSnd_mono {r r' : ℝ} (h_le : r ≤ r') : ρ.iicSnd r ≤ ρ.iicSnd r' :=
+#print MeasureTheory.Measure.IicSnd_mono /-
+theorem IicSnd_mono {r r' : ℝ} (h_le : r ≤ r') : ρ.IicSnd r ≤ ρ.IicSnd r' :=
by
intro s hs
simp_rw [Iic_snd_apply ρ _ hs]
refine' measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr _⟩))
exact_mod_cast h_le
-#align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.iicSnd_mono
+#align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono
+-/
-theorem iicSnd_le_fst (r : ℝ) : ρ.iicSnd r ≤ ρ.fst :=
+#print MeasureTheory.Measure.IicSnd_le_fst /-
+theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≤ ρ.fst :=
by
intro s hs
simp_rw [fst_apply hs, Iic_snd_apply ρ r hs]
exact measure_mono (prod_subset_preimage_fst _ _)
-#align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.iicSnd_le_fst
+#align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.IicSnd_le_fst
+-/
-theorem iicSnd_ac_fst (r : ℝ) : ρ.iicSnd r ≪ ρ.fst :=
- Measure.absolutelyContinuous_of_le (iicSnd_le_fst ρ r)
-#align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.iicSnd_ac_fst
+#print MeasureTheory.Measure.IicSnd_ac_fst /-
+theorem IicSnd_ac_fst (r : ℝ) : ρ.IicSnd r ≪ ρ.fst :=
+ Measure.absolutelyContinuous_of_le (IicSnd_le_fst ρ r)
+#align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.IicSnd_ac_fst
+-/
-theorem IsFiniteMeasure.iicSnd {ρ : Measure (α × ℝ)} [IsFiniteMeasure ρ] (r : ℝ) :
- IsFiniteMeasure (ρ.iicSnd r) :=
- isFiniteMeasure_of_le _ (iicSnd_le_fst ρ _)
-#align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.iicSnd
+#print MeasureTheory.Measure.IsFiniteMeasure.IicSnd /-
+theorem IsFiniteMeasure.IicSnd {ρ : Measure (α × ℝ)} [IsFiniteMeasure ρ] (r : ℝ) :
+ IsFiniteMeasure (ρ.IicSnd r) :=
+ isFiniteMeasure_of_le _ (IicSnd_le_fst ρ _)
+#align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.IicSnd
+-/
-theorem iInf_iicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMeasure ρ] :
- (⨅ r : { r' : ℚ // t < r' }, ρ.iicSnd r s) = ρ.iicSnd t s :=
+#print MeasureTheory.Measure.iInf_IicSnd_gt /-
+theorem iInf_IicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMeasure ρ] :
+ (⨅ r : { r' : ℚ // t < r' }, ρ.IicSnd r s) = ρ.IicSnd t s :=
by
simp_rw [ρ.Iic_snd_apply _ hs]
rw [← measure_Inter_eq_infi]
@@ -254,10 +293,12 @@ theorem iInf_iicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMe
simp_rw [coe_coe]
exact_mod_cast hrr'
· exact ⟨⟨t + 1, lt_add_one _⟩, measure_ne_top ρ _⟩
-#align measure_theory.measure.infi_Iic_snd_gt MeasureTheory.Measure.iInf_iicSnd_gt
+#align measure_theory.measure.infi_Iic_snd_gt MeasureTheory.Measure.iInf_IicSnd_gt
+-/
-theorem tendsto_iicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
- Tendsto (fun r : ℚ => ρ.iicSnd r s) atTop (𝓝 (ρ.fst s)) :=
+#print MeasureTheory.Measure.tendsto_IicSnd_atTop /-
+theorem tendsto_IicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
+ Tendsto (fun r : ℚ => ρ.IicSnd r s) atTop (𝓝 (ρ.fst s)) :=
by
simp_rw [ρ.Iic_snd_apply _ hs, fst_apply hs, ← prod_univ]
rw [← Real.iUnion_Iic_rat, prod_Union]
@@ -265,7 +306,8 @@ theorem tendsto_iicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
simp only [mem_prod, mem_Iic, and_imp]
refine' fun hxs hxr => ⟨hxs, hxr.trans _⟩
exact_mod_cast hr_le_q
-#align measure_theory.measure.tendsto_Iic_snd_at_top MeasureTheory.Measure.tendsto_iicSnd_atTop
+#align measure_theory.measure.tendsto_Iic_snd_at_top MeasureTheory.Measure.tendsto_IicSnd_atTop
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -274,8 +316,9 @@ theorem tendsto_iicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem tendsto_iicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableSet s) :
- Tendsto (fun r : ℚ => ρ.iicSnd r s) atBot (𝓝 0) :=
+#print MeasureTheory.Measure.tendsto_IicSnd_atBot /-
+theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableSet s) :
+ Tendsto (fun r : ℚ => ρ.IicSnd r s) atBot (𝓝 0) :=
by
simp_rw [ρ.Iic_snd_apply _ hs]
have h_empty : ρ (s ×ˢ ∅) = 0 := by simp only [prod_empty, measure_empty]
@@ -299,7 +342,8 @@ theorem tendsto_iicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
simp only [Rat.cast_neg, mem_Iic] at hx ⊢
refine' hx.trans (neg_le_neg _)
exact_mod_cast hqr
-#align measure_theory.measure.tendsto_Iic_snd_at_bot MeasureTheory.Measure.tendsto_iicSnd_atBot
+#align measure_theory.measure.tendsto_Iic_snd_at_bot MeasureTheory.Measure.tendsto_IicSnd_atBot
+-/
end MeasureTheory.Measure
@@ -309,7 +353,7 @@ namespace ProbabilityTheory
variable {α β ι : Type _} {mα : MeasurableSpace α}
-attribute [local instance] MeasureTheory.Measure.IsFiniteMeasure.iicSnd
+attribute [local instance] MeasureTheory.Measure.IsFiniteMeasure.IicSnd
/-! ### Auxiliary definitions
@@ -319,6 +363,7 @@ everywhere. We then introduce `probability_theory.cond_cdf_rat`, a function on `
the properties of a cdf for all `a : α`. We finally extend to `ℝ`. -/
+#print ProbabilityTheory.preCdf /-
/-- `pre_cdf` is the Radon-Nikodym derivative of `ρ.Iic_snd` with respect to `ρ.fst` at each
`r : ℚ`. This function `ℚ → α → ℝ≥0∞` is such that for almost all `a : α`, the function `ℚ → ℝ≥0∞`
satisfies the properties of a cdf (monotone with limit 0 at -∞ and 1 at +∞, right-continuous).
@@ -327,20 +372,26 @@ We define this function on `ℚ` and not `ℝ` because `ℚ` is countable, which
properties of the form `∀ᵐ a ∂ρ.fst, ∀ q, P (pre_cdf q a)`, instead of the weaker
`∀ q, ∀ᵐ a ∂ρ.fst, P (pre_cdf q a)`. -/
noncomputable def preCdf (ρ : Measure (α × ℝ)) (r : ℚ) : α → ℝ≥0∞ :=
- Measure.rnDeriv (ρ.iicSnd r) ρ.fst
+ Measure.rnDeriv (ρ.IicSnd r) ρ.fst
#align probability_theory.pre_cdf ProbabilityTheory.preCdf
+-/
+#print ProbabilityTheory.measurable_preCdf /-
theorem measurable_preCdf {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (preCdf ρ r) :=
Measure.measurable_rnDeriv _ _
#align probability_theory.measurable_pre_cdf ProbabilityTheory.measurable_preCdf
+-/
+#print ProbabilityTheory.withDensity_preCdf /-
theorem withDensity_preCdf (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
- ρ.fst.withDensity (preCdf ρ r) = ρ.iicSnd r :=
- Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq.mp (Measure.iicSnd_ac_fst ρ r)
+ ρ.fst.withDensity (preCdf ρ r) = ρ.IicSnd r :=
+ Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq.mp (Measure.IicSnd_ac_fst ρ r)
#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCdf
+-/
+#print ProbabilityTheory.set_lintegral_preCdf_fst /-
theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
- [IsFiniteMeasure ρ] : ∫⁻ x in s, preCdf ρ r x ∂ρ.fst = ρ.iicSnd r s :=
+ [IsFiniteMeasure ρ] : ∫⁻ x in s, preCdf ρ r x ∂ρ.fst = ρ.IicSnd r s :=
by
have : ∀ r, ∫⁻ x in s, pre_cdf ρ r x ∂ρ.fst = ∫⁻ x in s, (pre_cdf ρ r * 1) x ∂ρ.fst := by
simp only [mul_one, eq_self_iff_true, forall_const]
@@ -351,7 +402,9 @@ theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set
· rw [(_ : (1 : α → ℝ≥0∞) = fun _ => 1)]
exacts [measurable_const, rfl]
#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCdf_fst
+-/
+#print ProbabilityTheory.monotone_preCdf /-
theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Monotone fun r => preCdf ρ r a :=
by
@@ -363,9 +416,11 @@ theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
refine' measure.Iic_snd_mono ρ _ s hs
exact_mod_cast hrr'
#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCdf
+-/
+#print ProbabilityTheory.set_lintegral_iInf_gt_preCdf /-
theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
- (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst = ρ.iicSnd t s :=
+ (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst = ρ.IicSnd t s :=
by
refine' le_antisymm _ _
· have h : ∀ q : Ioi t, ∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst ≤ ρ.Iic_snd q s :=
@@ -385,7 +440,9 @@ theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure
· filter_upwards [monotone_pre_cdf] with a ha_mono
exact fun _ => le_iInf fun r => ha_mono (le_of_lt r.Prop)
#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCdf
+-/
+#print ProbabilityTheory.preCdf_le_one /-
theorem preCdf_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, ∀ r, preCdf ρ r a ≤ 1 := by
rw [ae_all_iff]
@@ -396,7 +453,9 @@ theorem preCdf_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
simp only [Pi.one_apply, lintegral_one, measure.restrict_apply, MeasurableSet.univ, univ_inter]
exact measure.Iic_snd_le_fst ρ r s hs
#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCdf_le_one
+-/
+#print ProbabilityTheory.tendsto_lintegral_preCdf_atTop /-
theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) :=
by
@@ -405,7 +464,9 @@ theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasu
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
· exact measure.fst_univ.symm
#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCdf_atTop
+-/
+#print ProbabilityTheory.tendsto_lintegral_preCdf_atBot /-
theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atBot (𝓝 0) :=
by
@@ -413,7 +474,9 @@ theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasu
ext1 r
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCdf_atBot
+-/
+#print ProbabilityTheory.tendsto_preCdf_atTop_one /-
theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1) :=
by
@@ -492,9 +555,11 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCdf_atTop_one
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.tendsto_preCdf_atBot_zero /-
theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0) :=
by
@@ -571,7 +636,9 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
exact_mod_cast hij
exact tendsto_nhds_unique h_lintegral h_lintegral'
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCdf_atBot_zero
+-/
+#print ProbabilityTheory.inf_gt_preCdf /-
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a :=
by
@@ -581,9 +648,11 @@ theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
intro s hs hs_fin
rw [set_lintegral_infi_gt_pre_cdf ρ t hs, set_lintegral_pre_cdf_fst ρ t hs]
#align probability_theory.inf_gt_pre_cdf ProbabilityTheory.inf_gt_preCdf
+-/
section HasCondCdf
+#print ProbabilityTheory.HasCondCdf /-
/-- A product measure on `α × ℝ` is said to have a conditional cdf at `a : α` if `pre_cdf` is
monotone with limit 0 at -∞ and 1 at +∞, and is right continuous.
This property holds almost everywhere (see `has_cond_cdf_ae`). -/
@@ -594,24 +663,32 @@ structure HasCondCdf (ρ : Measure (α × ℝ)) (a : α) : Prop where
tendsto_atBot_zero : Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0)
iInf_rat_gt_eq : ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a
#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCdf
+-/
+#print ProbabilityTheory.hasCondCdf_ae /-
theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a :=
by
filter_upwards [monotone_pre_cdf ρ, pre_cdf_le_one ρ, tendsto_pre_cdf_at_top_one ρ,
tendsto_pre_cdf_at_bot_zero ρ, inf_gt_pre_cdf ρ] with a h1 h2 h3 h4 h5
exact ⟨h1, h2, h3, h4, h5⟩
#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCdf_ae
+-/
+#print ProbabilityTheory.condCdfSet /-
/-- A measurable set of elements of `α` such that `ρ` has a conditional cdf at all
`a ∈ cond_cdf_set`. -/
def condCdfSet (ρ : Measure (α × ℝ)) : Set α :=
toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}ᶜ
#align probability_theory.cond_cdf_set ProbabilityTheory.condCdfSet
+-/
+#print ProbabilityTheory.measurableSet_condCdfSet /-
theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCdfSet ρ) :=
(measurableSet_toMeasurable _ _).compl
#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCdfSet
+-/
+#print ProbabilityTheory.hasCondCdf_of_mem_condCdfSet /-
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
HasCondCdf ρ a := by
rw [cond_cdf_set, mem_compl_iff] at h
@@ -619,33 +696,43 @@ theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a
by_contra ha
exact h (h_ss ha)
#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCdf_of_mem_condCdfSet
+-/
+#print ProbabilityTheory.mem_condCdfSet_ae /-
theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ :=
by
simp_rw [ae_iff, cond_cdf_set, not_mem_compl_iff, set_of_mem_eq, measure_to_measurable]
exact has_cond_cdf_ae ρ
#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCdfSet_ae
+-/
end HasCondCdf
open scoped Classical
+#print ProbabilityTheory.condCdfRat /-
/-- Conditional cdf of the measure given the value on `α`, restricted to the rationals.
It is defined to be `pre_cdf` if `a ∈ cond_cdf_set`, and a default cdf-like function
otherwise. This is an auxiliary definition used to define `cond_cdf`. -/
noncomputable def condCdfRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
if a ∈ condCdfSet ρ then fun r => (preCdf ρ r a).toReal else fun r => if r < 0 then 0 else 1
#align probability_theory.cond_cdf_rat ProbabilityTheory.condCdfRat
+-/
+#print ProbabilityTheory.condCdfRat_of_not_mem /-
theorem condCdfRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCdfSet ρ) {r : ℚ} :
condCdfRat ρ a r = if r < 0 then 0 else 1 := by simp only [cond_cdf_rat, h, if_false]
#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCdfRat_of_not_mem
+-/
+#print ProbabilityTheory.condCdfRat_of_mem /-
theorem condCdfRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCdfSet ρ) (r : ℚ) :
condCdfRat ρ a r = (preCdf ρ r a).toReal := by simp only [cond_cdf_rat, h, if_true]
#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCdfRat_of_mem
+-/
+#print ProbabilityTheory.monotone_condCdfRat /-
theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) :=
by
by_cases h : a ∈ cond_cdf_set ρ
@@ -662,7 +749,9 @@ theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (cond
split_ifs
exacts [le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCdfRat
+-/
+#print ProbabilityTheory.measurable_condCdfRat /-
theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
Measurable fun a => condCdfRat ρ a q :=
by
@@ -671,11 +760,15 @@ theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
Measurable.ite (measurable_set_cond_cdf_set ρ) measurable_pre_cdf.ennreal_to_real
measurable_const
#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCdfRat
+-/
+#print ProbabilityTheory.condCdfRat_nonneg /-
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
unfold cond_cdf_rat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCdfRat_nonneg
+-/
+#print ProbabilityTheory.condCdfRat_le_one /-
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 :=
by
unfold cond_cdf_rat
@@ -685,7 +778,9 @@ theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCd
exact (has_cond_cdf_of_mem_cond_cdf_set h).le_one r
exacts [zero_le_one, le_rfl]
#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCdfRat_le_one
+-/
+#print ProbabilityTheory.tendsto_condCdfRat_atBot /-
theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
Tendsto (condCdfRat ρ a) atBot (𝓝 0) :=
by
@@ -701,7 +796,9 @@ theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
refine' ⟨-1, fun q hq => (if_pos (hq.trans_lt _)).symm⟩
linarith
#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCdfRat_atBot
+-/
+#print ProbabilityTheory.tendsto_condCdfRat_atTop /-
theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
Tendsto (condCdfRat ρ a) atTop (𝓝 1) :=
by
@@ -716,12 +813,16 @@ theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
rw [eventually_eq, eventually_at_top]
exact ⟨0, fun q hq => (if_neg (not_lt.mpr hq)).symm⟩
#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCdfRat_atTop
+-/
+#print ProbabilityTheory.condCdfRat_ae_eq /-
theorem condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => condCdfRat ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using cond_cdf_rat_of_mem ρ a ha r
#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCdfRat_ae_eq
+-/
+#print ProbabilityTheory.ofReal_condCdfRat_ae_eq /-
theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => ENNReal.ofReal (condCdfRat ρ a r)) =ᵐ[ρ.fst] preCdf ρ r :=
by
@@ -729,7 +830,9 @@ theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCdfRat_ae_eq
+-/
+#print ProbabilityTheory.inf_gt_condCdfRat /-
theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
(⨅ r : Ioi t, condCdfRat ρ a r) = condCdfRat ρ a t :=
by
@@ -769,17 +872,23 @@ theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
rw [not_lt] at h ⊢
exact h.trans (mem_Ioi.mp x.prop).le
#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCdfRat
+-/
+#print ProbabilityTheory.condCdf' /-
/-- Conditional cdf of the measure given the value on `α`, as a plain function. This is an auxiliary
definition used to define `cond_cdf`. -/
noncomputable irreducible_def condCdf' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
⨅ r : { r' : ℚ // t < r' }, condCdfRat ρ a r
#align probability_theory.cond_cdf' ProbabilityTheory.condCdf'
+-/
-theorem condCdf'_def {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
+#print ProbabilityTheory.condCdf'_def' /-
+theorem condCdf'_def' {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
condCdf' ρ a x = ⨅ r : { r : ℚ // x < r }, condCdfRat ρ a r := by rw [cond_cdf']
-#align probability_theory.cond_cdf'_def ProbabilityTheory.condCdf'_def
+#align probability_theory.cond_cdf'_def ProbabilityTheory.condCdf'_def'
+-/
+#print ProbabilityTheory.condCdf'_eq_condCdfRat /-
theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
condCdf' ρ a r = condCdfRat ρ a r :=
by
@@ -794,7 +903,9 @@ theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
· intro t
simp only [Subtype.val_eq_coe, Equiv.coe_fn_mk, Subtype.coe_mk]
#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCdf'_eq_condCdfRat
+-/
+#print ProbabilityTheory.condCdf'_nonneg /-
theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf' ρ a r :=
by
have : Nonempty { r' : ℚ // r < ↑r' } :=
@@ -804,12 +915,16 @@ theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ co
rw [cond_cdf'_def]
exact le_ciInf fun r' => cond_cdf_rat_nonneg ρ a _
#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCdf'_nonneg
+-/
+#print ProbabilityTheory.bddBelow_range_condCdfRat_gt /-
theorem bddBelow_range_condCdfRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCdfRat ρ a r) := by
refine' ⟨0, fun z => _⟩; rintro ⟨u, rfl⟩; exact cond_cdf_rat_nonneg ρ a _
#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCdfRat_gt
+-/
+#print ProbabilityTheory.monotone_condCdf' /-
theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdf' ρ a) :=
by
intro x y hxy
@@ -823,7 +938,9 @@ theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCd
· exact bdd_below_range_cond_cdf_rat_gt ρ a x
· rfl
#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCdf'
+-/
+#print ProbabilityTheory.continuousWithinAt_condCdf'_Ici /-
theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
ContinuousWithinAt (condCdf' ρ a) (Ici x) x :=
by
@@ -846,10 +963,12 @@ theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
congr
exact cond_cdf'_def
#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCdf'_Ici
+-/
/-! ### Conditional cdf -/
+#print ProbabilityTheory.condCdf /-
/-- Conditional cdf of the measure given the value on `α`, as a Stieltjes function. -/
noncomputable def condCdf (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunction
where
@@ -857,17 +976,23 @@ noncomputable def condCdf (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunctio
mono' := monotone_condCdf' ρ a
right_continuous' x := continuousWithinAt_condCdf'_Ici ρ a x
#align probability_theory.cond_cdf ProbabilityTheory.condCdf
+-/
+#print ProbabilityTheory.condCdf_eq_condCdfRat /-
theorem condCdf_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
condCdf ρ a r = condCdfRat ρ a r :=
condCdf'_eq_condCdfRat ρ a r
#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCdf_eq_condCdfRat
+-/
+#print ProbabilityTheory.condCdf_nonneg /-
/-- The conditional cdf is non-negative for all `a : α`. -/
theorem condCdf_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf ρ a r :=
condCdf'_nonneg ρ a r
#align probability_theory.cond_cdf_nonneg ProbabilityTheory.condCdf_nonneg
+-/
+#print ProbabilityTheory.condCdf_le_one /-
/-- The conditional cdf is lower or equal to 1 for all `a : α`. -/
theorem condCdf_le_one (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) : condCdf ρ a x ≤ 1 :=
by
@@ -877,7 +1002,9 @@ theorem condCdf_le_one (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) : condCdf
refine' ciInf_le_of_le (bdd_below_range_cond_cdf_rat_gt ρ a x) _ (cond_cdf_rat_le_one _ _ _)
exact ⟨r, hrx⟩
#align probability_theory.cond_cdf_le_one ProbabilityTheory.condCdf_le_one
+-/
+#print ProbabilityTheory.tendsto_condCdf_atBot /-
/-- The conditional cdf tends to 0 at -∞ for all `a : α`. -/
theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (condCdf ρ a) atBot (𝓝 0) :=
by
@@ -897,7 +1024,9 @@ theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
rw [Function.comp_apply, ← cond_cdf_eq_cond_cdf_rat]
exact (cond_cdf ρ a).mono (h_exists x).choose_spec.1.le
#align probability_theory.tendsto_cond_cdf_at_bot ProbabilityTheory.tendsto_condCdf_atBot
+-/
+#print ProbabilityTheory.tendsto_condCdf_atTop /-
/-- The conditional cdf tends to 1 at +∞ for all `a : α`. -/
theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (condCdf ρ a) atTop (𝓝 1) :=
by
@@ -917,13 +1046,17 @@ theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
rw [Function.comp_apply, ← cond_cdf_eq_cond_cdf_rat]
exact (cond_cdf ρ a).mono (le_of_lt (h_exists x).choose_spec.2)
#align probability_theory.tendsto_cond_cdf_at_top ProbabilityTheory.tendsto_condCdf_atTop
+-/
+#print ProbabilityTheory.condCdf_ae_eq /-
theorem condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => condCdf ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using
(cond_cdf_eq_cond_cdf_rat ρ a r).trans (cond_cdf_rat_of_mem ρ a ha r)
#align probability_theory.cond_cdf_ae_eq ProbabilityTheory.condCdf_ae_eq
+-/
+#print ProbabilityTheory.ofReal_condCdf_ae_eq /-
theorem ofReal_condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => ENNReal.ofReal (condCdf ρ a r)) =ᵐ[ρ.fst] preCdf ρ r :=
by
@@ -931,7 +1064,9 @@ theorem ofReal_condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
#align probability_theory.of_real_cond_cdf_ae_eq ProbabilityTheory.ofReal_condCdf_ae_eq
+-/
+#print ProbabilityTheory.measurable_condCdf /-
/-- The conditional cdf is a measurable function of `a : α` for all `x : ℝ`. -/
theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun a => condCdf ρ a x :=
by
@@ -946,8 +1081,10 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
measurable_ciInf (fun q => measurable_cond_cdf_rat ρ q) fun a =>
bdd_below_range_cond_cdf_rat_gt ρ a _
#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCdf
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.set_lintegral_condCdf_rat /-
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
(hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic r) :=
@@ -957,9 +1094,11 @@ theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
rw [set_lintegral_congr_fun hs this, set_lintegral_pre_cdf_fst ρ r hs]
exact ρ.Iic_snd_apply r hs
#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCdf_rat
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.set_lintegral_condCdf /-
theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
(hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x) :=
by
@@ -1009,19 +1148,25 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
exact_mod_cast hij
· exact ⟨h_nonempty.some, measure_ne_top _ _⟩
#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCdf
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.lintegral_condCdf /-
theorem lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
∫⁻ a, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x) := by
rw [← set_lintegral_univ, set_lintegral_cond_cdf ρ _ MeasurableSet.univ]
#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCdf
+-/
+#print ProbabilityTheory.stronglyMeasurable_condCdf /-
/-- The conditional cdf is a strongly measurable function of `a : α` for all `x : ℝ`. -/
theorem stronglyMeasurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) :
StronglyMeasurable fun a => condCdf ρ a x :=
(measurable_condCdf ρ x).StronglyMeasurable
#align probability_theory.strongly_measurable_cond_cdf ProbabilityTheory.stronglyMeasurable_condCdf
+-/
+#print ProbabilityTheory.integrable_condCdf /-
theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
Integrable (fun a => condCdf ρ a x) ρ.fst :=
by
@@ -1038,8 +1183,10 @@ theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x :
simp only [Pi.one_apply, lintegral_one, measure.restrict_apply, MeasurableSet.univ, univ_inter]
exact measure_mono (subset_univ _)
#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCdf
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.set_integral_condCdf /-
theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
(hs : MeasurableSet s) : ∫ a in s, condCdf ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
by
@@ -1050,31 +1197,39 @@ theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
· exact (integrable_cond_cdf _ _).IntegrableOn
· exact eventually_of_forall fun _ => cond_cdf_nonneg _ _ _
#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCdf
+-/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print ProbabilityTheory.integral_condCdf /-
theorem integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
∫ a, condCdf ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal := by
rw [← set_integral_cond_cdf ρ _ MeasurableSet.univ, measure.restrict_univ]
#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCdf
+-/
section Measure
+#print ProbabilityTheory.measure_condCdf_Iic /-
theorem measure_condCdf_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
(condCdf ρ a).Measure (Iic x) = ENNReal.ofReal (condCdf ρ a x) :=
by
rw [← sub_zero (cond_cdf ρ a x)]
exact (cond_cdf ρ a).measure_Iic (tendsto_cond_cdf_at_bot ρ a) _
#align probability_theory.measure_cond_cdf_Iic ProbabilityTheory.measure_condCdf_Iic
+-/
+#print ProbabilityTheory.measure_condCdf_univ /-
theorem measure_condCdf_univ (ρ : Measure (α × ℝ)) (a : α) : (condCdf ρ a).Measure univ = 1 :=
by
rw [← ENNReal.ofReal_one, ← sub_zero (1 : ℝ)]
exact StieltjesFunction.measure_univ _ (tendsto_cond_cdf_at_bot ρ a) (tendsto_cond_cdf_at_top ρ a)
#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCdf_univ
+-/
instance (ρ : Measure (α × ℝ)) (a : α) : IsProbabilityMeasure (condCdf ρ a).Measure :=
⟨measure_condCdf_univ ρ a⟩
+#print ProbabilityTheory.measurable_measure_condCdf /-
/-- The function `a ↦ (cond_cdf ρ a).measure` is measurable. -/
theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
Measurable fun a => (condCdf ρ a).Measure :=
@@ -1099,6 +1254,7 @@ theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
simp_rw [measure_Union hf_disj hf_meas]
exact Measurable.ennreal_tsum hf_cd_meas
#align probability_theory.measurable_measure_cond_cdf ProbabilityTheory.measurable_measure_condCdf
+-/
end Measure
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.cond_cdf
-! leanprover-community/mathlib commit 3b88f4005dc2e28d42f974cc1ce838f0dafb39b8
+! leanprover-community/mathlib commit 2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -15,6 +15,9 @@ import Mathbin.MeasureTheory.Decomposition.RadonNikodym
/-!
# Conditional cumulative distribution function
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
Given `ρ : measure (α × ℝ)`, we define the conditional cumulative distribution function
(conditional cdf) of `ρ`. It is a function `cond_cdf ρ : α → ℝ → ℝ` such that if `ρ` is a finite
measure, then for all `a : α` `cond_cdf ρ a` is monotone and right-continuous with limit 0 at -∞
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -190,8 +190,6 @@ namespace MeasureTheory.Measure
variable {α β : Type _} {mα : MeasurableSpace α} (ρ : Measure (α × ℝ))
-include mα
-
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- Measure on `α` such that for a measurable set `s`, `ρ.Iic_snd r s = ρ (s ×ˢ Iic r)`. -/
noncomputable def iicSnd (r : ℝ) : Measure α :=
@@ -308,8 +306,6 @@ namespace ProbabilityTheory
variable {α β ι : Type _} {mα : MeasurableSpace α}
-include mα
-
attribute [local instance] MeasureTheory.Measure.IsFiniteMeasure.iicSnd
/-! ### Auxiliary definitions
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3e83f0fa4391c8740f7d773a7a9b74e311ae2a3
@@ -145,8 +145,8 @@ theorem ENNReal.ofReal_cinfi (f : α → ℝ) [Nonempty α] :
/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
{f : β → α → ℝ≥0∞} {μ : Measure α} (hμ : μ ≠ 0) (hf : ∀ b, Measurable (f b))
- (hf_int : ∀ b, (∫⁻ a, f b a ∂μ) ≠ ∞) (h_directed : Directed (· ≥ ·) f) :
- (∫⁻ a, ⨅ b, f b a ∂μ) = ⨅ b, ∫⁻ a, f b a ∂μ :=
+ (hf_int : ∀ b, ∫⁻ a, f b a ∂μ ≠ ∞) (h_directed : Directed (· ≥ ·) f) :
+ ∫⁻ a, ⨅ b, f b a ∂μ = ⨅ b, ∫⁻ a, f b a ∂μ :=
by
cases nonempty_encodable β
cases isEmpty_or_nonempty β
@@ -161,7 +161,7 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
(le_iInf fun b => iInf_le_of_le (Encodable.encode b + 1) _)
exact h_directed.sequence_le b a
calc
- (∫⁻ a, ⨅ b, f b a ∂μ) = ∫⁻ a, ⨅ n, f (h_directed.sequence f n) a ∂μ := by simp only [this]
+ ∫⁻ a, ⨅ b, f b a ∂μ = ∫⁻ a, ⨅ n, f (h_directed.sequence f n) a ∂μ := by simp only [this]
_ = ⨅ n, ∫⁻ a, f (h_directed.sequence f n) a ∂μ :=
by
rw [lintegral_infi (fun n => _) h_directed.sequence_anti]
@@ -341,9 +341,9 @@ theorem withDensity_preCdf (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure
#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCdf
theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
- [IsFiniteMeasure ρ] : (∫⁻ x in s, preCdf ρ r x ∂ρ.fst) = ρ.iicSnd r s :=
+ [IsFiniteMeasure ρ] : ∫⁻ x in s, preCdf ρ r x ∂ρ.fst = ρ.iicSnd r s :=
by
- have : ∀ r, (∫⁻ x in s, pre_cdf ρ r x ∂ρ.fst) = ∫⁻ x in s, (pre_cdf ρ r * 1) x ∂ρ.fst := by
+ have : ∀ r, ∫⁻ x in s, pre_cdf ρ r x ∂ρ.fst = ∫⁻ x in s, (pre_cdf ρ r * 1) x ∂ρ.fst := by
simp only [mul_one, eq_self_iff_true, forall_const]
rw [this, ← set_lintegral_with_density_eq_set_lintegral_mul _ measurable_pre_cdf _ hs]
·
@@ -366,10 +366,10 @@ theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCdf
theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
- (hs : MeasurableSet s) : (∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst) = ρ.iicSnd t s :=
+ (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst = ρ.iicSnd t s :=
by
refine' le_antisymm _ _
- · have h : ∀ q : Ioi t, (∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst) ≤ ρ.Iic_snd q s :=
+ · have h : ∀ q : Ioi t, ∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst ≤ ρ.Iic_snd q s :=
by
intro q
rw [coe_coe, ← set_lintegral_pre_cdf_fst ρ _ hs]
@@ -378,7 +378,7 @@ theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure
· filter_upwards [monotone_pre_cdf] with a ha_mono
exact fun _ => iInf_le _ q
calc
- (∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst) ≤ ⨅ q : Ioi t, ρ.Iic_snd q s := le_iInf h
+ ∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst ≤ ⨅ q : Ioi t, ρ.Iic_snd q s := le_iInf h
_ = ρ.Iic_snd t s := measure.infi_Iic_snd_gt ρ t hs
· rw [(set_lintegral_pre_cdf_fst ρ t hs).symm]
refine' set_lintegral_mono_ae measurable_pre_cdf _ _
@@ -461,7 +461,7 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
rwa [ha_eq] at ha_tendsto
-- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
-- us that `F` is 1 a.e.
- have h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst :=
+ have h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst :=
by
have h_lintegral :
tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
@@ -480,11 +480,11 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
rw [lintegral_one, measure.fst_univ]
exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_nat_cast_atTop_atTop
exact tendsto_nhds_unique h_lintegral h_lintegral'
- have : (∫⁻ a, 1 - F a ∂ρ.fst) = 0 :=
+ have : ∫⁻ a, 1 - F a ∂ρ.fst = 0 :=
by
rw [lintegral_sub' hF_ae_meas _ hF_le_one, h_lintegral_eq, tsub_self]
calc
- (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst := h_lintegral_eq
+ ∫⁻ a, F a ∂ρ.fst = ∫⁻ a, 1 ∂ρ.fst := h_lintegral_eq
_ = ρ.fst univ := lintegral_one
_ = ρ univ := measure.fst_univ
_ ≠ ∞ := measure_ne_top ρ _
@@ -528,7 +528,7 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
filter_upwards [h_exists] with a ha
simp_rw [F, dif_pos ha]
exact ha.some_spec
- suffices h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = 0
+ suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0
· have hF_ae_meas : AEMeasurable F ρ.fst :=
by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
@@ -951,7 +951,7 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
- (hs : MeasurableSet s) : (∫⁻ a in s, ENNReal.ofReal (condCdf ρ a r) ∂ρ.fst) = ρ (s ×ˢ Iic r) :=
+ (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic r) :=
by
have : ∀ᵐ a ∂ρ.fst, a ∈ s → ENNReal.ofReal (cond_cdf ρ a r) = pre_cdf ρ r a := by
filter_upwards [of_real_cond_cdf_ae_eq ρ r] with a ha using fun _ => ha
@@ -962,7 +962,7 @@ theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
- (hs : MeasurableSet s) : (∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst) = ρ (s ×ˢ Iic x) :=
+ (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x) :=
by
-- We have the result for `x : ℚ` thanks to `set_lintegral_cond_cdf_rat`. We use the equality
-- `cond_cdf ρ a x = ⨅ r : {r' : ℚ // x < r'}, cond_cdf ρ a r` and a monotone convergence
@@ -976,7 +976,7 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
_ = ρ.fst.restrict s univ := by rw [measure.restrict_apply_univ]
_ = 0 := by simp only [hρ_zero, measure.coe_zero, Pi.zero_apply]
have h :
- (∫⁻ a in s, ENNReal.ofReal (cond_cdf ρ a x) ∂ρ.fst) =
+ ∫⁻ a in s, ENNReal.ofReal (cond_cdf ρ a x) ∂ρ.fst =
∫⁻ a in s, ENNReal.ofReal (⨅ r : { r' : ℚ // x < r' }, cond_cdf ρ a r) ∂ρ.fst :=
by
congr with a : 1
@@ -1013,7 +1013,7 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- (∫⁻ a, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst) = ρ (univ ×ˢ Iic x) := by
+ ∫⁻ a, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x) := by
rw [← set_lintegral_univ, set_lintegral_cond_cdf ρ _ MeasurableSet.univ]
#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCdf
@@ -1042,7 +1042,7 @@ theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x :
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
- (hs : MeasurableSet s) : (∫ a in s, condCdf ρ a x ∂ρ.fst) = (ρ (s ×ˢ Iic x)).toReal :=
+ (hs : MeasurableSet s) : ∫ a in s, condCdf ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
by
have h := set_lintegral_cond_cdf ρ x hs
rw [← of_real_integral_eq_lintegral_of_real] at h
@@ -1054,7 +1054,7 @@ theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- (∫ a, condCdf ρ a x ∂ρ.fst) = (ρ (univ ×ˢ Iic x)).toReal := by
+ ∫ a, condCdf ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal := by
rw [← set_integral_cond_cdf ρ _ MeasurableSet.univ, measure.restrict_univ]
#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCdf
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -172,7 +172,6 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
refine' le_antisymm (le_iInf fun b => _) (le_iInf fun n => _)
· exact iInf_le_of_le (Encodable.encode b + 1) (lintegral_mono <| h_directed.sequence_le b)
· exact iInf_le (fun b => ∫⁻ a, f b a ∂μ) _
-
#align lintegral_infi_directed_of_measurable lintegral_iInf_directed_of_measurable
-- todo: move to measure_theory/pi_system
@@ -381,7 +380,6 @@ theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure
calc
(∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst) ≤ ⨅ q : Ioi t, ρ.Iic_snd q s := le_iInf h
_ = ρ.Iic_snd t s := measure.infi_Iic_snd_gt ρ t hs
-
· rw [(set_lintegral_pre_cdf_fst ρ t hs).symm]
refine' set_lintegral_mono_ae measurable_pre_cdf _ _
· exact measurable_iInf fun _ => measurable_pre_cdf
@@ -490,7 +488,6 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
_ = ρ.fst univ := lintegral_one
_ = ρ univ := measure.fst_univ
_ ≠ ∞ := measure_ne_top ρ _
-
rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
@@ -978,7 +975,6 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
_ = ρ.fst s := by rw [measure.fst_apply hs]
_ = ρ.fst.restrict s univ := by rw [measure.restrict_apply_univ]
_ = 0 := by simp only [hρ_zero, measure.coe_zero, Pi.zero_apply]
-
have h :
(∫⁻ a in s, ENNReal.ofReal (cond_cdf ρ a x) ∂ρ.fst) =
∫⁻ a in s, ENNReal.ofReal (⨅ r : { r' : ℚ // x < r' }, cond_cdf ρ a r) ∂ρ.fst :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -231,12 +231,12 @@ theorem iicSnd_ac_fst (r : ℝ) : ρ.iicSnd r ≪ ρ.fst :=
Measure.absolutelyContinuous_of_le (iicSnd_le_fst ρ r)
#align measure_theory.measure.Iic_snd_ac_fst MeasureTheory.Measure.iicSnd_ac_fst
-theorem IsFiniteMeasure.iicSnd {ρ : Measure (α × ℝ)} [FiniteMeasure ρ] (r : ℝ) :
- FiniteMeasure (ρ.iicSnd r) :=
- finiteMeasureOfLe _ (iicSnd_le_fst ρ _)
+theorem IsFiniteMeasure.iicSnd {ρ : Measure (α × ℝ)} [IsFiniteMeasure ρ] (r : ℝ) :
+ IsFiniteMeasure (ρ.iicSnd r) :=
+ isFiniteMeasure_of_le _ (iicSnd_le_fst ρ _)
#align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.iicSnd
-theorem iInf_iicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [FiniteMeasure ρ] :
+theorem iInf_iicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMeasure ρ] :
(⨅ r : { r' : ℚ // t < r' }, ρ.iicSnd r s) = ρ.iicSnd t s :=
by
simp_rw [ρ.Iic_snd_apply _ hs]
@@ -274,7 +274,7 @@ theorem tendsto_iicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem tendsto_iicSnd_atBot [FiniteMeasure ρ] {s : Set α} (hs : MeasurableSet s) :
+theorem tendsto_iicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableSet s) :
Tendsto (fun r : ℚ => ρ.iicSnd r s) atBot (𝓝 0) :=
by
simp_rw [ρ.Iic_snd_apply _ hs]
@@ -336,13 +336,13 @@ theorem measurable_preCdf {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (pre
Measure.measurable_rnDeriv _ _
#align probability_theory.measurable_pre_cdf ProbabilityTheory.measurable_preCdf
-theorem withDensity_preCdf (ρ : Measure (α × ℝ)) (r : ℚ) [FiniteMeasure ρ] :
+theorem withDensity_preCdf (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
ρ.fst.withDensity (preCdf ρ r) = ρ.iicSnd r :=
Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq.mp (Measure.iicSnd_ac_fst ρ r)
#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCdf
theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
- [FiniteMeasure ρ] : (∫⁻ x in s, preCdf ρ r x ∂ρ.fst) = ρ.iicSnd r s :=
+ [IsFiniteMeasure ρ] : (∫⁻ x in s, preCdf ρ r x ∂ρ.fst) = ρ.iicSnd r s :=
by
have : ∀ r, (∫⁻ x in s, pre_cdf ρ r x ∂ρ.fst) = ∫⁻ x in s, (pre_cdf ρ r * 1) x ∂ρ.fst := by
simp only [mul_one, eq_self_iff_true, forall_const]
@@ -354,7 +354,7 @@ theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set
exacts [measurable_const, rfl]
#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCdf_fst
-theorem monotone_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Monotone fun r => preCdf ρ r a :=
by
simp_rw [Monotone, ae_all_iff]
@@ -366,7 +366,7 @@ theorem monotone_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
exact_mod_cast hrr'
#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCdf
-theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (t : ℚ) {s : Set α}
+theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
(hs : MeasurableSet s) : (∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst) = ρ.iicSnd t s :=
by
refine' le_antisymm _ _
@@ -376,7 +376,7 @@ theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure
rw [coe_coe, ← set_lintegral_pre_cdf_fst ρ _ hs]
refine' set_lintegral_mono_ae _ measurable_pre_cdf _
· exact measurable_iInf fun _ => measurable_pre_cdf
- · filter_upwards [monotone_pre_cdf]with a ha_mono
+ · filter_upwards [monotone_pre_cdf] with a ha_mono
exact fun _ => iInf_le _ q
calc
(∫⁻ x in s, ⨅ r : Ioi t, pre_cdf ρ r x ∂ρ.fst) ≤ ⨅ q : Ioi t, ρ.Iic_snd q s := le_iInf h
@@ -385,11 +385,11 @@ theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure
· rw [(set_lintegral_pre_cdf_fst ρ t hs).symm]
refine' set_lintegral_mono_ae measurable_pre_cdf _ _
· exact measurable_iInf fun _ => measurable_pre_cdf
- · filter_upwards [monotone_pre_cdf]with a ha_mono
+ · filter_upwards [monotone_pre_cdf] with a ha_mono
exact fun _ => le_iInf fun r => ha_mono (le_of_lt r.Prop)
#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCdf
-theorem preCdf_le_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem preCdf_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, ∀ r, preCdf ρ r a ≤ 1 := by
rw [ae_all_iff]
refine' fun r =>
@@ -400,7 +400,7 @@ theorem preCdf_le_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
exact measure.Iic_snd_le_fst ρ r s hs
#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCdf_le_one
-theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) :=
by
convert ρ.tendsto_Iic_snd_at_top MeasurableSet.univ
@@ -409,7 +409,7 @@ theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [FiniteMeasure
· exact measure.fst_univ.symm
#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCdf_atTop
-theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atBot (𝓝 0) :=
by
convert ρ.tendsto_Iic_snd_at_bot MeasurableSet.univ
@@ -417,7 +417,7 @@ theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [FiniteMeasure
rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ]
#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCdf_atBot
-theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1) :=
by
-- We show first that `pre_cdf` has a limit almost everywhere. That limit has to be at most 1.
@@ -429,7 +429,7 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
-- `pre_cdf` has a limit a.e.
have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) :=
by
- filter_upwards [h_mono, h_le_one]with a ha_mono ha_le_one
+ filter_upwards [h_mono, h_le_one] with a ha_mono ha_le_one
have h_tendsto :
tendsto (fun r => pre_cdf ρ r a) at_top at_top ∨
∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) :=
@@ -440,66 +440,66 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
exact absurd (hr.trans (ha_le_one r)) ennreal.one_lt_two.not_le
· exact h_tendsto
classical
- -- let `F` be the pointwise limit of `pre_cdf` where it exists, and 0 elsewhere.
- let F : α → ℝ≥0∞ := fun a =>
- if h : ∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) then h.some else 0
- have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 (F a)) :=
- by
- filter_upwards [h_exists]with a ha
- simp_rw [F, dif_pos ha]
- exact ha.some_spec
- have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, tendsto (fun n : ℕ => pre_cdf ρ n a) at_top (𝓝 (F a)) := by
- filter_upwards [h_tendsto_ℚ]with a ha using ha.comp tendsto_nat_cast_atTop_atTop
- have hF_ae_meas : AEMeasurable F ρ.fst :=
- by
- refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
- exact measurable_pre_cdf.ae_measurable
- have hF_le_one : ∀ᵐ a ∂ρ.fst, F a ≤ 1 := by
- filter_upwards [h_tendsto_ℚ, h_le_one]with a ha ha_le using le_of_tendsto' ha ha_le
- -- it suffices to show that the limit `F` is 1 a.e.
- suffices ∀ᵐ a ∂ρ.fst, F a = 1
- by
- filter_upwards [h_tendsto_ℚ, this]with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
- -- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
- -- us that `F` is 1 a.e.
- have h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst :=
+ -- let `F` be the pointwise limit of `pre_cdf` where it exists, and 0 elsewhere.
+ let F : α → ℝ≥0∞ := fun a =>
+ if h : ∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) then h.some else 0
+ have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 (F a)) :=
+ by
+ filter_upwards [h_exists] with a ha
+ simp_rw [F, dif_pos ha]
+ exact ha.some_spec
+ have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, tendsto (fun n : ℕ => pre_cdf ρ n a) at_top (𝓝 (F a)) := by
+ filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_nat_cast_atTop_atTop
+ have hF_ae_meas : AEMeasurable F ρ.fst :=
+ by
+ refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
+ exact measurable_pre_cdf.ae_measurable
+ have hF_le_one : ∀ᵐ a ∂ρ.fst, F a ≤ 1 := by
+ filter_upwards [h_tendsto_ℚ, h_le_one] with a ha ha_le using le_of_tendsto' ha ha_le
+ -- it suffices to show that the limit `F` is 1 a.e.
+ suffices ∀ᵐ a ∂ρ.fst, F a = 1
+ by
+ filter_upwards [h_tendsto_ℚ, this] with a ha_tendsto ha_eq
+ rwa [ha_eq] at ha_tendsto
+ -- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
+ -- us that `F` is 1 a.e.
+ have h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst :=
+ by
+ have h_lintegral :
+ tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
by
- have h_lintegral :
- tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
- by
- refine'
- lintegral_tendsto_of_tendsto_of_monotone
- (-- does this exist only for ℕ?
- fun _ => measurable_pre_cdf.ae_measurable)
- _ h_tendsto_ℕ
- filter_upwards [h_mono]with a ha
- refine' fun n m hnm => ha _
- exact_mod_cast hnm
- have h_lintegral' :
- tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, 1 ∂ρ.fst)) :=
- by
- rw [lintegral_one, measure.fst_univ]
- exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_nat_cast_atTop_atTop
- exact tendsto_nhds_unique h_lintegral h_lintegral'
- have : (∫⁻ a, 1 - F a ∂ρ.fst) = 0 :=
+ refine'
+ lintegral_tendsto_of_tendsto_of_monotone
+ (-- does this exist only for ℕ?
+ fun _ => measurable_pre_cdf.ae_measurable)
+ _ h_tendsto_ℕ
+ filter_upwards [h_mono] with a ha
+ refine' fun n m hnm => ha _
+ exact_mod_cast hnm
+ have h_lintegral' :
+ tendsto (fun r : ℕ => ∫⁻ a, pre_cdf ρ r a ∂ρ.fst) at_top (𝓝 (∫⁻ a, 1 ∂ρ.fst)) :=
by
- rw [lintegral_sub' hF_ae_meas _ hF_le_one, h_lintegral_eq, tsub_self]
- calc
- (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst := h_lintegral_eq
- _ = ρ.fst univ := lintegral_one
- _ = ρ univ := measure.fst_univ
- _ ≠ ∞ := measure_ne_top ρ _
-
- rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
- filter_upwards [this, hF_le_one]with ha h_one_sub_eq_zero h_le_one
- rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
- exact le_antisymm h_le_one h_one_sub_eq_zero
+ rw [lintegral_one, measure.fst_univ]
+ exact (tendsto_lintegral_pre_cdf_at_top ρ).comp tendsto_nat_cast_atTop_atTop
+ exact tendsto_nhds_unique h_lintegral h_lintegral'
+ have : (∫⁻ a, 1 - F a ∂ρ.fst) = 0 :=
+ by
+ rw [lintegral_sub' hF_ae_meas _ hF_le_one, h_lintegral_eq, tsub_self]
+ calc
+ (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst := h_lintegral_eq
+ _ = ρ.fst univ := lintegral_one
+ _ = ρ univ := measure.fst_univ
+ _ ≠ ∞ := measure_ne_top ρ _
+
+ rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
+ filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
+ rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
+ exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCdf_atTop_one
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0) :=
by
-- We show first that `pre_cdf` has a limit in ℝ≥0∞ almost everywhere.
@@ -507,14 +507,14 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [FiniteMeasure ρ]
-- to the integral of the limit. Since the limit is has integral 0, it is equal to 0 a.e.
suffices ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 0)
by
- filter_upwards [this]with a ha
+ filter_upwards [this] with a ha
have h_eq_neg : (fun r : ℚ => pre_cdf ρ r a) = fun r : ℚ => pre_cdf ρ (- -r) a := by
simp_rw [neg_neg]
rw [h_eq_neg]
exact ha.comp tendsto_neg_at_bot_at_top
have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 l) :=
by
- filter_upwards [monotone_pre_cdf ρ]with a ha
+ filter_upwards [monotone_pre_cdf ρ] with a ha
have h_anti : Antitone fun r => pre_cdf ρ (-r) a := fun p q hpq => ha (neg_le_neg hpq)
have h_tendsto :
tendsto (fun r => pre_cdf ρ (-r) a) at_top at_bot ∨
@@ -524,60 +524,59 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [FiniteMeasure ρ]
· exact ⟨0, tendsto.mono_right h_bot atBot_le_nhds_bot⟩
· exact h_tendsto
classical
- let F : α → ℝ≥0∞ := fun a =>
- if h : ∃ l, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 l) then h.some else 0
- have h_tendsto : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 (F a)) :=
+ let F : α → ℝ≥0∞ := fun a =>
+ if h : ∃ l, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 l) then h.some else 0
+ have h_tendsto : ∀ᵐ a ∂ρ.fst, tendsto (fun r => pre_cdf ρ (-r) a) at_top (𝓝 (F a)) :=
+ by
+ filter_upwards [h_exists] with a ha
+ simp_rw [F, dif_pos ha]
+ exact ha.some_spec
+ suffices h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = 0
+ · have hF_ae_meas : AEMeasurable F ρ.fst :=
by
- filter_upwards [h_exists]with a ha
- simp_rw [F, dif_pos ha]
- exact ha.some_spec
- suffices h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = 0
- · have hF_ae_meas : AEMeasurable F ρ.fst :=
- by
- refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
- exact measurable_pre_cdf.ae_measurable
- rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
- filter_upwards [h_tendsto, h_lintegral_eq]with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
- have h_lintegral :
- tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
+ refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
+ exact measurable_pre_cdf.ae_measurable
+ rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
+ filter_upwards [h_tendsto, h_lintegral_eq] with a ha_tendsto ha_eq
+ rwa [ha_eq] at ha_tendsto
+ have h_lintegral :
+ tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
+ by
+ refine'
+ tendsto_lintegral_filter_of_dominated_convergence (fun _ => 1)
+ (eventually_of_forall fun _ => measurable_pre_cdf) (eventually_of_forall fun _ => _) _
+ h_tendsto
+ · filter_upwards [pre_cdf_le_one ρ] with a ha using ha _
+ · rw [lintegral_one]
+ exact measure_ne_top _ _
+ have h_lintegral' : tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 0) :=
+ by
+ have h_lintegral_eq :
+ (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) = fun r => ρ (univ ×ˢ Iic (-r)) :=
by
- refine'
- tendsto_lintegral_filter_of_dominated_convergence (fun _ => 1)
- (eventually_of_forall fun _ => measurable_pre_cdf) (eventually_of_forall fun _ => _) _
- h_tendsto
- · filter_upwards [pre_cdf_le_one ρ]with a ha using ha _
- · rw [lintegral_one]
- exact measure_ne_top _ _
- have h_lintegral' : tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 0) :=
+ ext1 n
+ rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ,
+ measure.Iic_snd_univ]
+ norm_cast
+ rw [h_lintegral_eq]
+ have h_zero_eq_measure_Inter : (0 : ℝ≥0∞) = ρ (⋂ r : ℚ, univ ×ˢ Iic (-r)) :=
by
- have h_lintegral_eq :
- (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) = fun r => ρ (univ ×ˢ Iic (-r)) :=
- by
- ext1 n
- rw [← set_lintegral_univ, set_lintegral_pre_cdf_fst ρ _ MeasurableSet.univ,
- measure.Iic_snd_univ]
- norm_cast
- rw [h_lintegral_eq]
- have h_zero_eq_measure_Inter : (0 : ℝ≥0∞) = ρ (⋂ r : ℚ, univ ×ˢ Iic (-r)) :=
- by
- suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by
- rwa [← prod_iInter, this, prod_empty, measure_empty]
- ext1 x
- simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
- simp_rw [neg_lt]
- exact exists_rat_gt _
- rw [h_zero_eq_measure_Inter]
- refine'
- tendsto_measure_Inter (fun n => measurable_set.univ.prod measurableSet_Iic)
- (fun i j hij x => _) ⟨0, measure_ne_top ρ _⟩
- simp only [mem_prod, mem_univ, mem_Iic, true_and_iff]
- refine' fun hxj => hxj.trans (neg_le_neg _)
- exact_mod_cast hij
- exact tendsto_nhds_unique h_lintegral h_lintegral'
+ suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by rwa [← prod_iInter, this, prod_empty, measure_empty]
+ ext1 x
+ simp only [mem_Inter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
+ simp_rw [neg_lt]
+ exact exists_rat_gt _
+ rw [h_zero_eq_measure_Inter]
+ refine'
+ tendsto_measure_Inter (fun n => measurable_set.univ.prod measurableSet_Iic)
+ (fun i j hij x => _) ⟨0, measure_ne_top ρ _⟩
+ simp only [mem_prod, mem_univ, mem_Iic, true_and_iff]
+ refine' fun hxj => hxj.trans (neg_le_neg _)
+ exact_mod_cast hij
+ exact tendsto_nhds_unique h_lintegral h_lintegral'
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCdf_atBot_zero
-theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
+theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
∀ᵐ a ∂ρ.fst, ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a :=
by
rw [ae_all_iff]
@@ -600,17 +599,17 @@ structure HasCondCdf (ρ : Measure (α × ℝ)) (a : α) : Prop where
iInf_rat_gt_eq : ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a
#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCdf
-theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a :=
+theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a :=
by
filter_upwards [monotone_pre_cdf ρ, pre_cdf_le_one ρ, tendsto_pre_cdf_at_top_one ρ,
- tendsto_pre_cdf_at_bot_zero ρ, inf_gt_pre_cdf ρ]with a h1 h2 h3 h4 h5
+ tendsto_pre_cdf_at_bot_zero ρ, inf_gt_pre_cdf ρ] with a h1 h2 h3 h4 h5
exact ⟨h1, h2, h3, h4, h5⟩
#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCdf_ae
/-- A measurable set of elements of `α` such that `ρ` has a conditional cdf at all
`a ∈ cond_cdf_set`. -/
def condCdfSet (ρ : Measure (α × ℝ)) : Set α :=
- toMeasurable ρ.fst { b | ¬HasCondCdf ρ b }ᶜ
+ toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}ᶜ
#align probability_theory.cond_cdf_set ProbabilityTheory.condCdfSet
theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCdfSet ρ) :=
@@ -620,12 +619,13 @@ theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (con
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
HasCondCdf ρ a := by
rw [cond_cdf_set, mem_compl_iff] at h
- have h_ss := subset_to_measurable ρ.fst { b | ¬has_cond_cdf ρ b }
+ have h_ss := subset_to_measurable ρ.fst {b | ¬has_cond_cdf ρ b}
by_contra ha
exact h (h_ss ha)
#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCdf_of_mem_condCdfSet
-theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ :=
+theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ :=
by
simp_rw [ae_iff, cond_cdf_set, not_mem_compl_iff, set_of_mem_eq, measure_to_measurable]
exact has_cond_cdf_ae ρ
@@ -721,15 +721,15 @@ theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
exact ⟨0, fun q hq => (if_neg (not_lt.mpr hq)).symm⟩
#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCdfRat_atTop
-theorem condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (r : ℚ) :
+theorem condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => condCdfRat ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
- filter_upwards [mem_cond_cdf_set_ae ρ]with a ha using cond_cdf_rat_of_mem ρ a ha r
+ filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using cond_cdf_rat_of_mem ρ a ha r
#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCdfRat_ae_eq
-theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (r : ℚ) :
+theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => ENNReal.ofReal (condCdfRat ρ a r)) =ᵐ[ρ.fst] preCdf ρ r :=
by
- filter_upwards [cond_cdf_rat_ae_eq ρ r, pre_cdf_le_one ρ]with a ha ha_le_one
+ filter_upwards [cond_cdf_rat_ae_eq ρ r, pre_cdf_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCdfRat_ae_eq
@@ -922,16 +922,16 @@ theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
exact (cond_cdf ρ a).mono (le_of_lt (h_exists x).choose_spec.2)
#align probability_theory.tendsto_cond_cdf_at_top ProbabilityTheory.tendsto_condCdf_atTop
-theorem condCdf_ae_eq (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (r : ℚ) :
+theorem condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => condCdf ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
- filter_upwards [mem_cond_cdf_set_ae
- ρ]with a ha using(cond_cdf_eq_cond_cdf_rat ρ a r).trans (cond_cdf_rat_of_mem ρ a ha r)
+ filter_upwards [mem_cond_cdf_set_ae ρ] with a ha using
+ (cond_cdf_eq_cond_cdf_rat ρ a r).trans (cond_cdf_rat_of_mem ρ a ha r)
#align probability_theory.cond_cdf_ae_eq ProbabilityTheory.condCdf_ae_eq
-theorem ofReal_condCdf_ae_eq (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (r : ℚ) :
+theorem ofReal_condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
(fun a => ENNReal.ofReal (condCdf ρ a r)) =ᵐ[ρ.fst] preCdf ρ r :=
by
- filter_upwards [cond_cdf_ae_eq ρ r, pre_cdf_le_one ρ]with a ha ha_le_one
+ filter_upwards [cond_cdf_ae_eq ρ r, pre_cdf_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).Ne
#align probability_theory.of_real_cond_cdf_ae_eq ProbabilityTheory.ofReal_condCdf_ae_eq
@@ -953,18 +953,18 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
-theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (r : ℚ) {s : Set α}
+theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
(hs : MeasurableSet s) : (∫⁻ a in s, ENNReal.ofReal (condCdf ρ a r) ∂ρ.fst) = ρ (s ×ˢ Iic r) :=
by
have : ∀ᵐ a ∂ρ.fst, a ∈ s → ENNReal.ofReal (cond_cdf ρ a r) = pre_cdf ρ r a := by
- filter_upwards [of_real_cond_cdf_ae_eq ρ r]with a ha using fun _ => ha
+ filter_upwards [of_real_cond_cdf_ae_eq ρ r] with a ha using fun _ => ha
rw [set_lintegral_congr_fun hs this, set_lintegral_pre_cdf_fst ρ r hs]
exact ρ.Iic_snd_apply r hs
#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCdf_rat
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x : ℝ) {s : Set α}
+theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
(hs : MeasurableSet s) : (∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst) = ρ (s ×ˢ Iic x) :=
by
-- We have the result for `x : ℚ` thanks to `set_lintegral_cond_cdf_rat`. We use the equality
@@ -1016,7 +1016,7 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x :
#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCdf
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem lintegral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x : ℝ) :
+theorem lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
(∫⁻ a, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst) = ρ (univ ×ˢ Iic x) := by
rw [← set_lintegral_univ, set_lintegral_cond_cdf ρ _ MeasurableSet.univ]
#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCdf
@@ -1027,7 +1027,7 @@ theorem stronglyMeasurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) :
(measurable_condCdf ρ x).StronglyMeasurable
#align probability_theory.strongly_measurable_cond_cdf ProbabilityTheory.stronglyMeasurable_condCdf
-theorem integrable_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x : ℝ) :
+theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
Integrable (fun a => condCdf ρ a x) ρ.fst :=
by
refine' integrable_of_forall_fin_meas_le _ (measure_lt_top ρ.fst univ) _ fun t ht hρt => _
@@ -1045,7 +1045,7 @@ theorem integrable_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x :
#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCdf
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x : ℝ) {s : Set α}
+theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
(hs : MeasurableSet s) : (∫ a in s, condCdf ρ a x ∂ρ.fst) = (ρ (s ×ˢ Iic x)).toReal :=
by
have h := set_lintegral_cond_cdf ρ x hs
@@ -1057,7 +1057,7 @@ theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x :
#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCdf
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
-theorem integral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x : ℝ) :
+theorem integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
(∫ a, condCdf ρ a x ∂ρ.fst) = (ρ (univ ×ˢ Iic x)).toReal := by
rw [← set_integral_cond_cdf ρ _ MeasurableSet.univ, measure.restrict_univ]
#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCdf
@@ -1077,7 +1077,7 @@ theorem measure_condCdf_univ (ρ : Measure (α × ℝ)) (a : α) : (condCdf ρ a
exact StieltjesFunction.measure_univ _ (tendsto_cond_cdf_at_bot ρ a) (tendsto_cond_cdf_at_top ρ a)
#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCdf_univ
-instance (ρ : Measure (α × ℝ)) (a : α) : ProbabilityMeasure (condCdf ρ a).Measure :=
+instance (ρ : Measure (α × ℝ)) (a : α) : IsProbabilityMeasure (condCdf ρ a).Measure :=
⟨measure_condCdf_univ ρ a⟩
/-- The function `a ↦ (cond_cdf ρ a).measure` is measurable. -/
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -287,16 +287,16 @@ theorem tendsto_iicSnd_atBot [FiniteMeasure ρ] {s : Set α} (hs : MeasurableSet
ext1 x
simp only [Rat.cast_eq_id, id.def, mem_Inter, mem_prod, mem_Iic]
refine' ⟨fun h i => ⟨(h i).1, _⟩, fun h i => ⟨(h i).1, _⟩⟩ <;> have h' := h (-i)
- · rw [neg_neg] at h'; exact h'.2
+ · rw [neg_neg] at h' ; exact h'.2
· exact h'.2
- rw [h_inter_eq] at h_neg
+ rw [h_inter_eq] at h_neg
have h_fun_eq : (fun r : ℚ => ρ (s ×ˢ Iic (r : ℝ))) = fun r => ρ (s ×ˢ Iic ↑(- -r)) := by
simp_rw [neg_neg]
rw [h_fun_eq]
exact h_neg.comp tendsto_neg_at_bot_at_top
refine' tendsto_measure_Inter (fun q => hs.prod measurableSet_Iic) _ ⟨0, measure_ne_top ρ _⟩
refine' fun q r hqr => prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, fun x hx => _⟩)
- simp only [Rat.cast_neg, mem_Iic] at hx⊢
+ simp only [Rat.cast_neg, mem_Iic] at hx ⊢
refine' hx.trans (neg_le_neg _)
exact_mod_cast hqr
#align measure_theory.measure.tendsto_Iic_snd_at_bot MeasureTheory.Measure.tendsto_iicSnd_atBot
@@ -351,7 +351,7 @@ theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set
simp only [with_density_pre_cdf ρ r, Pi.one_apply, lintegral_one, measure.restrict_apply,
MeasurableSet.univ, univ_inter]
· rw [(_ : (1 : α → ℝ≥0∞) = fun _ => 1)]
- exacts[measurable_const, rfl]
+ exacts [measurable_const, rfl]
#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCdf_fst
theorem monotone_preCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
@@ -435,7 +435,7 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
∃ l, tendsto (fun r => pre_cdf ρ r a) at_top (𝓝 l) :=
tendsto_of_monotone ha_mono
cases' h_tendsto with h_absurd h_tendsto
- · rw [Monotone.tendsto_atTop_atTop_iff ha_mono] at h_absurd
+ · rw [Monotone.tendsto_atTop_atTop_iff ha_mono] at h_absurd
obtain ⟨r, hr⟩ := h_absurd 2
exact absurd (hr.trans (ha_le_one r)) ennreal.one_lt_two.not_le
· exact h_tendsto
@@ -460,7 +460,7 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
suffices ∀ᵐ a ∂ρ.fst, F a = 1
by
filter_upwards [h_tendsto_ℚ, this]with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
+ rwa [ha_eq] at ha_tendsto
-- since `F` is at most 1, proving that its integral is the same as the integral of 1 will tell
-- us that `F` is 1 a.e.
have h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = ∫⁻ a, 1 ∂ρ.fst :=
@@ -491,9 +491,9 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
_ = ρ univ := measure.fst_univ
_ ≠ ∞ := measure_ne_top ρ _
- rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
+ rw [lintegral_eq_zero_iff' (ae_measurable_const.sub hF_ae_meas)] at this
filter_upwards [this, hF_le_one]with ha h_one_sub_eq_zero h_le_one
- rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
+ rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
exact le_antisymm h_le_one h_one_sub_eq_zero
#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCdf_atTop_one
@@ -536,9 +536,9 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [FiniteMeasure ρ]
by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
exact measurable_pre_cdf.ae_measurable
- rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
+ rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
filter_upwards [h_tendsto, h_lintegral_eq]with a ha_tendsto ha_eq
- rwa [ha_eq] at ha_tendsto
+ rwa [ha_eq] at ha_tendsto
have h_lintegral :
tendsto (fun r => ∫⁻ a, pre_cdf ρ (-r) a ∂ρ.fst) at_top (𝓝 (∫⁻ a, F a ∂ρ.fst)) :=
by
@@ -619,7 +619,7 @@ theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (con
theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
HasCondCdf ρ a := by
- rw [cond_cdf_set, mem_compl_iff] at h
+ rw [cond_cdf_set, mem_compl_iff] at h
have h_ss := subset_to_measurable ρ.fst { b | ¬has_cond_cdf ρ b }
by_contra ha
exact h (h_ss ha)
@@ -664,7 +664,7 @@ theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (cond
intro x y hxy
dsimp only
split_ifs
- exacts[le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
+ exacts [le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCdfRat
theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
@@ -677,7 +677,7 @@ theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCdfRat
theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
- unfold cond_cdf_rat; split_ifs; exacts[ENNReal.toReal_nonneg, le_rfl, zero_le_one]
+ unfold cond_cdf_rat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCdfRat_nonneg
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 :=
@@ -687,7 +687,7 @@ theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCd
· refine' ENNReal.toReal_le_of_le_ofReal zero_le_one _
rw [ENNReal.ofReal_one]
exact (has_cond_cdf_of_mem_cond_cdf_set h).le_one r
- exacts[zero_le_one, le_rfl]
+ exacts [zero_le_one, le_rfl]
#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCdfRat_le_one
theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
@@ -751,7 +751,7 @@ theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
obtain ⟨y, rfl⟩ := mem_range.mpr hx
dsimp only
split_ifs
- exacts[le_rfl, zero_le_one]
+ exacts [le_rfl, zero_le_one]
split_ifs with h h
· refine' le_antisymm _ (le_ciInf fun x => _)
· obtain ⟨q, htq, hq_neg⟩ : ∃ q, t < q ∧ q < 0 :=
@@ -763,14 +763,14 @@ theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
rw [if_pos]
rwa [Subtype.coe_mk]
· split_ifs
- exacts[le_rfl, zero_le_one]
+ exacts [le_rfl, zero_le_one]
· refine' le_antisymm _ _
· refine' (ciInf_le h_bdd ⟨t + 1, lt_add_one t⟩).trans _
split_ifs
- exacts[zero_le_one, le_rfl]
+ exacts [zero_le_one, le_rfl]
· refine' le_ciInf fun x => _
rw [if_neg]
- rw [not_lt] at h⊢
+ rw [not_lt] at h ⊢
exact h.trans (mem_Ioi.mp x.prop).le
#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCdfRat
@@ -893,7 +893,7 @@ theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
refine' fun q => ⟨q - 1, fun y hy => _⟩
have h_le : ↑(qs y) ≤ (q : ℝ) - 1 + 1 :=
(h_exists y).choose_spec.2.le.trans (add_le_add hy le_rfl)
- rw [sub_add_cancel] at h_le
+ rw [sub_add_cancel] at h_le
exact_mod_cast h_le
refine'
tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds
@@ -912,7 +912,7 @@ theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) : Tendsto (con
rw [tendsto_at_top_at_top]
refine' fun q => ⟨q + 1, fun y hy => _⟩
have h_le : y - 1 ≤ qs y := (h_exists y).choose_spec.1.le
- rw [sub_le_iff_le_add] at h_le
+ rw [sub_le_iff_le_add] at h_le
exact_mod_cast le_of_add_le_add_right (hy.trans h_le)
refine'
tendsto_of_tendsto_of_tendsto_of_le_of_le ((tendsto_cond_cdf_rat_at_top ρ a).comp hqs_tendsto)
@@ -1049,7 +1049,7 @@ theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x :
(hs : MeasurableSet s) : (∫ a in s, condCdf ρ a x ∂ρ.fst) = (ρ (s ×ˢ Iic x)).toReal :=
by
have h := set_lintegral_cond_cdf ρ x hs
- rw [← of_real_integral_eq_lintegral_of_real] at h
+ rw [← of_real_integral_eq_lintegral_of_real] at h
· rw [← h, ENNReal.toReal_ofReal]
exact integral_nonneg fun _ => cond_cdf_nonneg _ _ _
· exact (integrable_cond_cdf _ _).IntegrableOn
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -48,7 +48,7 @@ The construction of the conditional cdf in this file follows the proof of Theore
open MeasureTheory Set Filter TopologicalSpace
-open NNReal ENNReal MeasureTheory Topology ProbabilityTheory
+open scoped NNReal ENNReal MeasureTheory Topology ProbabilityTheory
section AuxLemmasToBeMoved
@@ -633,7 +633,7 @@ theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] : ∀ᵐ
end HasCondCdf
-open Classical
+open scoped Classical
/-- Conditional cdf of the measure given the value on `α`, restricted to the rationals.
It is defined to be `pre_cdf` if `a ∈ cond_cdf_set`, and a default cdf-like function
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -176,19 +176,13 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
#align lintegral_infi_directed_of_measurable lintegral_iInf_directed_of_measurable
-- todo: move to measure_theory/pi_system
-theorem isPiSystem_Iic [SemilatticeInf α] : @IsPiSystem α (range Iic) :=
- by
- rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _
- rw [Iic_inter_Iic]
- exact ⟨us ⊓ ut, rfl⟩
+theorem isPiSystem_Iic [SemilatticeInf α] : @IsPiSystem α (range Iic) := by
+ rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _; rw [Iic_inter_Iic]; exact ⟨us ⊓ ut, rfl⟩
#align is_pi_system_Iic isPiSystem_Iic
-- todo: move to measure_theory/pi_system
-theorem isPiSystem_Ici [SemilatticeSup α] : @IsPiSystem α (range Ici) :=
- by
- rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _
- rw [Ici_inter_Ici]
- exact ⟨us ⊔ ut, rfl⟩
+theorem isPiSystem_Ici [SemilatticeSup α] : @IsPiSystem α (range Ici) := by
+ rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _; rw [Ici_inter_Ici]; exact ⟨us ⊔ ut, rfl⟩
#align is_pi_system_Ici isPiSystem_Ici
end AuxLemmasToBeMoved
@@ -293,8 +287,7 @@ theorem tendsto_iicSnd_atBot [FiniteMeasure ρ] {s : Set α} (hs : MeasurableSet
ext1 x
simp only [Rat.cast_eq_id, id.def, mem_Inter, mem_prod, mem_Iic]
refine' ⟨fun h i => ⟨(h i).1, _⟩, fun h i => ⟨(h i).1, _⟩⟩ <;> have h' := h (-i)
- · rw [neg_neg] at h'
- exact h'.2
+ · rw [neg_neg] at h'; exact h'.2
· exact h'.2
rw [h_inter_eq] at h_neg
have h_fun_eq : (fun r : ℚ => ρ (s ×ˢ Iic (r : ℝ))) = fun r => ρ (s ×ˢ Iic ↑(- -r)) := by
@@ -683,11 +676,8 @@ theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
measurable_const
#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCdfRat
-theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r :=
- by
- unfold cond_cdf_rat
- split_ifs
- exacts[ENNReal.toReal_nonneg, le_rfl, zero_le_one]
+theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
+ unfold cond_cdf_rat; split_ifs; exacts[ENNReal.toReal_nonneg, le_rfl, zero_le_one]
#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCdfRat_nonneg
theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 :=
@@ -820,11 +810,8 @@ theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ co
#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCdf'_nonneg
theorem bddBelow_range_condCdfRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCdfRat ρ a r) :=
- by
- refine' ⟨0, fun z => _⟩
- rintro ⟨u, rfl⟩
- exact cond_cdf_rat_nonneg ρ a _
+ BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCdfRat ρ a r) := by
+ refine' ⟨0, fun z => _⟩; rintro ⟨u, rfl⟩; exact cond_cdf_rat_nonneg ρ a _
#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCdfRat_gt
theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdf' ρ a) :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/75e7fca56381d056096ce5d05e938f63a6567828
@@ -1044,7 +1044,7 @@ theorem integrable_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x :
Integrable (fun a => condCdf ρ a x) ρ.fst :=
by
refine' integrable_of_forall_fin_meas_le _ (measure_lt_top ρ.fst univ) _ fun t ht hρt => _
- · exact (strongly_measurable_cond_cdf ρ _).AeStronglyMeasurable
+ · exact (strongly_measurable_cond_cdf ρ _).AEStronglyMeasurable
· have : ∀ y, (‖cond_cdf ρ y x‖₊ : ℝ≥0∞) ≤ 1 :=
by
intro y
mathlib commit https://github.com/leanprover-community/mathlib/commit/75e7fca56381d056096ce5d05e938f63a6567828
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
! This file was ported from Lean 3 source module probability.kernel.cond_cdf
-! leanprover-community/mathlib commit 20d5763051978e9bc6428578ed070445df6a18b3
+! leanprover-community/mathlib commit 3b88f4005dc2e28d42f974cc1ce838f0dafb39b8
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -459,7 +459,7 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] :
filter_upwards [h_tendsto_ℚ]with a ha using ha.comp tendsto_nat_cast_atTop_atTop
have hF_ae_meas : AEMeasurable F ρ.fst :=
by
- refine' aEMeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
+ refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
exact measurable_pre_cdf.ae_measurable
have hF_le_one : ∀ᵐ a ∂ρ.fst, F a ≤ 1 := by
filter_upwards [h_tendsto_ℚ, h_le_one]with a ha ha_le using le_of_tendsto' ha ha_le
@@ -541,7 +541,7 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [FiniteMeasure ρ]
suffices h_lintegral_eq : (∫⁻ a, F a ∂ρ.fst) = 0
· have hF_ae_meas : AEMeasurable F ρ.fst :=
by
- refine' aEMeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
+ refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
exact measurable_pre_cdf.ae_measurable
rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
filter_upwards [h_tendsto, h_lintegral_eq]with a ha_tendsto ha_eq
@@ -1075,5 +1075,50 @@ theorem integral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x : ℝ)
rw [← set_integral_cond_cdf ρ _ MeasurableSet.univ, measure.restrict_univ]
#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCdf
+section Measure
+
+theorem measure_condCdf_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ (condCdf ρ a).Measure (Iic x) = ENNReal.ofReal (condCdf ρ a x) :=
+ by
+ rw [← sub_zero (cond_cdf ρ a x)]
+ exact (cond_cdf ρ a).measure_Iic (tendsto_cond_cdf_at_bot ρ a) _
+#align probability_theory.measure_cond_cdf_Iic ProbabilityTheory.measure_condCdf_Iic
+
+theorem measure_condCdf_univ (ρ : Measure (α × ℝ)) (a : α) : (condCdf ρ a).Measure univ = 1 :=
+ by
+ rw [← ENNReal.ofReal_one, ← sub_zero (1 : ℝ)]
+ exact StieltjesFunction.measure_univ _ (tendsto_cond_cdf_at_bot ρ a) (tendsto_cond_cdf_at_top ρ a)
+#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCdf_univ
+
+instance (ρ : Measure (α × ℝ)) (a : α) : ProbabilityMeasure (condCdf ρ a).Measure :=
+ ⟨measure_condCdf_univ ρ a⟩
+
+/-- The function `a ↦ (cond_cdf ρ a).measure` is measurable. -/
+theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
+ Measurable fun a => (condCdf ρ a).Measure :=
+ by
+ rw [measure.measurable_measure]
+ refine' fun s hs =>
+ MeasurableSpace.induction_on_inter (borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
+ · simp only [measure_empty, measurable_const]
+ · rintro S ⟨u, rfl⟩
+ simp_rw [measure_cond_cdf_Iic ρ _ u]
+ exact (measurable_cond_cdf ρ u).ennreal_ofReal
+ · intro t ht ht_cd_meas
+ have :
+ (fun a => (cond_cdf ρ a).Measure (tᶜ)) =
+ (fun a => (cond_cdf ρ a).Measure univ) - fun a => (cond_cdf ρ a).Measure t :=
+ by
+ ext1 a
+ rw [measure_compl ht (measure_ne_top (cond_cdf ρ a).Measure _), Pi.sub_apply]
+ simp_rw [this, measure_cond_cdf_univ ρ]
+ exact Measurable.sub measurable_const ht_cd_meas
+ · intro f hf_disj hf_meas hf_cd_meas
+ simp_rw [measure_Union hf_disj hf_meas]
+ exact Measurable.ennreal_tsum hf_cd_meas
+#align probability_theory.measurable_measure_cond_cdf ProbabilityTheory.measurable_measure_condCdf
+
+end Measure
+
end ProbabilityTheory
mathlib commit https://github.com/leanprover-community/mathlib/commit/33c67ae661dd8988516ff7f247b0be3018cdd952
@@ -960,7 +960,7 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
rw [coe_coe, cond_cdf_eq_cond_cdf_rat]
rw [this]
exact
- measurable_cinfi (fun q => measurable_cond_cdf_rat ρ q) fun a =>
+ measurable_ciInf (fun q => measurable_cond_cdf_rat ρ q) fun a =>
bdd_below_range_cond_cdf_rat_gt ρ a _
#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCdf
@@ -1006,7 +1006,7 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [FiniteMeasure ρ] (x :
simp_rw [ENNReal.ofReal_cinfi]
have h_coe : ∀ b : { r' : ℚ // x < ↑r' }, (b : ℝ) = ((b : ℚ) : ℝ) := fun _ => by congr
rw [lintegral_iInf_directed_of_measurable hρ_zero fun q : { r' : ℚ // x < ↑r' } =>
- (measurable_cond_cdf ρ q).eNNReal_ofReal]
+ (measurable_cond_cdf ρ q).ennreal_ofReal]
rotate_left
· intro b
simp_rw [h_coe]
mathlib commit https://github.com/leanprover-community/mathlib/commit/c89fe2d59ae06402c3f55f978016d1ada444f57e
@@ -412,7 +412,7 @@ instance instIsProbabilityMeasureCondCDF (ρ : Measure (α × ℝ)) (a : α) :
theorem measurable_measure_condCDF (ρ : Measure (α × ℝ)) :
Measurable fun a => (condCDF ρ a).measure := by
rw [Measure.measurable_measure]
- refine' fun s hs => ?_
+ refine fun s hs => ?_
-- Porting note: supplied `C`
refine' MeasurableSpace.induction_on_inter
(C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCDF ρ b) s)
set_integral
with setIntegral
(#12215)
Done with a global search and replace, and then (to fix the #align
lines), replace (#align \S*)setIntegral
with $1set_integral
.
@@ -199,7 +199,7 @@ theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
exact Measure.IicSnd_le_fst ρ r s
#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCDF_le_one
-lemma set_integral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
+lemma setIntegral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
[IsFiniteMeasure ρ] :
∫ x in s, (preCDF ρ r x).toReal ∂ρ.fst = (ρ.IicSnd r s).toReal := by
rw [integral_toReal]
@@ -209,9 +209,13 @@ lemma set_integral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α}
filter_upwards [preCDF_le_one ρ] with a ha
exact (ha r).trans_lt ENNReal.one_lt_top
+@[deprecated]
+alias set_integral_preCDF_fst :=
+ setIntegral_preCDF_fst -- deprecated on 2024-04-17
+
lemma integral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
∫ x, (preCDF ρ r x).toReal ∂ρ.fst = (ρ.IicSnd r univ).toReal := by
- rw [← integral_univ, set_integral_preCDF_fst ρ _ MeasurableSet.univ]
+ rw [← integral_univ, setIntegral_preCDF_fst ρ _ MeasurableSet.univ]
lemma integrable_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℚ) :
Integrable (fun a ↦ (preCDF ρ x a).toReal) ρ.fst := by
@@ -251,8 +255,8 @@ lemma isRatCondKernelCDFAux_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure
ENNReal.continuousAt_toReal (measure_ne_top _ _)
exact h0.comp (h.comp hs_tendsto)
integrable _ q := integrable_preCDF ρ q
- set_integral a s hs q := by rw [kernel.const_apply, kernel.const_apply,
- set_integral_preCDF_fst _ _ hs, Measure.IicSnd_apply _ _ hs]
+ setIntegral a s hs q := by rw [kernel.const_apply, kernel.const_apply,
+ setIntegral_preCDF_fst _ _ hs, Measure.IicSnd_apply _ _ hs]
lemma isRatCondKernelCDF_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
IsRatCondKernelCDF (fun p r ↦ (preCDF ρ r p.2).toReal)
@@ -373,10 +377,14 @@ theorem integrable_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x :
(isCondKernelCDF_condCDF ρ).integrable () x
#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCDF
-theorem set_integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
+theorem setIntegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
(hs : MeasurableSet s) : ∫ a in s, condCDF ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal :=
- (isCondKernelCDF_condCDF ρ).set_integral () hs x
-#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCDF
+ (isCondKernelCDF_condCDF ρ).setIntegral () hs x
+#align probability_theory.set_integral_cond_cdf ProbabilityTheory.setIntegral_condCDF
+
+@[deprecated]
+alias set_integral_condCDF :=
+ setIntegral_condCDF -- deprecated on 2024-04-17
theorem integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
∫ a, condCDF ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal :=
These are changes from #11997, the latest adaptation PR for nightly-2024-04-07, which can be made directly on master.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com>
@@ -108,7 +108,7 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
Tendsto (fun r : ℚ ↦ ρ (s ×ˢ Iic ↑(-r))) atTop (𝓝 (ρ (⋂ r : ℚ, s ×ˢ Iic ↑(-r)))) by
have h_inter_eq : ⋂ r : ℚ, s ×ˢ Iic ↑(-r) = ⋂ r : ℚ, s ×ˢ Iic (r : ℝ) := by
ext1 x
- simp only [Rat.cast_eq_id, id.def, mem_iInter, mem_prod, mem_Iic]
+ simp only [Rat.cast_eq_id, id, mem_iInter, mem_prod, mem_Iic]
refine ⟨fun h i ↦ ⟨(h i).1, ?_⟩, fun h i ↦ ⟨(h i).1, ?_⟩⟩ <;> have h' := h (-i)
· rw [neg_neg] at h'; exact h'.2
· exact h'.2
@@ -49,25 +49,6 @@ open MeasureTheory Set Filter TopologicalSpace
open scoped NNReal ENNReal MeasureTheory Topology
-section AuxLemmasToBeMoved
-
-variable {α β ι : Type*}
-
-theorem Real.iUnion_Iic_rat : ⋃ r : ℚ, Iic (r : ℝ) = univ := by
- ext1 x
- simp only [mem_iUnion, mem_Iic, mem_univ, iff_true_iff]
- obtain ⟨r, hr⟩ := exists_rat_gt x
- exact ⟨r, hr.le⟩
-#align real.Union_Iic_rat Real.iUnion_Iic_rat
-
-theorem Real.iInter_Iic_rat : ⋂ r : ℚ, Iic (r : ℝ) = ∅ := by
- ext1 x
- simp only [mem_iInter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
- exact exists_rat_lt x
-#align real.Inter_Iic_rat Real.iInter_Iic_rat
-
-end AuxLemmasToBeMoved
-
namespace MeasureTheory.Measure
variable {α β : Type*} {mα : MeasurableSpace α} (ρ : Measure (α × ℝ))
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -292,7 +292,7 @@ theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
if h : ∃ l, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 l) then h.choose else 0
have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 (F a)) := by
filter_upwards [h_exists] with a ha
- simp_rw [dif_pos ha]
+ simp_rw [F, dif_pos ha]
exact ha.choose_spec
have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, Tendsto (fun n : ℕ => preCDF ρ n a) atTop (𝓝 (F a)) := by
filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_nat_cast_atTop_atTop
@@ -356,7 +356,7 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
if h : ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) then h.choose else 0
have h_tendsto : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 (F a)) := by
filter_upwards [h_exists] with a ha
- simp_rw [dif_pos ha]
+ simp_rw [F, dif_pos ha]
exact ha.choose_spec
suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0 by
have hF_ae_meas : AEMeasurable F ρ.fst := by
≤
on measures (#10714)
Redefine ≤
on MeasureTheory.Measure
so that μ ≤ ν ↔ ∀ s, μ s ≤ ν s
by definition
instead of ∀ s, MeasurableSet s → μ s ≤ ν s
.
≤
on outer measures;DFunLike
types
and migrate measures to FunLike
, then this is unavoidable;μ ≤ ν
this way";
the counter-argument is
"it's slightly harder to apply μ ≤ ν
this way".@[gcongr]
tags to some ENNReal
lemmas;ENNReal.coe_lt_coe_of_le
-> ENNReal.ENNReal.coe_lt_coe_of_lt
;MeasurableSet
assumption
in set_lintegral_pdf_le_map
@@ -89,14 +89,14 @@ theorem IicSnd_univ (r : ℝ) : ρ.IicSnd r univ = ρ (univ ×ˢ Iic r) :=
#align measure_theory.measure.Iic_snd_univ MeasureTheory.Measure.IicSnd_univ
theorem IicSnd_mono {r r' : ℝ} (h_le : r ≤ r') : ρ.IicSnd r ≤ ρ.IicSnd r' := by
- intro s hs
+ refine Measure.le_iff.2 fun s hs ↦ ?_
simp_rw [IicSnd_apply ρ _ hs]
refine' measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr _⟩))
exact mod_cast h_le
#align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono
theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≤ ρ.fst := by
- intro s hs
+ refine Measure.le_iff.2 fun s hs ↦ ?_
simp_rw [fst_apply hs, IicSnd_apply ρ r hs]
exact measure_mono (prod_subset_preimage_fst _ _)
#align measure_theory.measure.Iic_snd_le_fst MeasureTheory.Measure.IicSnd_le_fst
@@ -219,8 +219,7 @@ theorem monotone_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
ae_le_of_forall_set_lintegral_le_of_sigmaFinite measurable_preCDF measurable_preCDF
fun s hs _ => _
rw [set_lintegral_preCDF_fst ρ r hs, set_lintegral_preCDF_fst ρ r' hs]
- refine' Measure.IicSnd_mono ρ _ s hs
- exact mod_cast hrr'
+ exact Measure.IicSnd_mono ρ (mod_cast hrr') s
#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCDF
theorem set_lintegral_iInf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
@@ -251,7 +250,7 @@ theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
fun s hs _ => _
rw [set_lintegral_preCDF_fst ρ r hs]
simp only [Pi.one_apply, lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter]
- exact Measure.IicSnd_le_fst ρ r s hs
+ exact Measure.IicSnd_le_fst ρ r s
#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCDF_le_one
theorem tendsto_lintegral_preCDF_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
have
, replace
and suffices
(#10640)
No changes to tactic file, it's just boring fixes throughout the library.
This follows on from #6964.
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -144,8 +144,8 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
have h_empty : ρ (s ×ˢ ∅) = 0 := by simp only [prod_empty, measure_empty]
rw [← h_empty, ← Real.iInter_Iic_rat, prod_iInter]
suffices h_neg :
- Tendsto (fun r : ℚ => ρ (s ×ˢ Iic ↑(-r))) atTop (𝓝 (ρ (⋂ r : ℚ, s ×ˢ Iic ↑(-r))))
- · have h_inter_eq : ⋂ r : ℚ, s ×ˢ Iic ↑(-r) = ⋂ r : ℚ, s ×ˢ Iic (r : ℝ) := by
+ Tendsto (fun r : ℚ => ρ (s ×ˢ Iic ↑(-r))) atTop (𝓝 (ρ (⋂ r : ℚ, s ×ˢ Iic ↑(-r)))) by
+ have h_inter_eq : ⋂ r : ℚ, s ×ˢ Iic ↑(-r) = ⋂ r : ℚ, s ×ˢ Iic (r : ℝ) := by
ext1 x
simp only [Rat.cast_eq_id, id.def, mem_iInter, mem_prod, mem_Iic]
refine' ⟨fun h i => ⟨(h i).1, _⟩, fun h i => ⟨(h i).1, _⟩⟩ <;> have h' := h (-i)
@@ -359,8 +359,8 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
filter_upwards [h_exists] with a ha
simp_rw [dif_pos ha]
exact ha.choose_spec
- suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0
- · have hF_ae_meas : AEMeasurable F ρ.fst := by
+ suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0 by
+ have hF_ae_meas : AEMeasurable F ρ.fst := by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
exact measurable_preCDF.aemeasurable
rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
atBot_le_nhds_bot
and atTop_le_nhds_top
;tendsto_atTop_iInf
instead in CondCdf
.@@ -351,13 +351,7 @@ theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) := by
filter_upwards [monotone_preCDF ρ] with a ha
have h_anti : Antitone fun r => preCDF ρ (-r) a := fun p q hpq => ha (neg_le_neg hpq)
- have h_tendsto :
- Tendsto (fun r => preCDF ρ (-r) a) atTop atBot ∨
- ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) :=
- tendsto_of_antitone h_anti
- cases' h_tendsto with h_bot h_tendsto
- · exact ⟨0, Tendsto.mono_right h_bot atBot_le_nhds_bot⟩
- · exact h_tendsto
+ exact ⟨_, tendsto_atTop_iInf h_anti⟩
classical
let F : α → ℝ≥0∞ := fun a =>
if h : ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) then h.choose else 0
@@ -66,27 +66,6 @@ theorem Real.iInter_Iic_rat : ⋂ r : ℚ, Iic (r : ℝ) = ∅ := by
exact exists_rat_lt x
#align real.Inter_Iic_rat Real.iInter_Iic_rat
--- todo after the port: move to order/filter/at_top_bot
-theorem atBot_le_nhds_bot {α : Type*} [TopologicalSpace α] [LinearOrder α] [OrderBot α]
- [OrderTopology α] : (atBot : Filter α) ≤ 𝓝 ⊥ := by
- cases subsingleton_or_nontrivial α
- · simp only [nhds_discrete, le_pure_iff, mem_atBot_sets, mem_singleton_iff,
- eq_iff_true_of_subsingleton, imp_true_iff, exists_const]
- have h : atBot.HasBasis (fun _ : α => True) Iic := @atBot_basis α _ _
- have h_nhds : (𝓝 ⊥).HasBasis (fun a : α => ⊥ < a) fun a => Iio a := @nhds_bot_basis α _ _ _ _ _
- intro s
- rw [h.mem_iff, h_nhds.mem_iff]
- rintro ⟨a, ha_bot_lt, h_Iio_a_subset_s⟩
- refine' ⟨⊥, trivial, _root_.trans _ h_Iio_a_subset_s⟩
- simpa only [Iic_bot, singleton_subset_iff, mem_Iio]
-#align at_bot_le_nhds_bot atBot_le_nhds_bot
-
--- todo after the port: move to order/filter/at_top_bot
-theorem atTop_le_nhds_top {α : Type*} [TopologicalSpace α] [LinearOrder α] [OrderTop α]
- [OrderTopology α] : (atTop : Filter α) ≤ 𝓝 ⊤ :=
- @atBot_le_nhds_bot αᵒᵈ _ _ _ _
-#align at_top_le_nhds_top atTop_le_nhds_top
-
end AuxLemmasToBeMoved
namespace MeasureTheory.Measure
@@ -87,45 +87,6 @@ theorem atTop_le_nhds_top {α : Type*} [TopologicalSpace α] [LinearOrder α] [O
@atBot_le_nhds_bot αᵒᵈ _ _ _ _
#align at_top_le_nhds_top atTop_le_nhds_top
--- todo: move to measure_theory/measurable_space
-/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
-theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
- {f : β → α → ℝ≥0∞} {μ : Measure α} (hμ : μ ≠ 0) (hf : ∀ b, Measurable (f b))
- (hf_int : ∀ b, ∫⁻ a, f b a ∂μ ≠ ∞) (h_directed : Directed (· ≥ ·) f) :
- ∫⁻ a, ⨅ b, f b a ∂μ = ⨅ b, ∫⁻ a, f b a ∂μ := by
- cases nonempty_encodable β
- cases isEmpty_or_nonempty β
- · -- Porting note: the next `simp only` doesn't do anything, so added a workaround below.
- -- simp only [WithTop.iInf_empty, lintegral_const]
- conv =>
- lhs
- congr
- · skip
- · ext x
- rw [WithTop.iInf_empty]
- rw [WithTop.iInf_empty, lintegral_const]
- rw [ENNReal.top_mul', if_neg]
- simp only [Measure.measure_univ_eq_zero, hμ, not_false_iff]
- inhabit β
- have : ∀ a, ⨅ b, f b a = ⨅ n, f (h_directed.sequence f n) a := by
- refine' fun a =>
- le_antisymm (le_iInf fun n => iInf_le _ _)
- (le_iInf fun b => iInf_le_of_le (Encodable.encode b + 1) _)
- exact h_directed.sequence_le b a
- -- Porting note: used `∘` below to deal with its reduced reducibility
- calc
- ∫⁻ a, ⨅ b, f b a ∂μ
- _ = ∫⁻ a, ⨅ n, (f ∘ h_directed.sequence f) n a ∂μ := by simp only [this, Function.comp_apply]
- _ = ⨅ n, ∫⁻ a, (f ∘ h_directed.sequence f) n a ∂μ := by
- rw [lintegral_iInf ?_ h_directed.sequence_anti]
- · exact hf_int _
- · exact (fun n => hf _)
- _ = ⨅ b, ∫⁻ a, f b a ∂μ := by
- refine' le_antisymm (le_iInf fun b => _) (le_iInf fun n => _)
- · exact iInf_le_of_le (Encodable.encode b + 1) (lintegral_mono <| h_directed.sequence_le b)
- · exact iInf_le (fun b => ∫⁻ a, f b a ∂μ) _
-#align lintegral_infi_directed_of_measurable lintegral_iInf_directed_of_measurable
-
end AuxLemmasToBeMoved
namespace MeasureTheory.Measure
@@ -87,13 +87,6 @@ theorem atTop_le_nhds_top {α : Type*} [TopologicalSpace α] [LinearOrder α] [O
@atBot_le_nhds_bot αᵒᵈ _ _ _ _
#align at_top_le_nhds_top atTop_le_nhds_top
--- todo: move to topology/algebra/order/monotone_convergence
-theorem tendsto_of_antitone {ι α : Type*} [Preorder ι] [TopologicalSpace α]
- [ConditionallyCompleteLinearOrder α] [OrderTopology α] {f : ι → α} (h_mono : Antitone f) :
- Tendsto f atTop atBot ∨ ∃ l, Tendsto f atTop (𝓝 l) :=
- @tendsto_of_monotone ι αᵒᵈ _ _ _ _ _ h_mono
-#align tendsto_of_antitone tendsto_of_antitone
-
-- todo: move to measure_theory/measurable_space
/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
@@ -3,6 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
+import Mathlib.Logic.Encodable.Basic
import Mathlib.Data.Set.Lattice
import Mathlib.MeasureTheory.Measure.Stieltjes
import Mathlib.MeasureTheory.Decomposition.RadonNikodym
@@ -52,21 +53,6 @@ section AuxLemmasToBeMoved
variable {α β ι : Type*}
-namespace Directed
-
--- todo after the port: move this to logic.encodable.basic near sequence_mono
-variable [Encodable α] [Inhabited α] [Preorder β] {f : α → β} (hf : Directed (· ≥ ·) f)
-
-theorem sequence_anti : Antitone (f ∘ hf.sequence f) :=
- antitone_nat_of_succ_le <| hf.sequence_mono_nat
-#align directed.sequence_anti Directed.sequence_anti
-
-theorem sequence_le (a : α) : f (hf.sequence f (Encodable.encode a + 1)) ≤ f a :=
- hf.rel_sequence a
-#align directed.sequence_le Directed.sequence_le
-
-end Directed
-
theorem Real.iUnion_Iic_rat : ⋃ r : ℚ, Iic (r : ℝ) = univ := by
ext1 x
simp only [mem_iUnion, mem_Iic, mem_univ, iff_true_iff]
@@ -108,21 +108,6 @@ theorem tendsto_of_antitone {ι α : Type*} [Preorder ι] [TopologicalSpace α]
@tendsto_of_monotone ι αᵒᵈ _ _ _ _ _ h_mono
#align tendsto_of_antitone tendsto_of_antitone
--- todo: move to data/real/ennreal
-theorem ENNReal.ofReal_cinfi (f : α → ℝ) [Nonempty α] :
- ENNReal.ofReal (⨅ i, f i) = ⨅ i, ENNReal.ofReal (f i) := by
- by_cases hf : BddBelow (range f)
- · exact
- Monotone.map_ciInf_of_continuousAt ENNReal.continuous_ofReal.continuousAt
- (fun i j hij => ENNReal.ofReal_le_ofReal hij) hf
- · symm
- rw [Real.iInf_of_not_bddBelow hf, ENNReal.ofReal_zero, ← ENNReal.bot_eq_zero, iInf_eq_bot]
- obtain ⟨y, hy_mem, hy_neg⟩ := not_bddBelow_iff.mp hf 0
- obtain ⟨i, rfl⟩ := mem_range.mpr hy_mem
- refine' fun x hx => ⟨i, _⟩
- rwa [ENNReal.ofReal_of_nonpos hy_neg.le]
-#align ennreal.of_real_cinfi ENNReal.ofReal_cinfi
-
-- todo: move to measure_theory/measurable_space
/-- Monotone convergence for an infimum over a directed family and indexed by a countable type -/
theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Countable β]
@@ -3,6 +3,7 @@ Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
+import Mathlib.Data.Set.Lattice
import Mathlib.MeasureTheory.Measure.Stieltjes
import Mathlib.MeasureTheory.Decomposition.RadonNikodym
import Mathlib.MeasureTheory.Constructions.Prod.Basic
@@ -66,14 +67,6 @@ theorem sequence_le (a : α) : f (hf.sequence f (Encodable.encode a + 1)) ≤ f
end Directed
--- todo: move to data/set/lattice next to prod_sUnion or prod_sInter
-theorem prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
- (s ×ˢ ⋂ i, t i) = ⋂ i, s ×ˢ t i := by
- ext x
- simp only [mem_prod, mem_iInter]
- exact ⟨fun h i => ⟨h.1, h.2 i⟩, fun h => ⟨(h hι.some).1, fun i => (h i).2⟩⟩
-#align prod_Inter prod_iInter
-
theorem Real.iUnion_Iic_rat : ⋃ r : ℚ, Iic (r : ℝ) = univ := by
ext1 x
simp only [mem_iUnion, mem_Iic, mem_univ, iff_true_iff]
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-/
import Mathlib.MeasureTheory.Measure.Stieltjes
-import Mathlib.Probability.Kernel.Composition
import Mathlib.MeasureTheory.Decomposition.RadonNikodym
+import Mathlib.MeasureTheory.Constructions.Prod.Basic
#align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8"
@@ -45,7 +45,7 @@ The construction of the conditional cdf in this file follows the proof of Theore
open MeasureTheory Set Filter TopologicalSpace
-open scoped NNReal ENNReal MeasureTheory Topology ProbabilityTheory
+open scoped NNReal ENNReal MeasureTheory Topology
section AuxLemmasToBeMoved
Replaces occurences of Pdf, Cdf and Pmf within camelCase situations by PDF, CDF and PMF respectively.
@@ -289,101 +289,101 @@ the properties of a cdf for all `a : α`. We finally extend to `ℝ`. -/
satisfies the properties of a cdf (monotone with limit 0 at -∞ and 1 at +∞, right-continuous).
We define this function on `ℚ` and not `ℝ` because `ℚ` is countable, which allows us to prove
-properties of the form `∀ᵐ a ∂ρ.fst, ∀ q, P (pre_cdf q a)`, instead of the weaker
-`∀ q, ∀ᵐ a ∂ρ.fst, P (pre_cdf q a)`. -/
-noncomputable def preCdf (ρ : Measure (α × ℝ)) (r : ℚ) : α → ℝ≥0∞ :=
+properties of the form `∀ᵐ a ∂ρ.fst, ∀ q, P (preCDF q a)`, instead of the weaker
+`∀ q, ∀ᵐ a ∂ρ.fst, P (preCDF q a)`. -/
+noncomputable def preCDF (ρ : Measure (α × ℝ)) (r : ℚ) : α → ℝ≥0∞ :=
Measure.rnDeriv (ρ.IicSnd r) ρ.fst
-#align probability_theory.pre_cdf ProbabilityTheory.preCdf
+#align probability_theory.pre_cdf ProbabilityTheory.preCDF
-theorem measurable_preCdf {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (preCdf ρ r) :=
+theorem measurable_preCDF {ρ : Measure (α × ℝ)} {r : ℚ} : Measurable (preCDF ρ r) :=
Measure.measurable_rnDeriv _ _
-#align probability_theory.measurable_pre_cdf ProbabilityTheory.measurable_preCdf
+#align probability_theory.measurable_pre_cdf ProbabilityTheory.measurable_preCDF
-theorem withDensity_preCdf (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
- ρ.fst.withDensity (preCdf ρ r) = ρ.IicSnd r :=
+theorem withDensity_preCDF (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
+ ρ.fst.withDensity (preCDF ρ r) = ρ.IicSnd r :=
Measure.absolutelyContinuous_iff_withDensity_rnDeriv_eq.mp (Measure.IicSnd_ac_fst ρ r)
-#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCdf
+#align probability_theory.with_density_pre_cdf ProbabilityTheory.withDensity_preCDF
-theorem set_lintegral_preCdf_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
- [IsFiniteMeasure ρ] : ∫⁻ x in s, preCdf ρ r x ∂ρ.fst = ρ.IicSnd r s := by
- have : ∀ r, ∫⁻ x in s, preCdf ρ r x ∂ρ.fst = ∫⁻ x in s, (preCdf ρ r * 1) x ∂ρ.fst := by
+theorem set_lintegral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) {s : Set α} (hs : MeasurableSet s)
+ [IsFiniteMeasure ρ] : ∫⁻ x in s, preCDF ρ r x ∂ρ.fst = ρ.IicSnd r s := by
+ have : ∀ r, ∫⁻ x in s, preCDF ρ r x ∂ρ.fst = ∫⁻ x in s, (preCDF ρ r * 1) x ∂ρ.fst := by
simp only [mul_one, eq_self_iff_true, forall_const]
- rw [this, ← set_lintegral_withDensity_eq_set_lintegral_mul _ measurable_preCdf _ hs]
- · simp only [withDensity_preCdf ρ r, Pi.one_apply, lintegral_one, Measure.restrict_apply,
+ rw [this, ← set_lintegral_withDensity_eq_set_lintegral_mul _ measurable_preCDF _ hs]
+ · simp only [withDensity_preCDF ρ r, Pi.one_apply, lintegral_one, Measure.restrict_apply,
MeasurableSet.univ, univ_inter]
· rw [(_ : (1 : α → ℝ≥0∞) = fun _ => 1)]
exacts [measurable_const, rfl]
-#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCdf_fst
+#align probability_theory.set_lintegral_pre_cdf_fst ProbabilityTheory.set_lintegral_preCDF_fst
-theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, Monotone fun r => preCdf ρ r a := by
+theorem monotone_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, Monotone fun r => preCDF ρ r a := by
simp_rw [Monotone, ae_all_iff]
refine' fun r r' hrr' =>
- ae_le_of_forall_set_lintegral_le_of_sigmaFinite measurable_preCdf measurable_preCdf
+ ae_le_of_forall_set_lintegral_le_of_sigmaFinite measurable_preCDF measurable_preCDF
fun s hs _ => _
- rw [set_lintegral_preCdf_fst ρ r hs, set_lintegral_preCdf_fst ρ r' hs]
+ rw [set_lintegral_preCDF_fst ρ r hs, set_lintegral_preCDF_fst ρ r' hs]
refine' Measure.IicSnd_mono ρ _ s hs
exact mod_cast hrr'
-#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCdf
+#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCDF
-theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
- (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst = ρ.IicSnd t s := by
+theorem set_lintegral_iInf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
+ (hs : MeasurableSet s) : ∫⁻ x in s, ⨅ r : Ioi t, preCDF ρ r x ∂ρ.fst = ρ.IicSnd t s := by
refine' le_antisymm _ _
- · have h : ∀ q : Ioi t, ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst ≤ ρ.IicSnd q s := by
+ · have h : ∀ q : Ioi t, ∫⁻ x in s, ⨅ r : Ioi t, preCDF ρ r x ∂ρ.fst ≤ ρ.IicSnd q s := by
intro q
- rw [← set_lintegral_preCdf_fst ρ _ hs]
- refine' set_lintegral_mono_ae _ measurable_preCdf _
- · exact measurable_iInf fun _ => measurable_preCdf
- · filter_upwards [monotone_preCdf _] with a _
+ rw [← set_lintegral_preCDF_fst ρ _ hs]
+ refine' set_lintegral_mono_ae _ measurable_preCDF _
+ · exact measurable_iInf fun _ => measurable_preCDF
+ · filter_upwards [monotone_preCDF _] with a _
exact fun _ => iInf_le _ q
calc
- ∫⁻ x in s, ⨅ r : Ioi t, preCdf ρ r x ∂ρ.fst ≤ ⨅ q : Ioi t, ρ.IicSnd q s := le_iInf h
+ ∫⁻ x in s, ⨅ r : Ioi t, preCDF ρ r x ∂ρ.fst ≤ ⨅ q : Ioi t, ρ.IicSnd q s := le_iInf h
_ = ρ.IicSnd t s := Measure.iInf_IicSnd_gt ρ t hs
- · rw [(set_lintegral_preCdf_fst ρ t hs).symm]
- refine' set_lintegral_mono_ae measurable_preCdf _ _
- · exact measurable_iInf fun _ => measurable_preCdf
- · filter_upwards [monotone_preCdf _] with a ha_mono
+ · rw [(set_lintegral_preCDF_fst ρ t hs).symm]
+ refine' set_lintegral_mono_ae measurable_preCDF _ _
+ · exact measurable_iInf fun _ => measurable_preCDF
+ · filter_upwards [monotone_preCDF _] with a ha_mono
exact fun _ => le_iInf fun r => ha_mono (le_of_lt r.prop)
-#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCdf
+#align probability_theory.set_lintegral_infi_gt_pre_cdf ProbabilityTheory.set_lintegral_iInf_gt_preCDF
-theorem preCdf_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, ∀ r, preCdf ρ r a ≤ 1 := by
+theorem preCDF_le_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, ∀ r, preCDF ρ r a ≤ 1 := by
rw [ae_all_iff]
refine' fun r =>
- ae_le_of_forall_set_lintegral_le_of_sigmaFinite measurable_preCdf measurable_const
+ ae_le_of_forall_set_lintegral_le_of_sigmaFinite measurable_preCDF measurable_const
fun s hs _ => _
- rw [set_lintegral_preCdf_fst ρ r hs]
+ rw [set_lintegral_preCDF_fst ρ r hs]
simp only [Pi.one_apply, lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter]
exact Measure.IicSnd_le_fst ρ r s hs
-#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCdf_le_one
+#align probability_theory.pre_cdf_le_one ProbabilityTheory.preCDF_le_one
-theorem tendsto_lintegral_preCdf_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) := by
+theorem tendsto_lintegral_preCDF_atTop (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ Tendsto (fun r => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atTop (𝓝 (ρ univ)) := by
convert ρ.tendsto_IicSnd_atTop MeasurableSet.univ
- · rw [← set_lintegral_univ, set_lintegral_preCdf_fst ρ _ MeasurableSet.univ]
+ · rw [← set_lintegral_univ, set_lintegral_preCDF_fst ρ _ MeasurableSet.univ]
· exact Measure.fst_univ.symm
-#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCdf_atTop
+#align probability_theory.tendsto_lintegral_pre_cdf_at_top ProbabilityTheory.tendsto_lintegral_preCDF_atTop
-theorem tendsto_lintegral_preCdf_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- Tendsto (fun r => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atBot (𝓝 0) := by
+theorem tendsto_lintegral_preCDF_atBot (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ Tendsto (fun r => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atBot (𝓝 0) := by
convert ρ.tendsto_IicSnd_atBot MeasurableSet.univ
- rw [← set_lintegral_univ, set_lintegral_preCdf_fst ρ _ MeasurableSet.univ]
-#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCdf_atBot
+ rw [← set_lintegral_univ, set_lintegral_preCDF_fst ρ _ MeasurableSet.univ]
+#align probability_theory.tendsto_lintegral_pre_cdf_at_bot ProbabilityTheory.tendsto_lintegral_preCDF_atBot
-theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1) := by
- -- We show first that `preCdf` has a limit almost everywhere. That limit has to be at most 1.
- -- We then show that the integral of `preCdf` tends to the integral of 1, and that it also tends
+theorem tendsto_preCDF_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 1) := by
+ -- We show first that `preCDF` has a limit almost everywhere. That limit has to be at most 1.
+ -- We then show that the integral of `preCDF` tends to the integral of 1, and that it also tends
-- to the integral of the limit. Since the limit is at most 1 and has same integral as 1, it is
-- equal to 1 a.e.
- have h_mono := monotone_preCdf ρ
- have h_le_one := preCdf_le_one ρ
- -- `preCdf` has a limit a.e.
- have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 l) := by
+ have h_mono := monotone_preCDF ρ
+ have h_le_one := preCDF_le_one ρ
+ -- `preCDF` has a limit a.e.
+ have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 l) := by
filter_upwards [h_mono, h_le_one] with a ha_mono ha_le_one
have h_tendsto :
- Tendsto (fun r => preCdf ρ r a) atTop atTop ∨
- ∃ l, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 l) :=
+ Tendsto (fun r => preCDF ρ r a) atTop atTop ∨
+ ∃ l, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 l) :=
tendsto_of_monotone ha_mono
cases' h_tendsto with h_absurd h_tendsto
· rw [Monotone.tendsto_atTop_atTop_iff ha_mono] at h_absurd
@@ -391,18 +391,18 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
exact absurd (hr.trans (ha_le_one r)) ENNReal.one_lt_two.not_le
· exact h_tendsto
classical
- -- let `F` be the pointwise limit of `preCdf` where it exists, and 0 elsewhere.
+ -- let `F` be the pointwise limit of `preCDF` where it exists, and 0 elsewhere.
let F : α → ℝ≥0∞ := fun a =>
- if h : ∃ l, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 l) then h.choose else 0
- have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atTop (𝓝 (F a)) := by
+ if h : ∃ l, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 l) then h.choose else 0
+ have h_tendsto_ℚ : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atTop (𝓝 (F a)) := by
filter_upwards [h_exists] with a ha
simp_rw [dif_pos ha]
exact ha.choose_spec
- have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, Tendsto (fun n : ℕ => preCdf ρ n a) atTop (𝓝 (F a)) := by
+ have h_tendsto_ℕ : ∀ᵐ a ∂ρ.fst, Tendsto (fun n : ℕ => preCDF ρ n a) atTop (𝓝 (F a)) := by
filter_upwards [h_tendsto_ℚ] with a ha using ha.comp tendsto_nat_cast_atTop_atTop
have hF_ae_meas : AEMeasurable F ρ.fst := by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto_ℚ
- exact measurable_preCdf.aemeasurable
+ exact measurable_preCDF.aemeasurable
have hF_le_one : ∀ᵐ a ∂ρ.fst, F a ≤ 1 := by
filter_upwards [h_tendsto_ℚ, h_le_one] with a ha ha_le using le_of_tendsto' ha ha_le
-- it suffices to show that the limit `F` is 1 a.e.
@@ -413,19 +413,19 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
-- us that `F` is 1 a.e.
have h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = ∫⁻ _, 1 ∂ρ.fst := by
have h_lintegral :
- Tendsto (fun r : ℕ => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (∫⁻ a, F a ∂ρ.fst)) := by
+ Tendsto (fun r : ℕ => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atTop (𝓝 (∫⁻ a, F a ∂ρ.fst)) := by
refine'
lintegral_tendsto_of_tendsto_of_monotone
(-- does this exist only for ℕ?
- fun _ => measurable_preCdf.aemeasurable)
+ fun _ => measurable_preCDF.aemeasurable)
_ h_tendsto_ℕ
filter_upwards [h_mono] with a ha
refine' fun n m hnm => ha _
exact mod_cast hnm
have h_lintegral' :
- Tendsto (fun r : ℕ => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (∫⁻ _, 1 ∂ρ.fst)) := by
+ Tendsto (fun r : ℕ => ∫⁻ a, preCDF ρ r a ∂ρ.fst) atTop (𝓝 (∫⁻ _, 1 ∂ρ.fst)) := by
rw [lintegral_one, Measure.fst_univ]
- exact (tendsto_lintegral_preCdf_atTop ρ).comp tendsto_nat_cast_atTop_atTop
+ exact (tendsto_lintegral_preCDF_atTop ρ).comp tendsto_nat_cast_atTop_atTop
exact tendsto_nhds_unique h_lintegral h_lintegral'
have : ∫⁻ a, 1 - F a ∂ρ.fst = 0 := by
rw [lintegral_sub' hF_ae_meas _ hF_le_one, h_lintegral_eq, tsub_self]
@@ -438,57 +438,57 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
filter_upwards [this, hF_le_one] with ha h_one_sub_eq_zero h_le_one
rw [Pi.zero_apply, tsub_eq_zero_iff_le] at h_one_sub_eq_zero
exact le_antisymm h_le_one h_one_sub_eq_zero
-#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCdf_atTop_one
+#align probability_theory.tendsto_pre_cdf_at_top_one ProbabilityTheory.tendsto_preCDF_atTop_one
-theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0) := by
- -- We show first that `preCdf` has a limit in ℝ≥0∞ almost everywhere.
+theorem tendsto_preCDF_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0) := by
+ -- We show first that `preCDF` has a limit in ℝ≥0∞ almost everywhere.
-- We then show that the integral of `pre_cdf` tends to 0, and that it also tends
-- to the integral of the limit. Since the limit has integral 0, it is equal to 0 a.e.
- suffices ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 0) by
+ suffices ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 0) by
filter_upwards [this] with a ha
- have h_eq_neg : (fun r : ℚ => preCdf ρ r a) = fun r : ℚ => preCdf ρ (- -r) a := by
+ have h_eq_neg : (fun r : ℚ => preCDF ρ r a) = fun r : ℚ => preCDF ρ (- -r) a := by
simp_rw [neg_neg]
rw [h_eq_neg]
exact ha.comp tendsto_neg_atBot_atTop
- have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) := by
- filter_upwards [monotone_preCdf ρ] with a ha
- have h_anti : Antitone fun r => preCdf ρ (-r) a := fun p q hpq => ha (neg_le_neg hpq)
+ have h_exists : ∀ᵐ a ∂ρ.fst, ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) := by
+ filter_upwards [monotone_preCDF ρ] with a ha
+ have h_anti : Antitone fun r => preCDF ρ (-r) a := fun p q hpq => ha (neg_le_neg hpq)
have h_tendsto :
- Tendsto (fun r => preCdf ρ (-r) a) atTop atBot ∨
- ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) :=
+ Tendsto (fun r => preCDF ρ (-r) a) atTop atBot ∨
+ ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) :=
tendsto_of_antitone h_anti
cases' h_tendsto with h_bot h_tendsto
· exact ⟨0, Tendsto.mono_right h_bot atBot_le_nhds_bot⟩
· exact h_tendsto
classical
let F : α → ℝ≥0∞ := fun a =>
- if h : ∃ l, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 l) then h.choose else 0
- have h_tendsto : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 (F a)) := by
+ if h : ∃ l, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 l) then h.choose else 0
+ have h_tendsto : ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCDF ρ (-r) a) atTop (𝓝 (F a)) := by
filter_upwards [h_exists] with a ha
simp_rw [dif_pos ha]
exact ha.choose_spec
suffices h_lintegral_eq : ∫⁻ a, F a ∂ρ.fst = 0
· have hF_ae_meas : AEMeasurable F ρ.fst := by
refine' aemeasurable_of_tendsto_metrizable_ae _ (fun n => _) h_tendsto
- exact measurable_preCdf.aemeasurable
+ exact measurable_preCDF.aemeasurable
rw [lintegral_eq_zero_iff' hF_ae_meas] at h_lintegral_eq
filter_upwards [h_tendsto, h_lintegral_eq] with a ha_tendsto ha_eq
rwa [ha_eq] at ha_tendsto
have h_lintegral :
- Tendsto (fun r => ∫⁻ a, preCdf ρ (-r) a ∂ρ.fst) atTop (𝓝 (∫⁻ a, F a ∂ρ.fst)) := by
+ Tendsto (fun r => ∫⁻ a, preCDF ρ (-r) a ∂ρ.fst) atTop (𝓝 (∫⁻ a, F a ∂ρ.fst)) := by
refine'
tendsto_lintegral_filter_of_dominated_convergence (fun _ => 1)
- (eventually_of_forall fun _ => measurable_preCdf) (eventually_of_forall fun _ => _) _
+ (eventually_of_forall fun _ => measurable_preCDF) (eventually_of_forall fun _ => _) _
h_tendsto
- · filter_upwards [preCdf_le_one ρ] with a ha using ha _
+ · filter_upwards [preCDF_le_one ρ] with a ha using ha _
· rw [lintegral_one]
exact measure_ne_top _ _
- have h_lintegral' : Tendsto (fun r => ∫⁻ a, preCdf ρ (-r) a ∂ρ.fst) atTop (𝓝 0) := by
+ have h_lintegral' : Tendsto (fun r => ∫⁻ a, preCDF ρ (-r) a ∂ρ.fst) atTop (𝓝 0) := by
have h_lintegral_eq :
- (fun r => ∫⁻ a, preCdf ρ (-r) a ∂ρ.fst) = fun r : ℚ => ρ (univ ×ˢ Iic (-r : ℝ)) := by
+ (fun r => ∫⁻ a, preCDF ρ (-r) a ∂ρ.fst) = fun r : ℚ => ρ (univ ×ˢ Iic (-r : ℝ)) := by
ext1 n
- rw [← set_lintegral_univ, set_lintegral_preCdf_fst ρ _ MeasurableSet.univ,
+ rw [← set_lintegral_univ, set_lintegral_preCDF_fst ρ _ MeasurableSet.univ,
Measure.IicSnd_univ]
norm_cast
rw [h_lintegral_eq]
@@ -506,144 +506,144 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
refine' fun hxj => hxj.trans (neg_le_neg _)
exact mod_cast hij
exact tendsto_nhds_unique h_lintegral h_lintegral'
-#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCdf_atBot_zero
+#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCDF_atBot_zero
-theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
+theorem inf_gt_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCDF ρ r a = preCDF ρ t a := by
rw [ae_all_iff]
- refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCdf _
- · exact measurable_iInf fun i => measurable_preCdf
+ refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCDF _
+ · exact measurable_iInf fun i => measurable_preCDF
intro s hs _
- rw [set_lintegral_iInf_gt_preCdf ρ t hs, set_lintegral_preCdf_fst ρ t hs]
-#align probability_theory.inf_gt_pre_cdf ProbabilityTheory.inf_gt_preCdf
+ rw [set_lintegral_iInf_gt_preCDF ρ t hs, set_lintegral_preCDF_fst ρ t hs]
+#align probability_theory.inf_gt_pre_cdf ProbabilityTheory.inf_gt_preCDF
-section HasCondCdf
+section HasCondCDF
-/-- A product measure on `α × ℝ` is said to have a conditional cdf at `a : α` if `preCdf` is
+/-- A product measure on `α × ℝ` is said to have a conditional cdf at `a : α` if `preCDF` is
monotone with limit 0 at -∞ and 1 at +∞, and is right continuous.
This property holds almost everywhere (see `has_cond_cdf_ae`). -/
-structure HasCondCdf (ρ : Measure (α × ℝ)) (a : α) : Prop where
- mono : Monotone fun r => preCdf ρ r a
- le_one : ∀ r, preCdf ρ r a ≤ 1
- tendsto_atTop_one : Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1)
- tendsto_atBot_zero : Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0)
- iInf_rat_gt_eq : ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a
-#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCdf
-
-theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a := by
- filter_upwards [monotone_preCdf ρ, preCdf_le_one ρ, tendsto_preCdf_atTop_one ρ,
- tendsto_preCdf_atBot_zero ρ, inf_gt_preCdf ρ] with a h1 h2 h3 h4 h5
+structure HasCondCDF (ρ : Measure (α × ℝ)) (a : α) : Prop where
+ mono : Monotone fun r => preCDF ρ r a
+ le_one : ∀ r, preCDF ρ r a ≤ 1
+ tendsto_atTop_one : Tendsto (fun r => preCDF ρ r a) atTop (𝓝 1)
+ tendsto_atBot_zero : Tendsto (fun r => preCDF ρ r a) atBot (𝓝 0)
+ iInf_rat_gt_eq : ∀ t : ℚ, ⨅ r : Ioi t, preCDF ρ r a = preCDF ρ t a
+#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCDF
+
+theorem hasCondCDF_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCDF ρ a := by
+ filter_upwards [monotone_preCDF ρ, preCDF_le_one ρ, tendsto_preCDF_atTop_one ρ,
+ tendsto_preCDF_atBot_zero ρ, inf_gt_preCDF ρ] with a h1 h2 h3 h4 h5
exact ⟨h1, h2, h3, h4, h5⟩
-#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCdf_ae
+#align probability_theory.has_cond_cdf_ae ProbabilityTheory.hasCondCDF_ae
/-- A measurable set of elements of `α` such that `ρ` has a conditional cdf at all
-`a ∈ condCdfSet`. -/
-def condCdfSet (ρ : Measure (α × ℝ)) : Set α :=
- (toMeasurable ρ.fst {b | ¬HasCondCdf ρ b})ᶜ
-#align probability_theory.cond_cdf_set ProbabilityTheory.condCdfSet
+`a ∈ condCDFSet`. -/
+def condCDFSet (ρ : Measure (α × ℝ)) : Set α :=
+ (toMeasurable ρ.fst {b | ¬HasCondCDF ρ b})ᶜ
+#align probability_theory.cond_cdf_set ProbabilityTheory.condCDFSet
-theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCdfSet ρ) :=
+theorem measurableSet_condCDFSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCDFSet ρ) :=
(measurableSet_toMeasurable _ _).compl
-#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCdfSet
+#align probability_theory.measurable_set_cond_cdf_set ProbabilityTheory.measurableSet_condCDFSet
-theorem hasCondCdf_of_mem_condCdfSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCdfSet ρ) :
- HasCondCdf ρ a := by
- rw [condCdfSet, mem_compl_iff] at h
- have h_ss := subset_toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}
+theorem hasCondCDF_of_mem_condCDFSet {ρ : Measure (α × ℝ)} {a : α} (h : a ∈ condCDFSet ρ) :
+ HasCondCDF ρ a := by
+ rw [condCDFSet, mem_compl_iff] at h
+ have h_ss := subset_toMeasurable ρ.fst {b | ¬HasCondCDF ρ b}
by_contra ha
exact h (h_ss ha)
-#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCdf_of_mem_condCdfSet
+#align probability_theory.has_cond_cdf_of_mem_cond_cdf_set ProbabilityTheory.hasCondCDF_of_mem_condCDFSet
-theorem mem_condCdfSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, a ∈ condCdfSet ρ := by
- simp_rw [ae_iff, condCdfSet, not_mem_compl_iff, setOf_mem_eq, measure_toMeasurable]
- exact hasCondCdf_ae ρ
-#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCdfSet_ae
+theorem mem_condCDFSet_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
+ ∀ᵐ a ∂ρ.fst, a ∈ condCDFSet ρ := by
+ simp_rw [ae_iff, condCDFSet, not_mem_compl_iff, setOf_mem_eq, measure_toMeasurable]
+ exact hasCondCDF_ae ρ
+#align probability_theory.mem_cond_cdf_set_ae ProbabilityTheory.mem_condCDFSet_ae
-end HasCondCdf
+end HasCondCDF
open scoped Classical
/-- Conditional cdf of the measure given the value on `α`, restricted to the rationals.
-It is defined to be `pre_cdf` if `a ∈ condCdfSet`, and a default cdf-like function
+It is defined to be `pre_cdf` if `a ∈ condCDFSet`, and a default cdf-like function
otherwise. This is an auxiliary definition used to define `cond_cdf`. -/
-noncomputable def condCdfRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
- if a ∈ condCdfSet ρ then fun r => (preCdf ρ r a).toReal else fun r => if r < 0 then 0 else 1
-#align probability_theory.cond_cdf_rat ProbabilityTheory.condCdfRat
+noncomputable def condCDFRat (ρ : Measure (α × ℝ)) : α → ℚ → ℝ := fun a =>
+ if a ∈ condCDFSet ρ then fun r => (preCDF ρ r a).toReal else fun r => if r < 0 then 0 else 1
+#align probability_theory.cond_cdf_rat ProbabilityTheory.condCDFRat
-theorem condCdfRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCdfSet ρ) {r : ℚ} :
- condCdfRat ρ a r = if r < 0 then 0 else 1 := by simp only [condCdfRat, h, if_false]
-#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCdfRat_of_not_mem
+theorem condCDFRat_of_not_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∉ condCDFSet ρ) {r : ℚ} :
+ condCDFRat ρ a r = if r < 0 then 0 else 1 := by simp only [condCDFRat, h, if_false]
+#align probability_theory.cond_cdf_rat_of_not_mem ProbabilityTheory.condCDFRat_of_not_mem
-theorem condCdfRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCdfSet ρ) (r : ℚ) :
- condCdfRat ρ a r = (preCdf ρ r a).toReal := by simp only [condCdfRat, h, if_true]
-#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCdfRat_of_mem
+theorem condCDFRat_of_mem (ρ : Measure (α × ℝ)) (a : α) (h : a ∈ condCDFSet ρ) (r : ℚ) :
+ condCDFRat ρ a r = (preCDF ρ r a).toReal := by simp only [condCDFRat, h, if_true]
+#align probability_theory.cond_cdf_rat_of_mem ProbabilityTheory.condCDFRat_of_mem
-theorem monotone_condCdfRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdfRat ρ a) := by
- by_cases h : a ∈ condCdfSet ρ
- · simp only [condCdfRat, h, if_true, forall_const, and_self_iff]
+theorem monotone_condCDFRat (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCDFRat ρ a) := by
+ by_cases h : a ∈ condCDFSet ρ
+ · simp only [condCDFRat, h, if_true, forall_const, and_self_iff]
intro r r' hrr'
- have h' := hasCondCdf_of_mem_condCdfSet h
- have h_ne_top : ∀ r, preCdf ρ r a ≠ ∞ := fun r =>
+ have h' := hasCondCDF_of_mem_condCDFSet h
+ have h_ne_top : ∀ r, preCDF ρ r a ≠ ∞ := fun r =>
((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
rw [ENNReal.toReal_le_toReal (h_ne_top _) (h_ne_top _)]
exact h'.1 hrr'
- · simp only [condCdfRat, h, if_false]
+ · simp only [condCDFRat, h, if_false]
intro x y hxy
dsimp only
split_ifs with h_1 h_2 h_2
exacts [le_rfl, zero_le_one, absurd (hxy.trans_lt h_2) h_1, le_rfl]
-#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCdfRat
+#align probability_theory.monotone_cond_cdf_rat ProbabilityTheory.monotone_condCDFRat
-theorem measurable_condCdfRat (ρ : Measure (α × ℝ)) (q : ℚ) :
- Measurable fun a => condCdfRat ρ a q := by
- simp_rw [condCdfRat, ite_apply]
+theorem measurable_condCDFRat (ρ : Measure (α × ℝ)) (q : ℚ) :
+ Measurable fun a => condCDFRat ρ a q := by
+ simp_rw [condCDFRat, ite_apply]
exact
- Measurable.ite (measurableSet_condCdfSet ρ) measurable_preCdf.ennreal_toReal
+ Measurable.ite (measurableSet_condCDFSet ρ) measurable_preCDF.ennreal_toReal
measurable_const
-#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCdfRat
+#align probability_theory.measurable_cond_cdf_rat ProbabilityTheory.measurable_condCDFRat
-theorem condCdfRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCdfRat ρ a r := by
+theorem condCDFRat_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : 0 ≤ condCDFRat ρ a r := by
-- Porting note: was
- -- unfold condCdfRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
- unfold condCdfRat; split_ifs
+ -- unfold condCDFRat; split_ifs; exacts [ENNReal.toReal_nonneg, le_rfl, zero_le_one]
+ unfold condCDFRat; split_ifs
· exact ENNReal.toReal_nonneg
dsimp only
split_ifs
exacts [le_rfl, zero_le_one]
-#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCdfRat_nonneg
+#align probability_theory.cond_cdf_rat_nonneg ProbabilityTheory.condCDFRat_nonneg
-theorem condCdfRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCdfRat ρ a r ≤ 1 := by
- unfold condCdfRat
+theorem condCDFRat_le_one (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) : condCDFRat ρ a r ≤ 1 := by
+ unfold condCDFRat
split_ifs with h
· refine' ENNReal.toReal_le_of_le_ofReal zero_le_one _
rw [ENNReal.ofReal_one]
- exact (hasCondCdf_of_mem_condCdfSet h).le_one r
+ exact (hasCondCDF_of_mem_condCDFSet h).le_one r
-- Porting note: added
dsimp only; split_ifs
exacts [zero_le_one, le_rfl]
-#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCdfRat_le_one
+#align probability_theory.cond_cdf_rat_le_one ProbabilityTheory.condCDFRat_le_one
-theorem tendsto_condCdfRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCdfRat ρ a) atBot (𝓝 0) := by
- unfold condCdfRat
+theorem tendsto_condCDFRat_atBot (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCDFRat ρ a) atBot (𝓝 0) := by
+ unfold condCDFRat
split_ifs with h
· rw [← ENNReal.zero_toReal, ENNReal.tendsto_toReal_iff]
- · exact (hasCondCdf_of_mem_condCdfSet h).tendsto_atBot_zero
- · have h' := hasCondCdf_of_mem_condCdfSet h
+ · exact (hasCondCDF_of_mem_condCDFSet h).tendsto_atBot_zero
+ · have h' := hasCondCDF_of_mem_condCDFSet h
exact fun r => ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
· exact ENNReal.zero_ne_top
· refine' (tendsto_congr' _).mp tendsto_const_nhds
rw [EventuallyEq, eventually_atBot]
refine' ⟨-1, fun q hq => (if_pos (hq.trans_lt _)).symm⟩
linarith
-#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCdfRat_atBot
+#align probability_theory.tendsto_cond_cdf_rat_at_bot ProbabilityTheory.tendsto_condCDFRat_atBot
-theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCdfRat ρ a) atTop (𝓝 1) := by
- unfold condCdfRat
+theorem tendsto_condCDFRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCDFRat ρ a) atTop (𝓝 1) := by
+ unfold condCDFRat
split_ifs with h
- · have h' := hasCondCdf_of_mem_condCdfSet h
+ · have h' := hasCondCDF_of_mem_condCDFSet h
rw [← ENNReal.one_toReal, ENNReal.tendsto_toReal_iff]
· exact h'.tendsto_atTop_one
· exact fun r => ((h'.le_one r).trans_lt ENNReal.one_lt_top).ne
@@ -651,30 +651,30 @@ theorem tendsto_condCdfRat_atTop (ρ : Measure (α × ℝ)) (a : α) :
· refine' (tendsto_congr' _).mp tendsto_const_nhds
rw [EventuallyEq, eventually_atTop]
exact ⟨0, fun q hq => (if_neg (not_lt.mpr hq)).symm⟩
-#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCdfRat_atTop
+#align probability_theory.tendsto_cond_cdf_rat_at_top ProbabilityTheory.tendsto_condCDFRat_atTop
-theorem condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => condCdfRat ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
- filter_upwards [mem_condCdfSet_ae ρ] with a ha using condCdfRat_of_mem ρ a ha r
-#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCdfRat_ae_eq
+theorem condCDFRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => condCDFRat ρ a r) =ᵐ[ρ.fst] fun a => (preCDF ρ r a).toReal := by
+ filter_upwards [mem_condCDFSet_ae ρ] with a ha using condCDFRat_of_mem ρ a ha r
+#align probability_theory.cond_cdf_rat_ae_eq ProbabilityTheory.condCDFRat_ae_eq
-theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => ENNReal.ofReal (condCdfRat ρ a r)) =ᵐ[ρ.fst] preCdf ρ r := by
- filter_upwards [condCdfRat_ae_eq ρ r, preCdf_le_one ρ] with a ha ha_le_one
+theorem ofReal_condCDFRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => ENNReal.ofReal (condCDFRat ρ a r)) =ᵐ[ρ.fst] preCDF ρ r := by
+ filter_upwards [condCDFRat_ae_eq ρ r, preCDF_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).ne
-#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCdfRat_ae_eq
+#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCDFRat_ae_eq
-theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
- ⨅ r : Ioi t, condCdfRat ρ a r = condCdfRat ρ a t := by
- by_cases ha : a ∈ condCdfSet ρ
- · simp_rw [condCdfRat_of_mem ρ a ha]
- have ha' := hasCondCdf_of_mem_condCdfSet ha
+theorem inf_gt_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
+ ⨅ r : Ioi t, condCDFRat ρ a r = condCDFRat ρ a t := by
+ by_cases ha : a ∈ condCDFSet ρ
+ · simp_rw [condCDFRat_of_mem ρ a ha]
+ have ha' := hasCondCDF_of_mem_condCDFSet ha
rw [← ENNReal.toReal_iInf]
- · suffices ⨅ i : ↥(Ioi t), preCdf ρ (↑i) a = preCdf ρ t a by rw [this]
+ · suffices ⨅ i : ↥(Ioi t), preCDF ρ (↑i) a = preCDF ρ t a by rw [this]
rw [← ha'.iInf_rat_gt_eq]
· exact fun r => ((ha'.le_one r).trans_lt ENNReal.one_lt_top).ne
- · simp_rw [condCdfRat_of_not_mem ρ a ha]
+ · simp_rw [condCDFRat_of_not_mem ρ a ha]
have h_bdd : BddBelow (range fun r : ↥(Ioi t) => ite ((r : ℚ) < 0) (0 : ℝ) 1) := by
refine' ⟨0, fun x hx => _⟩
obtain ⟨y, rfl⟩ := mem_range.mpr hx
@@ -700,21 +700,21 @@ theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
rw [if_neg]
rw [not_lt] at h ⊢
exact h.trans (mem_Ioi.mp x.prop).le
-#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCdfRat
+#align probability_theory.inf_gt_cond_cdf_rat ProbabilityTheory.inf_gt_condCDFRat
/-- Conditional cdf of the measure given the value on `α`, as a plain function. This is an auxiliary
definition used to define `cond_cdf`. -/
-noncomputable irreducible_def condCdf' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
- ⨅ r : { r' : ℚ // t < r' }, condCdfRat ρ a r
-#align probability_theory.cond_cdf' ProbabilityTheory.condCdf'
+noncomputable irreducible_def condCDF' (ρ : Measure (α × ℝ)) : α → ℝ → ℝ := fun a t =>
+ ⨅ r : { r' : ℚ // t < r' }, condCDFRat ρ a r
+#align probability_theory.cond_cdf' ProbabilityTheory.condCDF'
-theorem condCdf'_def' {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
- condCdf' ρ a x = ⨅ r : { r : ℚ // x < r }, condCdfRat ρ a r := by rw [condCdf']
-#align probability_theory.cond_cdf'_def ProbabilityTheory.condCdf'_def'
+theorem condCDF'_def' {ρ : Measure (α × ℝ)} {a : α} {x : ℝ} :
+ condCDF' ρ a x = ⨅ r : { r : ℚ // x < r }, condCDFRat ρ a r := by rw [condCDF']
+#align probability_theory.cond_cdf'_def ProbabilityTheory.condCDF'_def'
-theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
- condCdf' ρ a r = condCdfRat ρ a r := by
- rw [← inf_gt_condCdfRat ρ a r, condCdf']
+theorem condCDF'_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
+ condCDF' ρ a r = condCDFRat ρ a r := by
+ rw [← inf_gt_condCDFRat ρ a r, condCDF']
refine' Equiv.iInf_congr _ _
· exact
{ toFun := fun t => ⟨t.1, mod_cast t.2⟩
@@ -723,85 +723,85 @@ theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
right_inv := fun t => by simp only [Subtype.coe_eta] }
· intro t
simp only [Equiv.coe_fn_mk, Subtype.coe_mk]
-#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCdf'_eq_condCdfRat
+#align probability_theory.cond_cdf'_eq_cond_cdf_rat ProbabilityTheory.condCDF'_eq_condCDFRat
-theorem condCdf'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf' ρ a r := by
+theorem condCDF'_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF' ρ a r := by
have : Nonempty { r' : ℚ // r < ↑r' } := by
obtain ⟨r, hrx⟩ := exists_rat_gt r
exact ⟨⟨r, hrx⟩⟩
- rw [condCdf'_def]
- exact le_ciInf fun r' => condCdfRat_nonneg ρ a _
-#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCdf'_nonneg
+ rw [condCDF'_def]
+ exact le_ciInf fun r' => condCDFRat_nonneg ρ a _
+#align probability_theory.cond_cdf'_nonneg ProbabilityTheory.condCDF'_nonneg
-theorem bddBelow_range_condCdfRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCdfRat ρ a r) := by
- refine' ⟨0, fun z => _⟩; rintro ⟨u, rfl⟩; exact condCdfRat_nonneg ρ a _
-#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCdfRat_gt
+theorem bddBelow_range_condCDFRat_gt (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ BddBelow (range fun r : { r' : ℚ // x < ↑r' } => condCDFRat ρ a r) := by
+ refine' ⟨0, fun z => _⟩; rintro ⟨u, rfl⟩; exact condCDFRat_nonneg ρ a _
+#align probability_theory.bdd_below_range_cond_cdf_rat_gt ProbabilityTheory.bddBelow_range_condCDFRat_gt
-theorem monotone_condCdf' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCdf' ρ a) := by
+theorem monotone_condCDF' (ρ : Measure (α × ℝ)) (a : α) : Monotone (condCDF' ρ a) := by
intro x y hxy
have : Nonempty { r' : ℚ // y < ↑r' } := by
obtain ⟨r, hrx⟩ := exists_rat_gt y
exact ⟨⟨r, hrx⟩⟩
- simp_rw [condCdf'_def]
+ simp_rw [condCDF'_def]
refine' le_ciInf fun r => (ciInf_le _ _).trans_eq _
- · exact bddBelow_range_condCdfRat_gt ρ a x
+ · exact bddBelow_range_condCDFRat_gt ρ a x
· exact ⟨r.1, hxy.trans_lt r.prop⟩
· rfl
-#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCdf'
+#align probability_theory.monotone_cond_cdf' ProbabilityTheory.monotone_condCDF'
-theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- ContinuousWithinAt (condCdf' ρ a) (Ici x) x := by
+theorem continuousWithinAt_condCDF'_Ici (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ ContinuousWithinAt (condCDF' ρ a) (Ici x) x := by
rw [← continuousWithinAt_Ioi_iff_Ici]
- convert Monotone.tendsto_nhdsWithin_Ioi (monotone_condCdf' ρ a) x
+ convert Monotone.tendsto_nhdsWithin_Ioi (monotone_condCDF' ρ a) x
rw [sInf_image']
- have h' : ⨅ r : Ioi x, condCdf' ρ a r = ⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r := by
- refine' Real.iInf_Ioi_eq_iInf_rat_gt x _ (monotone_condCdf' ρ a)
+ have h' : ⨅ r : Ioi x, condCDF' ρ a r = ⨅ r : { r' : ℚ // x < r' }, condCDF' ρ a r := by
+ refine' Real.iInf_Ioi_eq_iInf_rat_gt x _ (monotone_condCDF' ρ a)
refine' ⟨0, fun z => _⟩
rintro ⟨u, -, rfl⟩
- exact condCdf'_nonneg ρ a u
+ exact condCDF'_nonneg ρ a u
have h'' :
- ⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r =
- ⨅ r : { r' : ℚ // x < r' }, condCdfRat ρ a r := by
+ ⨅ r : { r' : ℚ // x < r' }, condCDF' ρ a r =
+ ⨅ r : { r' : ℚ // x < r' }, condCDFRat ρ a r := by
congr with r
- exact condCdf'_eq_condCdfRat ρ a r
+ exact condCDF'_eq_condCDFRat ρ a r
rw [h', h'', ContinuousWithinAt]
congr!
- exact condCdf'_def'
-#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCdf'_Ici
+ exact condCDF'_def'
+#align probability_theory.continuous_within_at_cond_cdf'_Ici ProbabilityTheory.continuousWithinAt_condCDF'_Ici
/-! ### Conditional cdf -/
/-- Conditional cdf of the measure given the value on `α`, as a Stieltjes function. -/
-noncomputable def condCdf (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunction where
- toFun := condCdf' ρ a
- mono' := monotone_condCdf' ρ a
- right_continuous' x := continuousWithinAt_condCdf'_Ici ρ a x
-#align probability_theory.cond_cdf ProbabilityTheory.condCdf
+noncomputable def condCDF (ρ : Measure (α × ℝ)) (a : α) : StieltjesFunction where
+ toFun := condCDF' ρ a
+ mono' := monotone_condCDF' ρ a
+ right_continuous' x := continuousWithinAt_condCDF'_Ici ρ a x
+#align probability_theory.cond_cdf ProbabilityTheory.condCDF
-theorem condCdf_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
- condCdf ρ a r = condCdfRat ρ a r :=
- condCdf'_eq_condCdfRat ρ a r
-#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCdf_eq_condCdfRat
+theorem condCDF_eq_condCDFRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
+ condCDF ρ a r = condCDFRat ρ a r :=
+ condCDF'_eq_condCDFRat ρ a r
+#align probability_theory.cond_cdf_eq_cond_cdf_rat ProbabilityTheory.condCDF_eq_condCDFRat
/-- The conditional cdf is non-negative for all `a : α`. -/
-theorem condCdf_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCdf ρ a r :=
- condCdf'_nonneg ρ a r
-#align probability_theory.cond_cdf_nonneg ProbabilityTheory.condCdf_nonneg
+theorem condCDF_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF ρ a r :=
+ condCDF'_nonneg ρ a r
+#align probability_theory.cond_cdf_nonneg ProbabilityTheory.condCDF_nonneg
/-- The conditional cdf is lower or equal to 1 for all `a : α`. -/
-theorem condCdf_le_one (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) : condCdf ρ a x ≤ 1 := by
+theorem condCDF_le_one (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) : condCDF ρ a x ≤ 1 := by
obtain ⟨r, hrx⟩ := exists_rat_gt x
rw [← StieltjesFunction.iInf_rat_gt_eq]
- simp_rw [condCdf_eq_condCdfRat]
- refine' ciInf_le_of_le (bddBelow_range_condCdfRat_gt ρ a x) _ (condCdfRat_le_one _ _ _)
+ simp_rw [condCDF_eq_condCDFRat]
+ refine' ciInf_le_of_le (bddBelow_range_condCDFRat_gt ρ a x) _ (condCDFRat_le_one _ _ _)
exact ⟨r, hrx⟩
-#align probability_theory.cond_cdf_le_one ProbabilityTheory.condCdf_le_one
+#align probability_theory.cond_cdf_le_one ProbabilityTheory.condCDF_le_one
/-- The conditional cdf tends to 0 at -∞ for all `a : α`. -/
-theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCdf ρ a) atBot (𝓝 0) := by
+theorem tendsto_condCDF_atBot (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCDF ρ a) atBot (𝓝 0) := by
have h_exists : ∀ x : ℝ, ∃ q : ℚ, x < q ∧ ↑q < x + 1 := fun x => exists_rat_btwn (lt_add_one x)
let qs : ℝ → ℚ := fun x => (h_exists x).choose
have hqs_tendsto : Tendsto qs atBot atBot := by
@@ -813,14 +813,14 @@ theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) :
exact mod_cast h_le
refine'
tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds
- ((tendsto_condCdfRat_atBot ρ a).comp hqs_tendsto) (condCdf_nonneg ρ a) fun x => _
- rw [Function.comp_apply, ← condCdf_eq_condCdfRat]
- exact (condCdf ρ a).mono (h_exists x).choose_spec.1.le
-#align probability_theory.tendsto_cond_cdf_at_bot ProbabilityTheory.tendsto_condCdf_atBot
+ ((tendsto_condCDFRat_atBot ρ a).comp hqs_tendsto) (condCDF_nonneg ρ a) fun x => _
+ rw [Function.comp_apply, ← condCDF_eq_condCDFRat]
+ exact (condCDF ρ a).mono (h_exists x).choose_spec.1.le
+#align probability_theory.tendsto_cond_cdf_at_bot ProbabilityTheory.tendsto_condCDF_atBot
/-- The conditional cdf tends to 1 at +∞ for all `a : α`. -/
-theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) :
- Tendsto (condCdf ρ a) atTop (𝓝 1) := by
+theorem tendsto_condCDF_atTop (ρ : Measure (α × ℝ)) (a : α) :
+ Tendsto (condCDF ρ a) atTop (𝓝 1) := by
have h_exists : ∀ x : ℝ, ∃ q : ℚ, x - 1 < q ∧ ↑q < x := fun x => exists_rat_btwn (sub_one_lt x)
let qs : ℝ → ℚ := fun x => (h_exists x).choose
have hqs_tendsto : Tendsto qs atTop atTop := by
@@ -830,51 +830,51 @@ theorem tendsto_condCdf_atTop (ρ : Measure (α × ℝ)) (a : α) :
rw [sub_le_iff_le_add] at h_le
exact_mod_cast le_of_add_le_add_right (hy.trans h_le)
refine'
- tendsto_of_tendsto_of_tendsto_of_le_of_le ((tendsto_condCdfRat_atTop ρ a).comp hqs_tendsto)
- tendsto_const_nhds _ (condCdf_le_one ρ a)
+ tendsto_of_tendsto_of_tendsto_of_le_of_le ((tendsto_condCDFRat_atTop ρ a).comp hqs_tendsto)
+ tendsto_const_nhds _ (condCDF_le_one ρ a)
intro x
- rw [Function.comp_apply, ← condCdf_eq_condCdfRat]
- exact (condCdf ρ a).mono (le_of_lt (h_exists x).choose_spec.2)
-#align probability_theory.tendsto_cond_cdf_at_top ProbabilityTheory.tendsto_condCdf_atTop
-
-theorem condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => condCdf ρ a r) =ᵐ[ρ.fst] fun a => (preCdf ρ r a).toReal := by
- filter_upwards [mem_condCdfSet_ae ρ] with a ha using
- (condCdf_eq_condCdfRat ρ a r).trans (condCdfRat_of_mem ρ a ha r)
-#align probability_theory.cond_cdf_ae_eq ProbabilityTheory.condCdf_ae_eq
-
-theorem ofReal_condCdf_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
- (fun a => ENNReal.ofReal (condCdf ρ a r)) =ᵐ[ρ.fst] preCdf ρ r := by
- filter_upwards [condCdf_ae_eq ρ r, preCdf_le_one ρ] with a ha ha_le_one
+ rw [Function.comp_apply, ← condCDF_eq_condCDFRat]
+ exact (condCDF ρ a).mono (le_of_lt (h_exists x).choose_spec.2)
+#align probability_theory.tendsto_cond_cdf_at_top ProbabilityTheory.tendsto_condCDF_atTop
+
+theorem condCDF_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => condCDF ρ a r) =ᵐ[ρ.fst] fun a => (preCDF ρ r a).toReal := by
+ filter_upwards [mem_condCDFSet_ae ρ] with a ha using
+ (condCDF_eq_condCDFRat ρ a r).trans (condCDFRat_of_mem ρ a ha r)
+#align probability_theory.cond_cdf_ae_eq ProbabilityTheory.condCDF_ae_eq
+
+theorem ofReal_condCDF_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) :
+ (fun a => ENNReal.ofReal (condCDF ρ a r)) =ᵐ[ρ.fst] preCDF ρ r := by
+ filter_upwards [condCDF_ae_eq ρ r, preCDF_le_one ρ] with a ha ha_le_one
rw [ha, ENNReal.ofReal_toReal]
exact ((ha_le_one r).trans_lt ENNReal.one_lt_top).ne
-#align probability_theory.of_real_cond_cdf_ae_eq ProbabilityTheory.ofReal_condCdf_ae_eq
+#align probability_theory.of_real_cond_cdf_ae_eq ProbabilityTheory.ofReal_condCDF_ae_eq
/-- The conditional cdf is a measurable function of `a : α` for all `x : ℝ`. -/
-theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun a => condCdf ρ a x := by
- have : (fun a => condCdf ρ a x) = fun a => ⨅ r : { r' : ℚ // x < r' }, condCdfRat ρ a ↑r := by
+theorem measurable_condCDF (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun a => condCDF ρ a x := by
+ have : (fun a => condCDF ρ a x) = fun a => ⨅ r : { r' : ℚ // x < r' }, condCDFRat ρ a ↑r := by
ext1 a
rw [← StieltjesFunction.iInf_rat_gt_eq]
congr with q
- rw [condCdf_eq_condCdfRat]
+ rw [condCDF_eq_condCDFRat]
rw [this]
- exact measurable_iInf (fun q => measurable_condCdfRat ρ q)
-#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCdf
+ exact measurable_iInf (fun q => measurable_condCDFRat ρ q)
+#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCDF
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
-theorem set_lintegral_condCdf_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
+theorem set_lintegral_condCDF_rat (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (r : ℚ) {s : Set α}
(hs : MeasurableSet s) :
- ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic (r : ℝ)) := by
- have : ∀ᵐ a ∂ρ.fst, a ∈ s → ENNReal.ofReal (condCdf ρ a r) = preCdf ρ r a := by
- filter_upwards [ofReal_condCdf_ae_eq ρ r] with a ha using fun _ => ha
- rw [set_lintegral_congr_fun hs this, set_lintegral_preCdf_fst ρ r hs]
+ ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a r) ∂ρ.fst = ρ (s ×ˢ Iic (r : ℝ)) := by
+ have : ∀ᵐ a ∂ρ.fst, a ∈ s → ENNReal.ofReal (condCDF ρ a r) = preCDF ρ r a := by
+ filter_upwards [ofReal_condCDF_ae_eq ρ r] with a ha using fun _ => ha
+ rw [set_lintegral_congr_fun hs this, set_lintegral_preCDF_fst ρ r hs]
exact ρ.IicSnd_apply r hs
-#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCdf_rat
+#align probability_theory.set_lintegral_cond_cdf_rat ProbabilityTheory.set_lintegral_condCDF_rat
-theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
- (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x) := by
- -- We have the result for `x : ℚ` thanks to `set_lintegral_cond_cdf_rat`. We use the equality
- -- `cond_cdf ρ a x = ⨅ r : {r' : ℚ // x < r'}, cond_cdf ρ a r` and a monotone convergence
+theorem set_lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
+ (hs : MeasurableSet s) : ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst = ρ (s ×ˢ Iic x) := by
+ -- We have the result for `x : ℚ` thanks to `set_lintegral_condCDF_rat`. We use the equality
+ -- `condCDF ρ a x = ⨅ r : {r' : ℚ // x < r'}, condCDF ρ a r` and a monotone convergence
-- argument to extend it to the reals.
by_cases hρ_zero : ρ.fst.restrict s = 0
· rw [hρ_zero, lintegral_zero_measure]
@@ -885,10 +885,10 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
_ = ρ.fst.restrict s univ := by rw [Measure.restrict_apply_univ]
_ = 0 := by simp only [hρ_zero, Measure.coe_zero, Pi.zero_apply]
have h :
- ∫⁻ a in s, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst =
- ∫⁻ a in s, ENNReal.ofReal (⨅ r : { r' : ℚ // x < r' }, condCdf ρ a r) ∂ρ.fst := by
+ ∫⁻ a in s, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst =
+ ∫⁻ a in s, ENNReal.ofReal (⨅ r : { r' : ℚ // x < r' }, condCDF ρ a r) ∂ρ.fst := by
congr with a : 1
- rw [← (condCdf ρ a).iInf_rat_gt_eq x]
+ rw [← (condCDF ρ a).iInf_rat_gt_eq x]
have h_nonempty : Nonempty { r' : ℚ // x < ↑r' } := by
obtain ⟨r, hrx⟩ := exists_rat_gt x
exact ⟨⟨r, hrx⟩⟩
@@ -896,15 +896,15 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
simp_rw [ENNReal.ofReal_cinfi]
have h_coe : ∀ b : { r' : ℚ // x < ↑r' }, (b : ℝ) = ((b : ℚ) : ℝ) := fun _ => by congr
rw [lintegral_iInf_directed_of_measurable hρ_zero fun q : { r' : ℚ // x < ↑r' } =>
- (measurable_condCdf ρ q).ennreal_ofReal]
+ (measurable_condCDF ρ q).ennreal_ofReal]
rotate_left
· intro b
- rw [set_lintegral_condCdf_rat ρ _ hs]
+ rw [set_lintegral_condCDF_rat ρ _ hs]
exact measure_ne_top ρ _
- · refine' Monotone.directed_ge fun i j hij a => ENNReal.ofReal_le_ofReal ((condCdf ρ a).mono _)
+ · refine' Monotone.directed_ge fun i j hij a => ENNReal.ofReal_le_ofReal ((condCDF ρ a).mono _)
rw [h_coe, h_coe]
exact mod_cast hij
- simp_rw [set_lintegral_condCdf_rat ρ _ hs]
+ simp_rw [set_lintegral_condCDF_rat ρ _ hs]
rw [← measure_iInter_eq_iInf]
· rw [← prod_iInter]
congr with y
@@ -915,93 +915,93 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
refine' prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr _⟩)
exact mod_cast hij
· exact ⟨h_nonempty.some, measure_ne_top _ _⟩
-#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCdf
+#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCDF
-theorem lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- ∫⁻ a, ENNReal.ofReal (condCdf ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x) := by
- rw [← set_lintegral_univ, set_lintegral_condCdf ρ _ MeasurableSet.univ]
-#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCdf
+theorem lintegral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
+ ∫⁻ a, ENNReal.ofReal (condCDF ρ a x) ∂ρ.fst = ρ (univ ×ˢ Iic x) := by
+ rw [← set_lintegral_univ, set_lintegral_condCDF ρ _ MeasurableSet.univ]
+#align probability_theory.lintegral_cond_cdf ProbabilityTheory.lintegral_condCDF
/-- The conditional cdf is a strongly measurable function of `a : α` for all `x : ℝ`. -/
-theorem stronglyMeasurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) :
- StronglyMeasurable fun a => condCdf ρ a x :=
- (measurable_condCdf ρ x).stronglyMeasurable
-#align probability_theory.strongly_measurable_cond_cdf ProbabilityTheory.stronglyMeasurable_condCdf
+theorem stronglyMeasurable_condCDF (ρ : Measure (α × ℝ)) (x : ℝ) :
+ StronglyMeasurable fun a => condCDF ρ a x :=
+ (measurable_condCDF ρ x).stronglyMeasurable
+#align probability_theory.strongly_measurable_cond_cdf ProbabilityTheory.stronglyMeasurable_condCDF
-theorem integrable_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- Integrable (fun a => condCdf ρ a x) ρ.fst := by
+theorem integrable_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
+ Integrable (fun a => condCDF ρ a x) ρ.fst := by
refine' integrable_of_forall_fin_meas_le _ (measure_lt_top ρ.fst univ) _ fun t _ _ => _
- · exact (stronglyMeasurable_condCdf ρ _).aestronglyMeasurable
- · have : ∀ y, (‖condCdf ρ y x‖₊ : ℝ≥0∞) ≤ 1 := by
+ · exact (stronglyMeasurable_condCDF ρ _).aestronglyMeasurable
+ · have : ∀ y, (‖condCDF ρ y x‖₊ : ℝ≥0∞) ≤ 1 := by
intro y
- rw [Real.nnnorm_of_nonneg (condCdf_nonneg _ _ _)]
- -- Porting note: was exact_mod_cast condCdf_le_one _ _ _
+ rw [Real.nnnorm_of_nonneg (condCDF_nonneg _ _ _)]
+ -- Porting note: was exact_mod_cast condCDF_le_one _ _ _
simp only [ENNReal.coe_le_one_iff]
- exact condCdf_le_one _ _ _
+ exact condCDF_le_one _ _ _
refine'
- (set_lintegral_mono (measurable_condCdf _ _).ennnorm measurable_one fun y _ => this y).trans
+ (set_lintegral_mono (measurable_condCDF _ _).ennnorm measurable_one fun y _ => this y).trans
_
simp only [Pi.one_apply, lintegral_one, Measure.restrict_apply, MeasurableSet.univ, univ_inter]
exact measure_mono (subset_univ _)
-#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCdf
+#align probability_theory.integrable_cond_cdf ProbabilityTheory.integrable_condCDF
-theorem set_integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
- (hs : MeasurableSet s) : ∫ a in s, condCdf ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal := by
- have h := set_lintegral_condCdf ρ x hs
+theorem set_integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) {s : Set α}
+ (hs : MeasurableSet s) : ∫ a in s, condCDF ρ a x ∂ρ.fst = (ρ (s ×ˢ Iic x)).toReal := by
+ have h := set_lintegral_condCDF ρ x hs
rw [← ofReal_integral_eq_lintegral_ofReal] at h
· rw [← h, ENNReal.toReal_ofReal]
- exact integral_nonneg fun _ => condCdf_nonneg _ _ _
- · exact (integrable_condCdf _ _).integrableOn
- · exact eventually_of_forall fun _ => condCdf_nonneg _ _ _
-#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCdf
+ exact integral_nonneg fun _ => condCDF_nonneg _ _ _
+ · exact (integrable_condCDF _ _).integrableOn
+ · exact eventually_of_forall fun _ => condCDF_nonneg _ _ _
+#align probability_theory.set_integral_cond_cdf ProbabilityTheory.set_integral_condCDF
-theorem integral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
- ∫ a, condCdf ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal := by
- rw [← set_integral_condCdf ρ _ MeasurableSet.univ, Measure.restrict_univ]
-#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCdf
+theorem integral_condCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x : ℝ) :
+ ∫ a, condCDF ρ a x ∂ρ.fst = (ρ (univ ×ˢ Iic x)).toReal := by
+ rw [← set_integral_condCDF ρ _ MeasurableSet.univ, Measure.restrict_univ]
+#align probability_theory.integral_cond_cdf ProbabilityTheory.integral_condCDF
section Measure
-theorem measure_condCdf_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
- (condCdf ρ a).measure (Iic x) = ENNReal.ofReal (condCdf ρ a x) := by
- rw [← sub_zero (condCdf ρ a x)]
- exact (condCdf ρ a).measure_Iic (tendsto_condCdf_atBot ρ a) _
-#align probability_theory.measure_cond_cdf_Iic ProbabilityTheory.measure_condCdf_Iic
+theorem measure_condCDF_Iic (ρ : Measure (α × ℝ)) (a : α) (x : ℝ) :
+ (condCDF ρ a).measure (Iic x) = ENNReal.ofReal (condCDF ρ a x) := by
+ rw [← sub_zero (condCDF ρ a x)]
+ exact (condCDF ρ a).measure_Iic (tendsto_condCDF_atBot ρ a) _
+#align probability_theory.measure_cond_cdf_Iic ProbabilityTheory.measure_condCDF_Iic
-theorem measure_condCdf_univ (ρ : Measure (α × ℝ)) (a : α) : (condCdf ρ a).measure univ = 1 := by
+theorem measure_condCDF_univ (ρ : Measure (α × ℝ)) (a : α) : (condCDF ρ a).measure univ = 1 := by
rw [← ENNReal.ofReal_one, ← sub_zero (1 : ℝ)]
- exact StieltjesFunction.measure_univ _ (tendsto_condCdf_atBot ρ a) (tendsto_condCdf_atTop ρ a)
-#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCdf_univ
+ exact StieltjesFunction.measure_univ _ (tendsto_condCDF_atBot ρ a) (tendsto_condCDF_atTop ρ a)
+#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCDF_univ
instance instIsProbabilityMeasure (ρ : Measure (α × ℝ)) (a : α) :
- IsProbabilityMeasure (condCdf ρ a).measure :=
- ⟨measure_condCdf_univ ρ a⟩
+ IsProbabilityMeasure (condCDF ρ a).measure :=
+ ⟨measure_condCDF_univ ρ a⟩
-/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
-theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
- Measurable fun a => (condCdf ρ a).measure := by
+/-- The function `a ↦ (condCDF ρ a).measure` is measurable. -/
+theorem measurable_measure_condCDF (ρ : Measure (α × ℝ)) :
+ Measurable fun a => (condCDF ρ a).measure := by
rw [Measure.measurable_measure]
refine' fun s hs => ?_
-- Porting note: supplied `C`
refine' MeasurableSpace.induction_on_inter
- (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCdf ρ b) s)
+ (C := fun s => Measurable fun b ↦ StieltjesFunction.measure (condCDF ρ b) s)
(borel_eq_generateFrom_Iic ℝ) isPiSystem_Iic _ _ _ _ hs
· simp only [measure_empty, measurable_const]
· rintro S ⟨u, rfl⟩
- simp_rw [measure_condCdf_Iic ρ _ u]
- exact (measurable_condCdf ρ u).ennreal_ofReal
+ simp_rw [measure_condCDF_Iic ρ _ u]
+ exact (measurable_condCDF ρ u).ennreal_ofReal
· intro t ht ht_cd_meas
have :
- (fun a => (condCdf ρ a).measure tᶜ) =
- (fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
+ (fun a => (condCDF ρ a).measure tᶜ) =
+ (fun a => (condCDF ρ a).measure univ) - fun a => (condCDF ρ a).measure t := by
ext1 a
- rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
- simp_rw [this, measure_condCdf_univ ρ]
+ rw [measure_compl ht (measure_ne_top (condCDF ρ a).measure _), Pi.sub_apply]
+ simp_rw [this, measure_condCDF_univ ρ]
exact Measurable.sub measurable_const ht_cd_meas
· intro f hf_disj hf_meas hf_cd_meas
simp_rw [measure_iUnion hf_disj hf_meas]
exact Measurable.ennreal_tsum hf_cd_meas
-#align probability_theory.measurable_measure_cond_cdf ProbabilityTheory.measurable_measure_condCdf
+#align probability_theory.measurable_measure_cond_cdf ProbabilityTheory.measurable_measure_condCDF
end Measure
exact_mod_cast
tactic with mod_cast
elaborator where possible (#8404)
We still have the exact_mod_cast
tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast
are the ones that don't work using the term elaborator by itself.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -195,7 +195,7 @@ theorem IicSnd_mono {r r' : ℝ} (h_le : r ≤ r') : ρ.IicSnd r ≤ ρ.IicSnd r
intro s hs
simp_rw [IicSnd_apply ρ _ hs]
refine' measure_mono (prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr _⟩))
- exact_mod_cast h_le
+ exact mod_cast h_le
#align measure_theory.measure.Iic_snd_mono MeasureTheory.Measure.IicSnd_mono
theorem IicSnd_le_fst (r : ℝ) : ρ.IicSnd r ≤ ρ.fst := by
@@ -222,12 +222,12 @@ theorem iInf_IicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMe
simp only [mem_iInter, mem_Iic, Subtype.forall, Subtype.coe_mk]
refine' ⟨fun h => _, fun h a hta => h.trans _⟩
· refine' le_of_forall_lt_rat_imp_le fun q htq => h q _
- exact_mod_cast htq
- · exact_mod_cast hta.le
+ exact mod_cast htq
+ · exact mod_cast hta.le
· exact fun _ => hs.prod measurableSet_Iic
· refine' Monotone.directed_ge fun r r' hrr' => prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, _⟩)
refine' Iic_subset_Iic.mpr _
- exact_mod_cast hrr'
+ exact mod_cast hrr'
· exact ⟨⟨t + 1, lt_add_one _⟩, measure_ne_top ρ _⟩
#align measure_theory.measure.infi_Iic_snd_gt MeasureTheory.Measure.iInf_IicSnd_gt
@@ -238,7 +238,7 @@ theorem tendsto_IicSnd_atTop {s : Set α} (hs : MeasurableSet s) :
refine' tendsto_measure_iUnion fun r q hr_le_q x => _
simp only [mem_prod, mem_Iic, and_imp]
refine' fun hxs hxr => ⟨hxs, hxr.trans _⟩
- exact_mod_cast hr_le_q
+ exact mod_cast hr_le_q
#align measure_theory.measure.tendsto_Iic_snd_at_top MeasureTheory.Measure.tendsto_IicSnd_atTop
theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableSet s) :
@@ -263,7 +263,7 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
refine' fun q r hqr => prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, fun x hx => _⟩)
simp only [Rat.cast_neg, mem_Iic] at hx ⊢
refine' hx.trans (neg_le_neg _)
- exact_mod_cast hqr
+ exact mod_cast hqr
#align measure_theory.measure.tendsto_Iic_snd_at_bot MeasureTheory.Measure.tendsto_IicSnd_atBot
end MeasureTheory.Measure
@@ -323,7 +323,7 @@ theorem monotone_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
fun s hs _ => _
rw [set_lintegral_preCdf_fst ρ r hs, set_lintegral_preCdf_fst ρ r' hs]
refine' Measure.IicSnd_mono ρ _ s hs
- exact_mod_cast hrr'
+ exact mod_cast hrr'
#align probability_theory.monotone_pre_cdf ProbabilityTheory.monotone_preCdf
theorem set_lintegral_iInf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (t : ℚ) {s : Set α}
@@ -421,7 +421,7 @@ theorem tendsto_preCdf_atTop_one (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
_ h_tendsto_ℕ
filter_upwards [h_mono] with a ha
refine' fun n m hnm => ha _
- exact_mod_cast hnm
+ exact mod_cast hnm
have h_lintegral' :
Tendsto (fun r : ℕ => ∫⁻ a, preCdf ρ r a ∂ρ.fst) atTop (𝓝 (∫⁻ _, 1 ∂ρ.fst)) := by
rw [lintegral_one, Measure.fst_univ]
@@ -504,7 +504,7 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
(fun i j hij x => _) ⟨0, measure_ne_top ρ _⟩
simp only [mem_prod, mem_univ, mem_Iic, true_and_iff]
refine' fun hxj => hxj.trans (neg_le_neg _)
- exact_mod_cast hij
+ exact mod_cast hij
exact tendsto_nhds_unique h_lintegral h_lintegral'
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCdf_atBot_zero
@@ -717,8 +717,8 @@ theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
rw [← inf_gt_condCdfRat ρ a r, condCdf']
refine' Equiv.iInf_congr _ _
· exact
- { toFun := fun t => ⟨t.1, by exact_mod_cast t.2⟩
- invFun := fun t => ⟨t.1, by exact_mod_cast t.2⟩
+ { toFun := fun t => ⟨t.1, mod_cast t.2⟩
+ invFun := fun t => ⟨t.1, mod_cast t.2⟩
left_inv := fun t => by simp only [Subtype.coe_eta]
right_inv := fun t => by simp only [Subtype.coe_eta] }
· intro t
@@ -810,7 +810,7 @@ theorem tendsto_condCdf_atBot (ρ : Measure (α × ℝ)) (a : α) :
have h_le : ↑(qs y) ≤ (q : ℝ) - 1 + 1 :=
(h_exists y).choose_spec.2.le.trans (add_le_add hy le_rfl)
rw [sub_add_cancel] at h_le
- exact_mod_cast h_le
+ exact mod_cast h_le
refine'
tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds
((tendsto_condCdfRat_atBot ρ a).comp hqs_tendsto) (condCdf_nonneg ρ a) fun x => _
@@ -903,7 +903,7 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
exact measure_ne_top ρ _
· refine' Monotone.directed_ge fun i j hij a => ENNReal.ofReal_le_ofReal ((condCdf ρ a).mono _)
rw [h_coe, h_coe]
- exact_mod_cast hij
+ exact mod_cast hij
simp_rw [set_lintegral_condCdf_rat ρ _ hs]
rw [← measure_iInter_eq_iInf]
· rw [← prod_iInter]
@@ -913,7 +913,7 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
· exact fun i => hs.prod measurableSet_Iic
· refine' Monotone.directed_ge fun i j hij => _
refine' prod_subset_prod_iff.mpr (Or.inl ⟨subset_rfl, Iic_subset_Iic.mpr _⟩)
- exact_mod_cast hij
+ exact mod_cast hij
· exact ⟨h_nonempty.some, measure_ne_top _ _⟩
#align probability_theory.set_lintegral_cond_cdf ProbabilityTheory.set_lintegral_condCdf
@@ -66,7 +66,7 @@ theorem sequence_le (a : α) : f (hf.sequence f (Encodable.encode a + 1)) ≤ f
end Directed
--- todo: move to data/set/lattice next to prod_Union or prod_sInter
+-- todo: move to data/set/lattice next to prod_sUnion or prod_sInter
theorem prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
(s ×ˢ ⋂ i, t i) = ⋂ i, s ×ˢ t i := by
ext x
Currently, we only have that sups and limsups are measurable in complete linear orders, which excludes the main case of the real line. With more complicated proofs, these measurability results can be extended to all conditionally complete linear orders, without any further assumption in the statements.
@@ -858,9 +858,7 @@ theorem measurable_condCdf (ρ : Measure (α × ℝ)) (x : ℝ) : Measurable fun
congr with q
rw [condCdf_eq_condCdfRat]
rw [this]
- exact
- measurable_ciInf (fun q => measurable_condCdfRat ρ q) fun a =>
- bddBelow_range_condCdfRat_gt ρ a _
+ exact measurable_iInf (fun q => measurable_condCdfRat ρ q)
#align probability_theory.measurable_cond_cdf ProbabilityTheory.measurable_condCdf
/-- Auxiliary lemma for `set_lintegral_cond_cdf`. -/
@@ -139,7 +139,7 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
cases nonempty_encodable β
cases isEmpty_or_nonempty β
· -- Porting note: the next `simp only` doesn't do anything, so added a workaround below.
- simp only [WithTop.iInf_empty, lintegral_const]
+ -- simp only [WithTop.iInf_empty, lintegral_const]
conv =>
lhs
congr
@@ -901,13 +901,12 @@ theorem set_lintegral_condCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] (x
(measurable_condCdf ρ q).ennreal_ofReal]
rotate_left
· intro b
- simp_rw [h_coe]
rw [set_lintegral_condCdf_rat ρ _ hs]
exact measure_ne_top ρ _
· refine' Monotone.directed_ge fun i j hij a => ENNReal.ofReal_le_ofReal ((condCdf ρ a).mono _)
rw [h_coe, h_coe]
exact_mod_cast hij
- simp_rw [h_coe, set_lintegral_condCdf_rat ρ _ hs]
+ simp_rw [set_lintegral_condCdf_rat ρ _ hs]
rw [← measure_iInter_eq_iInf]
· rw [← prod_iInter]
congr with y
Add borel_eq_generateFrom_Ioi_rat
, borel_eq_generateFrom_Ici_rat
, borel_eq_generateFrom_Iic_rat
(we already have the Iio
result). Also prove that these sets of intervals are pi-systems.
Co-authored-by: RemyDegenne <remydegenne@gmail.com>
@@ -169,16 +169,6 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
· exact iInf_le (fun b => ∫⁻ a, f b a ∂μ) _
#align lintegral_infi_directed_of_measurable lintegral_iInf_directed_of_measurable
--- todo: move to measure_theory/pi_system
-theorem isPiSystem_Iic [SemilatticeInf α] : @IsPiSystem α (range Iic) := by
- rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _; rw [Iic_inter_Iic]; exact ⟨us ⊓ ut, rfl⟩
-#align is_pi_system_Iic isPiSystem_Iic
-
--- todo: move to measure_theory/pi_system
-theorem isPiSystem_Ici [SemilatticeSup α] : @IsPiSystem α (range Ici) := by
- rintro s ⟨us, rfl⟩ t ⟨ut, rfl⟩ _; rw [Ici_inter_Ici]; exact ⟨us ⊔ ut, rfl⟩
-#align is_pi_system_Ici isPiSystem_Ici
-
end AuxLemmasToBeMoved
namespace MeasureTheory.Measure
@@ -766,7 +766,7 @@ theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
convert Monotone.tendsto_nhdsWithin_Ioi (monotone_condCdf' ρ a) x
rw [sInf_image']
have h' : ⨅ r : Ioi x, condCdf' ρ a r = ⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r := by
- refine' iInf_Ioi_eq_iInf_rat_gt x _ (monotone_condCdf' ρ a)
+ refine' Real.iInf_Ioi_eq_iInf_rat_gt x _ (monotone_condCdf' ρ a)
refine' ⟨0, fun z => _⟩
rintro ⟨u, -, rfl⟩
exact condCdf'_nonneg ρ a u
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -49,7 +49,7 @@ open scoped NNReal ENNReal MeasureTheory Topology ProbabilityTheory
section AuxLemmasToBeMoved
-variable {α β ι : Type _}
+variable {α β ι : Type*}
namespace Directed
@@ -88,7 +88,7 @@ theorem Real.iInter_Iic_rat : ⋂ r : ℚ, Iic (r : ℝ) = ∅ := by
#align real.Inter_Iic_rat Real.iInter_Iic_rat
-- todo after the port: move to order/filter/at_top_bot
-theorem atBot_le_nhds_bot {α : Type _} [TopologicalSpace α] [LinearOrder α] [OrderBot α]
+theorem atBot_le_nhds_bot {α : Type*} [TopologicalSpace α] [LinearOrder α] [OrderBot α]
[OrderTopology α] : (atBot : Filter α) ≤ 𝓝 ⊥ := by
cases subsingleton_or_nontrivial α
· simp only [nhds_discrete, le_pure_iff, mem_atBot_sets, mem_singleton_iff,
@@ -103,13 +103,13 @@ theorem atBot_le_nhds_bot {α : Type _} [TopologicalSpace α] [LinearOrder α] [
#align at_bot_le_nhds_bot atBot_le_nhds_bot
-- todo after the port: move to order/filter/at_top_bot
-theorem atTop_le_nhds_top {α : Type _} [TopologicalSpace α] [LinearOrder α] [OrderTop α]
+theorem atTop_le_nhds_top {α : Type*} [TopologicalSpace α] [LinearOrder α] [OrderTop α]
[OrderTopology α] : (atTop : Filter α) ≤ 𝓝 ⊤ :=
@atBot_le_nhds_bot αᵒᵈ _ _ _ _
#align at_top_le_nhds_top atTop_le_nhds_top
-- todo: move to topology/algebra/order/monotone_convergence
-theorem tendsto_of_antitone {ι α : Type _} [Preorder ι] [TopologicalSpace α]
+theorem tendsto_of_antitone {ι α : Type*} [Preorder ι] [TopologicalSpace α]
[ConditionallyCompleteLinearOrder α] [OrderTopology α] {f : ι → α} (h_mono : Antitone f) :
Tendsto f atTop atBot ∨ ∃ l, Tendsto f atTop (𝓝 l) :=
@tendsto_of_monotone ι αᵒᵈ _ _ _ _ _ h_mono
@@ -183,7 +183,7 @@ end AuxLemmasToBeMoved
namespace MeasureTheory.Measure
-variable {α β : Type _} {mα : MeasurableSpace α} (ρ : Measure (α × ℝ))
+variable {α β : Type*} {mα : MeasurableSpace α} (ρ : Measure (α × ℝ))
/-- Measure on `α` such that for a measurable set `s`, `ρ.Iic_snd r s = ρ (s ×ˢ Iic r)`. -/
noncomputable def IicSnd (r : ℝ) : Measure α :=
@@ -282,7 +282,7 @@ open MeasureTheory
namespace ProbabilityTheory
-variable {α β ι : Type _} {mα : MeasurableSpace α}
+variable {α β ι : Type*} {mα : MeasurableSpace α}
attribute [local instance] MeasureTheory.Measure.IsFiniteMeasure.IicSnd
@@ -454,7 +454,7 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0) := by
-- We show first that `preCdf` has a limit in ℝ≥0∞ almost everywhere.
-- We then show that the integral of `pre_cdf` tends to 0, and that it also tends
- -- to the integral of the limit. Since the limit is has integral 0, it is equal to 0 a.e.
+ -- to the integral of the limit. Since the limit has integral 0, it is equal to 0 a.e.
suffices ∀ᵐ a ∂ρ.fst, Tendsto (fun r => preCdf ρ (-r) a) atTop (𝓝 0) by
filter_upwards [this] with a ha
have h_eq_neg : (fun r : ℚ => preCdf ρ r a) = fun r : ℚ => preCdf ρ (- -r) a := by
@@ -2,16 +2,13 @@
Copyright (c) 2023 Rémy Degenne. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.kernel.cond_cdf
-! leanprover-community/mathlib commit 3b88f4005dc2e28d42f974cc1ce838f0dafb39b8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.MeasureTheory.Measure.Stieltjes
import Mathlib.Probability.Kernel.Composition
import Mathlib.MeasureTheory.Decomposition.RadonNikodym
+#align_import probability.kernel.cond_cdf from "leanprover-community/mathlib"@"3b88f4005dc2e28d42f974cc1ce838f0dafb39b8"
+
/-!
# Conditional cumulative distribution function
@@ -165,7 +165,7 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
_ = ⨅ n, ∫⁻ a, (f ∘ h_directed.sequence f) n a ∂μ := by
rw [lintegral_iInf ?_ h_directed.sequence_anti]
· exact hf_int _
- · exact (fun n => hf _)
+ · exact (fun n => hf _)
_ = ⨅ b, ∫⁻ a, f b a ∂μ := by
refine' le_antisymm (le_iInf fun b => _) (le_iInf fun n => _)
· exact iInf_le_of_le (Encodable.encode b + 1) (lintegral_mono <| h_directed.sequence_le b)
This is the second half of the changes originally in #5699, removing all occurrences of ;
after a space and implementing a linter rule to enforce it.
In most cases this 2-character substring has a space after it, so the following command was run first:
find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;
The remaining cases were few enough in number that they were done manually.
@@ -265,7 +265,7 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
ext1 x
simp only [Rat.cast_eq_id, id.def, mem_iInter, mem_prod, mem_Iic]
refine' ⟨fun h i => ⟨(h i).1, _⟩, fun h i => ⟨(h i).1, _⟩⟩ <;> have h' := h (-i)
- · rw [neg_neg] at h' ; exact h'.2
+ · rw [neg_neg] at h'; exact h'.2
· exact h'.2
rw [h_inter_eq] at h_neg
have h_fun_eq : (fun r : ℚ => ρ (s ×ˢ Iic (r : ℝ))) = fun r : ℚ => ρ (s ×ˢ Iic ↑(- -r)) := by
This PR is the result of running
find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;
which firstly replaces .
focusing dots with ·
and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.
@@ -94,8 +94,7 @@ theorem Real.iInter_Iic_rat : ⋂ r : ℚ, Iic (r : ℝ) = ∅ := by
theorem atBot_le_nhds_bot {α : Type _} [TopologicalSpace α] [LinearOrder α] [OrderBot α]
[OrderTopology α] : (atBot : Filter α) ≤ 𝓝 ⊥ := by
cases subsingleton_or_nontrivial α
- ·
- simp only [nhds_discrete, le_pure_iff, mem_atBot_sets, mem_singleton_iff,
+ · simp only [nhds_discrete, le_pure_iff, mem_atBot_sets, mem_singleton_iff,
eq_iff_true_of_subsingleton, imp_true_iff, exists_const]
have h : atBot.HasBasis (fun _ : α => True) Iic := @atBot_basis α _ _
have h_nhds : (𝓝 ⊥).HasBasis (fun a : α => ⊥ < a) fun a => Iio a := @nhds_bot_basis α _ _ _ _ _
@@ -730,8 +729,7 @@ theorem condCdf'_eq_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (r : ℚ) :
condCdf' ρ a r = condCdfRat ρ a r := by
rw [← inf_gt_condCdfRat ρ a r, condCdf']
refine' Equiv.iInf_congr _ _
- ·
- exact
+ · exact
{ toFun := fun t => ⟨t.1, by exact_mod_cast t.2⟩
invFun := fun t => ⟨t.1, by exact_mod_cast t.2⟩
left_inv := fun t => by simp only [Subtype.coe_eta]
@@ -77,14 +77,14 @@ theorem prod_iInter {s : Set α} {t : ι → Set β} [hι : Nonempty ι] :
exact ⟨fun h i => ⟨h.1, h.2 i⟩, fun h => ⟨(h hι.some).1, fun i => (h i).2⟩⟩
#align prod_Inter prod_iInter
-theorem Real.iUnion_Iic_rat : (⋃ r : ℚ, Iic (r : ℝ)) = univ := by
+theorem Real.iUnion_Iic_rat : ⋃ r : ℚ, Iic (r : ℝ) = univ := by
ext1 x
simp only [mem_iUnion, mem_Iic, mem_univ, iff_true_iff]
obtain ⟨r, hr⟩ := exists_rat_gt x
exact ⟨r, hr.le⟩
#align real.Union_Iic_rat Real.iUnion_Iic_rat
-theorem Real.iInter_Iic_rat : (⋂ r : ℚ, Iic (r : ℝ)) = ∅ := by
+theorem Real.iInter_Iic_rat : ⋂ r : ℚ, Iic (r : ℝ) = ∅ := by
ext1 x
simp only [mem_iInter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
exact exists_rat_lt x
@@ -154,7 +154,7 @@ theorem lintegral_iInf_directed_of_measurable {mα : MeasurableSpace α} [Counta
rw [ENNReal.top_mul', if_neg]
simp only [Measure.measure_univ_eq_zero, hμ, not_false_iff]
inhabit β
- have : ∀ a, (⨅ b, f b a) = ⨅ n, f (h_directed.sequence f n) a := by
+ have : ∀ a, ⨅ b, f b a = ⨅ n, f (h_directed.sequence f n) a := by
refine' fun a =>
le_antisymm (le_iInf fun n => iInf_le _ _)
(le_iInf fun b => iInf_le_of_le (Encodable.encode b + 1) _)
@@ -228,7 +228,7 @@ theorem IsFiniteMeasure.IicSnd {ρ : Measure (α × ℝ)} [IsFiniteMeasure ρ] (
#align measure_theory.measure.is_finite_measure.Iic_snd MeasureTheory.Measure.IsFiniteMeasure.IicSnd
theorem iInf_IicSnd_gt (t : ℚ) {s : Set α} (hs : MeasurableSet s) [IsFiniteMeasure ρ] :
- (⨅ r : { r' : ℚ // t < r' }, ρ.IicSnd r s) = ρ.IicSnd t s := by
+ ⨅ r : { r' : ℚ // t < r' }, ρ.IicSnd r s = ρ.IicSnd t s := by
simp_rw [ρ.IicSnd_apply _ hs]
rw [← measure_iInter_eq_iInf]
· rw [← prod_iInter]
@@ -262,7 +262,7 @@ theorem tendsto_IicSnd_atBot [IsFiniteMeasure ρ] {s : Set α} (hs : MeasurableS
rw [← h_empty, ← Real.iInter_Iic_rat, prod_iInter]
suffices h_neg :
Tendsto (fun r : ℚ => ρ (s ×ˢ Iic ↑(-r))) atTop (𝓝 (ρ (⋂ r : ℚ, s ×ˢ Iic ↑(-r))))
- · have h_inter_eq : (⋂ r : ℚ, s ×ˢ Iic ↑(-r)) = ⋂ r : ℚ, s ×ˢ Iic (r : ℝ) := by
+ · have h_inter_eq : ⋂ r : ℚ, s ×ˢ Iic ↑(-r) = ⋂ r : ℚ, s ×ˢ Iic (r : ℝ) := by
ext1 x
simp only [Rat.cast_eq_id, id.def, mem_iInter, mem_prod, mem_Iic]
refine' ⟨fun h i => ⟨(h i).1, _⟩, fun h i => ⟨(h i).1, _⟩⟩ <;> have h' := h (-i)
@@ -507,7 +507,7 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
norm_cast
rw [h_lintegral_eq]
have h_zero_eq_measure_iInter : (0 : ℝ≥0∞) = ρ (⋂ r : ℚ, univ ×ˢ Iic (-r : ℝ)) := by
- suffices (⋂ r : ℚ, Iic (-(r : ℝ))) = ∅ by rw [← prod_iInter, this, prod_empty, measure_empty]
+ suffices ⋂ r : ℚ, Iic (-(r : ℝ)) = ∅ by rw [← prod_iInter, this, prod_empty, measure_empty]
ext1 x
simp only [mem_iInter, mem_Iic, mem_empty_iff_false, iff_false_iff, not_forall, not_le]
simp_rw [neg_lt]
@@ -523,7 +523,7 @@ theorem tendsto_preCdf_atBot_zero (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ
#align probability_theory.tendsto_pre_cdf_at_bot_zero ProbabilityTheory.tendsto_preCdf_atBot_zero
theorem inf_gt_preCdf (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
- ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a := by
+ ∀ᵐ a ∂ρ.fst, ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a := by
rw [ae_all_iff]
refine' fun t => ae_eq_of_forall_set_lintegral_eq_of_sigmaFinite _ measurable_preCdf _
· exact measurable_iInf fun i => measurable_preCdf
@@ -541,7 +541,7 @@ structure HasCondCdf (ρ : Measure (α × ℝ)) (a : α) : Prop where
le_one : ∀ r, preCdf ρ r a ≤ 1
tendsto_atTop_one : Tendsto (fun r => preCdf ρ r a) atTop (𝓝 1)
tendsto_atBot_zero : Tendsto (fun r => preCdf ρ r a) atBot (𝓝 0)
- iInf_rat_gt_eq : ∀ t : ℚ, (⨅ r : Ioi t, preCdf ρ r a) = preCdf ρ t a
+ iInf_rat_gt_eq : ∀ t : ℚ, ⨅ r : Ioi t, preCdf ρ r a = preCdf ρ t a
#align probability_theory.has_cond_cdf ProbabilityTheory.HasCondCdf
theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a ∂ρ.fst, HasCondCdf ρ a := by
@@ -680,12 +680,12 @@ theorem ofReal_condCdfRat_ae_eq (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ]
#align probability_theory.of_real_cond_cdf_rat_ae_eq ProbabilityTheory.ofReal_condCdfRat_ae_eq
theorem inf_gt_condCdfRat (ρ : Measure (α × ℝ)) (a : α) (t : ℚ) :
- (⨅ r : Ioi t, condCdfRat ρ a r) = condCdfRat ρ a t := by
+ ⨅ r : Ioi t, condCdfRat ρ a r = condCdfRat ρ a t := by
by_cases ha : a ∈ condCdfSet ρ
· simp_rw [condCdfRat_of_mem ρ a ha]
have ha' := hasCondCdf_of_mem_condCdfSet ha
rw [← ENNReal.toReal_iInf]
- · suffices (⨅ i : ↥(Ioi t), preCdf ρ (↑i) a) = preCdf ρ t a by rw [this]
+ · suffices ⨅ i : ↥(Ioi t), preCdf ρ (↑i) a = preCdf ρ t a by rw [this]
rw [← ha'.iInf_rat_gt_eq]
· exact fun r => ((ha'.le_one r).trans_lt ENNReal.one_lt_top).ne
· simp_rw [condCdfRat_of_not_mem ρ a ha]
@@ -770,13 +770,13 @@ theorem continuousWithinAt_condCdf'_Ici (ρ : Measure (α × ℝ)) (a : α) (x :
rw [← continuousWithinAt_Ioi_iff_Ici]
convert Monotone.tendsto_nhdsWithin_Ioi (monotone_condCdf' ρ a) x
rw [sInf_image']
- have h' : (⨅ r : Ioi x, condCdf' ρ a r) = ⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r := by
+ have h' : ⨅ r : Ioi x, condCdf' ρ a r = ⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r := by
refine' iInf_Ioi_eq_iInf_rat_gt x _ (monotone_condCdf' ρ a)
refine' ⟨0, fun z => _⟩
rintro ⟨u, -, rfl⟩
exact condCdf'_nonneg ρ a u
have h'' :
- (⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r) =
+ ⨅ r : { r' : ℚ // x < r' }, condCdf' ρ a r =
⨅ r : { r' : ℚ // x < r' }, condCdfRat ρ a r := by
congr with r
exact condCdf'_eq_condCdfRat ρ a r
@@ -553,7 +553,7 @@ theorem hasCondCdf_ae (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] : ∀ᵐ a
/-- A measurable set of elements of `α` such that `ρ` has a conditional cdf at all
`a ∈ condCdfSet`. -/
def condCdfSet (ρ : Measure (α × ℝ)) : Set α :=
- toMeasurable ρ.fst {b | ¬HasCondCdf ρ b}ᶜ
+ (toMeasurable ρ.fst {b | ¬HasCondCdf ρ b})ᶜ
#align probability_theory.cond_cdf_set ProbabilityTheory.condCdfSet
theorem measurableSet_condCdfSet (ρ : Measure (α × ℝ)) : MeasurableSet (condCdfSet ρ) :=
@@ -1010,7 +1010,7 @@ theorem measurable_measure_condCdf (ρ : Measure (α × ℝ)) :
exact (measurable_condCdf ρ u).ennreal_ofReal
· intro t ht ht_cd_meas
have :
- (fun a => (condCdf ρ a).measure (tᶜ)) =
+ (fun a => (condCdf ρ a).measure tᶜ) =
(fun a => (condCdf ρ a).measure univ) - fun a => (condCdf ρ a).measure t := by
ext1 a
rw [measure_compl ht (measure_ne_top (condCdf ρ a).measure _), Pi.sub_apply]
@@ -991,7 +991,8 @@ theorem measure_condCdf_univ (ρ : Measure (α × ℝ)) (a : α) : (condCdf ρ a
exact StieltjesFunction.measure_univ _ (tendsto_condCdf_atBot ρ a) (tendsto_condCdf_atTop ρ a)
#align probability_theory.measure_cond_cdf_univ ProbabilityTheory.measure_condCdf_univ
-instance (ρ : Measure (α × ℝ)) (a : α) : IsProbabilityMeasure (condCdf ρ a).measure :=
+instance instIsProbabilityMeasure (ρ : Measure (α × ℝ)) (a : α) :
+ IsProbabilityMeasure (condCdf ρ a).measure :=
⟨measure_condCdf_univ ρ a⟩
/-- The function `a ↦ (condCdf ρ a).measure` is measurable. -/
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
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