Skip to content

Commit 56267c9

Browse files
committed
refactor(MeasureTheory/Integral/DominatedConvergence): golf; improve readability
1 parent 1aaeb22 commit 56267c9

1 file changed

Lines changed: 63 additions & 139 deletions

File tree

Mathlib/MeasureTheory/Integral/DominatedConvergence.lean

Lines changed: 63 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -639,173 +639,97 @@ end intervalIntegral
639639

640640
namespace MeasureTheory
641641

642-
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {μ : Measure ℝ} {f : ℝ → E}
642+
namespace IntegrableOn
643+
644+
open intervalIntegral
643645

644-
section PrimitiveIoi
646+
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {μ : Measure ℝ} {f : ℝ → E}
645647

646-
theorem IntegrableOn.tendsto_primitive_Ioi {a b₀ : ℝ} (hf : IntegrableOn f (Ioi a) μ)
647-
(hb₀ : a ≤ b₀) :
648-
Tendsto (fun b ↦ ∫ x in Ioi b, f x ∂μ) (𝓝[≥] b₀) (𝓝 (∫ x in Ioi b₀, f x ∂μ)) := by
648+
theorem continuousWithinAt_primitive_Ioi {a b₀ : ℝ} (hf : IntegrableOn f (Ioi a) μ) (hb₀ : a ≤ b₀) :
649+
ContinuousWithinAt (fun b ↦ ∫ x in Ioi b, f x ∂μ) (Ici b₀) b₀ := by
649650
simp_rw [← integral_indicator measurableSet_Ioi]
650-
apply tendsto_integral_filter_of_dominated_convergence
651+
refine tendsto_integral_filter_of_dominated_convergence ((Ioi a).indicator (norm ∘ f)) ?_ ?_ ?_ ?_
651652
· filter_upwards [self_mem_nhdsWithin] with b hb
652653
rw [aestronglyMeasurable_indicator_iff measurableSet_Ioi]
653-
apply Integrable.aestronglyMeasurable
654-
exact hf.mono_set (Ioi_subset_Ioi (hb₀.trans hb))
654+
exact (hf.mono_set (Ioi_subset_Ioi (hb₀.trans hb))).aestronglyMeasurable
655655
· filter_upwards [self_mem_nhdsWithin] with b hb
656-
apply ae_of_all
657-
intro x
656+
refine ae_of_all _ fun x ↦ ?_
658657
rw [norm_indicator_eq_indicator_norm]
659-
apply indicator_le_indicator_of_subset (Ioi_subset_Ioi (hb₀.trans hb))
660-
intro _
661-
exact norm_nonneg _
658+
apply indicator_le_indicator_of_subset (Ioi_subset_Ioi (by grind)) (fun a ↦ norm_nonneg (f a))
662659
· simpa [integrable_indicator_iff measurableSet_Ioi] using hf.norm
663-
· apply ae_of_all
664-
intro x
665-
rw [indicator_apply]
666-
by_cases hx : b₀ < x
667-
· simp only [mem_Ioi, hx, if_true]
668-
apply tendsto_const_nhds.congr'
669-
filter_upwards [mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hx)] with b (hb : b < x)
670-
simp [hb]
671-
· simp only [mem_Ioi, hx, if_false]
672-
simp at hx
673-
apply tendsto_const_nhds.congr'
674-
filter_upwards [self_mem_nhdsWithin] with b hb
675-
simp [hx.trans hb]
676-
677-
theorem IntegrableOn.continuousWithinAt_primitive_Ioi {a b₀ : ℝ} (hf : IntegrableOn f (Ioi a) μ)
678-
(hb₀ : a ≤ b₀) :
679-
ContinuousWithinAt (fun b ↦ ∫ x in Ioi b, f x ∂μ) (Ici b₀) b₀ :=
680-
hf.tendsto_primitive_Ioi hb₀
681-
682-
theorem IntegrableOn.continuousOn_primitive_Ioi [NoAtoms μ] {a : ℝ}
683-
(hf : IntegrableOn f (Ioi a) μ) :
660+
· refine ae_of_all _ fun x ↦ ?_
661+
simp only [indicator_apply, mem_Ioi]
662+
by_cases hx : b₀ < x <;> apply tendsto_const_nhds.congr'
663+
· filter_upwards [mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hx)] with b hb using by grind
664+
· filter_upwards [self_mem_nhdsWithin] with b hb using by grind
665+
666+
theorem continuousOn_primitive_Ioi [NoAtoms μ] {a : ℝ} (hf : IntegrableOn f (Ioi a) μ) :
684667
ContinuousOn (fun b ↦ ∫ x in Ioi b, f x ∂μ) (Ici a) := by
685668
intro b₀ hb₀
686669
rw [mem_Ici] at hb₀
687-
simp_rw [← integral_indicator measurableSet_Ioi]
688-
apply tendsto_integral_filter_of_dominated_convergence
689-
· filter_upwards [self_mem_nhdsWithin] with b hb
690-
rw [aestronglyMeasurable_indicator_iff measurableSet_Ioi]
691-
apply Integrable.aestronglyMeasurable
692-
exact hf.mono_set (Ioi_subset_Ioi hb)
693-
· filter_upwards [self_mem_nhdsWithin] with b hb
694-
apply ae_of_all
695-
intro x
696-
rw [norm_indicator_eq_indicator_norm]
697-
apply indicator_le_indicator_of_subset (Ioi_subset_Ioi hb)
698-
intro _
699-
exact norm_nonneg _
700-
· simpa [integrable_indicator_iff measurableSet_Ioi] using hf.norm
701-
· have hne : ∀ᵐ x ∂μ, x ≠ b₀ := by simp [ae_iff]
702-
filter_upwards [hne] with x hx
703-
rw [indicator_apply]
704-
by_cases hxb : b₀ < x
705-
· simp only [mem_Ioi, hxb, if_true]
706-
apply tendsto_const_nhds.congr'
707-
filter_upwards [mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hxb)] with b (hb : b < x)
708-
simp [hb]
709-
· simp only [mem_Ioi, hxb, if_false]
710-
have hxb' : x < b₀ := lt_of_le_of_ne (not_lt.mp hxb) hx
711-
apply tendsto_const_nhds.congr'
712-
filter_upwards [mem_nhdsWithin_of_mem_nhds (Ioi_mem_nhds hxb')] with b (hb : x < b)
713-
simp [hb.le]
714-
715-
end PrimitiveIoi
716-
717-
section PrimitiveIio
718-
719-
theorem IntegrableOn.tendsto_primitive_Iio {a b₀ : ℝ} (hf : IntegrableOn f (Iio a) μ)
720-
(hb₀ : b₀ ≤ a) :
721-
Tendsto (fun b ↦ ∫ x in Iio b, f x ∂μ) (𝓝[≤] b₀) (𝓝 (∫ x in Iio b₀, f x ∂μ)) := by
670+
rw [continuousWithinAt_iff_continuous_left_right]
671+
constructor
672+
· rw [Ici_inter_Iic]
673+
have h_int : IntervalIntegrable f μ a b₀ := by
674+
rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hb₀]
675+
exact hf.mono_set Ioc_subset_Ioi_self
676+
have h_split : ∀ b ∈ Icc a b₀, ∫ x in Ioi b, f x ∂μ =
677+
(∫ x in Ioi a, f x ∂μ) - ∫ x in a..b, f x ∂μ := by
678+
intro b hb
679+
simp [← integral_Ioi_sub_Ioi hf hb.1]
680+
have h_cwa : ContinuousWithinAt (fun b ↦ ∫ x in a..b, f x ∂μ) (Icc a b₀) b₀ :=
681+
continuousWithinAt_primitive (measure_singleton b₀) (by simpa [hb₀])
682+
exact (continuousWithinAt_const.sub h_cwa).congr h_split (h_split b₀ (right_mem_Icc.2 hb₀))
683+
· simpa [hb₀] using hf.continuousWithinAt_primitive_Ioi hb₀
684+
685+
theorem continuousWithinAt_primitive_Iio {a b₀ : ℝ} (hf : IntegrableOn f (Iio a) μ) (hb₀ : b₀ ≤ a) :
686+
ContinuousWithinAt (fun b ↦ ∫ x in Iio b, f x ∂μ) (Iic b₀) b₀ := by
722687
simp_rw [← integral_indicator measurableSet_Iio]
723-
apply tendsto_integral_filter_of_dominated_convergence
688+
refine tendsto_integral_filter_of_dominated_convergence ((Iio a).indicator (norm ∘ f)) ?_ ?_ ?_ ?_
724689
· filter_upwards [self_mem_nhdsWithin] with b hb
725690
rw [aestronglyMeasurable_indicator_iff measurableSet_Iio]
726-
apply Integrable.aestronglyMeasurable
727-
exact hf.mono_set (Iio_subset_Iio (hb.trans hb₀))
691+
exact (hf.mono_set (Iio_subset_Iio (hb.trans hb₀))).aestronglyMeasurable
728692
· filter_upwards [self_mem_nhdsWithin] with b hb
729-
apply ae_of_all
730-
intro x
693+
refine ae_of_all _ fun x ↦ ?_
731694
rw [norm_indicator_eq_indicator_norm]
732-
apply indicator_le_indicator_of_subset (Iio_subset_Iio (hb.trans hb₀))
733-
intro _
734-
exact norm_nonneg _
695+
apply indicator_le_indicator_of_subset (Iio_subset_Iio (by grind)) (fun a ↦ norm_nonneg (f a))
735696
· simpa [integrable_indicator_iff measurableSet_Iio] using hf.norm
736-
· apply ae_of_all
737-
intro x
738-
rw [indicator_apply]
739-
by_cases hx : x < b₀
740-
· simp only [mem_Iio, hx, if_true]
741-
apply tendsto_const_nhds.congr'
742-
filter_upwards [mem_nhdsWithin_of_mem_nhds (Ioi_mem_nhds hx)] with b (hb : x < b)
743-
simp [hb]
744-
· simp only [mem_Iio, hx, if_false]
745-
simp at hx
746-
apply tendsto_const_nhds.congr'
747-
filter_upwards [self_mem_nhdsWithin] with b hb
748-
simp [hb.trans hx]
749-
750-
theorem IntegrableOn.continuousWithinAt_primitive_Iio {a b₀ : ℝ} (hf : IntegrableOn f (Iio a) μ)
751-
(hb₀ : b₀ ≤ a) :
752-
ContinuousWithinAt (fun b ↦ ∫ x in Iio b, f x ∂μ) (Iic b₀) b₀ :=
753-
hf.tendsto_primitive_Iio hb₀
754-
755-
theorem IntegrableOn.continuousOn_primitive_Iio [NoAtoms μ] {a : ℝ}
756-
(hf : IntegrableOn f (Iio a) μ) :
697+
· refine ae_of_all _ fun x ↦ ?_
698+
simp only [indicator_apply, mem_Iio]
699+
by_cases hx : x < b₀ <;> apply tendsto_const_nhds.congr'
700+
· filter_upwards [mem_nhdsWithin_of_mem_nhds (Ioi_mem_nhds hx)] with b hb using by grind
701+
· filter_upwards [self_mem_nhdsWithin] with b hb using by grind
702+
703+
theorem continuousOn_primitive_Iio [NoAtoms μ] {a : ℝ} (hf : IntegrableOn f (Iio a) μ) :
757704
ContinuousOn (fun b ↦ ∫ x in Iio b, f x ∂μ) (Iic a) := by
758705
intro b₀ hb₀
759706
rw [mem_Iic] at hb₀
760-
simp_rw [← integral_indicator measurableSet_Iio]
761-
apply tendsto_integral_filter_of_dominated_convergence
762-
· filter_upwards [self_mem_nhdsWithin] with b hb
763-
rw [aestronglyMeasurable_indicator_iff measurableSet_Iio]
764-
apply Integrable.aestronglyMeasurable
765-
exact hf.mono_set (Iio_subset_Iio hb)
766-
· filter_upwards [self_mem_nhdsWithin] with b hb
767-
apply ae_of_all
768-
intro x
769-
rw [norm_indicator_eq_indicator_norm]
770-
apply indicator_le_indicator_of_subset (Iio_subset_Iio hb)
771-
intro _
772-
exact norm_nonneg _
773-
· simpa [integrable_indicator_iff measurableSet_Iio] using hf.norm
774-
· have hne : ∀ᵐ x ∂μ, x ≠ b₀ := by simp [ae_iff]
775-
filter_upwards [hne] with x hx
776-
rw [indicator_apply]
777-
by_cases hxb : x < b₀
778-
· simp only [mem_Iio, hxb, if_true]
779-
apply tendsto_const_nhds.congr'
780-
filter_upwards [mem_nhdsWithin_of_mem_nhds (Ioi_mem_nhds hxb)] with b (hb : x < b)
781-
simp [hb]
782-
· simp only [mem_Iio, hxb, if_false]
783-
have hxb' : b₀ < x := lt_of_le_of_ne (not_lt.mp hxb) (Ne.symm hx)
784-
apply tendsto_const_nhds.congr'
785-
filter_upwards [mem_nhdsWithin_of_mem_nhds (Iio_mem_nhds hxb')] with b (hb : b < x)
786-
simp [hb.le]
787-
788-
end PrimitiveIio
789-
790-
section PrimitiveIci
791-
792-
theorem IntegrableOn.continuousOn_primitive_Ici [NoAtoms μ] {a : ℝ}
793-
(hf : IntegrableOn f (Ici a) μ) :
707+
rw [continuousWithinAt_iff_continuous_left_right]
708+
constructor
709+
· simpa [hb₀] using hf.continuousWithinAt_primitive_Iio hb₀
710+
· rw [Iic_inter_Ici]
711+
have h_int : IntervalIntegrable f μ b₀ a := by
712+
rw [intervalIntegrable_iff_integrableOn_Ico_of_le hb₀]
713+
exact hf.mono_set Ico_subset_Iio_self
714+
have h_split : ∀ b ∈ Icc b₀ a, ∫ x in Iio b, f x ∂μ =
715+
(∫ x in Iio a, f x ∂μ) + ∫ x in a..b, f x ∂μ := by
716+
intro b hb
717+
simp [integral_symm b a, ← integral_Iio_sub_Iio hf hb.2]
718+
have h_cwa : ContinuousWithinAt (fun b ↦ ∫ x in a..b, f x ∂μ) (Icc b₀ a) b₀ := by
719+
exact continuousWithinAt_primitive (measure_singleton b₀) (by simpa [hb₀])
720+
apply (continuousWithinAt_const.add h_cwa).congr h_split (h_split b₀ (left_mem_Icc.2 hb₀))
721+
722+
theorem continuousOn_primitive_Ici [NoAtoms μ] {a : ℝ} (hf : IntegrableOn f (Ici a) μ) :
794723
ContinuousOn (fun b ↦ ∫ x in Ici b, f x ∂μ) (Ici a) := by
795724
simp_rw [integral_Ici_eq_integral_Ioi]
796725
exact (hf.mono_set Ioi_subset_Ici_self).continuousOn_primitive_Ioi
797726

798-
end PrimitiveIci
799-
800-
section PrimitiveIci
801-
802-
theorem IntegrableOn.continuousOn_primitive_Iic [NoAtoms μ] {a : ℝ}
803-
(hf : IntegrableOn f (Iic a) μ) :
727+
theorem continuousOn_primitive_Iic [NoAtoms μ] {a : ℝ} (hf : IntegrableOn f (Iic a) μ) :
804728
ContinuousOn (fun b ↦ ∫ x in Iic b, f x ∂μ) (Iic a) := by
805729
simp_rw [integral_Iic_eq_integral_Iio]
806730
exact (hf.mono_set Iio_subset_Iic_self).continuousOn_primitive_Iio
807731

808-
end PrimitiveIci
732+
end IntegrableOn
809733

810734
end MeasureTheory
811735

0 commit comments

Comments
 (0)