probability.borel_cantelliMathlib.Probability.BorelCantelli

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -49,7 +49,7 @@ theorem iIndepFun.indep_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i
   suffices
     indep (⨆ k ∈ {j}, MeasurableSpace.comap (f k) mβ)
       (⨆ k ∈ {k | k ≤ i}, MeasurableSpace.comap (f k) mβ) μ
-    by rwa [iSup_singleton] at this 
+    by rwa [iSup_singleton] at this
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.iIndepFun.indep_comap_natural_of_lt
 -/
@@ -109,14 +109,14 @@ theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (
     by
     rw [← ENNReal.tsum_add_one_eq_top hs' (measure_ne_top _ _)]
     exact ENNReal.tendsto_nat_tsum _
-  rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends 
+  rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends
   refine' tendsto_at_top_at_top_of_monotone' _ _
   · refine' monotone_nat_of_le_succ fun n => _
     rw [← sub_nonneg, Finset.sum_range_succ_sub_sum]
     exact ENNReal.toReal_nonneg
   · rintro ⟨B, hB⟩
     refine' not_eventually.2 (frequently_of_forall fun n => _) (htends B.to_nnreal)
-    rw [mem_upperBounds] at hB 
+    rw [mem_upperBounds] at hB
     specialize hB (∑ k : ℕ in Finset.range n, μ (s (k + 1))).toReal _
     · refine' ⟨n, _⟩
       rw [ENNReal.toReal_sum]
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 -/
-import Mathbin.Probability.Martingale.BorelCantelli
-import Mathbin.Probability.ConditionalExpectation
-import Mathbin.Probability.Independence.Basic
+import Probability.Martingale.BorelCantelli
+import Probability.ConditionalExpectation
+import Probability.Independence.Basic
 
 #align_import probability.borel_cantelli from "leanprover-community/mathlib"@"e8e130de9dba4ed6897183c3193c752ffadbcc77"
 
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
-
-! This file was ported from Lean 3 source module probability.borel_cantelli
-! leanprover-community/mathlib commit e8e130de9dba4ed6897183c3193c752ffadbcc77
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Martingale.BorelCantelli
 import Mathbin.Probability.ConditionalExpectation
 import Mathbin.Probability.Independence.Basic
 
+#align_import probability.borel_cantelli from "leanprover-community/mathlib"@"e8e130de9dba4ed6897183c3193c752ffadbcc77"
+
 /-!
 
 # The second Borel-Cantelli lemma
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.borel_cantelli
-! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
+! leanprover-community/mathlib commit e8e130de9dba4ed6897183c3193c752ffadbcc77
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.Probability.Independence.Basic
 
 # The second Borel-Cantelli lemma
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file contains the second Borel-Cantelli lemma which states that, given a sequence of
 independent sets `(sₙ)` in a probability space, if `∑ n, μ sₙ = ∞`, then the limsup of `sₙ` has
 measure 1. We employ a proof using Lévy's generalized Borel-Cantelli by choosing an appropriate
Diff
@@ -41,6 +41,7 @@ section BorelCantelli
 variable {ι β : Type _} [LinearOrder ι] [mβ : MeasurableSpace β] [NormedAddCommGroup β]
   [BorelSpace β] {f : ι → Ω → β} {i j : ι} {s : ι → Set Ω}
 
+#print ProbabilityTheory.iIndepFun.indep_comap_natural_of_lt /-
 theorem iIndepFun.indep_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i))
     (hfi : iIndepFun (fun i => mβ) f μ) (hij : i < j) :
     Indep (MeasurableSpace.comap (f j) mβ) (Filtration.natural f hf i) μ :=
@@ -51,14 +52,18 @@ theorem iIndepFun.indep_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i
     by rwa [iSup_singleton] at this 
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.iIndepFun.indep_comap_natural_of_lt
+-/
 
+#print ProbabilityTheory.iIndepFun.condexp_natural_ae_eq_of_lt /-
 theorem iIndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
     [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : iIndepFun (fun i => mβ) f μ)
     (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun ω => μ[f j] :=
   condexp_indep_eq (hf j).Measurable.comap_le (Filtration.le _ _)
     (comap_measurable <| f j).StronglyMeasurable (hfi.indep_comap_natural_of_lt hf hij)
 #align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.iIndepFun.condexp_natural_ae_eq_of_lt
+-/
 
+#print ProbabilityTheory.iIndepSet.condexp_indicator_filtrationOfSet_ae_eq /-
 theorem iIndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
     (hs : iIndepSet s μ) (hij : i < j) :
     μ[(s j).indicator (fun ω => 1 : Ω → ℝ)|filtrationOfSet hsm i] =ᵐ[μ] fun ω => (μ (s j)).toReal :=
@@ -68,9 +73,11 @@ theorem iIndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, Measurab
   · simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]
   · infer_instance
 #align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.iIndepSet.condexp_indicator_filtrationOfSet_ae_eq
+-/
 
 open Filter
 
+#print ProbabilityTheory.measure_limsup_eq_one /-
 /-- **The second Borel-Cantelli lemma**: Given a sequence of independent sets `(sₙ)` such that
 `∑ n, μ sₙ = ∞`, `limsup sₙ` has measure 1. -/
 theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s μ)
@@ -118,6 +125,7 @@ theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (
       · exact hB.trans (by simp)
       · exact fun _ _ => measure_ne_top _ _
 #align probability_theory.measure_limsup_eq_one ProbabilityTheory.measure_limsup_eq_one
+-/
 
 end BorelCantelli
 
Diff
@@ -74,7 +74,7 @@ open Filter
 /-- **The second Borel-Cantelli lemma**: Given a sequence of independent sets `(sₙ)` such that
 `∑ n, μ sₙ = ∞`, `limsup sₙ` has measure 1. -/
 theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s μ)
-    (hs' : (∑' n, μ (s n)) = ∞) : μ (limsup s atTop) = 1 :=
+    (hs' : ∑' n, μ (s n) = ∞) : μ (limsup s atTop) = 1 :=
   by
   rw [measure_congr
       (eventually_eq_set.2 (ae_mem_limsup_at_top_iff μ <| measurable_set_filtration_of_set' hsm) :
Diff
@@ -34,68 +34,68 @@ open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace
 
 namespace ProbabilityTheory
 
-variable {Ω : Type _} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [ProbabilityMeasure μ]
+variable {Ω : Type _} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ]
 
 section BorelCantelli
 
 variable {ι β : Type _} [LinearOrder ι] [mβ : MeasurableSpace β] [NormedAddCommGroup β]
   [BorelSpace β] {f : ι → Ω → β} {i j : ι} {s : ι → Set Ω}
 
-theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i))
-    (hfi : IndepFun (fun i => mβ) f μ) (hij : i < j) :
-    IndepCat (MeasurableSpace.comap (f j) mβ) (Filtration.natural f hf i) μ :=
+theorem iIndepFun.indep_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i))
+    (hfi : iIndepFun (fun i => mβ) f μ) (hij : i < j) :
+    Indep (MeasurableSpace.comap (f j) mβ) (Filtration.natural f hf i) μ :=
   by
   suffices
     indep (⨆ k ∈ {j}, MeasurableSpace.comap (f k) mβ)
-      (⨆ k ∈ { k | k ≤ i }, MeasurableSpace.comap (f k) mβ) μ
+      (⨆ k ∈ {k | k ≤ i}, MeasurableSpace.comap (f k) mβ) μ
     by rwa [iSup_singleton] at this 
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
-#align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
+#align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.iIndepFun.indep_comap_natural_of_lt
 
-theorem IndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
-    [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : IndepFun (fun i => mβ) f μ)
+theorem iIndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
+    [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : iIndepFun (fun i => mβ) f μ)
     (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun ω => μ[f j] :=
-  condexp_indepCat_eq (hf j).Measurable.comap_le (Filtration.le _ _)
-    (comap_measurable <| f j).StronglyMeasurable (hfi.indepCat_comap_natural_of_lt hf hij)
-#align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natural_ae_eq_of_lt
+  condexp_indep_eq (hf j).Measurable.comap_le (Filtration.le _ _)
+    (comap_measurable <| f j).StronglyMeasurable (hfi.indep_comap_natural_of_lt hf hij)
+#align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.iIndepFun.condexp_natural_ae_eq_of_lt
 
-theorem IndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
-    (hs : IndepSet s μ) (hij : i < j) :
+theorem iIndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
+    (hs : iIndepSet s μ) (hij : i < j) :
     μ[(s j).indicator (fun ω => 1 : Ω → ℝ)|filtrationOfSet hsm i] =ᵐ[μ] fun ω => (μ (s j)).toReal :=
   by
   rw [filtration.filtration_of_set_eq_natural hsm]
   refine' (Indep_fun.condexp_natural_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
   · simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]
   · infer_instance
-#align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.IndepSet.condexp_indicator_filtrationOfSet_ae_eq
+#align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.iIndepSet.condexp_indicator_filtrationOfSet_ae_eq
 
 open Filter
 
 /-- **The second Borel-Cantelli lemma**: Given a sequence of independent sets `(sₙ)` such that
 `∑ n, μ sₙ = ∞`, `limsup sₙ` has measure 1. -/
-theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (s n)) (hs : IndepSet s μ)
+theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s μ)
     (hs' : (∑' n, μ (s n)) = ∞) : μ (limsup s atTop) = 1 :=
   by
   rw [measure_congr
       (eventually_eq_set.2 (ae_mem_limsup_at_top_iff μ <| measurable_set_filtration_of_set' hsm) :
         (limsup s at_top : Set Ω) =ᵐ[μ]
-          { ω |
+          {ω |
             tendsto
               (fun n =>
                 ∑ k in Finset.range n,
                   (μ[(s (k + 1)).indicator (1 : Ω → ℝ)|filtration_of_set hsm k]) ω)
-              at_top at_top })]
+              at_top at_top})]
   suffices
-    { ω |
+    {ω |
         tendsto
           (fun n =>
             ∑ k in Finset.range n, (μ[(s (k + 1)).indicator (1 : Ω → ℝ)|filtration_of_set hsm k]) ω)
-          at_top at_top } =ᵐ[μ]
+          at_top at_top} =ᵐ[μ]
       Set.univ
     by rw [measure_congr this, measure_univ]
   have : ∀ᵐ ω ∂μ, ∀ n, (μ[(s (n + 1)).indicator (1 : Ω → ℝ)|filtration_of_set hsm n]) ω = _ :=
     ae_all_iff.2 fun n => hs.condexp_indicator_filtration_of_set_ae_eq hsm n.lt_succ_self
-  filter_upwards [this]with ω hω
+  filter_upwards [this] with ω hω
   refine' eq_true (_ : tendsto _ _ _)
   simp_rw [hω]
   have htends : tendsto (fun n => ∑ k in Finset.range n, μ (s (k + 1))) at_top (𝓝 ∞) :=
Diff
@@ -48,7 +48,7 @@ theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f
   suffices
     indep (⨆ k ∈ {j}, MeasurableSpace.comap (f k) mβ)
       (⨆ k ∈ { k | k ≤ i }, MeasurableSpace.comap (f k) mβ) μ
-    by rwa [iSup_singleton] at this
+    by rwa [iSup_singleton] at this 
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
 
@@ -102,14 +102,14 @@ theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (
     by
     rw [← ENNReal.tsum_add_one_eq_top hs' (measure_ne_top _ _)]
     exact ENNReal.tendsto_nat_tsum _
-  rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends
+  rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends 
   refine' tendsto_at_top_at_top_of_monotone' _ _
   · refine' monotone_nat_of_le_succ fun n => _
     rw [← sub_nonneg, Finset.sum_range_succ_sub_sum]
     exact ENNReal.toReal_nonneg
   · rintro ⟨B, hB⟩
     refine' not_eventually.2 (frequently_of_forall fun n => _) (htends B.to_nnreal)
-    rw [mem_upperBounds] at hB
+    rw [mem_upperBounds] at hB 
     specialize hB (∑ k : ℕ in Finset.range n, μ (s (k + 1))).toReal _
     · refine' ⟨n, _⟩
       rw [ENNReal.toReal_sum]
Diff
@@ -28,7 +28,7 @@ filtration.
 -/
 
 
-open MeasureTheory ProbabilityTheory ENNReal BigOperators Topology
+open scoped MeasureTheory ProbabilityTheory ENNReal BigOperators Topology
 
 open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace
 
Diff
@@ -48,7 +48,7 @@ theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f
   suffices
     indep (⨆ k ∈ {j}, MeasurableSpace.comap (f k) mβ)
       (⨆ k ∈ { k | k ≤ i }, MeasurableSpace.comap (f k) mβ) μ
-    by rwa [supᵢ_singleton] at this
+    by rwa [iSup_singleton] at this
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
 
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.borel_cantelli
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Martingale.BorelCantelli
 import Mathbin.Probability.ConditionalExpectation
-import Mathbin.Probability.Independence
+import Mathbin.Probability.Independence.Basic
 
 /-!
 
@@ -52,19 +52,19 @@ theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
 
-theorem IndepFun.condexp_natrual_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
+theorem IndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
     [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : IndepFun (fun i => mβ) f μ)
     (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun ω => μ[f j] :=
   condexp_indepCat_eq (hf j).Measurable.comap_le (Filtration.le _ _)
     (comap_measurable <| f j).StronglyMeasurable (hfi.indepCat_comap_natural_of_lt hf hij)
-#align probability_theory.Indep_fun.condexp_natrual_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natrual_ae_eq_of_lt
+#align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natural_ae_eq_of_lt
 
 theorem IndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
     (hs : IndepSet s μ) (hij : i < j) :
     μ[(s j).indicator (fun ω => 1 : Ω → ℝ)|filtrationOfSet hsm i] =ᵐ[μ] fun ω => (μ (s j)).toReal :=
   by
   rw [filtration.filtration_of_set_eq_natural hsm]
-  refine' (Indep_fun.condexp_natrual_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
+  refine' (Indep_fun.condexp_natural_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
   · simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]
   · infer_instance
 #align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.IndepSet.condexp_indicator_filtrationOfSet_ae_eq
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.borel_cantelli
-! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
+! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Martingale.BorelCantelli
 import Mathbin.Probability.ConditionalExpectation
-import Mathbin.Probability.Independence.Basic
+import Mathbin.Probability.Independence
 
 /-!
 
@@ -52,19 +52,19 @@ theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
 
-theorem IndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
+theorem IndepFun.condexp_natrual_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
     [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : IndepFun (fun i => mβ) f μ)
     (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun ω => μ[f j] :=
   condexp_indepCat_eq (hf j).Measurable.comap_le (Filtration.le _ _)
     (comap_measurable <| f j).StronglyMeasurable (hfi.indepCat_comap_natural_of_lt hf hij)
-#align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natural_ae_eq_of_lt
+#align probability_theory.Indep_fun.condexp_natrual_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natrual_ae_eq_of_lt
 
 theorem IndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
     (hs : IndepSet s μ) (hij : i < j) :
     μ[(s j).indicator (fun ω => 1 : Ω → ℝ)|filtrationOfSet hsm i] =ᵐ[μ] fun ω => (μ (s j)).toReal :=
   by
   rw [filtration.filtration_of_set_eq_natural hsm]
-  refine' (Indep_fun.condexp_natural_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
+  refine' (Indep_fun.condexp_natrual_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
   · simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]
   · infer_instance
 #align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.IndepSet.condexp_indicator_filtrationOfSet_ae_eq
Diff
@@ -4,13 +4,13 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
 
 ! This file was ported from Lean 3 source module probability.borel_cantelli
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Martingale.BorelCantelli
 import Mathbin.Probability.ConditionalExpectation
-import Mathbin.Probability.Independence
+import Mathbin.Probability.Independence.Basic
 
 /-!
 
@@ -52,19 +52,19 @@ theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
 #align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
 
-theorem IndepFun.condexp_natrual_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
+theorem IndepFun.condexp_natural_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
     [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : IndepFun (fun i => mβ) f μ)
     (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun ω => μ[f j] :=
   condexp_indepCat_eq (hf j).Measurable.comap_le (Filtration.le _ _)
     (comap_measurable <| f j).StronglyMeasurable (hfi.indepCat_comap_natural_of_lt hf hij)
-#align probability_theory.Indep_fun.condexp_natrual_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natrual_ae_eq_of_lt
+#align probability_theory.Indep_fun.condexp_natural_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natural_ae_eq_of_lt
 
 theorem IndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
     (hs : IndepSet s μ) (hij : i < j) :
     μ[(s j).indicator (fun ω => 1 : Ω → ℝ)|filtrationOfSet hsm i] =ᵐ[μ] fun ω => (μ (s j)).toReal :=
   by
   rw [filtration.filtration_of_set_eq_natural hsm]
-  refine' (Indep_fun.condexp_natrual_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
+  refine' (Indep_fun.condexp_natural_ae_eq_of_lt _ hs.Indep_fun_indicator hij).trans _
   · simp only [integral_indicator_const _ (hsm _), Algebra.id.smul_eq_mul, mul_one]
   · infer_instance
 #align probability_theory.Indep_set.condexp_indicator_filtration_of_set_ae_eq ProbabilityTheory.IndepSet.condexp_indicator_filtrationOfSet_ae_eq
Diff
@@ -34,7 +34,7 @@ open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace
 
 namespace ProbabilityTheory
 
-variable {Ω : Type _} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ]
+variable {Ω : Type _} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [ProbabilityMeasure μ]
 
 section BorelCantelli
 
Diff
@@ -41,7 +41,7 @@ section BorelCantelli
 variable {ι β : Type _} [LinearOrder ι] [mβ : MeasurableSpace β] [NormedAddCommGroup β]
   [BorelSpace β] {f : ι → Ω → β} {i j : ι} {s : ι → Set Ω}
 
-theorem IndepFun.indepComapNaturalOfLt (hf : ∀ i, StronglyMeasurable (f i))
+theorem IndepFun.indepCat_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i))
     (hfi : IndepFun (fun i => mβ) f μ) (hij : i < j) :
     IndepCat (MeasurableSpace.comap (f j) mβ) (Filtration.natural f hf i) μ :=
   by
@@ -50,13 +50,13 @@ theorem IndepFun.indepComapNaturalOfLt (hf : ∀ i, StronglyMeasurable (f i))
       (⨆ k ∈ { k | k ≤ i }, MeasurableSpace.comap (f k) mβ) μ
     by rwa [supᵢ_singleton] at this
   exact indep_supr_of_disjoint (fun k => (hf k).Measurable.comap_le) hfi (by simpa)
-#align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepComapNaturalOfLt
+#align probability_theory.Indep_fun.indep_comap_natural_of_lt ProbabilityTheory.IndepFun.indepCat_comap_natural_of_lt
 
 theorem IndepFun.condexp_natrual_ae_eq_of_lt [SecondCountableTopology β] [CompleteSpace β]
     [NormedSpace ℝ β] (hf : ∀ i, StronglyMeasurable (f i)) (hfi : IndepFun (fun i => mβ) f μ)
     (hij : i < j) : μ[f j|Filtration.natural f hf i] =ᵐ[μ] fun ω => μ[f j] :=
   condexp_indepCat_eq (hf j).Measurable.comap_le (Filtration.le _ _)
-    (comap_measurable <| f j).StronglyMeasurable (hfi.indepComapNaturalOfLt hf hij)
+    (comap_measurable <| f j).StronglyMeasurable (hfi.indepCat_comap_natural_of_lt hf hij)
 #align probability_theory.Indep_fun.condexp_natrual_ae_eq_of_lt ProbabilityTheory.IndepFun.condexp_natrual_ae_eq_of_lt
 
 theorem IndepSet.condexp_indicator_filtrationOfSet_ae_eq (hsm : ∀ n, MeasurableSet (s n))
Diff
@@ -102,7 +102,7 @@ theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (
     by
     rw [← ENNReal.tsum_add_one_eq_top hs' (measure_ne_top _ _)]
     exact ENNReal.tendsto_nat_tsum _
-  rw [ENNReal.tendsto_nhds_top_iff_nNReal] at htends
+  rw [ENNReal.tendsto_nhds_top_iff_nnreal] at htends
   refine' tendsto_at_top_at_top_of_monotone' _ _
   · refine' monotone_nat_of_le_succ fun n => _
     rw [← sub_nonneg, Finset.sum_range_succ_sub_sum]
Diff
@@ -28,7 +28,7 @@ filtration.
 -/
 
 
-open MeasureTheory ProbabilityTheory Ennreal BigOperators Topology
+open MeasureTheory ProbabilityTheory ENNReal BigOperators Topology
 
 open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace
 
@@ -100,21 +100,21 @@ theorem measure_limsup_eq_one {s : ℕ → Set Ω} (hsm : ∀ n, MeasurableSet (
   simp_rw [hω]
   have htends : tendsto (fun n => ∑ k in Finset.range n, μ (s (k + 1))) at_top (𝓝 ∞) :=
     by
-    rw [← Ennreal.tsum_add_one_eq_top hs' (measure_ne_top _ _)]
-    exact Ennreal.tendsto_nat_tsum _
-  rw [Ennreal.tendsto_nhds_top_iff_nNReal] at htends
+    rw [← ENNReal.tsum_add_one_eq_top hs' (measure_ne_top _ _)]
+    exact ENNReal.tendsto_nat_tsum _
+  rw [ENNReal.tendsto_nhds_top_iff_nNReal] at htends
   refine' tendsto_at_top_at_top_of_monotone' _ _
   · refine' monotone_nat_of_le_succ fun n => _
     rw [← sub_nonneg, Finset.sum_range_succ_sub_sum]
-    exact Ennreal.toReal_nonneg
+    exact ENNReal.toReal_nonneg
   · rintro ⟨B, hB⟩
     refine' not_eventually.2 (frequently_of_forall fun n => _) (htends B.to_nnreal)
     rw [mem_upperBounds] at hB
     specialize hB (∑ k : ℕ in Finset.range n, μ (s (k + 1))).toReal _
     · refine' ⟨n, _⟩
-      rw [Ennreal.toReal_sum]
+      rw [ENNReal.toReal_sum]
       exact fun _ _ => measure_ne_top _ _
-    · rw [not_lt, ← Ennreal.toReal_le_toReal (Ennreal.sum_lt_top _).Ne Ennreal.coe_ne_top]
+    · rw [not_lt, ← ENNReal.toReal_le_toReal (ENNReal.sum_lt_top _).Ne ENNReal.coe_ne_top]
       · exact hB.trans (by simp)
       · exact fun _ _ => measure_ne_top _ _
 #align probability_theory.measure_limsup_eq_one ProbabilityTheory.measure_limsup_eq_one

Changes in mathlib4

mathlib3
mathlib4
feat(Probability/BorelCantelli): clarify documentation (#8527)

Some of the students from my Lean seminar got quite confused trying to find the Borel-Cantelli lemmas in Mathlib, because there is a file Probability.Martingale.BorelCantelli but neither of the Borel-Cantelli lemmas are in it! This PR adds cross-links between the documentation strings for the various files concerned. (There are no changes to actual code.)

Diff
@@ -13,7 +13,7 @@ import Mathlib.Probability.Independence.Basic
 
 # The second Borel-Cantelli lemma
 
-This file contains the second Borel-Cantelli lemma which states that, given a sequence of
+This file contains the *second Borel-Cantelli lemma* which states that, given a sequence of
 independent sets `(sₙ)` in a probability space, if `∑ n, μ sₙ = ∞`, then the limsup of `sₙ` has
 measure 1. We employ a proof using Lévy's generalized Borel-Cantelli by choosing an appropriate
 filtration.
@@ -22,6 +22,8 @@ filtration.
 
 - `ProbabilityTheory.measure_limsup_eq_one`: the second Borel-Cantelli lemma.
 
+**Note**: for the *first Borel-Cantelli lemma*, which holds in general measure spaces (not only
+in probability spaces), see `MeasureTheory.measure_limsup_eq_zero`.
 -/
 
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -31,11 +31,11 @@ open MeasureTheory ProbabilityTheory MeasurableSpace TopologicalSpace
 
 namespace ProbabilityTheory
 
-variable {Ω : Type _} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ]
+variable {Ω : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} [IsProbabilityMeasure μ]
 
 section BorelCantelli
 
-variable {ι β : Type _} [LinearOrder ι] [mβ : MeasurableSpace β] [NormedAddCommGroup β]
+variable {ι β : Type*} [LinearOrder ι] [mβ : MeasurableSpace β] [NormedAddCommGroup β]
   [BorelSpace β] {f : ι → Ω → β} {i j : ι} {s : ι → Set Ω}
 
 theorem iIndepFun.indep_comap_natural_of_lt (hf : ∀ i, StronglyMeasurable (f i))
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 Kexing Ying. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kexing Ying
-
-! This file was ported from Lean 3 source module probability.borel_cantelli
-! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Probability.Martingale.BorelCantelli
 import Mathlib.Probability.ConditionalExpectation
 import Mathlib.Probability.Independence.Basic
 
+#align_import probability.borel_cantelli from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740"
+
 /-!
 
 # The second Borel-Cantelli lemma
feat: port Probability.BorelCantelli (#5286)

Dependencies 12 + 1033

1034 files ported (98.9%)
471202 lines ported (98.8%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file