probability.conditional_expectationMathlib.Probability.ConditionalExpectation

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
@@ -52,14 +52,14 @@ theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
         (fun s _ hs => integrable_on_const.2 (Or.inr hs)) (fun s hms hs => _)
         strongly_measurable_const.ae_strongly_measurable').symm
   rw [set_integral_const]
-  rw [← mem_ℒp_one_iff_integrable] at hfint 
+  rw [← mem_ℒp_one_iff_integrable] at hfint
   refine' hfint.induction_strongly_measurable hle₁ ENNReal.one_ne_top _ _ _ _ _ _
   · intro c t hmt ht
     rw [integral_indicator (hle₁ _ hmt), set_integral_const, smul_smul, ← ENNReal.toReal_mul,
       mul_comm, ← hindp _ _ hmt hms, set_integral_indicator (hle₁ _ hmt), set_integral_const,
       Set.inter_comm]
   · intro u v hdisj huint hvint hu hv hu_eq hv_eq
-    rw [mem_ℒp_one_iff_integrable] at huint hvint 
+    rw [mem_ℒp_one_iff_integrable] at huint hvint
     rw [integral_add' huint hvint, smul_add, hu_eq, hv_eq,
       integral_add' huint.integrable_on hvint.integrable_on]
   · have heq₁ :
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.Notation
-import Mathbin.Probability.Independence.Basic
-import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
+import Probability.Notation
+import Probability.Independence.Basic
+import MeasureTheory.Function.ConditionalExpectation.Basic
 
 #align_import probability.conditional_expectation from "leanprover-community/mathlib"@"e160cefedc932ce41c7049bf0c4b0f061d06216e"
 
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.conditional_expectation
-! leanprover-community/mathlib commit e160cefedc932ce41c7049bf0c4b0f061d06216e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Notation
 import Mathbin.Probability.Independence.Basic
 import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
+#align_import probability.conditional_expectation from "leanprover-community/mathlib"@"e160cefedc932ce41c7049bf0c4b0f061d06216e"
+
 /-!
 
 # Probabilistic properties of the conditional expectation
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.conditional_expectation
-! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
+! leanprover-community/mathlib commit e160cefedc932ce41c7049bf0c4b0f061d06216e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
 # Probabilistic properties of the conditional expectation
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file contains some properties about the conditional expectation which does not belong in
 the main conditional expectation file.
 
Diff
@@ -38,6 +38,7 @@ open ProbabilityTheory
 variable {Ω E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
   {m₁ m₂ m : MeasurableSpace Ω} {μ : Measure Ω} {f : Ω → E}
 
+#print MeasureTheory.condexp_indep_eq /-
 /-- If `m₁, m₂` are independent σ-algebras and `f` is `m₁`-measurable, then `𝔼[f | m₂] = 𝔼[f]`
 almost everywhere. -/
 theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinite (μ.trim hle₂)]
@@ -85,6 +86,7 @@ theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
     filter_upwards [huv] with x hx _ using hx
   · exact ⟨f, hf, eventually_eq.rfl⟩
 #align measure_theory.condexp_indep_eq MeasureTheory.condexp_indep_eq
+-/
 
 end MeasureTheory
 
Diff
@@ -81,7 +81,7 @@ theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
       exact (continuous_set_integral _).comp (ContinuousLinearMap.continuous _)
   · intro u v huv huint hueq
     rwa [← integral_congr_ae huv, ←
-      (set_integral_congr_ae (hle₂ _ hms) _ : (∫ x in s, u x ∂μ) = ∫ x in s, v x ∂μ)]
+      (set_integral_congr_ae (hle₂ _ hms) _ : ∫ x in s, u x ∂μ = ∫ x in s, v x ∂μ)]
     filter_upwards [huv] with x hx _ using hx
   · exact ⟨f, hf, eventually_eq.rfl⟩
 #align measure_theory.condexp_indep_eq MeasureTheory.condexp_indep_eq
Diff
@@ -40,8 +40,8 @@ variable {Ω E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpa
 
 /-- If `m₁, m₂` are independent σ-algebras and `f` is `m₁`-measurable, then `𝔼[f | m₂] = 𝔼[f]`
 almost everywhere. -/
-theorem condexp_indepCat_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinite (μ.trim hle₂)]
-    (hf : strongly_measurable[m₁] f) (hindp : IndepCat m₁ m₂ μ) : μ[f|m₂] =ᵐ[μ] fun x => μ[f] :=
+theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinite (μ.trim hle₂)]
+    (hf : strongly_measurable[m₁] f) (hindp : Indep m₁ m₂ μ) : μ[f|m₂] =ᵐ[μ] fun x => μ[f] :=
   by
   by_cases hfint : integrable f μ
   swap; · rw [condexp_undef hfint, integral_undef hfint]; rfl
@@ -82,9 +82,9 @@ theorem condexp_indepCat_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFi
   · intro u v huv huint hueq
     rwa [← integral_congr_ae huv, ←
       (set_integral_congr_ae (hle₂ _ hms) _ : (∫ x in s, u x ∂μ) = ∫ x in s, v x ∂μ)]
-    filter_upwards [huv]with x hx _ using hx
+    filter_upwards [huv] with x hx _ using hx
   · exact ⟨f, hf, eventually_eq.rfl⟩
-#align measure_theory.condexp_indep_eq MeasureTheory.condexp_indepCat_eq
+#align measure_theory.condexp_indep_eq MeasureTheory.condexp_indep_eq
 
 end MeasureTheory
 
Diff
@@ -51,14 +51,14 @@ theorem condexp_indepCat_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFi
         (fun s _ hs => integrable_on_const.2 (Or.inr hs)) (fun s hms hs => _)
         strongly_measurable_const.ae_strongly_measurable').symm
   rw [set_integral_const]
-  rw [← mem_ℒp_one_iff_integrable] at hfint
+  rw [← mem_ℒp_one_iff_integrable] at hfint 
   refine' hfint.induction_strongly_measurable hle₁ ENNReal.one_ne_top _ _ _ _ _ _
   · intro c t hmt ht
     rw [integral_indicator (hle₁ _ hmt), set_integral_const, smul_smul, ← ENNReal.toReal_mul,
       mul_comm, ← hindp _ _ hmt hms, set_integral_indicator (hle₁ _ hmt), set_integral_const,
       Set.inter_comm]
   · intro u v hdisj huint hvint hu hv hu_eq hv_eq
-    rw [mem_ℒp_one_iff_integrable] at huint hvint
+    rw [mem_ℒp_one_iff_integrable] at huint hvint 
     rw [integral_add' huint hvint, smul_add, hu_eq, hv_eq,
       integral_add' huint.integrable_on hvint.integrable_on]
   · have heq₁ :
Diff
@@ -29,7 +29,7 @@ the main conditional expectation file.
 
 open TopologicalSpace Filter
 
-open NNReal ENNReal MeasureTheory ProbabilityTheory BigOperators
+open scoped NNReal ENNReal MeasureTheory ProbabilityTheory BigOperators
 
 namespace MeasureTheory
 
Diff
@@ -44,9 +44,7 @@ theorem condexp_indepCat_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFi
     (hf : strongly_measurable[m₁] f) (hindp : IndepCat m₁ m₂ μ) : μ[f|m₂] =ᵐ[μ] fun x => μ[f] :=
   by
   by_cases hfint : integrable f μ
-  swap;
-  · rw [condexp_undef hfint, integral_undef hfint]
-    rfl
+  swap; · rw [condexp_undef hfint, integral_undef hfint]; rfl
   have hfint₁ := hfint.trim hle₁ hf
   refine'
     (ae_eq_condexp_of_forall_set_integral_eq hle₂ hfint
Diff
@@ -4,12 +4,12 @@ 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.conditional_expectation
-! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
+! 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.Notation
-import Mathbin.Probability.Independence
+import Mathbin.Probability.Independence.Basic
 import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
 /-!
Diff
@@ -4,12 +4,12 @@ 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.conditional_expectation
-! leanprover-community/mathlib commit 2f8347015b12b0864dfaf366ec4909eb70c78740
+! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Probability.Notation
-import Mathbin.Probability.Independence.Basic
+import Mathbin.Probability.Independence
 import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
 /-!
Diff
@@ -4,12 +4,12 @@ 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.conditional_expectation
-! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
+! 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.Notation
-import Mathbin.Probability.Independence
+import Mathbin.Probability.Independence.Basic
 import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
 /-!
Diff
@@ -29,7 +29,7 @@ the main conditional expectation file.
 
 open TopologicalSpace Filter
 
-open NNReal Ennreal MeasureTheory ProbabilityTheory BigOperators
+open NNReal ENNReal MeasureTheory ProbabilityTheory BigOperators
 
 namespace MeasureTheory
 
@@ -54,9 +54,9 @@ theorem condexp_indepCat_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFi
         strongly_measurable_const.ae_strongly_measurable').symm
   rw [set_integral_const]
   rw [← mem_ℒp_one_iff_integrable] at hfint
-  refine' hfint.induction_strongly_measurable hle₁ Ennreal.one_ne_top _ _ _ _ _ _
+  refine' hfint.induction_strongly_measurable hle₁ ENNReal.one_ne_top _ _ _ _ _ _
   · intro c t hmt ht
-    rw [integral_indicator (hle₁ _ hmt), set_integral_const, smul_smul, ← Ennreal.toReal_mul,
+    rw [integral_indicator (hle₁ _ hmt), set_integral_const, smul_smul, ← ENNReal.toReal_mul,
       mul_comm, ← hindp _ _ hmt hms, set_integral_indicator (hle₁ _ hmt), set_integral_const,
       Set.inter_comm]
   · intro u v hdisj huint hvint hu hv hu_eq hv_eq

Changes in mathlib4

mathlib3
mathlib4
chore: replace 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.

Diff
@@ -41,17 +41,17 @@ theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
     (hf : StronglyMeasurable[m₁] f) (hindp : Indep m₁ m₂ μ) : μ[f|m₂] =ᵐ[μ] fun _ => μ[f] := by
   by_cases hfint : Integrable f μ
   swap; · rw [condexp_undef hfint, integral_undef hfint]; rfl
-  refine' (ae_eq_condexp_of_forall_set_integral_eq hle₂ hfint
+  refine' (ae_eq_condexp_of_forall_setIntegral_eq hle₂ hfint
     (fun s _ hs => integrableOn_const.2 (Or.inr hs)) (fun s hms hs => _)
       stronglyMeasurable_const.aeStronglyMeasurable').symm
-  rw [set_integral_const]
+  rw [setIntegral_const]
   rw [← memℒp_one_iff_integrable] at hfint
   refine' Memℒp.induction_stronglyMeasurable hle₁ ENNReal.one_ne_top _ _ _ _ hfint _
   · exact ⟨f, hf, EventuallyEq.rfl⟩
   · intro c t hmt _
     rw [Indep_iff] at hindp
-    rw [integral_indicator (hle₁ _ hmt), set_integral_const, smul_smul, ← ENNReal.toReal_mul,
-      mul_comm, ← hindp _ _ hmt hms, set_integral_indicator (hle₁ _ hmt), set_integral_const,
+    rw [integral_indicator (hle₁ _ hmt), setIntegral_const, smul_smul, ← ENNReal.toReal_mul,
+      mul_comm, ← hindp _ _ hmt hms, setIntegral_indicator (hle₁ _ hmt), setIntegral_const,
       Set.inter_comm]
   · intro u v _ huint hvint hu hv hu_eq hv_eq
     rw [memℒp_one_iff_integrable] at huint hvint
@@ -70,10 +70,10 @@ theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
     · rw [heq₁]
       exact continuous_integral.comp (ContinuousLinearMap.continuous _)
     · rw [heq₂]
-      exact (continuous_set_integral _).comp (ContinuousLinearMap.continuous _)
+      exact (continuous_setIntegral _).comp (ContinuousLinearMap.continuous _)
   · intro u v huv _ hueq
     rwa [← integral_congr_ae huv, ←
-      (set_integral_congr_ae (hle₂ _ hms) _ : ∫ x in s, u x ∂μ = ∫ x in s, v x ∂μ)]
+      (setIntegral_congr_ae (hle₂ _ hms) _ : ∫ x in s, u x ∂μ = ∫ x in s, v x ∂μ)]
     filter_upwards [huv] with x hx _ using hx
 #align measure_theory.condexp_indep_eq MeasureTheory.condexp_indep_eq
 
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
@@ -32,7 +32,7 @@ namespace MeasureTheory
 
 open ProbabilityTheory
 
-variable {Ω E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
+variable {Ω E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E]
   {m₁ m₂ m : MeasurableSpace Ω} {μ : Measure Ω} {f : Ω → E}
 
 /-- If `m₁, m₂` are independent σ-algebras and `f` is `m₁`-measurable, then `𝔼[f | m₂] = 𝔼[f]`
refactor(Probability/Independence): define independence using kernel independence (#6294)

Independence is the special case of independence with respect to a kernel and a measure where the kernel is constant.

Diff
@@ -49,6 +49,7 @@ theorem condexp_indep_eq (hle₁ : m₁ ≤ m) (hle₂ : m₂ ≤ m) [SigmaFinit
   refine' Memℒp.induction_stronglyMeasurable hle₁ ENNReal.one_ne_top _ _ _ _ hfint _
   · exact ⟨f, hf, EventuallyEq.rfl⟩
   · intro c t hmt _
+    rw [Indep_iff] at hindp
     rw [integral_indicator (hle₁ _ hmt), set_integral_const, smul_smul, ← ENNReal.toReal_mul,
       mul_comm, ← hindp _ _ hmt hms, set_integral_indicator (hle₁ _ hmt), set_integral_const,
       Set.inter_comm]
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.conditional_expectation
-! 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.Notation
 import Mathlib.Probability.Independence.Basic
 import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic
 
+#align_import probability.conditional_expectation from "leanprover-community/mathlib"@"2f8347015b12b0864dfaf366ec4909eb70c78740"
+
 /-!
 
 # Probabilistic properties of the conditional expectation
chore: fix grammar in docs (#5668)
Diff
@@ -21,7 +21,7 @@ the main conditional expectation file.
 
 ## Main result
 
-* `MeasureTheory.condexp_indep_eq`: If `m₁, m₂` are independent σ-algebras and `f` is a
+* `MeasureTheory.condexp_indep_eq`: If `m₁, m₂` are independent σ-algebras and `f` is an
   `m₁`-measurable function, then `𝔼[f | m₂] = 𝔼[f]` almost everywhere.
 
 -/
feat: port Probability.ConditionalExpectation (#5192)

Dependencies 12 + 997

998 files ported (98.8%)
454868 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