measure_theory.measure.lebesgue.integralMathlib.MeasureTheory.Measure.Lebesgue.Integral

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -71,7 +71,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type _} [NormedAddCommGroup E]
           mul_nonneg (norm_nonneg (f.restrict (⟨Icc n (n + 1), is_compact_Icc⟩ : compacts ℝ)))
             ENNReal.toReal_nonneg)
         (fun n => _) hf)
-      (iUnion_Icc_int_cast ℝ)
+      (iUnion_Icc_intCast ℝ)
   simp only [compacts.coe_mk, Real.volume_Icc, add_sub_cancel_left,
     ENNReal.toReal_ofReal zero_le_one, mul_one, norm_le _ (norm_nonneg _)]
   intro x
Diff
@@ -72,8 +72,8 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type _} [NormedAddCommGroup E]
             ENNReal.toReal_nonneg)
         (fun n => _) hf)
       (iUnion_Icc_int_cast ℝ)
-  simp only [compacts.coe_mk, Real.volume_Icc, add_sub_cancel', ENNReal.toReal_ofReal zero_le_one,
-    mul_one, norm_le _ (norm_nonneg _)]
+  simp only [compacts.coe_mk, Real.volume_Icc, add_sub_cancel_left,
+    ENNReal.toReal_ofReal zero_le_one, mul_one, norm_le _ (norm_nonneg _)]
   intro x
   have :=
     ((f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)).norm_coe_le_norm
Diff
@@ -102,7 +102,7 @@ theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace 
   have A : MeasurableEmbedding fun x : ℝ => -x :=
     (Homeomorph.neg ℝ).ClosedEmbedding.MeasurableEmbedding
   have := A.set_integral_map f (Ici (-c))
-  rw [measure.map_neg_eq_self (volume : Measure ℝ)] at this 
+  rw [measure.map_neg_eq_self (volume : Measure ℝ)] at this
   simp_rw [← integral_Ici_eq_integral_Ioi, this, neg_preimage, preimage_neg_Ici, neg_neg]
 #align integral_comp_neg_Iic integral_comp_neg_Iic
 -/
Diff
@@ -66,7 +66,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type _} [NormedAddCommGroup E]
   by
   refine'
     integrable_of_summable_norm_restrict
-      (summable_of_nonneg_of_le
+      (Summable.of_nonneg_of_le
         (fun n : ℤ =>
           mul_nonneg (norm_nonneg (f.restrict (⟨Icc n (n + 1), is_compact_Icc⟩ : compacts ℝ)))
             ENNReal.toReal_nonneg)
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov
 -/
-import Mathbin.MeasureTheory.Integral.SetIntegral
-import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
+import MeasureTheory.Integral.SetIntegral
+import MeasureTheory.Measure.Lebesgue.Basic
 
 #align_import measure_theory.measure.lebesgue.integral from "leanprover-community/mathlib"@"6b31d1eebd64eab86d5bd9936bfaada6ca8b5842"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov
-
-! This file was ported from Lean 3 source module measure_theory.measure.lebesgue.integral
-! leanprover-community/mathlib commit 6b31d1eebd64eab86d5bd9936bfaada6ca8b5842
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Integral.SetIntegral
 import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
 
+#align_import measure_theory.measure.lebesgue.integral from "leanprover-community/mathlib"@"6b31d1eebd64eab86d5bd9936bfaada6ca8b5842"
+
 /-! # Properties of integration with respect to the Lebesgue measure 
 
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
Diff
@@ -39,6 +39,7 @@ theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn
 #align volume_region_between_eq_integral' volume_regionBetween_eq_integral'
 -/
 
+#print volume_regionBetween_eq_integral /-
 /-- If two functions are integrable on a measurable set, and one function is less than
     or equal to the other on that set, then the volume of the region
     between the two functions can be represented as an integral. -/
@@ -48,6 +49,7 @@ theorem volume_regionBetween_eq_integral [SigmaFinite μ] (f_int : IntegrableOn
   volume_regionBetween_eq_integral' f_int g_int hs
     ((ae_restrict_iff' hs).mpr (eventually_of_forall hfg))
 #align volume_region_between_eq_integral volume_regionBetween_eq_integral
+-/
 
 end regionBetween
 
@@ -95,6 +97,7 @@ of finite integrals, see `interval_integral.integral_comp_neg`.
 -/
 
 
+#print integral_comp_neg_Iic /-
 @[simp]
 theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
     [CompleteSpace E] (c : ℝ) (f : ℝ → E) : ∫ x in Iic c, f (-x) = ∫ x in Ioi (-c), f x :=
@@ -105,7 +108,9 @@ theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace 
   rw [measure.map_neg_eq_self (volume : Measure ℝ)] at this 
   simp_rw [← integral_Ici_eq_integral_Ioi, this, neg_preimage, preimage_neg_Ici, neg_neg]
 #align integral_comp_neg_Iic integral_comp_neg_Iic
+-/
 
+#print integral_comp_neg_Ioi /-
 @[simp]
 theorem integral_comp_neg_Ioi {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
     [CompleteSpace E] (c : ℝ) (f : ℝ → E) : ∫ x in Ioi c, f (-x) = ∫ x in Iic (-c), f x :=
@@ -113,4 +118,5 @@ theorem integral_comp_neg_Ioi {E : Type _} [NormedAddCommGroup E] [NormedSpace 
   rw [← neg_neg c, ← integral_comp_neg_Iic]
   simp only [neg_neg]
 #align integral_comp_neg_Ioi integral_comp_neg_Ioi
+-/
 
Diff
@@ -97,7 +97,7 @@ of finite integrals, see `interval_integral.integral_comp_neg`.
 
 @[simp]
 theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
-    [CompleteSpace E] (c : ℝ) (f : ℝ → E) : (∫ x in Iic c, f (-x)) = ∫ x in Ioi (-c), f x :=
+    [CompleteSpace E] (c : ℝ) (f : ℝ → E) : ∫ x in Iic c, f (-x) = ∫ x in Ioi (-c), f x :=
   by
   have A : MeasurableEmbedding fun x : ℝ => -x :=
     (Homeomorph.neg ℝ).ClosedEmbedding.MeasurableEmbedding
@@ -108,7 +108,7 @@ theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace 
 
 @[simp]
 theorem integral_comp_neg_Ioi {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
-    [CompleteSpace E] (c : ℝ) (f : ℝ → E) : (∫ x in Ioi c, f (-x)) = ∫ x in Iic (-c), f x :=
+    [CompleteSpace E] (c : ℝ) (f : ℝ → E) : ∫ x in Ioi c, f (-x) = ∫ x in Iic (-c), f x :=
   by
   rw [← neg_neg c, ← integral_comp_neg_Iic]
   simp only [neg_neg]
Diff
@@ -4,14 +4,17 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov
 
 ! This file was ported from Lean 3 source module measure_theory.measure.lebesgue.integral
-! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
+! leanprover-community/mathlib commit 6b31d1eebd64eab86d5bd9936bfaada6ca8b5842
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Integral.SetIntegral
 import Mathbin.MeasureTheory.Measure.Lebesgue.Basic
 
-/-! # Properties of integration with respect to the Lebesgue measure -/
+/-! # Properties of integration with respect to the Lebesgue measure 
+
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.-/
 
 
 open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace
Diff
@@ -22,6 +22,7 @@ variable {α : Type _}
 
 variable [MeasurableSpace α] {μ : Measure α} {f g : α → ℝ} {s : Set α}
 
+#print volume_regionBetween_eq_integral' /-
 theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
     (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : f ≤ᵐ[μ.restrict s] g) :
     μ.Prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ) :=
@@ -33,6 +34,7 @@ theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn
     lintegral_coe_eq_integral _ ((integrable_congr h).mp (g_int.sub f_int))]
   simpa only
 #align volume_region_between_eq_integral' volume_regionBetween_eq_integral'
+-/
 
 /-- If two functions are integrable on a measurable set, and one function is less than
     or equal to the other on that set, then the volume of the region
@@ -50,6 +52,7 @@ section SummableNormIcc
 
 open ContinuousMap
 
+#print Real.integrable_of_summable_norm_Icc /-
 /- The following lemma is a minor variation on `integrable_of_summable_norm_restrict` in
 `measure_theory.integral.set_integral`, but it is placed here because it needs to know that
 `Icc a b` has volume `b - a`. -/
@@ -76,6 +79,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type _} [NormedAddCommGroup E]
   simpa only [ContinuousMap.restrict_apply, comp_apply, coe_add_right, Subtype.coe_mk,
     sub_add_cancel] using this
 #align real.integrable_of_summable_norm_Icc Real.integrable_of_summable_norm_Icc
+-/
 
 end SummableNormIcc
 
Diff
@@ -95,7 +95,7 @@ theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace 
   have A : MeasurableEmbedding fun x : ℝ => -x :=
     (Homeomorph.neg ℝ).ClosedEmbedding.MeasurableEmbedding
   have := A.set_integral_map f (Ici (-c))
-  rw [measure.map_neg_eq_self (volume : Measure ℝ)] at this
+  rw [measure.map_neg_eq_self (volume : Measure ℝ)] at this 
   simp_rw [← integral_Ici_eq_integral_Ioi, this, neg_preimage, preimage_neg_Ici, neg_neg]
 #align integral_comp_neg_Iic integral_comp_neg_Iic
 

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
@@ -92,7 +92,7 @@ theorem integral_comp_neg_Iic {E : Type*} [NormedAddCommGroup E] [NormedSpace 
     (c : ℝ) (f : ℝ → E) : (∫ x in Iic c, f (-x)) = ∫ x in Ioi (-c), f x := by
   have A : MeasurableEmbedding fun x : ℝ => -x :=
     (Homeomorph.neg ℝ).closedEmbedding.measurableEmbedding
-  have := MeasurableEmbedding.set_integral_map (μ := volume) A f (Ici (-c))
+  have := MeasurableEmbedding.setIntegral_map (μ := volume) A f (Ici (-c))
   rw [Measure.map_neg_eq_self (volume : Measure ℝ)] at this
   simp_rw [← integral_Ici_eq_integral_Ioi, this, neg_preimage, preimage_neg_Ici, neg_neg]
 #align integral_comp_neg_Iic integral_comp_neg_Iic
@@ -108,7 +108,7 @@ theorem integral_comp_neg_Ioi {E : Type*} [NormedAddCommGroup E] [NormedSpace 
 theorem integral_comp_abs {f : ℝ → ℝ} :
     ∫ x, f |x| = 2 * ∫ x in Ioi (0:ℝ), f x := by
   have eq : ∫ (x : ℝ) in Ioi 0, f |x| = ∫ (x : ℝ) in Ioi 0, f x := by
-    refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
+    refine setIntegral_congr measurableSet_Ioi (fun _ hx => ?_)
     rw [abs_eq_self.mpr (le_of_lt (by exact hx))]
   by_cases hf : IntegrableOn (fun x => f |x|) (Ioi 0)
   · have int_Iic : IntegrableOn (fun x ↦ f |x|) (Iic 0) := by
@@ -125,7 +125,7 @@ theorem integral_comp_abs {f : ℝ → ℝ} :
         rw [two_mul, eq]
         congr! 1
         rw [← neg_zero, ← integral_comp_neg_Iic, neg_zero]
-        refine set_integral_congr measurableSet_Iic (fun _ hx => ?_)
+        refine setIntegral_congr measurableSet_Iic (fun _ hx => ?_)
         rw [abs_eq_neg_self.mpr (by exact hx)]
   · have : ¬ Integrable (fun x => f |x|) := by
       contrapose! hf
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -72,7 +72,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E]
         ⟨x - n, ⟨sub_nonneg.mpr x.2.1, sub_le_iff_le_add'.mpr x.2.2⟩⟩
     simpa only [ContinuousMap.restrict_apply, comp_apply, coe_addRight, Subtype.coe_mk,
       sub_add_cancel] using this
-  · exact iUnion_Icc_int_cast ℝ
+  · exact iUnion_Icc_intCast ℝ
 #align real.integrable_of_summable_norm_Icc Real.integrable_of_summable_norm_Icc
 
 end SummableNormIcc
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -65,8 +65,8 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E]
   -- Porting note: `refine` was able to find that on its own before
   · intro n
     exact ⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩
-  · simp only [Compacts.coe_mk, Real.volume_Icc, add_sub_cancel', ENNReal.toReal_ofReal zero_le_one,
-      mul_one, norm_le _ (norm_nonneg _)]
+  · simp only [Compacts.coe_mk, Real.volume_Icc, add_sub_cancel_left,
+      ENNReal.toReal_ofReal zero_le_one, mul_one, norm_le _ (norm_nonneg _)]
     intro x
     have := ((f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)).norm_coe_le_norm
         ⟨x - n, ⟨sub_nonneg.mpr x.2.1, sub_le_iff_le_add'.mpr x.2.2⟩⟩
chore(*): remove empty lines between variable statements (#11418)

Empty lines were removed by executing the following Python script twice

import os
import re


# Loop through each file in the repository
for dir_path, dirs, files in os.walk('.'):
  for filename in files:
    if filename.endswith('.lean'):
      file_path = os.path.join(dir_path, filename)

      # Open the file and read its contents
      with open(file_path, 'r') as file:
        content = file.read()

      # Use a regular expression to replace sequences of "variable" lines separated by empty lines
      # with sequences without empty lines
      modified_content = re.sub(r'(variable.*\n)\n(variable(?! .* in))', r'\1\2', content)

      # Write the modified content back to the file
      with open(file_path, 'w') as file:
        file.write(modified_content)
Diff
@@ -17,7 +17,6 @@ open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace
 section regionBetween
 
 variable {α : Type*}
-
 variable [MeasurableSpace α] {μ : Measure α} {f g : α → ℝ} {s : Set α}
 
 theorem volume_regionBetween_eq_integral' [SigmaFinite μ] (f_int : IntegrableOn f s μ)
chore(MeasureTheory/Integral/SetIntegral): rename type variables (#11131)

Rename measurable spaces \alpha and \beta to X and Y. Rename variables a : X and b : Y to x and y, respectively (and associated hypotheses as well).

Diff
@@ -57,7 +57,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E]
     (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
     Integrable f := by
   refine'
-    @integrable_of_summable_norm_restrict ℝ ℤ E _ volume _ _ _ _ _ _ _ _
+    @integrable_of_summable_norm_restrict ℝ E _ ℤ _ volume _ _ _ _ _ _ _
       (.of_nonneg_of_le
         (fun n : ℤ => mul_nonneg (norm_nonneg
             (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -63,7 +63,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E]
             (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
             ENNReal.toReal_nonneg)
         (fun n => _) hf) _
-  -- porting note: `refine` was able to find that on its own before
+  -- Porting note: `refine` was able to find that on its own before
   · intro n
     exact ⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩
   · simp only [Compacts.coe_mk, Real.volume_Icc, add_sub_cancel', ENNReal.toReal_ofReal zero_le_one,
chore: replace Lean 3 syntax λ x, in doc comments (#10727)

Use Lean 4 syntax fun x ↦ instead, matching the style guide. This is close to exhaustive for doc comments; mathlib has about 460 remaining uses of λ (not all in Lean 3 syntax).

Diff
@@ -51,7 +51,7 @@ open ContinuousMap
 /- The following lemma is a minor variation on `integrable_of_summable_norm_restrict` in
 `Mathlib/MeasureTheory/Integral/SetIntegral.lean`, but it is placed here because it needs to know
 that `Icc a b` has volume `b - a`. -/
-/-- If the sequence with `n`-th term the the sup norm of `λ x, f (x + n)` on the interval `Icc 0 1`,
+/-- If the sequence with `n`-th term the sup norm of `fun x ↦ f (x + n)` on the interval `Icc 0 1`,
 for `n ∈ ℤ`, is summable, then `f` is integrable on `ℝ`. -/
 theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E] {f : C(ℝ, E)}
     (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
feat: uniqueness of Haar measure in general locally compact groups (#8198)

We prove that two regular Haar measures in a locally compact group coincide up to scalar multiplication, and the same thing for inner regular Haar measures. This is implemented in a new file MeasureTheory.Measure.Haar.Unique. A few results that used to be in the MeasureTheory.Measure.Haar.Basic are moved to this file (and extended) so several imports have to be changed.

Diff
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov
 -/
 import Mathlib.MeasureTheory.Integral.SetIntegral
 import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
+import Mathlib.MeasureTheory.Measure.Haar.Unique
 
 #align_import measure_theory.measure.lebesgue.integral from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
 
chore(InfiniteSum): use dot notation (#8358)

Rename

  • summable_of_norm_bounded -> Summable.of_norm_bounded;
  • summable_of_norm_bounded_eventually -> Summable.of_norm_bounded_eventually;
  • summable_of_nnnorm_bounded -> Summable.of_nnnorm_bounded;
  • summable_of_summable_norm -> Summable.of_norm;
  • summable_of_summable_nnnorm -> Summable.of_nnnorm;

New lemmas

  • Summable.of_norm_bounded_eventually_nat
  • Summable.norm

Misc changes

  • Golf a few proofs.
Diff
@@ -57,7 +57,7 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E]
     Integrable f := by
   refine'
     @integrable_of_summable_norm_restrict ℝ ℤ E _ volume _ _ _ _ _ _ _ _
-      (summable_of_nonneg_of_le
+      (.of_nonneg_of_le
         (fun n : ℤ => mul_nonneg (norm_nonneg
             (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
             ENNReal.toReal_nonneg)
feat: Prove that the integral of a function composed with the absolute value is twice the integral over the positive (#8036)
Diff
@@ -104,3 +104,30 @@ theorem integral_comp_neg_Ioi {E : Type*} [NormedAddCommGroup E] [NormedSpace 
   rw [← neg_neg c, ← integral_comp_neg_Iic]
   simp only [neg_neg]
 #align integral_comp_neg_Ioi integral_comp_neg_Ioi
+
+theorem integral_comp_abs {f : ℝ → ℝ} :
+    ∫ x, f |x| = 2 * ∫ x in Ioi (0:ℝ), f x := by
+  have eq : ∫ (x : ℝ) in Ioi 0, f |x| = ∫ (x : ℝ) in Ioi 0, f x := by
+    refine set_integral_congr measurableSet_Ioi (fun _ hx => ?_)
+    rw [abs_eq_self.mpr (le_of_lt (by exact hx))]
+  by_cases hf : IntegrableOn (fun x => f |x|) (Ioi 0)
+  · have int_Iic : IntegrableOn (fun x ↦ f |x|) (Iic 0) := by
+      rw [← Measure.map_neg_eq_self (volume : Measure ℝ)]
+      let m : MeasurableEmbedding fun x : ℝ => -x := (Homeomorph.neg ℝ).measurableEmbedding
+      rw [m.integrableOn_map_iff]
+      simp_rw [Function.comp, abs_neg, neg_preimage, preimage_neg_Iic, neg_zero]
+      exact integrableOn_Ici_iff_integrableOn_Ioi.mpr hf
+    calc
+      _ = (∫ x in Iic 0, f |x|) + ∫ x in Ioi 0, f |x| := by
+        rw [← integral_union (Iic_disjoint_Ioi le_rfl) measurableSet_Ioi int_Iic hf,
+          Iic_union_Ioi, restrict_univ]
+      _ = 2 * ∫ x in Ioi 0, f x := by
+        rw [two_mul, eq]
+        congr! 1
+        rw [← neg_zero, ← integral_comp_neg_Iic, neg_zero]
+        refine set_integral_congr measurableSet_Iic (fun _ hx => ?_)
+        rw [abs_eq_neg_self.mpr (by exact hx)]
+  · have : ¬ Integrable (fun x => f |x|) := by
+      contrapose! hf
+      exact hf.integrableOn
+    rw [← eq, integral_undef hf, integral_undef this, mul_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
@@ -15,7 +15,7 @@ open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace
 
 section regionBetween
 
-variable {α : Type _}
+variable {α : Type*}
 
 variable [MeasurableSpace α] {μ : Measure α} {f g : α → ℝ} {s : Set α}
 
@@ -52,7 +52,7 @@ open ContinuousMap
 that `Icc a b` has volume `b - a`. -/
 /-- If the sequence with `n`-th term the the sup norm of `λ x, f (x + n)` on the interval `Icc 0 1`,
 for `n ∈ ℤ`, is summable, then `f` is integrable on `ℝ`. -/
-theorem Real.integrable_of_summable_norm_Icc {E : Type _} [NormedAddCommGroup E] {f : C(ℝ, E)}
+theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E] {f : C(ℝ, E)}
     (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
     Integrable f := by
   refine'
@@ -88,7 +88,7 @@ of finite integrals, see `intervalIntegral.integral_comp_neg`.
 
 /- @[simp] Porting note: Linter complains it does not apply to itself. Although it does apply to
 itself, it does not apply when `f` is more complicated -/
-theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
+theorem integral_comp_neg_Iic {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
     (c : ℝ) (f : ℝ → E) : (∫ x in Iic c, f (-x)) = ∫ x in Ioi (-c), f x := by
   have A : MeasurableEmbedding fun x : ℝ => -x :=
     (Homeomorph.neg ℝ).closedEmbedding.measurableEmbedding
@@ -99,7 +99,7 @@ theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace 
 
 /- @[simp] Porting note: Linter complains it does not apply to itself. Although it does apply to
 itself, it does not apply when `f` is more complicated -/
-theorem integral_comp_neg_Ioi {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
+theorem integral_comp_neg_Ioi {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
     (c : ℝ) (f : ℝ → E) : (∫ x in Ioi c, f (-x)) = ∫ x in Iic (-c), f x := by
   rw [← neg_neg c, ← integral_comp_neg_Iic]
   simp only [neg_neg]
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,15 +2,12 @@
 Copyright (c) 2017 Johannes Hölzl. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Johannes Hölzl, Sébastien Gouëzel, Yury Kudryashov
-
-! This file was ported from Lean 3 source module measure_theory.measure.lebesgue.integral
-! leanprover-community/mathlib commit fd5edc43dc4f10b85abfe544b88f82cf13c5f844
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Integral.SetIntegral
 import Mathlib.MeasureTheory.Measure.Lebesgue.Basic
 
+#align_import measure_theory.measure.lebesgue.integral from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844"
+
 /-! # Properties of integration with respect to the Lebesgue measure -/
 
 
chore: cleanup whitespace (#5988)

Grepping for [^ .:{-] [^ :] and reviewing the results. Once I started I couldn't stop. :-)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -59,9 +59,9 @@ theorem Real.integrable_of_summable_norm_Icc {E : Type _} [NormedAddCommGroup E]
     (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
     Integrable f := by
   refine'
-    @integrable_of_summable_norm_restrict ℝ ℤ E _ volume  _ _ _ _ _ _ _ _
+    @integrable_of_summable_norm_restrict ℝ ℤ E _ volume _ _ _ _ _ _ _ _
       (summable_of_nonneg_of_le
-        (fun n : ℤ =>  mul_nonneg (norm_nonneg
+        (fun n : ℤ => mul_nonneg (norm_nonneg
             (f.restrict (⟨Icc (n : ℝ) ((n : ℝ) + 1), isCompact_Icc⟩ : Compacts ℝ)))
             ENNReal.toReal_nonneg)
         (fun n => _) hf) _
feat(MeasureTheory.Integral.Bochner): drop completeness requirement from the definition (#5910)

The notion of Bochner integral of a function taking values in a normed space E requires that E is complete. This means that whenever we write down an integral, the term contains the assertion that E is complete.

In this PR, we remove the completeness requirement from the definition, using the junk value 0 when the space is not complete. Mathematically this does not make any difference, as all reasonable applications will be with a complete E. But it means that terms involving integrals become a little bit simpler and that completeness will not have to be checked by the system when applying a bunch of basic lemmas on integrals.

Diff
@@ -92,10 +92,10 @@ of finite integrals, see `intervalIntegral.integral_comp_neg`.
 /- @[simp] Porting note: Linter complains it does not apply to itself. Although it does apply to
 itself, it does not apply when `f` is more complicated -/
 theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
-    [CompleteSpace E] (c : ℝ) (f : ℝ → E) : (∫ x in Iic c, f (-x)) = ∫ x in Ioi (-c), f x := by
+    (c : ℝ) (f : ℝ → E) : (∫ x in Iic c, f (-x)) = ∫ x in Ioi (-c), f x := by
   have A : MeasurableEmbedding fun x : ℝ => -x :=
     (Homeomorph.neg ℝ).closedEmbedding.measurableEmbedding
-  have := @MeasurableEmbedding.set_integral_map _ _ _ _ volume _ _ _ _ _  A f (Ici (-c))
+  have := MeasurableEmbedding.set_integral_map (μ := volume) A f (Ici (-c))
   rw [Measure.map_neg_eq_self (volume : Measure ℝ)] at this
   simp_rw [← integral_Ici_eq_integral_Ioi, this, neg_preimage, preimage_neg_Ici, neg_neg]
 #align integral_comp_neg_Iic integral_comp_neg_Iic
@@ -103,7 +103,7 @@ theorem integral_comp_neg_Iic {E : Type _} [NormedAddCommGroup E] [NormedSpace 
 /- @[simp] Porting note: Linter complains it does not apply to itself. Although it does apply to
 itself, it does not apply when `f` is more complicated -/
 theorem integral_comp_neg_Ioi {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
-    [CompleteSpace E] (c : ℝ) (f : ℝ → E) : (∫ x in Ioi c, f (-x)) = ∫ x in Iic (-c), f x := by
+    (c : ℝ) (f : ℝ → E) : (∫ x in Ioi c, f (-x)) = ∫ x in Iic (-c), f x := by
   rw [← neg_neg c, ← integral_comp_neg_Iic]
   simp only [neg_neg]
 #align integral_comp_neg_Ioi integral_comp_neg_Ioi
feat: port MeasureTheory.Measure.Lebesgue.Integral (#4734)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com>

Dependencies 12 + 994

995 files ported (98.8%)
454922 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