Skip to content

Commit f210104

Browse files
sgouezelBergschaf
authored andcommitted
feat: missing small lemmas in measure theory, cleanup (leanprover-community#40106)
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
1 parent 6c644c2 commit f210104

10 files changed

Lines changed: 71 additions & 15 deletions

File tree

Mathlib/MeasureTheory/Function/AEEqFun.lean

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,12 @@ theorem coeFn_const_eq [NeZero μ] (b : β) (x : α) : (const α b : α →ₘ[
658658
simp_rw [const, mk_eq_mk, EventuallyEq, ← const_def, eventually_const] at this
659659
rw [Function.const, this]
660660

661+
theorem coeFn_const_eq' (b : β) : ∃ b', ((const α b : α →ₘ[μ] β) : α → β) = fun _ ↦ b' := by
662+
simp only [cast]
663+
split_ifs with h
664+
case neg => exact h.elim ⟨b, rfl⟩
665+
exact ⟨Classical.choose h, by ext; simp⟩
666+
661667
variable {α}
662668

663669
instance instInhabited [Inhabited β] : Inhabited (α →ₘ[μ] β) :=
@@ -782,6 +788,24 @@ end Monoid
782788
instance instCommMonoid [CommMonoid γ] [ContinuousMul γ] : CommMonoid (α →ₘ[μ] γ) :=
783789
toGerm_injective.commMonoid toGerm one_toGerm mul_toGerm pow_toGerm
784790

791+
@[to_additive]
792+
theorem coeFn_finsetProd [CommMonoid γ] [ContinuousMul γ]
793+
{ι : Type*} (s : Finset ι) (f : ι → α →ₘ[μ] γ) :
794+
⇑(∏ i ∈ s, f i) =ᵐ[μ] ∏ i ∈ s, ⇑(f i) := by
795+
classical
796+
induction s using Finset.induction with
797+
| empty => simp [coeFn_one]
798+
| insert a s ha ih =>
799+
simp only [ha, not_false_eq_true, Finset.prod_insert]
800+
grw [coeFn_mul, ih]
801+
802+
@[to_additive]
803+
theorem coeFn_fun_finsetProd [CommMonoid γ] [ContinuousMul γ]
804+
{ι : Type*} (s : Finset ι) (f : ι → α →ₘ[μ] γ) :
805+
⇑(∏ i ∈ s, f i) =ᵐ[μ] fun x ↦ ∏ i ∈ s, f i x := by
806+
grw [coeFn_finsetProd]
807+
filter_upwards with x using by simp
808+
785809
section Group
786810

787811
variable [Group γ] [IsTopologicalGroup γ]

Mathlib/MeasureTheory/Function/L1Space/HasFiniteIntegral.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ theorem hasFiniteIntegral_zero_measure {m : MeasurableSpace α} (f : α → ε)
245245
simp only [HasFiniteIntegral, lintegral_zero_measure, zero_lt_top]
246246

247247
variable (α μ) in
248-
@[fun_prop, simp]
248+
@[to_fun (attr := fun_prop, simp) hasFiniteIntegral_fun_zero]
249249
theorem hasFiniteIntegral_zero {ε : Type*} [TopologicalSpace ε] [ESeminormedAddMonoid ε] :
250-
HasFiniteIntegral (fun _ : α => (0 : ε)) μ := by
250+
HasFiniteIntegral (0 : α → ε) μ := by
251251
simp [hasFiniteIntegral_iff_enorm]
252252

253253
@[fun_prop]

Mathlib/MeasureTheory/Function/L1Space/Integrable.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,9 @@ section ESeminormedAddMonoid
405405
variable {ε' : Type*} [TopologicalSpace ε'] [ESeminormedAddMonoid ε']
406406

407407
variable (α ε') in
408-
@[simp]
409-
theorem integrable_zero (μ : Measure α) : Integrable (fun _ => (0 : ε')) μ := by
410-
simp [Integrable, aestronglyMeasurable_const]
408+
@[to_fun (attr := fun_prop, simp) integrable_fun_zero]
409+
theorem integrable_zero (μ : Measure α) : Integrable (0 : α → ε') μ := by
410+
simp [Integrable, aestronglyMeasurable_zero]
411411

412412
theorem Integrable.add' {f g : α → ε'} (hf : Integrable f μ) (hg : Integrable g μ) :
413413
HasFiniteIntegral (f + g) μ :=

Mathlib/MeasureTheory/Function/LpSpace/Basic.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ theorem coeFn_add (f g : Lp E p μ) : ⇑(f + g) =ᵐ[μ] f + g :=
199199
theorem coeFn_sub (f g : Lp E p μ) : ⇑(f - g) =ᵐ[μ] f - g :=
200200
AEEqFun.coeFn_sub _ _
201201

202+
theorem coeFn_finsetSum {ι : Type*} (s : Finset ι) (f : ι → Lp E p μ) :
203+
⇑(∑ i ∈ s, f i) =ᵐ[μ] ∑ i ∈ s, ⇑(f i) := by
204+
simp [AEEqFun.coeFn_finsetSum]
205+
206+
theorem coeFn_fun_finsetSum {ι : Type*} (s : Finset ι) (f : ι → Lp E p μ) :
207+
⇑(∑ i ∈ s, f i) =ᵐ[μ] fun x ↦ ∑ i ∈ s, f i x := by
208+
grw [coeFn_finsetSum]
209+
filter_upwards with x using by simp
210+
202211
theorem const_mem_Lp (α) {_ : MeasurableSpace α} (μ : Measure α) (c : E) [IsFiniteMeasure μ] :
203212
@AEEqFun.const α _ _ μ _ c ∈ Lp E p μ :=
204213
(memLp_const c).eLpNorm_mk_lt_top

Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,19 @@ protected theorem inv [Inv β] [ContinuousInv β] (hf : AEStronglyMeasurable[m]
316316
AEStronglyMeasurable[m] f⁻¹ μ :=
317317
⟨(hf.mk f)⁻¹, hf.stronglyMeasurable_mk.inv, hf.ae_eq_mk.inv⟩
318318

319+
@[fun_prop]
320+
theorem inv₀ [GroupWithZero β] [ContinuousInv₀ β] [MetrizableSpace β]
321+
(hf : AEStronglyMeasurable[m] f μ) : AEStronglyMeasurable[m] f⁻¹ μ :=
322+
⟨(hf.mk f)⁻¹, hf.stronglyMeasurable_mk.inv₀, hf.ae_eq_mk.inv⟩
323+
319324
@[to_additive (attr := fun_prop)]
320325
protected theorem div [Group β] [IsTopologicalGroup β] (hf : AEStronglyMeasurable[m] f μ)
321326
(hg : AEStronglyMeasurable[m] g μ) : AEStronglyMeasurable[m] (f / g) μ :=
322327
⟨hf.mk f / hg.mk g, hf.stronglyMeasurable_mk.div' hg.stronglyMeasurable_mk,
323328
hf.ae_eq_mk.div hg.ae_eq_mk⟩
324329

325330
@[fun_prop]
326-
theorem div₀ [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] [PseudoMetrizableSpace β]
327-
[MeasurableSpace β] [BorelSpace β] [MeasurableSingletonClass β]
331+
theorem div₀ [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] [MetrizableSpace β]
328332
(hf : AEStronglyMeasurable[m] f μ) (hg : AEStronglyMeasurable[m] g μ) :
329333
AEStronglyMeasurable[m] (f / g) μ :=
330334
⟨hf.mk f / hg.mk g, hf.stronglyMeasurable_mk.div hg.stronglyMeasurable_mk,

Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,21 @@ protected theorem inv [Inv β] [ContinuousInv β] (hf : StronglyMeasurable f) :
416416
StronglyMeasurable f⁻¹ :=
417417
fun n => (hf.approx n)⁻¹, fun x => (hf.tendsto_approx x).inv⟩
418418

419+
@[fun_prop]
420+
protected theorem inv₀ [GroupWithZero β] [ContinuousInv₀ β] [MetrizableSpace β]
421+
(hf : StronglyMeasurable f) : StronglyMeasurable f⁻¹ := by
422+
borelize β
423+
refine ⟨fun n => ((hf.approx n).restrict {x | f x ≠ 0})⁻¹, fun x => ?_⟩
424+
have : MeasurableSet {x | f x ≠ 0} := ((MeasurableSet.singleton 0).preimage hf.measurable).compl
425+
by_cases h : f x = 0
426+
· simp_all only [ne_eq, measurableSet_setOf, SimpleFunc.coe_inv, SimpleFunc.coe_restrict,
427+
Pi.inv_apply, mem_setOf_eq, not_true_eq_false, not_false_eq_true, indicator_of_notMem,
428+
_root_.inv_zero]
429+
exact tendsto_const_nhds
430+
· simp_all only [ne_eq, measurableSet_setOf, SimpleFunc.coe_inv, SimpleFunc.coe_restrict,
431+
Pi.inv_apply, mem_setOf_eq, not_false_eq_true, indicator_of_mem]
432+
apply (hf.tendsto_approx x).inv₀ h
433+
419434
@[to_additive (attr := fun_prop) sub]
420435
protected theorem div' [Div β] [ContinuousDiv β] (hf : StronglyMeasurable f)
421436
(hg : StronglyMeasurable g) : StronglyMeasurable (f / g) :=
@@ -428,10 +443,10 @@ theorem div₀ [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] (hf :
428443
fun x => (hf.tendsto_approx x).div (hg.tendsto_approx x) (h₀ x)⟩
429444

430445
@[fun_prop]
431-
theorem div [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] [PseudoMetrizableSpace β]
432-
[MeasurableSpace β] [BorelSpace β] [MeasurableSingletonClass β] (hf : StronglyMeasurable f)
433-
(hg : StronglyMeasurable g) :
446+
theorem div [GroupWithZero β] [ContinuousMul β] [ContinuousInv₀ β] [MetrizableSpace β]
447+
(hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
434448
StronglyMeasurable (f / g) := by
449+
borelize β
435450
refine ⟨fun n => hf.approx n / (hg.approx n).restrict {x | g x ≠ 0}, fun x => ?_⟩
436451
have : MeasurableSet {x | g x ≠ 0} := ((MeasurableSet.singleton 0).preimage hg.measurable).compl
437452
by_cases h : g x = 0

Mathlib/MeasureTheory/Integral/Bochner/Basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ theorem integral_non_aestronglyMeasurable {f : α → G} (h : ¬AEStronglyMeasur
214214
∫ a, f a ∂μ = 0 :=
215215
integral_undef <| not_and_of_not_left _ h
216216

217+
theorem integral_of_not_completeSpace {f : α → G} (hG : ¬CompleteSpace G) :
218+
∫ a, f a ∂μ = 0 := by
219+
simp [integral, hG]
220+
217221
variable (α G)
218222

219223
@[simp]

Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,14 +545,16 @@ theorem setLIntegral_eq_const {f : α → ℝ≥0∞} (hf : Measurable f) (r :
545545
· rw [lintegral_const, Measure.restrict_apply MeasurableSet.univ, Set.univ_inter]
546546
· exact hf (measurableSet_singleton r)
547547

548+
@[to_fun lintegral_indicator_fun_one_le]
548549
theorem lintegral_indicator_one_le (s : Set α) : ∫⁻ a, s.indicator 1 a ∂μ ≤ μ s :=
549550
(lintegral_indicator_const_le _ _).trans <| (one_mul _).le
550551

551-
@[simp]
552+
@[to_fun (attr := simp) lintegral_indicator_fun_one₀]
552553
theorem lintegral_indicator_one₀ {s : Set α} (hs : NullMeasurableSet s μ) :
553554
∫⁻ a, s.indicator 1 a ∂μ = μ s :=
554555
(lintegral_indicator_const₀ hs _).trans <| one_mul _
555556

557+
@[to_fun lintegral_indicator_fun_one]
556558
theorem lintegral_indicator_one {s : Set α} (hs : MeasurableSet s) :
557559
∫⁻ a, s.indicator 1 a ∂μ = μ s := by
558560
simp [hs]

Mathlib/MeasureTheory/Integral/SetToL1.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,7 @@ theorem setToFun_smul_left' (hT : DominatedFinMeasAdditive μ T C)
715715
theorem setToFun_zero (hT : DominatedFinMeasAdditive μ T C) : setToFun μ T hT (0 : α → E) = 0 := by
716716
by_cases hF : CompleteSpace F; swap
717717
· simp [setToFun, hF]
718-
rw [Pi.zero_def, setToFun_eq hT (integrable_zero _ _ _)]
719-
simp only [← Pi.zero_def]
720-
rw [Integrable.toL1_zero, map_zero]
718+
rw [setToFun_eq hT (integrable_zero _ _ _), Integrable.toL1_zero, map_zero]
721719

722720
@[simp]
723721
theorem setToFun_zero_left {hT : DominatedFinMeasAdditive μ (0 : Set α → E →L[ℝ] F) C} :

Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ theorem withDensityᵥ_apply (hf : Integrable f μ) {s : Set α} (hs : Measurabl
6363
@[simp]
6464
theorem withDensityᵥ_zero : μ.withDensityᵥ (0 : α → E) = 0 := by
6565
ext1 s hs
66-
rw [Pi.zero_def, withDensityᵥ_apply (integrable_zero α E μ) hs]
66+
rw [withDensityᵥ_apply (integrable_zero α E μ) hs]
6767
simp
6868

6969
@[simp]

0 commit comments

Comments
 (0)