measure_theory.integral.peak_functionMathlib.MeasureTheory.Integral.PeakFunction

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -87,11 +87,11 @@ theorem integrableOn_peak_smul_of_integrableOn_of_tendsto (hs : MeasurableSet s)
 
 variable [CompleteSpace E]
 
-#print tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux /-
+#print tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux /-
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. Auxiliary lemma
 where one assumes additionally `g x₀ = 0`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux (hs : MeasurableSet s)
+theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux (hs : MeasurableSet s)
     (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
     (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
@@ -167,13 +167,13 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux (hs : Meas
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
     _ ≤ δ * ∫ x in s, ‖g x‖ ∂μ + δ := add_le_add C B
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux
 -/
 
-#print tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto /-
+#print tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto /-
 /- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto (hs : MeasurableSet s)
+theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto (hs : MeasurableSet s)
     (h's : μ s ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
     (hiφ : (fun i => ∫ x in s, φ i x ∂μ) =ᶠ[l] 1) (hmg : IntegrableOn g s μ)
@@ -186,7 +186,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto (hs : Measurab
       (𝓝 (0 + (1 : ℝ) • g x₀)) :=
     by
     refine' tendsto.add _ (tendsto.smul (tendsto_const_nhds.congr' hiφ.symm) tendsto_const_nhds)
-    apply tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux hs hnφ hlφ hiφ
+    apply tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux hs hnφ hlφ hiφ
     · apply integrable.sub hmg
       apply integrable_on_const.2
       simp only [h's.lt_top, or_true_iff]
@@ -199,10 +199,10 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto (hs : Measurab
   simp only [h, Pi.sub_apply, smul_sub]
   rw [integral_sub hi, integral_smul_const, sub_add_cancel]
   exact integrable.smul_const (integrable_of_integral_eq_one h'i) _
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto
 -/
 
-#print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos /-
+#print tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos /-
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
@@ -212,7 +212,7 @@ Version assuming that `μ` gives positive mass to all neighborhoods of `x₀` wi
 For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
  -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
+theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
     (hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
     (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
@@ -303,14 +303,14 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
     exact (M n x hx).trans_lt hn
   have : tendsto (fun i : ℕ => ∫ x : α in s, φ i x • g x ∂μ) at_top (𝓝 (g x₀)) :=
-    tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto hs.measurable_set hs.measure_lt_top.ne
+    tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto hs.measurable_set hs.measure_lt_top.ne
       (eventually_of_forall hnφ) A (eventually_of_forall hiφ) hmg hcg
   convert this
   simp_rw [← smul_smul, integral_smul]
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
 -/
 
-#print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn /-
+#print tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn /-
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
@@ -320,7 +320,7 @@ Version assuming that `μ` gives positive mass to all open sets.
 For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
 -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
+theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
     {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
     (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
@@ -329,30 +329,30 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrab
   by
   have : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
   apply
-    tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos hs _ hc
+    tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos hs _ hc
       h'c hnc hnc₀ this hmg hcg
   intro u u_open x₀_u
   calc
     0 < μ (u ∩ interior s) :=
       (u_open.inter isOpen_interior).measure_pos μ (_root_.mem_closure_iff.1 h₀ u u_open x₀_u)
     _ ≤ μ (u ∩ s) := measure_mono (inter_subset_inter_right _ interior_subset)
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_integrable_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_integrable_on tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
 -/
 
-#print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn /-
+#print tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn /-
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
 continuous on `s`. -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
+theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
     {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
     (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
     (hmg : ContinuousOn g s) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   haveI : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
-  tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
+  tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
     (hmg.integrable_on_compact hs) (hmg x₀ this)
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
 -/
 
Diff
@@ -78,7 +78,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_tendsto (hs : MeasurableSet s)
     · apply
         mem_ℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).AEStronglyMeasurable (‖g x₀‖ + 1)
       filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurable_set)] with x hx
-      rw [inter_comm] at hx 
+      rw [inter_comm] at hx
       exact (norm_lt_of_mem_ball (hu x hx)).le
   convert A.union B
   simp only [diff_union_inter]
@@ -105,7 +105,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux (hs : Meas
       by
       apply tendsto.mono_left _ nhdsWithin_le_nhds
       exact (tendsto_id.mul tendsto_const_nhds).add tendsto_id
-    rw [MulZeroClass.zero_mul, zero_add] at A 
+    rw [MulZeroClass.zero_mul, zero_add] at A
     exact (((tendsto_order.1 A).2 ε εpos).And self_mem_nhdsWithin).exists
   suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ δ * ∫ x in s, ‖g x‖ ∂μ + δ
     by
@@ -130,7 +130,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux (hs : Meas
               (inter_subset_left _ _)
         rw [norm_smul]
         apply mul_le_mul_of_nonneg_left _ (norm_nonneg _)
-        rw [inter_comm, h'g] at hu 
+        rw [inter_comm, h'g] at hu
         exact (mem_ball_zero_iff.1 (hu x hx)).le
       _ ≤ ∫ x in s, ‖φ i x‖ * δ ∂μ := by
         apply set_integral_mono_set
@@ -192,7 +192,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto (hs : Measurab
       simp only [h's.lt_top, or_true_iff]
     · simp only [h, Pi.sub_apply, sub_self]
     · exact hcg.sub continuousWithinAt_const
-  simp only [one_smul, zero_add] at A 
+  simp only [one_smul, zero_add] at A
   refine' tendsto.congr' _ A
   filter_upwards [integrableOn_peak_smul_of_integrableOn_of_tendsto hs hlφ hiφ hmg hcg, hiφ] with i
     hi h'i
@@ -297,7 +297,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       apply tendsto.mul tendsto_const_nhds _; · infer_instance
       apply tendsto_pow_atTop_nhds_zero_of_lt_one (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
-    rw [MulZeroClass.mul_zero] at N 
+    rw [MulZeroClass.mul_zero] at N
     refine' tendsto_uniformly_on_iff.2 fun ε εpos => _
     filter_upwards [(tendsto_order.1 N).2 ε εpos] with n hn x hx
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
Diff
@@ -52,10 +52,10 @@ variable {α E ι : Type _} {hm : MeasurableSpace α} {μ : Measure α} [Topolog
   [BorelSpace α] [NormedAddCommGroup E] [NormedSpace ℝ E] {g : α → E} {l : Filter ι} {x₀ : α}
   {s : Set α} {φ : ι → α → ℝ}
 
-#print integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt /-
+#print integrableOn_peak_smul_of_integrableOn_of_tendsto /-
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `φᵢ • g` is eventually integrable. -/
-theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
+theorem integrableOn_peak_smul_of_integrableOn_of_tendsto (hs : MeasurableSet s)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
     (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ)
     (hcg : ContinuousWithinAt g s x₀) : ∀ᶠ i in l, IntegrableOn (fun x => φ i x • g x) s μ :=
@@ -82,17 +82,17 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
       exact (norm_lt_of_mem_ball (hu x hx)).le
   convert A.union B
   simp only [diff_union_inter]
-#align integrable_on_peak_smul_of_integrable_on_of_continuous_within_at integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt
+#align integrable_on_peak_smul_of_integrable_on_of_continuous_within_at integrableOn_peak_smul_of_integrableOn_of_tendsto
 -/
 
 variable [CompleteSpace E]
 
-#print tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux /-
+#print tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux /-
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. Auxiliary lemma
 where one assumes additionally `g x₀ = 0`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
-    (hs : MeasurableSet s) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
+theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux (hs : MeasurableSet s)
+    (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
     (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
     (hcg : ContinuousWithinAt g s x₀) : Tendsto (fun i : ι => ∫ x in s, φ i x • g x ∂μ) l (𝓝 0) :=
@@ -115,8 +115,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
   obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) δ
   exact mem_nhdsWithin.1 (hcg (ball_mem_nhds _ δpos))
   filter_upwards [tendsto_uniformly_on_iff.1 (hlφ u u_open x₀u) δ δpos, hiφ, hnφ,
-    integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg] with i hi h'i
-    hφpos h''i
+    integrableOn_peak_smul_of_integrableOn_of_tendsto hs hlφ hiφ hmg hcg] with i hi h'i hφpos h''i
   have B : ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ δ :=
     calc
       ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ ∫ x in s ∩ u, ‖φ i x • g x‖ ∂μ :=
@@ -168,13 +167,13 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
     _ ≤ δ * ∫ x in s, ‖g x‖ ∂μ + δ := add_le_add C B
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
 -/
 
-#print tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt /-
+#print tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto /-
 /- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
+theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto (hs : MeasurableSet s)
     (h's : μ s ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
     (hiφ : (fun i => ∫ x in s, φ i x ∂μ) =ᶠ[l] 1) (hmg : IntegrableOn g s μ)
@@ -187,7 +186,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs
       (𝓝 (0 + (1 : ℝ) • g x₀)) :=
     by
     refine' tendsto.add _ (tendsto.smul (tendsto_const_nhds.congr' hiφ.symm) tendsto_const_nhds)
-    apply tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux hs hnφ hlφ hiφ
+    apply tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux hs hnφ hlφ hiφ
     · apply integrable.sub hmg
       apply integrable_on_const.2
       simp only [h's.lt_top, or_true_iff]
@@ -195,12 +194,12 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs
     · exact hcg.sub continuousWithinAt_const
   simp only [one_smul, zero_add] at A 
   refine' tendsto.congr' _ A
-  filter_upwards [integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg,
-    hiφ] with i hi h'i
+  filter_upwards [integrableOn_peak_smul_of_integrableOn_of_tendsto hs hlφ hiφ hmg hcg, hiφ] with i
+    hi h'i
   simp only [h, Pi.sub_apply, smul_sub]
   rw [integral_sub hi, integral_smul_const, sub_add_cancel]
   exact integrable.smul_const (integrable_of_integral_eq_one h'i) _
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
 -/
 
 #print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos /-
@@ -304,8 +303,8 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
     exact (M n x hx).trans_lt hn
   have : tendsto (fun i : ℕ => ∫ x : α in s, φ i x • g x ∂μ) at_top (𝓝 (g x₀)) :=
-    tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt hs.measurable_set
-      hs.measure_lt_top.ne (eventually_of_forall hnφ) A (eventually_of_forall hiφ) hmg hcg
+    tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto hs.measurable_set hs.measure_lt_top.ne
+      (eventually_of_forall hnφ) A (eventually_of_forall hiφ) hmg hcg
   convert this
   simp_rw [← smul_smul, integral_smul]
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
Diff
@@ -296,7 +296,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
         (𝓝 ((μ (v ∩ s)).toReal⁻¹ * 0)) :=
       by
       apply tendsto.mul tendsto_const_nhds _; · infer_instance
-      apply tendsto_pow_atTop_nhds_0_of_lt_1 (div_nonneg t_pos t'_pos.le)
+      apply tendsto_pow_atTop_nhds_zero_of_lt_one (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
     rw [MulZeroClass.mul_zero] at N 
     refine' tendsto_uniformly_on_iff.2 fun ε εpos => _
Diff
@@ -282,12 +282,12 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
               exact lt_of_le_of_lt (measure_mono (inter_subset_right _ _)) hs.measure_lt_top
             · exact (I n).mono (inter_subset_right _ _) le_rfl
             · intro x hx
-              exact pow_le_pow_of_le_left t'_pos.le (le_of_lt (hv hx)) _
+              exact pow_le_pow_left t'_pos.le (le_of_lt (hv hx)) _
           _ ≤ ∫ y in s, c y ^ n ∂μ :=
             set_integral_mono_set (I n) (J n) (eventually_of_forall (inter_subset_right _ _))
       simp_rw [φ, ← div_eq_inv_mul, div_pow, div_div]
       apply div_le_div (pow_nonneg t_pos n) _ _ B
-      · exact pow_le_pow_of_le_left (hnc _ hx.1) (ht x hx) _
+      · exact pow_le_pow_left (hnc _ hx.1) (ht x hx) _
       · apply mul_pos (pow_pos (t_pos.trans_lt tt') _) (ENNReal.toReal_pos (hμ v v_open x₀_v).ne' _)
         have : μ (v ∩ s) ≤ μ s := measure_mono (inter_subset_right _ _)
         exact ne_of_lt (lt_of_le_of_lt this hs.measure_lt_top)
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 -/
-import Mathbin.MeasureTheory.Integral.SetIntegral
-import Mathbin.MeasureTheory.Function.LocallyIntegrable
+import MeasureTheory.Integral.SetIntegral
+import MeasureTheory.Function.LocallyIntegrable
 
 #align_import measure_theory.integral.peak_function from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2023 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module measure_theory.integral.peak_function
-! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
-! 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.Function.LocallyIntegrable
 
+#align_import measure_theory.integral.peak_function from "leanprover-community/mathlib"@"7e5137f579de09a059a5ce98f364a04e221aabf0"
+
 /-!
 # Integrals against peak functions
 
Diff
@@ -41,11 +41,13 @@ open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
 
 open scoped Topology ENNReal
 
+#print Set.disjoint_sdiff_inter /-
 /-- This lemma exists for finsets, but not for sets currently. porting note: move to
 data.set.basic after the port. -/
 theorem Set.disjoint_sdiff_inter {α : Type _} (s t : Set α) : Disjoint (s \ t) (s ∩ t) :=
   disjoint_of_subset_right (inter_subset_right _ _) disjoint_sdiff_left
 #align set.disjoint_sdiff_inter Set.disjoint_sdiff_inter
+-/
 
 open Set
 
@@ -53,6 +55,7 @@ variable {α E ι : Type _} {hm : MeasurableSpace α} {μ : Measure α} [Topolog
   [BorelSpace α] [NormedAddCommGroup E] [NormedSpace ℝ E] {g : α → E} {l : Filter ι} {x₀ : α}
   {s : Set α} {φ : ι → α → ℝ}
 
+#print integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt /-
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `φᵢ • g` is eventually integrable. -/
 theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
@@ -83,9 +86,11 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
   convert A.union B
   simp only [diff_union_inter]
 #align integrable_on_peak_smul_of_integrable_on_of_continuous_within_at integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt
+-/
 
 variable [CompleteSpace E]
 
+#print tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux /-
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. Auxiliary lemma
 where one assumes additionally `g x₀ = 0`. -/
@@ -167,7 +172,9 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
     _ ≤ δ * ∫ x in s, ‖g x‖ ∂μ + δ := add_le_add C B
 #align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
+-/
 
+#print tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt /-
 /- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
 `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. -/
 theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
@@ -197,7 +204,9 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs
   rw [integral_sub hi, integral_smul_const, sub_add_cancel]
   exact integrable.smul_const (integrable_of_integral_eq_one h'i) _
 #align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt
+-/
 
+#print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos /-
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
@@ -303,7 +312,9 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
   convert this
   simp_rw [← smul_smul, integral_smul]
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
+-/
 
+#print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn /-
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
@@ -330,7 +341,9 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrab
       (u_open.inter isOpen_interior).measure_pos μ (_root_.mem_closure_iff.1 h₀ u u_open x₀_u)
     _ ≤ μ (u ∩ s) := measure_mono (inter_subset_inter_right _ interior_subset)
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_integrable_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
+-/
 
+#print tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn /-
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
@@ -345,4 +358,5 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuo
   tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
     (hmg.integrable_on_compact hs) (hmg x₀ this)
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
+-/
 
Diff
@@ -57,7 +57,7 @@ variable {α E ι : Type _} {hm : MeasurableSpace α} {μ : Measure α} [Topolog
 `g` is integrable and continuous at `x₀`, then `φᵢ • g` is eventually integrable. -/
 theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : ∀ᶠ i in l, (∫ x in s, φ i x ∂μ) = 1) (hmg : IntegrableOn g s μ)
+    (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ)
     (hcg : ContinuousWithinAt g s x₀) : ∀ᶠ i in l, IntegrableOn (fun x => φ i x • g x) s μ :=
   by
   obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) 1
@@ -92,20 +92,20 @@ where one assumes additionally `g x₀ = 0`. -/
 theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
     (hs : MeasurableSet s) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : ∀ᶠ i in l, (∫ x in s, φ i x ∂μ) = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
+    (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
     (hcg : ContinuousWithinAt g s x₀) : Tendsto (fun i : ι => ∫ x in s, φ i x • g x ∂μ) l (𝓝 0) :=
   by
   refine' Metric.tendsto_nhds.2 fun ε εpos => _
-  obtain ⟨δ, hδ, δpos⟩ : ∃ δ, (δ * ∫ x in s, ‖g x‖ ∂μ) + δ < ε ∧ 0 < δ :=
+  obtain ⟨δ, hδ, δpos⟩ : ∃ δ, δ * ∫ x in s, ‖g x‖ ∂μ + δ < ε ∧ 0 < δ :=
     by
     have A :
-      tendsto (fun δ => (δ * ∫ x in s, ‖g x‖ ∂μ) + δ) (𝓝[>] 0) (𝓝 ((0 * ∫ x in s, ‖g x‖ ∂μ) + 0)) :=
+      tendsto (fun δ => δ * ∫ x in s, ‖g x‖ ∂μ + δ) (𝓝[>] 0) (𝓝 (0 * ∫ x in s, ‖g x‖ ∂μ + 0)) :=
       by
       apply tendsto.mono_left _ nhdsWithin_le_nhds
       exact (tendsto_id.mul tendsto_const_nhds).add tendsto_id
     rw [MulZeroClass.zero_mul, zero_add] at A 
     exact (((tendsto_order.1 A).2 ε εpos).And self_mem_nhdsWithin).exists
-  suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ
+  suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ δ * ∫ x in s, ‖g x‖ ∂μ + δ
     by
     filter_upwards [this] with i hi
     simp only [dist_zero_right]
@@ -159,13 +159,13 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
         · exact eventually_of_forall fun x => norm_nonneg _
         · apply eventually_of_forall; exact diff_subset s u
   calc
-    ‖∫ x in s, φ i x • g x ∂μ‖ = ‖(∫ x in s \ u, φ i x • g x ∂μ) + ∫ x in s ∩ u, φ i x • g x ∂μ‖ :=
+    ‖∫ x in s, φ i x • g x ∂μ‖ = ‖∫ x in s \ u, φ i x • g x ∂μ + ∫ x in s ∩ u, φ i x • g x ∂μ‖ :=
       by
       conv_lhs => rw [← diff_union_inter s u]
       rw [integral_union (disjoint_sdiff_inter _ _) (hs.inter u_open.measurable_set)
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
-    _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ := add_le_add C B
+    _ ≤ δ * ∫ x in s, ‖g x‖ ∂μ + δ := add_le_add C B
 #align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
 
 /- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
@@ -179,7 +179,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs
   by
   let h := g - fun y => g x₀
   have A :
-    tendsto (fun i : ι => (∫ x in s, φ i x • h x ∂μ) + (∫ x in s, φ i x ∂μ) • g x₀) l
+    tendsto (fun i : ι => ∫ x in s, φ i x • h x ∂μ + (∫ x in s, φ i x ∂μ) • g x₀) l
       (𝓝 (0 + (1 : ℝ) • g x₀)) :=
     by
     refine' tendsto.add _ (tendsto.smul (tendsto_const_nhds.congr' hiφ.symm) tendsto_const_nhds)
@@ -241,7 +241,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       _root_.continuous_on_iff.1 hc x₀ h₀ (Ioi (0 : ℝ)) isOpen_Ioi hnc₀
     apply (hμ u u_open x₀_u).trans_le
     exact measure_mono fun x hx => ⟨ne_of_gt (pow_pos (hu hx) _), hx.2⟩
-  have hiφ : ∀ n, (∫ x in s, φ n x ∂μ) = 1 := fun n => by
+  have hiφ : ∀ n, ∫ x in s, φ n x ∂μ = 1 := fun n => by
     rw [integral_mul_left, inv_mul_cancel (P n).ne']
   have A : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 at_top (s \ u) :=
     by
Diff
@@ -141,7 +141,6 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
         apply set_integral_congr hs fun x hx => _
         rw [Real.norm_of_nonneg (hφpos _ hx)]
       _ = δ := by rw [integral_mul_right, h'i, one_mul]
-      
   have C : ‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ δ * ∫ x in s, ‖g x‖ ∂μ :=
     calc
       ‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ ∫ x in s \ u, ‖φ i x • g x‖ ∂μ :=
@@ -159,7 +158,6 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
         apply mul_le_mul_of_nonneg_left (set_integral_mono_set hmg.norm _ _) δpos.le
         · exact eventually_of_forall fun x => norm_nonneg _
         · apply eventually_of_forall; exact diff_subset s u
-      
   calc
     ‖∫ x in s, φ i x • g x ∂μ‖ = ‖(∫ x in s \ u, φ i x • g x ∂μ) + ∫ x in s ∩ u, φ i x • g x ∂μ‖ :=
       by
@@ -168,7 +166,6 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
     _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ := add_le_add C B
-    
 #align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
 
 /- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
@@ -282,7 +279,6 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
               exact pow_le_pow_of_le_left t'_pos.le (le_of_lt (hv hx)) _
           _ ≤ ∫ y in s, c y ^ n ∂μ :=
             set_integral_mono_set (I n) (J n) (eventually_of_forall (inter_subset_right _ _))
-          
       simp_rw [φ, ← div_eq_inv_mul, div_pow, div_div]
       apply div_le_div (pow_nonneg t_pos n) _ _ B
       · exact pow_le_pow_of_le_left (hnc _ hx.1) (ht x hx) _
@@ -333,7 +329,6 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrab
     0 < μ (u ∩ interior s) :=
       (u_open.inter isOpen_interior).measure_pos μ (_root_.mem_closure_iff.1 h₀ u u_open x₀_u)
     _ ≤ μ (u ∩ s) := measure_mono (inter_subset_inter_right _ interior_subset)
-    
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_integrable_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
 
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module measure_theory.integral.peak_function
-! leanprover-community/mathlib commit 13b0d72fd8533ba459ac66e9a885e35ffabb32b2
+! leanprover-community/mathlib commit 7e5137f579de09a059a5ce98f364a04e221aabf0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.MeasureTheory.Function.LocallyIntegrable
 /-!
 # Integrals against peak functions
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 A sequence of peak functions is a sequence of functions with average one concentrating around
 a point `x₀`. Given such a sequence `φₙ`, then `∫ φₙ g` tends to `g x₀` in many situations, with
 a whole zoo of possible assumptions on `φₙ` and `g`. This file is devoted to such results.
Diff
@@ -207,7 +207,7 @@ Version assuming that `μ` gives positive mass to all neighborhoods of `x₀` wi
 For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
  -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhds_within_pos
+theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
     (hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
     (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
@@ -303,7 +303,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       hs.measure_lt_top.ne (eventually_of_forall hnφ) A (eventually_of_forall hiφ) hmg hcg
   convert this
   simp_rw [← smul_smul, integral_smul]
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhds_within_pos
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
 
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
@@ -323,7 +323,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrab
   by
   have : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
   apply
-    tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhds_within_pos hs _ hc
+    tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos hs _ hc
       h'c hnc hnc₀ this hmg hcg
   intro u u_open x₀_u
   calc
Diff
@@ -59,14 +59,14 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
   by
   obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) 1
   exact mem_nhdsWithin.1 (hcg (ball_mem_nhds _ zero_lt_one))
-  filter_upwards [tendsto_uniformly_on_iff.1 (hlφ u u_open x₀u) 1 zero_lt_one, hiφ]with i hi h'i
+  filter_upwards [tendsto_uniformly_on_iff.1 (hlφ u u_open x₀u) 1 zero_lt_one, hiφ] with i hi h'i
   have A : integrable_on (fun x => φ i x • g x) (s \ u) μ :=
     by
     refine' integrable.smul_of_top_right (hmg.mono (diff_subset _ _) le_rfl) _
     apply
       mem_ℒp_top_of_bound
         ((integrable_of_integral_eq_one h'i).AEStronglyMeasurable.mono_set (diff_subset _ _)) 1
-    filter_upwards [self_mem_ae_restrict (hs.diff u_open.measurable_set)]with x hx
+    filter_upwards [self_mem_ae_restrict (hs.diff u_open.measurable_set)] with x hx
     simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
   have B : integrable_on (fun x => φ i x • g x) (s ∩ u) μ :=
     by
@@ -74,7 +74,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
     · exact integrable_on.mono_set (integrable_of_integral_eq_one h'i) (inter_subset_left _ _)
     · apply
         mem_ℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).AEStronglyMeasurable (‖g x₀‖ + 1)
-      filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurable_set)]with x hx
+      filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurable_set)] with x hx
       rw [inter_comm] at hx 
       exact (norm_lt_of_mem_ball (hu x hx)).le
   convert A.union B
@@ -104,14 +104,14 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
     exact (((tendsto_order.1 A).2 ε εpos).And self_mem_nhdsWithin).exists
   suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ
     by
-    filter_upwards [this]with i hi
+    filter_upwards [this] with i hi
     simp only [dist_zero_right]
     exact hi.trans_lt hδ
   obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) δ
   exact mem_nhdsWithin.1 (hcg (ball_mem_nhds _ δpos))
   filter_upwards [tendsto_uniformly_on_iff.1 (hlφ u u_open x₀u) δ δpos, hiφ, hnφ,
-    integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg
-      hcg]with i hi h'i hφpos h''i
+    integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg] with i hi h'i
+    hφpos h''i
   have B : ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ δ :=
     calc
       ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ ∫ x in s ∩ u, ‖φ i x • g x‖ ∂μ :=
@@ -192,7 +192,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs
   simp only [one_smul, zero_add] at A 
   refine' tendsto.congr' _ A
   filter_upwards [integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg,
-    hiφ]with i hi h'i
+    hiφ] with i hi h'i
   simp only [h, Pi.sub_apply, smul_sub]
   rw [integral_sub hi, integral_smul_const, sub_add_cancel]
   exact integrable.smul_const (integrable_of_integral_eq_one h'i) _
@@ -208,7 +208,7 @@ For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
  -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhds_within_pos
-    [MetrizableSpace α] [LocallyFiniteMeasure μ] (hs : IsCompact s)
+    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
     (hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
     (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
     (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
@@ -232,7 +232,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
   have J : ∀ n, 0 ≤ᵐ[μ.restrict s] fun x : α => c x ^ n :=
     by
     intro n
-    filter_upwards [ae_restrict_mem hs.measurable_set]with x hx
+    filter_upwards [ae_restrict_mem hs.measurable_set] with x hx
     exact pow_nonneg (hnc x hx) n
   have P : ∀ n, 0 < ∫ x in s, c x ^ n ∂μ := by
     intro n
@@ -295,7 +295,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       exact (div_lt_one t'_pos).2 tt'
     rw [MulZeroClass.mul_zero] at N 
     refine' tendsto_uniformly_on_iff.2 fun ε εpos => _
-    filter_upwards [(tendsto_order.1 N).2 ε εpos]with n hn x hx
+    filter_upwards [(tendsto_order.1 N).2 ε εpos] with n hn x hx
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
     exact (M n x hx).trans_lt hn
   have : tendsto (fun i : ℕ => ∫ x : α in s, φ i x • g x ∂μ) at_top (𝓝 (g x₀)) :=
@@ -315,10 +315,10 @@ For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
 -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
-    [MetrizableSpace α] [LocallyFiniteMeasure μ] [OpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
-    (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
-    (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : IntegrableOn g s μ)
-    (hcg : ContinuousWithinAt g s x₀) :
+    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
+    {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
+    (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
+    (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   by
   have : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
@@ -338,9 +338,10 @@ then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
 continuous on `s`. -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
-    [MetrizableSpace α] [LocallyFiniteMeasure μ] [OpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
-    (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
-    (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : ContinuousOn g s) :
+    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
+    {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
+    (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
+    (hmg : ContinuousOn g s) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   haveI : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
   tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
Diff
@@ -75,7 +75,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
     · apply
         mem_ℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).AEStronglyMeasurable (‖g x₀‖ + 1)
       filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurable_set)]with x hx
-      rw [inter_comm] at hx
+      rw [inter_comm] at hx 
       exact (norm_lt_of_mem_ball (hu x hx)).le
   convert A.union B
   simp only [diff_union_inter]
@@ -100,7 +100,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
       by
       apply tendsto.mono_left _ nhdsWithin_le_nhds
       exact (tendsto_id.mul tendsto_const_nhds).add tendsto_id
-    rw [MulZeroClass.zero_mul, zero_add] at A
+    rw [MulZeroClass.zero_mul, zero_add] at A 
     exact (((tendsto_order.1 A).2 ε εpos).And self_mem_nhdsWithin).exists
   suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ
     by
@@ -126,7 +126,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
               (inter_subset_left _ _)
         rw [norm_smul]
         apply mul_le_mul_of_nonneg_left _ (norm_nonneg _)
-        rw [inter_comm, h'g] at hu
+        rw [inter_comm, h'g] at hu 
         exact (mem_ball_zero_iff.1 (hu x hx)).le
       _ ≤ ∫ x in s, ‖φ i x‖ * δ ∂μ := by
         apply set_integral_mono_set
@@ -189,7 +189,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs
       simp only [h's.lt_top, or_true_iff]
     · simp only [h, Pi.sub_apply, sub_self]
     · exact hcg.sub continuousWithinAt_const
-  simp only [one_smul, zero_add] at A
+  simp only [one_smul, zero_add] at A 
   refine' tendsto.congr' _ A
   filter_upwards [integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg,
     hiφ]with i hi h'i
@@ -293,7 +293,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       apply tendsto.mul tendsto_const_nhds _; · infer_instance
       apply tendsto_pow_atTop_nhds_0_of_lt_1 (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
-    rw [MulZeroClass.mul_zero] at N
+    rw [MulZeroClass.mul_zero] at N 
     refine' tendsto_uniformly_on_iff.2 fun ε εpos => _
     filter_upwards [(tendsto_order.1 N).2 ε εpos]with n hn x hx
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
Diff
@@ -36,7 +36,7 @@ Note that there are related results about convolution with respect to peak funct
 
 open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
 
-open Topology ENNReal
+open scoped Topology ENNReal
 
 /-- This lemma exists for finsets, but not for sets currently. porting note: move to
 data.set.basic after the port. -/
Diff
@@ -132,8 +132,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
         apply set_integral_mono_set
         · exact (integrable_of_integral_eq_one h'i).norm.mul_const _
         · exact eventually_of_forall fun x => mul_nonneg (norm_nonneg _) δpos.le
-        · apply eventually_of_forall
-          exact inter_subset_left s u
+        · apply eventually_of_forall; exact inter_subset_left s u
       _ = ∫ x in s, φ i x * δ ∂μ :=
         by
         apply set_integral_congr hs fun x hx => _
@@ -156,8 +155,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
         rw [integral_mul_left]
         apply mul_le_mul_of_nonneg_left (set_integral_mono_set hmg.norm _ _) δpos.le
         · exact eventually_of_forall fun x => norm_nonneg _
-        · apply eventually_of_forall
-          exact diff_subset s u
+        · apply eventually_of_forall; exact diff_subset s u
       
   calc
     ‖∫ x in s, φ i x • g x ∂μ‖ = ‖(∫ x in s \ u, φ i x • g x ∂μ) + ∫ x in s ∩ u, φ i x • g x ∂μ‖ :=
@@ -292,8 +290,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       tendsto (fun n => (μ (v ∩ s)).toReal⁻¹ * (t / t') ^ n) at_top
         (𝓝 ((μ (v ∩ s)).toReal⁻¹ * 0)) :=
       by
-      apply tendsto.mul tendsto_const_nhds _
-      · infer_instance
+      apply tendsto.mul tendsto_const_nhds _; · infer_instance
       apply tendsto_pow_atTop_nhds_0_of_lt_1 (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
     rw [MulZeroClass.mul_zero] at N
@@ -324,9 +321,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrab
     (hcg : ContinuousWithinAt g s x₀) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   by
-  have : x₀ ∈ s := by
-    rw [← hs.is_closed.closure_eq]
-    exact closure_mono interior_subset h₀
+  have : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
   apply
     tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhds_within_pos hs _ hc
       h'c hnc hnc₀ this hmg hcg
@@ -347,9 +342,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuo
     (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
     (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : ContinuousOn g s) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
-  haveI : x₀ ∈ s := by
-    rw [← hs.is_closed.closure_eq]
-    exact closure_mono interior_subset h₀
+  haveI : x₀ ∈ s := by rw [← hs.is_closed.closure_eq]; exact closure_mono interior_subset h₀
   tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
     (hmg.integrable_on_compact hs) (hmg x₀ this)
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 
 ! This file was ported from Lean 3 source module measure_theory.integral.peak_function
-! leanprover-community/mathlib commit 59694bd07f0a39c5beccba34bd9f413a160782bf
+! leanprover-community/mathlib commit 13b0d72fd8533ba459ac66e9a885e35ffabb32b2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -62,7 +62,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
   filter_upwards [tendsto_uniformly_on_iff.1 (hlφ u u_open x₀u) 1 zero_lt_one, hiφ]with i hi h'i
   have A : integrable_on (fun x => φ i x • g x) (s \ u) μ :=
     by
-    apply integrable.smul_of_top_right (hmg.mono (diff_subset _ _) le_rfl)
+    refine' integrable.smul_of_top_right (hmg.mono (diff_subset _ _) le_rfl) _
     apply
       mem_ℒp_top_of_bound
         ((integrable_of_integral_eq_one h'i).AEStronglyMeasurable.mono_set (diff_subset _ _)) 1
Diff
@@ -65,7 +65,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
     apply integrable.smul_of_top_right (hmg.mono (diff_subset _ _) le_rfl)
     apply
       mem_ℒp_top_of_bound
-        ((integrable_of_integral_eq_one h'i).AeStronglyMeasurable.mono_set (diff_subset _ _)) 1
+        ((integrable_of_integral_eq_one h'i).AEStronglyMeasurable.mono_set (diff_subset _ _)) 1
     filter_upwards [self_mem_ae_restrict (hs.diff u_open.measurable_set)]with x hx
     simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
   have B : integrable_on (fun x => φ i x • g x) (s ∩ u) μ :=
@@ -73,7 +73,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
     apply integrable.smul_of_top_left
     · exact integrable_on.mono_set (integrable_of_integral_eq_one h'i) (inter_subset_left _ _)
     · apply
-        mem_ℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).AeStronglyMeasurable (‖g x₀‖ + 1)
+        mem_ℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).AEStronglyMeasurable (‖g x₀‖ + 1)
       filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurable_set)]with x hx
       rw [inter_comm] at hx
       exact (norm_lt_of_mem_ball (hu x hx)).le
Diff
@@ -318,7 +318,7 @@ For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
 -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
-    [MetrizableSpace α] [LocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
+    [MetrizableSpace α] [LocallyFiniteMeasure μ] [OpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
     (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
     (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : IntegrableOn g s μ)
     (hcg : ContinuousWithinAt g s x₀) :
@@ -343,7 +343,7 @@ then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
 continuous on `s`. -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
-    [MetrizableSpace α] [LocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
+    [MetrizableSpace α] [LocallyFiniteMeasure μ] [OpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
     (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
     (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : ContinuousOn g s) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
Diff
@@ -210,7 +210,7 @@ For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
  -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhds_within_pos
-    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
+    [MetrizableSpace α] [LocallyFiniteMeasure μ] (hs : IsCompact s)
     (hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
     (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
     (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
@@ -318,10 +318,10 @@ For a less precise but more usable version, see
 `tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on`.
 -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
-    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
-    {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
-    (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
-    (hmg : IntegrableOn g s μ) (hcg : ContinuousWithinAt g s x₀) :
+    [MetrizableSpace α] [LocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
+    (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
+    (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : IntegrableOn g s μ)
+    (hcg : ContinuousWithinAt g s x₀) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   by
   have : x₀ ∈ s := by
@@ -343,10 +343,9 @@ then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
 continuous on `s`. -/
 theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
-    [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
-    {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
-    (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
-    (hmg : ContinuousOn g s) :
+    [MetrizableSpace α] [LocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s) {c : α → ℝ}
+    (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x)
+    (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s)) (hmg : ContinuousOn g s) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   haveI : x₀ ∈ s := by
     rw [← hs.is_closed.closure_eq]
Diff
@@ -65,7 +65,7 @@ theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : Measu
     apply integrable.smul_of_top_right (hmg.mono (diff_subset _ _) le_rfl)
     apply
       mem_ℒp_top_of_bound
-        ((integrable_of_integral_eq_one h'i).AeStronglyMeasurable.monoSet (diff_subset _ _)) 1
+        ((integrable_of_integral_eq_one h'i).AeStronglyMeasurable.mono_set (diff_subset _ _)) 1
     filter_upwards [self_mem_ae_restrict (hs.diff u_open.measurable_set)]with x hx
     simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
   have B : integrable_on (fun x => φ i x • g x) (s ∩ u) μ :=
@@ -230,7 +230,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
     apply mul_nonneg (inv_nonneg.2 _) (pow_nonneg (hnc x hx) _)
     exact set_integral_nonneg hs.measurable_set fun x hx => pow_nonneg (hnc x hx) _
   have I : ∀ n, integrable_on (fun x => c x ^ n) s μ := fun n =>
-    ContinuousOn.integrableOnCompact hs (hc.pow n)
+    ContinuousOn.integrableOn_compact hs (hc.pow n)
   have J : ∀ n, 0 ≤ᵐ[μ.restrict s] fun x : α => c x ^ n :=
     by
     intro n
Diff
@@ -100,7 +100,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
       by
       apply tendsto.mono_left _ nhdsWithin_le_nhds
       exact (tendsto_id.mul tendsto_const_nhds).add tendsto_id
-    rw [zero_mul, zero_add] at A
+    rw [MulZeroClass.zero_mul, zero_add] at A
     exact (((tendsto_order.1 A).2 ε εpos).And self_mem_nhdsWithin).exists
   suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ
     by
@@ -296,7 +296,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       · infer_instance
       apply tendsto_pow_atTop_nhds_0_of_lt_1 (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
-    rw [mul_zero] at N
+    rw [MulZeroClass.mul_zero] at N
     refine' tendsto_uniformly_on_iff.2 fun ε εpos => _
     filter_upwards [(tendsto_order.1 N).2 ε εpos]with n hn x hx
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
Diff
@@ -165,7 +165,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
       conv_lhs => rw [← diff_union_inter s u]
       rw [integral_union (disjoint_sdiff_inter _ _) (hs.inter u_open.measurable_set)
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
-    _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := norm_add_le _ _
+    _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
     _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ := add_le_add C B
     
 #align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
Diff
@@ -36,7 +36,7 @@ Note that there are related results about convolution with respect to peak funct
 
 open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
 
-open Topology Ennreal
+open Topology ENNReal
 
 /-- This lemma exists for finsets, but not for sets currently. porting note: move to
 data.set.basic after the port. -/
@@ -285,7 +285,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       simp_rw [φ, ← div_eq_inv_mul, div_pow, div_div]
       apply div_le_div (pow_nonneg t_pos n) _ _ B
       · exact pow_le_pow_of_le_left (hnc _ hx.1) (ht x hx) _
-      · apply mul_pos (pow_pos (t_pos.trans_lt tt') _) (Ennreal.toReal_pos (hμ v v_open x₀_v).ne' _)
+      · apply mul_pos (pow_pos (t_pos.trans_lt tt') _) (ENNReal.toReal_pos (hμ v v_open x₀_v).ne' _)
         have : μ (v ∩ s) ≤ μ s := measure_mono (inter_subset_right _ _)
         exact ne_of_lt (lt_of_le_of_lt this hs.measure_lt_top)
     have N :

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
@@ -17,10 +17,10 @@ functions are also called approximations of unity, or approximations of identity
 
 ## Main results
 
-* `tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto`: If a sequence of peak
+* `tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto`: If a sequence of peak
   functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
   `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `g x₀`.
-* `tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`:
+* `tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`:
   If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
   then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
   concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀`
@@ -94,7 +94,7 @@ variable [CompleteSpace E]
 integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
 has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`.
 Auxiliary lemma where one assumes additionally `a = 0`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
+theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux
     (hs : MeasurableSet s) (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
     (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
@@ -137,7 +137,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
       ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ ∫ x in s ∩ u, ‖φ i x • g x‖ ∂μ :=
         norm_integral_le_integral_norm _
       _ ≤ ∫ x in s ∩ u, ‖φ i x‖ * δ ∂μ := by
-        refine' set_integral_mono_on _ _ (hs.inter u_open.measurableSet) fun x hx => _
+        refine' setIntegral_mono_on _ _ (hs.inter u_open.measurableSet) fun x hx => _
         · exact IntegrableOn.mono_set h''i.norm (inter_subset_left _ _)
         · exact IntegrableOn.mono_set (I.norm.mul_const _) ut
         rw [norm_smul]
@@ -145,12 +145,12 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
         rw [inter_comm] at hu
         exact (mem_ball_zero_iff.1 (hu x hx)).le
       _ ≤ ∫ x in t, ‖φ i x‖ * δ ∂μ := by
-        apply set_integral_mono_set
+        apply setIntegral_mono_set
         · exact I.norm.mul_const _
         · exact eventually_of_forall fun x => mul_nonneg (norm_nonneg _) δpos.le
         · exact eventually_of_forall ut
       _ = ∫ x in t, φ i x * δ ∂μ := by
-        apply set_integral_congr ht fun x hx => ?_
+        apply setIntegral_congr ht fun x hx => ?_
         rw [Real.norm_of_nonneg (hφpos _ (hts hx))]
       _ = (∫ x in t, φ i x ∂μ) * δ := by rw [integral_mul_right]
       _ ≤ 2 * δ := by gcongr; linarith [(le_abs_self _).trans h'i.le]
@@ -159,7 +159,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
       ‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ ∫ x in s \ u, ‖φ i x • g x‖ ∂μ :=
         norm_integral_le_integral_norm _
       _ ≤ ∫ x in s \ u, δ * ‖g x‖ ∂μ := by
-        refine' set_integral_mono_on _ _ (hs.diff u_open.measurableSet) fun x hx => _
+        refine' setIntegral_mono_on _ _ (hs.diff u_open.measurableSet) fun x hx => _
         · exact IntegrableOn.mono_set h''i.norm (diff_subset _ _)
         · exact IntegrableOn.mono_set (hmg.norm.const_mul _) (diff_subset _ _)
         rw [norm_smul]
@@ -167,7 +167,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
         simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
       _ ≤ δ * ∫ x in s, ‖g x‖ ∂μ := by
         rw [integral_mul_left]
-        apply mul_le_mul_of_nonneg_left (set_integral_mono_set hmg.norm _ _) δpos.le
+        apply mul_le_mul_of_nonneg_left (setIntegral_mono_set hmg.norm _ _) δpos.le
         · filter_upwards with x using norm_nonneg _
         · filter_upwards using diff_subset s u
   calc
@@ -178,14 +178,14 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := norm_add_le _ _
     _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ := add_le_add C B
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
-@[deprecated] alias tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux :=
-  tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux -- deprecated on 2024-02-20
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux
+@[deprecated] alias tendsto_setIntegral_peak_smul_of_integrableOn_of_continuousWithinAt_aux :=
+  tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux -- deprecated on 2024-02-20
 
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
 integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
 has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`. Version localized to a subset. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
+theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto
     (hs : MeasurableSet s) {t : Set α} (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
     (h't : μ t ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
@@ -197,7 +197,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
   have A : Tendsto (fun i : ι => (∫ x in s, φ i x • h x ∂μ) + (∫ x in t, φ i x ∂μ) • a) l
       (𝓝 (0 + (1 : ℝ) • a)) := by
     refine' Tendsto.add _ (Tendsto.smul hiφ tendsto_const_nhds)
-    apply tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux hs ht hts h'ts
+    apply tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto_aux hs ht hts h'ts
         hnφ hlφ hiφ h'iφ
     · apply hmg.sub
       simp only [integrable_indicator_iff ht, integrableOn_const, ht, Measure.restrict_apply]
@@ -213,15 +213,15 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
     hlφ hiφ h'iφ hmg hcg,
     (tendsto_order.1 (tendsto_iff_norm_sub_tendsto_zero.1 hiφ)).2 1 zero_lt_one] with i hi h'i
   simp only [h, Pi.sub_apply, smul_sub, ← indicator_smul_apply]
-  rw [integral_sub hi, set_integral_indicator ht, inter_eq_right.mpr hts,
+  rw [integral_sub hi, setIntegral_indicator ht, inter_eq_right.mpr hts,
     integral_smul_const, sub_add_cancel]
   rw [integrable_indicator_iff ht]
   apply Integrable.smul_const
   rw [restrict_restrict ht, inter_eq_left.mpr hts]
   exact .of_integral_ne_zero (fun h ↦ by simp [h] at h'i)
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
-@[deprecated] alias tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt :=
-  tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto -- deprecated on 2024-02-20
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto
+@[deprecated] alias tendsto_setIntegral_peak_smul_of_integrableOn_of_continuousWithinAt :=
+  tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto -- deprecated on 2024-02-20
 
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
 integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
@@ -235,7 +235,7 @@ theorem tendsto_integral_peak_smul_of_integrable_of_tendsto
     (hmg : Integrable g μ) (hcg : Tendsto g (𝓝 x₀) (𝓝 a)) :
     Tendsto (fun i : ι ↦ ∫ x, φ i x • g x ∂μ) l (𝓝 a) := by
   suffices Tendsto (fun i : ι ↦ ∫ x in univ, φ i x • g x ∂μ) l (𝓝 a) by simpa
-  exact tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto MeasurableSet.univ ht (x₀ := x₀)
+  exact tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto MeasurableSet.univ ht (x₀ := x₀)
     (subset_univ _) (by simpa [nhdsWithin_univ]) h't (by simpa)
     (by simpa [← compl_eq_univ_diff] using hlφ) hiφ
     (by simpa) (by simpa) (by simpa [nhdsWithin_univ])
@@ -251,9 +251,9 @@ integrable on `s` and continuous at `x₀`.
 
 Version assuming that `μ` gives positive mass to all neighborhoods of `x₀` within `s`.
 For a less precise but more usable version, see
-`tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
+`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
  -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
+theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] (hs : IsCompact s)
     (hμ : ∀ u, IsOpen u → x₀ ∈ u → 0 < μ (u ∩ s)) {c : α → ℝ} (hc : ContinuousOn c s)
     (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀) (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ s)
@@ -261,7 +261,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ)
       atTop (𝓝 (g x₀)) := by
   /- We apply the general result
-    `tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt` to the sequence of
+    `tendsto_setIntegral_peak_smul_of_integrableOn_of_continuousWithinAt` to the sequence of
     peak functions `φₙ = (c x) ^ n / ∫ (c x) ^ n`. The only nontrivial bit is to check that this
     sequence converges uniformly to zero on any set `s \ u` away from `x₀`. By compactness, the
     function `c` is bounded by `t < c x₀` there. Consider `t' ∈ (t, c x₀)`, and a neighborhood `v`
@@ -272,7 +272,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
   have hnφ : ∀ n, ∀ x ∈ s, 0 ≤ φ n x := by
     intro n x hx
     apply mul_nonneg (inv_nonneg.2 _) (pow_nonneg (hnc x hx) _)
-    exact set_integral_nonneg hs.measurableSet fun x hx => pow_nonneg (hnc x hx) _
+    exact setIntegral_nonneg hs.measurableSet fun x hx => pow_nonneg (hnc x hx) _
   have I : ∀ n, IntegrableOn (fun x => c x ^ n) s μ := fun n =>
     ContinuousOn.integrableOn_compact hs (hc.pow n)
   have J : ∀ n, 0 ≤ᵐ[μ.restrict s] fun x : α => c x ^ n := by
@@ -281,7 +281,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
     exact pow_nonneg (hnc x hx) n
   have P : ∀ n, (0 : ℝ) < ∫ x in s, c x ^ n ∂μ := by
     intro n
-    refine' (set_integral_pos_iff_support_of_nonneg_ae (J n) (I n)).2 _
+    refine' (setIntegral_pos_iff_support_of_nonneg_ae (J n) (I n)).2 _
     obtain ⟨u, u_open, x₀_u, hu⟩ : ∃ u : Set α, IsOpen u ∧ x₀ ∈ u ∧ u ∩ s ⊆ c ⁻¹' Ioi 0 :=
       _root_.continuousOn_iff.1 hc x₀ h₀ (Ioi (0 : ℝ)) isOpen_Ioi hnc₀
     apply (hμ u u_open x₀_u).trans_le
@@ -311,14 +311,14 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
             simp only [integral_const, Measure.restrict_apply, MeasurableSet.univ, univ_inter,
               Algebra.id.smul_eq_mul, mul_comm]
           _ ≤ ∫ y in v ∩ s, c y ^ n ∂μ := by
-            apply set_integral_mono_on _ _ (v_open.measurableSet.inter hs.measurableSet) _
+            apply setIntegral_mono_on _ _ (v_open.measurableSet.inter hs.measurableSet) _
             · apply integrableOn_const.2 (Or.inr _)
               exact lt_of_le_of_lt (measure_mono (inter_subset_right _ _)) hs.measure_lt_top
             · exact (I n).mono (inter_subset_right _ _) le_rfl
             · intro x hx
               exact pow_le_pow_left t'_pos.le (le_of_lt (hv hx)) _
           _ ≤ ∫ y in s, c y ^ n ∂μ :=
-            set_integral_mono_set (I n) (J n) (eventually_of_forall (inter_subset_right _ _))
+            setIntegral_mono_set (I n) (J n) (eventually_of_forall (inter_subset_right _ _))
       simp_rw [φ, ← div_eq_inv_mul, div_pow, div_div]
       apply div_le_div (pow_nonneg t_pos n) _ _ B
       · exact pow_le_pow_left (hnc _ hx.1) (ht x hx) _
@@ -341,12 +341,12 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       tendsto_const_nhds.congr (fun n ↦ (hiφ n).symm)
     have C : ∀ᶠ (i : ℕ) in atTop, AEStronglyMeasurable (fun x ↦ φ i x) (μ.restrict s) := by
       apply eventually_of_forall (fun n ↦ ((I n).const_mul _).aestronglyMeasurable)
-    exact tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto hs.measurableSet
+    exact tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto hs.measurableSet
       hs.measurableSet (Subset.rfl) (self_mem_nhdsWithin)
       hs.measure_lt_top.ne (eventually_of_forall hnφ) A B C hmg hcg
   convert this
   simp_rw [φ, ← smul_smul, integral_smul]
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
 
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
@@ -355,9 +355,9 @@ integrable on `s` and continuous at `x₀`.
 
 Version assuming that `μ` gives positive mass to all open sets.
 For a less precise but more usable version, see
-`tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
+`tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`.
 -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
+theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
     {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
     (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
@@ -366,29 +366,29 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrab
       (𝓝 (g x₀)) := by
   have : x₀ ∈ s := by rw [← hs.isClosed.closure_eq]; exact closure_mono interior_subset h₀
   apply
-    tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos hs _ hc
+    tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos hs _ hc
       h'c hnc hnc₀ this hmg hcg
   intro u u_open x₀_u
   calc
     0 < μ (u ∩ interior s) :=
       (u_open.inter isOpen_interior).measure_pos μ (_root_.mem_closure_iff.1 h₀ u u_open x₀_u)
     _ ≤ μ (u ∩ s) := measure_mono (inter_subset_inter_right _ interior_subset)
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_integrable_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_integrable_on tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn
 
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
 concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀` if `g` is
 continuous on `s`. -/
-theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
+theorem tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
     [MetrizableSpace α] [IsLocallyFiniteMeasure μ] [IsOpenPosMeasure μ] (hs : IsCompact s)
     {c : α → ℝ} (hc : ContinuousOn c s) (h'c : ∀ y ∈ s, y ≠ x₀ → c y < c x₀)
     (hnc : ∀ x ∈ s, 0 ≤ c x) (hnc₀ : 0 < c x₀) (h₀ : x₀ ∈ closure (interior s))
     (hmg : ContinuousOn g s) :
     Tendsto (fun n : ℕ => (∫ x in s, c x ^ n ∂μ)⁻¹ • ∫ x in s, c x ^ n • g x ∂μ) atTop (𝓝 (g x₀)) :=
   haveI : x₀ ∈ s := by rw [← hs.isClosed.closure_eq]; exact closure_mono interior_subset h₀
-  tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
+  tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
     (hmg.integrableOn_compact hs) (hmg x₀ this)
-#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
+#align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_setIntegral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
 
 /-!
 ### Peak functions of the form `x ↦ c ^ dim * φ (c x)`
@@ -449,7 +449,7 @@ theorem tendsto_integral_comp_smul_smul_of_integrable
       exact (aecover_closedBall tendsto_id).integral_tendsto_of_countably_generated I
     apply this.congr'
     filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c)
-    rw [integral_mul_left, set_integral_comp_smul_of_pos _ _ _ hc, smul_eq_mul, ← mul_assoc,
+    rw [integral_mul_left, setIntegral_comp_smul_of_pos _ _ _ hc, smul_eq_mul, ← mul_assoc,
       mul_inv_cancel (by positivity), _root_.smul_closedBall _ _ zero_le_one]
     simp [abs_of_nonneg hc.le]
   · filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c)
refactor: move disjoint_sdiff_inter (#12021)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -3,12 +3,7 @@ Copyright (c) 2023 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
 -/
-import Mathlib.MeasureTheory.Integral.SetIntegral
-import Mathlib.MeasureTheory.Function.LocallyIntegrable
-import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
 import Mathlib.MeasureTheory.Integral.IntegralEqImproper
-import Mathlib.MeasureTheory.Group.Integral
-import Mathlib.MeasureTheory.Measure.Haar.Unique
 
 #align_import measure_theory.integral.peak_function from "leanprover-community/mathlib"@"13b0d72fd8533ba459ac66e9a885e35ffabb32b2"
 
@@ -44,13 +39,6 @@ open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
 
 open scoped Topology ENNReal
 
-/-- This lemma exists for finsets, but not for sets currently. porting note: move to
-data.set.basic after the port. -/
-theorem Set.disjoint_sdiff_inter {α : Type*} (s t : Set α) : Disjoint (s \ t) (s ∩ t) :=
-  disjoint_of_subset_right (inter_subset_right _ _) disjoint_sdiff_left
-#align set.disjoint_sdiff_inter Set.disjoint_sdiff_inter
-
-
 /-!
 ### General convergent result for integrals against a sequence of peak functions
 -/
@@ -186,7 +174,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
     ‖∫ x in s, φ i x • g x ∂μ‖ =
       ‖(∫ x in s \ u, φ i x • g x ∂μ) + ∫ x in s ∩ u, φ i x • g x ∂μ‖ := by
       conv_lhs => rw [← diff_union_inter s u]
-      rw [integral_union (disjoint_sdiff_inter _ _) (hs.inter u_open.measurableSet)
+      rw [integral_union disjoint_sdiff_inter (hs.inter u_open.measurableSet)
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := norm_add_le _ _
     _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ := add_le_add C B
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -188,7 +188,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
       conv_lhs => rw [← diff_union_inter s u]
       rw [integral_union (disjoint_sdiff_inter _ _) (hs.inter u_open.measurableSet)
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
-    _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
+    _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := norm_add_le _ _
     _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ := add_le_add C B
 #align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
 @[deprecated] alias tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux :=
@@ -420,7 +420,7 @@ theorem tendsto_integral_comp_smul_smul_of_integrable
     (h : Tendsto (fun x ↦ ‖x‖ ^ finrank ℝ F * φ x) (cobounded F) (𝓝 0))
     {g : F → E} (hg : Integrable g μ) (h'g : ContinuousAt g 0) :
     Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • g x ∂μ) atTop (𝓝 (g 0)) := by
-  have I : Integrable φ μ := (integrable_of_integral_eq_one h'φ)
+  have I : Integrable φ μ := integrable_of_integral_eq_one h'φ
   apply tendsto_integral_peak_smul_of_integrable_of_tendsto (t := closedBall 0 1) (x₀ := 0)
   · exact isClosed_ball.measurableSet
   · exact closedBall_mem_nhds _ zero_lt_one
chore: golf using filter_upwards (#11208)

This is presumably not exhaustive, but covers about a hundred instances.

Style opinions (e.g., why a particular change is great/not a good idea) are very welcome; I'm still forming my own.

Diff
@@ -160,7 +160,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
         apply set_integral_mono_set
         · exact I.norm.mul_const _
         · exact eventually_of_forall fun x => mul_nonneg (norm_nonneg _) δpos.le
-        · apply eventually_of_forall ut
+        · exact eventually_of_forall ut
       _ = ∫ x in t, φ i x * δ ∂μ := by
         apply set_integral_congr ht fun x hx => ?_
         rw [Real.norm_of_nonneg (hφpos _ (hts hx))]
@@ -180,8 +180,8 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
       _ ≤ δ * ∫ x in s, ‖g x‖ ∂μ := by
         rw [integral_mul_left]
         apply mul_le_mul_of_nonneg_left (set_integral_mono_set hmg.norm _ _) δpos.le
-        · exact eventually_of_forall fun x => norm_nonneg _
-        · apply eventually_of_forall; exact diff_subset s u
+        · filter_upwards with x using norm_nonneg _
+        · filter_upwards using diff_subset s u
   calc
     ‖∫ x in s, φ i x • g x ∂μ‖ =
       ‖(∫ x in s \ u, φ i x • g x ∂μ) + ∫ x in s ∩ u, φ i x • g x ∂μ‖ := by
chore: move Mathlib to v4.7.0-rc1 (#11162)

This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0 branch as we update to intermediate nightlies.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>

Diff
@@ -224,7 +224,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
   filter_upwards [integrableOn_peak_smul_of_integrableOn_of_tendsto hs h'ts
     hlφ hiφ h'iφ hmg hcg,
     (tendsto_order.1 (tendsto_iff_norm_sub_tendsto_zero.1 hiφ)).2 1 zero_lt_one] with i hi h'i
-  simp only [Pi.sub_apply, smul_sub, ← indicator_smul_apply]
+  simp only [h, Pi.sub_apply, smul_sub, ← indicator_smul_apply]
   rw [integral_sub hi, set_integral_indicator ht, inter_eq_right.mpr hts,
     integral_smul_const, sub_add_cancel]
   rw [integrable_indicator_iff ht]
@@ -331,7 +331,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
               exact pow_le_pow_left t'_pos.le (le_of_lt (hv hx)) _
           _ ≤ ∫ y in s, c y ^ n ∂μ :=
             set_integral_mono_set (I n) (J n) (eventually_of_forall (inter_subset_right _ _))
-      simp_rw [← div_eq_inv_mul, div_pow, div_div]
+      simp_rw [φ, ← div_eq_inv_mul, div_pow, div_div]
       apply div_le_div (pow_nonneg t_pos n) _ _ B
       · exact pow_le_pow_left (hnc _ hx.1) (ht x hx) _
       · apply mul_pos (pow_pos (t_pos.trans_lt tt') _) (ENNReal.toReal_pos (hμ v v_open x₀_v).ne' _)
@@ -357,7 +357,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       hs.measurableSet (Subset.rfl) (self_mem_nhdsWithin)
       hs.measure_lt_top.ne (eventually_of_forall hnφ) A B C hmg hcg
   convert this
-  simp_rw [← smul_smul, integral_smul]
+  simp_rw [φ, ← smul_smul, integral_smul]
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
 
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
@@ -480,14 +480,14 @@ theorem tendsto_integral_comp_smul_smul_of_integrable'
     Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • (x₀ - x))) • g x ∂μ)
       atTop (𝓝 (g x₀)) := by
   let f := fun x ↦ g (x₀ - x)
-  have If : Integrable f μ := by simpa [sub_eq_add_neg] using (hg.comp_add_left x₀).comp_neg
+  have If : Integrable f μ := by simpa [f, sub_eq_add_neg] using (hg.comp_add_left x₀).comp_neg
   have : Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • f x ∂μ)
       atTop (𝓝 (f 0)) := by
     apply tendsto_integral_comp_smul_smul_of_integrable hφ h'φ h If
     have A : ContinuousAt g (x₀ - 0) := by simpa using h'g
     have B : ContinuousAt (fun x ↦ x₀ - x) 0 := Continuous.continuousAt (by continuity)
     exact A.comp B
-  simp only [sub_zero] at this
+  simp only [f, sub_zero] at this
   convert this using 2 with c
   conv_rhs => rw [← integral_add_left_eq_self x₀ (μ := μ)
     (f := fun x ↦ (c ^ finrank ℝ F * φ (c • x)) • g (x₀ - x)), ← integral_neg_eq_self]
feat: extend convergence of integrals against peak functions to noncompact settings (#10829)

This makes it possible to use Gaussians as peak functions in the proof of Fourier inversion.

Diff
@@ -5,6 +5,10 @@ Authors: Sébastien Gouëzel
 -/
 import Mathlib.MeasureTheory.Integral.SetIntegral
 import Mathlib.MeasureTheory.Function.LocallyIntegrable
+import Mathlib.MeasureTheory.Measure.Lebesgue.EqHaar
+import Mathlib.MeasureTheory.Integral.IntegralEqImproper
+import Mathlib.MeasureTheory.Group.Integral
+import Mathlib.MeasureTheory.Measure.Haar.Unique
 
 #align_import measure_theory.integral.peak_function from "leanprover-community/mathlib"@"13b0d72fd8533ba459ac66e9a885e35ffabb32b2"
 
@@ -13,11 +17,12 @@ import Mathlib.MeasureTheory.Function.LocallyIntegrable
 
 A sequence of peak functions is a sequence of functions with average one concentrating around
 a point `x₀`. Given such a sequence `φₙ`, then `∫ φₙ g` tends to `g x₀` in many situations, with
-a whole zoo of possible assumptions on `φₙ` and `g`. This file is devoted to such results.
+a whole zoo of possible assumptions on `φₙ` and `g`. This file is devoted to such results. Such
+functions are also called approximations of unity, or approximations of identity.
 
 ## Main results
 
-* `tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt`: If a sequence of peak
+* `tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto`: If a sequence of peak
   functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
   `g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `g x₀`.
 * `tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn`:
@@ -25,6 +30,11 @@ a whole zoo of possible assumptions on `φₙ` and `g`. This file is devoted to
   then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
   concentrating around `x₀`. Therefore, `∫ (c x) ^ n * g / ∫ (c x) ^ n` converges to `g x₀`
   if `g` is continuous on `s`.
+* `tendsto_integral_comp_smul_smul_of_integrable`:
+  If a nonnegative function `φ` has integral one and decays quickly enough at infinity,
+  then its renormalizations `x ↦ c ^ d * φ (c • x)` form a sequence of peak functions as `c → ∞`.
+  Therefore, `∫ (c ^ d * φ (c • x)) • g x` converges to `g 0` as `c → ∞` if `g` is continuous
+  at `0` and integrable.
 
 Note that there are related results about convolution with respect to peak functions in the file
 `Analysis.Convolution`, such as `convolution_tendsto_right` there.
@@ -40,92 +50,122 @@ theorem Set.disjoint_sdiff_inter {α : Type*} (s t : Set α) : Disjoint (s \ t)
   disjoint_of_subset_right (inter_subset_right _ _) disjoint_sdiff_left
 #align set.disjoint_sdiff_inter Set.disjoint_sdiff_inter
 
+
+/-!
+### General convergent result for integrals against a sequence of peak functions
+-/
+
 open Set
 
 variable {α E ι : Type*} {hm : MeasurableSpace α} {μ : Measure α} [TopologicalSpace α]
   [BorelSpace α] [NormedAddCommGroup E] [NormedSpace ℝ E] {g : α → E} {l : Filter ι} {x₀ : α}
-  {s : Set α} {φ : ι → α → ℝ}
+  {s t : Set α} {φ : ι → α → ℝ} {a : E}
 
 /-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
-`g` is integrable and continuous at `x₀`, then `φᵢ • g` is eventually integrable. -/
-theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
+`g` is integrable and has a limit at `x₀`, then `φᵢ • g` is eventually integrable. -/
+theorem integrableOn_peak_smul_of_integrableOn_of_tendsto
+    (hs : MeasurableSet s) (h'st : t ∈ 𝓝[s] x₀)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ)
-    (hcg : ContinuousWithinAt g s x₀) : ∀ᶠ i in l, IntegrableOn (fun x => φ i x • g x) s μ := by
-  obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) 1
-  exact mem_nhdsWithin.1 (hcg (ball_mem_nhds _ zero_lt_one))
-  filter_upwards [tendstoUniformlyOn_iff.1 (hlφ u u_open x₀u) 1 zero_lt_one, hiφ] with i hi h'i
+    (hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
+    (h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
+    (hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 a)) :
+    ∀ᶠ i in l, IntegrableOn (fun x => φ i x • g x) s μ := by
+  obtain ⟨u, u_open, x₀u, ut, hu⟩ :
+      ∃ u, IsOpen u ∧ x₀ ∈ u ∧ s ∩ u ⊆ t ∧ ∀ x ∈ u ∩ s, g x ∈ ball a 1 := by
+    rcases mem_nhdsWithin.1 (Filter.inter_mem h'st (hcg (ball_mem_nhds _ zero_lt_one)))
+      with ⟨u, u_open, x₀u, hu⟩
+    refine ⟨u, u_open, x₀u, ?_, hu.trans (inter_subset_right _ _)⟩
+    rw [inter_comm]
+    exact hu.trans (inter_subset_left _ _)
+  rw [tendsto_iff_norm_sub_tendsto_zero] at hiφ
+  filter_upwards [tendstoUniformlyOn_iff.1 (hlφ u u_open x₀u) 1 zero_lt_one,
+    (tendsto_order.1 hiφ).2 1 zero_lt_one, h'iφ] with i hi h'i h''i
+  have I : IntegrableOn (φ i) t μ := .of_integral_ne_zero (fun h ↦ by simp [h] at h'i)
   have A : IntegrableOn (fun x => φ i x • g x) (s \ u) μ := by
     refine' Integrable.smul_of_top_right (hmg.mono (diff_subset _ _) le_rfl) _
-    apply
-      memℒp_top_of_bound
-        ((integrable_of_integral_eq_one h'i).aestronglyMeasurable.mono_set (diff_subset _ _)) 1
+    apply memℒp_top_of_bound (h''i.mono_set (diff_subset _ _)) 1
     filter_upwards [self_mem_ae_restrict (hs.diff u_open.measurableSet)] with x hx
     simpa only [Pi.zero_apply, dist_zero_left] using (hi x hx).le
   have B : IntegrableOn (fun x => φ i x • g x) (s ∩ u) μ := by
     apply Integrable.smul_of_top_left
-    · exact IntegrableOn.mono_set (integrable_of_integral_eq_one h'i) (inter_subset_left _ _)
+    · exact IntegrableOn.mono_set I ut
     · apply
-        memℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).aestronglyMeasurable (‖g x₀‖ + 1)
+        memℒp_top_of_bound (hmg.mono_set (inter_subset_left _ _)).aestronglyMeasurable (‖a‖ + 1)
       filter_upwards [self_mem_ae_restrict (hs.inter u_open.measurableSet)] with x hx
       rw [inter_comm] at hx
       exact (norm_lt_of_mem_ball (hu x hx)).le
   convert A.union B
   simp only [diff_union_inter]
-#align integrable_on_peak_smul_of_integrable_on_of_continuous_within_at integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt
+#align integrable_on_peak_smul_of_integrable_on_of_continuous_within_at integrableOn_peak_smul_of_integrableOn_of_tendsto
+@[deprecated] alias integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt :=
+  integrableOn_peak_smul_of_integrableOn_of_tendsto -- deprecated on 2024-02-20
 
 variable [CompleteSpace E]
 
-/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
-`g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. Auxiliary lemma
-where one assumes additionally `g x₀ = 0`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
-    (hs : MeasurableSet s) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
+/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
+integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
+has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`.
+Auxiliary lemma where one assumes additionally `a = 0`. -/
+theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
+    (hs : MeasurableSet s) (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
+    (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
-    (hcg : ContinuousWithinAt g s x₀) :
+    (hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
+    (h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
+    (hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 0)) :
     Tendsto (fun i : ι => ∫ x in s, φ i x • g x ∂μ) l (𝓝 0) := by
   refine' Metric.tendsto_nhds.2 fun ε εpos => _
-  obtain ⟨δ, hδ, δpos⟩ : ∃ δ, (δ * ∫ x in s, ‖g x‖ ∂μ) + δ < ε ∧ 0 < δ := by
+  obtain ⟨δ, hδ, δpos, δone⟩ : ∃ δ, (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ < ε ∧ 0 < δ ∧ δ < 1:= by
     have A :
-      Tendsto (fun δ => (δ * ∫ x in s, ‖g x‖ ∂μ) + δ) (𝓝[>] 0)
-        (𝓝 ((0 * ∫ x in s, ‖g x‖ ∂μ) + 0)) := by
+      Tendsto (fun δ => (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ) (𝓝[>] 0)
+        (𝓝 ((0 * ∫ x in s, ‖g x‖ ∂μ) + 2 * 0)) := by
       apply Tendsto.mono_left _ nhdsWithin_le_nhds
-      exact (tendsto_id.mul tendsto_const_nhds).add tendsto_id
-    rw [zero_mul, zero_add] at A
-    exact (((tendsto_order.1 A).2 ε εpos).and self_mem_nhdsWithin).exists
-  suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ by
+      exact (tendsto_id.mul tendsto_const_nhds).add (tendsto_id.const_mul _)
+    rw [zero_mul, zero_add, mul_zero] at A
+    have : Ioo (0 : ℝ) 1 ∈ 𝓝[>] 0 := Ioo_mem_nhdsWithin_Ioi ⟨le_rfl, zero_lt_one⟩
+    rcases (((tendsto_order.1 A).2 ε εpos).and this).exists with ⟨δ, hδ, h'δ⟩
+    exact ⟨δ, hδ, h'δ.1, h'δ.2⟩
+  suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ by
     filter_upwards [this] with i hi
     simp only [dist_zero_right]
     exact hi.trans_lt hδ
-  obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) δ
-  exact mem_nhdsWithin.1 (hcg (ball_mem_nhds _ δpos))
-  filter_upwards [tendstoUniformlyOn_iff.1 (hlφ u u_open x₀u) δ δpos, hiφ, hnφ,
-    integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg] with i hi h'i
-    hφpos h''i
-  have B : ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ δ :=
+  obtain ⟨u, u_open, x₀u, ut, hu⟩ :
+      ∃ u, IsOpen u ∧ x₀ ∈ u ∧ s ∩ u ⊆ t ∧ ∀ x ∈ u ∩ s, g x ∈ ball 0 δ := by
+    rcases mem_nhdsWithin.1 (Filter.inter_mem h'ts (hcg (ball_mem_nhds _ δpos)))
+      with ⟨u, u_open, x₀u, hu⟩
+    refine ⟨u, u_open, x₀u, ?_, hu.trans (inter_subset_right _ _)⟩
+    rw [inter_comm]
+    exact hu.trans (inter_subset_left _ _)
+  filter_upwards [tendstoUniformlyOn_iff.1 (hlφ u u_open x₀u) δ δpos,
+    (tendsto_order.1 (tendsto_iff_norm_sub_tendsto_zero.1 hiφ)).2 δ δpos, hnφ,
+    integrableOn_peak_smul_of_integrableOn_of_tendsto hs h'ts hlφ hiφ h'iφ hmg hcg]
+    with i hi h'i hφpos h''i
+  have I : IntegrableOn (φ i) t μ := by
+    apply Integrable.of_integral_ne_zero (fun h ↦ ?_)
+    simp [h] at h'i
+    linarith
+  have B : ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ 2 * δ :=
     calc
       ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ ≤ ∫ x in s ∩ u, ‖φ i x • g x‖ ∂μ :=
         norm_integral_le_integral_norm _
       _ ≤ ∫ x in s ∩ u, ‖φ i x‖ * δ ∂μ := by
         refine' set_integral_mono_on _ _ (hs.inter u_open.measurableSet) fun x hx => _
         · exact IntegrableOn.mono_set h''i.norm (inter_subset_left _ _)
-        · exact
-            IntegrableOn.mono_set ((integrable_of_integral_eq_one h'i).norm.mul_const _)
-              (inter_subset_left _ _)
+        · exact IntegrableOn.mono_set (I.norm.mul_const _) ut
         rw [norm_smul]
         apply mul_le_mul_of_nonneg_left _ (norm_nonneg _)
-        rw [inter_comm, h'g] at hu
+        rw [inter_comm] at hu
         exact (mem_ball_zero_iff.1 (hu x hx)).le
-      _ ≤ ∫ x in s, ‖φ i x‖ * δ ∂μ := by
+      _ ≤ ∫ x in t, ‖φ i x‖ * δ ∂μ := by
         apply set_integral_mono_set
-        · exact (integrable_of_integral_eq_one h'i).norm.mul_const _
+        · exact I.norm.mul_const _
         · exact eventually_of_forall fun x => mul_nonneg (norm_nonneg _) δpos.le
-        · apply eventually_of_forall; exact inter_subset_left s u
-      _ = ∫ x in s, φ i x * δ ∂μ := by
-        apply set_integral_congr hs fun x hx => ?_
-        rw [Real.norm_of_nonneg (hφpos _ hx)]
-      _ = δ := by rw [integral_mul_right, h'i, one_mul]
+        · apply eventually_of_forall ut
+      _ = ∫ x in t, φ i x * δ ∂μ := by
+        apply set_integral_congr ht fun x hx => ?_
+        rw [Real.norm_of_nonneg (hφpos _ (hts hx))]
+      _ = (∫ x in t, φ i x ∂μ) * δ := by rw [integral_mul_right]
+      _ ≤ 2 * δ := by gcongr; linarith [(le_abs_self _).trans h'i.le]
   have C : ‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ δ * ∫ x in s, ‖g x‖ ∂μ :=
     calc
       ‖∫ x in s \ u, φ i x • g x ∂μ‖ ≤ ∫ x in s \ u, ‖φ i x • g x‖ ∂μ :=
@@ -149,36 +189,72 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
       rw [integral_union (disjoint_sdiff_inter _ _) (hs.inter u_open.measurableSet)
           (h''i.mono_set (diff_subset _ _)) (h''i.mono_set (inter_subset_left _ _))]
     _ ≤ ‖∫ x in s \ u, φ i x • g x ∂μ‖ + ‖∫ x in s ∩ u, φ i x • g x ∂μ‖ := (norm_add_le _ _)
-    _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ := add_le_add C B
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
+    _ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + 2 * δ := add_le_add C B
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at_aux tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux
+@[deprecated] alias tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux :=
+  tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux -- deprecated on 2024-02-20
 
-/- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀`, and
-`g` is integrable and continuous at `x₀`, then `∫ φᵢ • g` converges to `x₀`. -/
-theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
-    (h's : μ s ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
+/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
+integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
+has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`. Version localized to a subset. -/
+theorem tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
+    (hs : MeasurableSet s) {t : Set α} (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
+    (h't : μ t ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : (fun i => ∫ x in s, φ i x ∂μ) =ᶠ[l] 1) (hmg : IntegrableOn g s μ)
-    (hcg : ContinuousWithinAt g s x₀) :
-    Tendsto (fun i : ι => ∫ x in s, φ i x • g x ∂μ) l (𝓝 (g x₀)) := by
-  let h := g - fun _ => g x₀
-  have A :
-    Tendsto (fun i : ι => (∫ x in s, φ i x • h x ∂μ) + (∫ x in s, φ i x ∂μ) • g x₀) l
-      (𝓝 (0 + (1 : ℝ) • g x₀)) := by
-    refine' Tendsto.add _ (Tendsto.smul (tendsto_const_nhds.congr' hiφ.symm) tendsto_const_nhds)
-    apply tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux hs hnφ hlφ hiφ
-    · apply Integrable.sub hmg
-      apply integrableOn_const.2
-      simp only [h's.lt_top, or_true_iff]
-    · simp only [Pi.sub_apply, sub_self]
-    · exact hcg.sub continuousWithinAt_const
+    (hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
+    (h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
+    (hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 a)) :
+    Tendsto (fun i : ι ↦ ∫ x in s, φ i x • g x ∂μ) l (𝓝 a) := by
+  let h := g - t.indicator (fun _ ↦ a)
+  have A : Tendsto (fun i : ι => (∫ x in s, φ i x • h x ∂μ) + (∫ x in t, φ i x ∂μ) • a) l
+      (𝓝 (0 + (1 : ℝ) • a)) := by
+    refine' Tendsto.add _ (Tendsto.smul hiφ tendsto_const_nhds)
+    apply tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto_aux hs ht hts h'ts
+        hnφ hlφ hiφ h'iφ
+    · apply hmg.sub
+      simp only [integrable_indicator_iff ht, integrableOn_const, ht, Measure.restrict_apply]
+      right
+      exact lt_of_le_of_lt (measure_mono (inter_subset_left _ _)) (h't.lt_top)
+    · rw [← sub_self a]
+      apply Tendsto.sub hcg
+      apply tendsto_const_nhds.congr'
+      filter_upwards [h'ts] with x hx using by simp [hx]
   simp only [one_smul, zero_add] at A
   refine' Tendsto.congr' _ A
-  filter_upwards [integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt hs hlφ hiφ hmg hcg,
-    hiφ] with i hi h'i
-  simp only [Pi.sub_apply, smul_sub]
-  rw [integral_sub hi, integral_smul_const, sub_add_cancel]
-  exact Integrable.smul_const (integrable_of_integral_eq_one h'i) _
-#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt
+  filter_upwards [integrableOn_peak_smul_of_integrableOn_of_tendsto hs h'ts
+    hlφ hiφ h'iφ hmg hcg,
+    (tendsto_order.1 (tendsto_iff_norm_sub_tendsto_zero.1 hiφ)).2 1 zero_lt_one] with i hi h'i
+  simp only [Pi.sub_apply, smul_sub, ← indicator_smul_apply]
+  rw [integral_sub hi, set_integral_indicator ht, inter_eq_right.mpr hts,
+    integral_smul_const, sub_add_cancel]
+  rw [integrable_indicator_iff ht]
+  apply Integrable.smul_const
+  rw [restrict_restrict ht, inter_eq_left.mpr hts]
+  exact .of_integral_ne_zero (fun h ↦ by simp [h] at h'i)
+#align tendsto_set_integral_peak_smul_of_integrable_on_of_continuous_within_at tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto
+@[deprecated] alias tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt :=
+  tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto -- deprecated on 2024-02-20
+
+/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
+integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
+has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`. -/
+theorem tendsto_integral_peak_smul_of_integrable_of_tendsto
+    {t : Set α} (ht : MeasurableSet t) (h'ts : t ∈ 𝓝 x₀)
+    (h't : μ t ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x, 0 ≤ φ i x)
+    (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l uᶜ)
+    (hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
+    (h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) μ)
+    (hmg : Integrable g μ) (hcg : Tendsto g (𝓝 x₀) (𝓝 a)) :
+    Tendsto (fun i : ι ↦ ∫ x, φ i x • g x ∂μ) l (𝓝 a) := by
+  suffices Tendsto (fun i : ι ↦ ∫ x in univ, φ i x • g x ∂μ) l (𝓝 a) by simpa
+  exact tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto MeasurableSet.univ ht (x₀ := x₀)
+    (subset_univ _) (by simpa [nhdsWithin_univ]) h't (by simpa)
+    (by simpa [← compl_eq_univ_diff] using hlφ) hiφ
+    (by simpa) (by simpa) (by simpa [nhdsWithin_univ])
+
+/-!
+### Peak functions of the form `x ↦ (c x) ^ n / ∫ (c y) ^ n`
+-/
 
 /-- If a continuous function `c` realizes its maximum at a unique point `x₀` in a compact set `s`,
 then the sequence of functions `(c x) ^ n / ∫ (c x) ^ n` is a sequence of peak functions
@@ -272,9 +348,14 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
     filter_upwards [(tendsto_order.1 N).2 ε εpos] with n hn x hx
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
     exact (M n x hx).trans_lt hn
-  have : Tendsto (fun i : ℕ => ∫ x : α in s, φ i x • g x ∂μ) atTop (𝓝 (g x₀)) :=
-    tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt hs.measurableSet
-      hs.measure_lt_top.ne (eventually_of_forall hnφ) A (eventually_of_forall hiφ) hmg hcg
+  have : Tendsto (fun i : ℕ => ∫ x : α in s, φ i x • g x ∂μ) atTop (𝓝 (g x₀)) := by
+    have B : Tendsto (fun i ↦ ∫ (x : α) in s, φ i x ∂μ) atTop (𝓝 1) :=
+      tendsto_const_nhds.congr (fun n ↦ (hiφ n).symm)
+    have C : ∀ᶠ (i : ℕ) in atTop, AEStronglyMeasurable (fun x ↦ φ i x) (μ.restrict s) := by
+      apply eventually_of_forall (fun n ↦ ((I n).const_mul _).aestronglyMeasurable)
+    exact tendsto_set_integral_peak_smul_of_integrableOn_of_tendsto hs.measurableSet
+      hs.measurableSet (Subset.rfl) (self_mem_nhdsWithin)
+      hs.measure_lt_top.ne (eventually_of_forall hnφ) A B C hmg hcg
   convert this
   simp_rw [← smul_smul, integral_smul]
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_measure_nhds_within_pos tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_nhdsWithin_pos
@@ -320,3 +401,94 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuo
   tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_integrableOn hs hc h'c hnc hnc₀ h₀
     (hmg.integrableOn_compact hs) (hmg x₀ this)
 #align tendsto_set_integral_pow_smul_of_unique_maximum_of_is_compact_of_continuous_on tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_continuousOn
+
+/-!
+### Peak functions of the form `x ↦ c ^ dim * φ (c x)`
+-/
+
+open FiniteDimensional Bornology
+
+variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F]
+  [MeasurableSpace F] [BorelSpace F] {μ : Measure F} [IsAddHaarMeasure μ]
+
+/-- Consider a nonnegative function `φ` with integral one, decaying quickly enough at infinity.
+Then suitable renormalizations of `φ` form a sequence of peak functions around the origin:
+`∫ (c ^ d * φ (c • x)) • g x` converges to `g 0` as `c → ∞` if `g` is continuous at `0`
+and integrable. -/
+theorem tendsto_integral_comp_smul_smul_of_integrable
+    {φ : F → ℝ} (hφ : ∀ x, 0 ≤ φ x) (h'φ : ∫ x, φ x ∂μ = 1)
+    (h : Tendsto (fun x ↦ ‖x‖ ^ finrank ℝ F * φ x) (cobounded F) (𝓝 0))
+    {g : F → E} (hg : Integrable g μ) (h'g : ContinuousAt g 0) :
+    Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • g x ∂μ) atTop (𝓝 (g 0)) := by
+  have I : Integrable φ μ := (integrable_of_integral_eq_one h'φ)
+  apply tendsto_integral_peak_smul_of_integrable_of_tendsto (t := closedBall 0 1) (x₀ := 0)
+  · exact isClosed_ball.measurableSet
+  · exact closedBall_mem_nhds _ zero_lt_one
+  · exact (isCompact_closedBall 0 1).measure_ne_top
+  · filter_upwards [Ici_mem_atTop 0] with c (hc : 0 ≤ c) x using mul_nonneg (by positivity) (hφ _)
+  · intro u u_open hu
+    apply tendstoUniformlyOn_iff.2 (fun ε εpos ↦ ?_)
+    obtain ⟨δ, δpos, h'u⟩ : ∃ δ > 0, ball 0 δ ⊆ u := Metric.isOpen_iff.1 u_open _ hu
+    obtain ⟨M, Mpos, hM⟩ : ∃ M > 0, ∀ ⦃x : F⦄, x ∈ (closedBall 0 M)ᶜ →
+        ‖x‖ ^ finrank ℝ F * φ x < δ ^ finrank ℝ F * ε := by
+      rcases (hasBasis_cobounded_compl_closedBall (0 : F)).eventually_iff.1
+        ((tendsto_order.1 h).2 (δ ^ finrank ℝ F * ε) (by positivity)) with ⟨M, -, hM⟩
+      refine ⟨max M 1, zero_lt_one.trans_le (le_max_right _ _), fun x hx ↦ hM ?_⟩
+      simp only [mem_compl_iff, mem_closedBall, dist_zero_right, le_max_iff, not_or, not_le] at hx
+      simpa using hx.1
+    filter_upwards [Ioi_mem_atTop (M / δ)] with c (hc : M / δ < c) x hx
+    have cpos : 0 < c := lt_trans (by positivity) hc
+    suffices c ^ finrank ℝ F * φ (c • x) < ε by simpa [abs_of_nonneg (hφ _), abs_of_nonneg cpos.le]
+    have hδx : δ ≤ ‖x‖ := by
+      have : x ∈ (ball 0 δ)ᶜ := fun h ↦ hx (h'u h)
+      simpa only [mem_compl_iff, mem_ball, dist_zero_right, not_lt]
+    suffices δ ^ finrank ℝ F * (c ^ finrank ℝ F * φ (c • x)) < δ ^ finrank ℝ F * ε by
+      rwa [mul_lt_mul_iff_of_pos_left (by positivity)] at this
+    calc
+      δ ^ finrank ℝ F * (c ^ finrank ℝ F * φ (c • x))
+      _ ≤ ‖x‖ ^ finrank ℝ F * (c ^ finrank ℝ F * φ (c • x)) := by
+        gcongr; exact mul_nonneg (by positivity) (hφ _)
+      _ = ‖c • x‖ ^ finrank ℝ F * φ (c • x) := by
+        simp [norm_smul, abs_of_pos cpos, mul_pow]; ring
+      _ < δ ^ finrank ℝ F * ε := by
+        apply hM
+        rw [div_lt_iff δpos] at hc
+        simp only [mem_compl_iff, mem_closedBall, dist_zero_right, norm_smul, Real.norm_eq_abs,
+          abs_of_nonneg cpos.le, not_le, gt_iff_lt]
+        exact hc.trans_le (by gcongr)
+  · have : Tendsto (fun c ↦ ∫ (x : F) in closedBall 0 c, φ x ∂μ) atTop (𝓝 1) := by
+      rw [← h'φ]
+      exact (aecover_closedBall tendsto_id).integral_tendsto_of_countably_generated I
+    apply this.congr'
+    filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c)
+    rw [integral_mul_left, set_integral_comp_smul_of_pos _ _ _ hc, smul_eq_mul, ← mul_assoc,
+      mul_inv_cancel (by positivity), _root_.smul_closedBall _ _ zero_le_one]
+    simp [abs_of_nonneg hc.le]
+  · filter_upwards [Ioi_mem_atTop 0] with c (hc : 0 < c)
+    exact (I.comp_smul hc.ne').aestronglyMeasurable.const_mul _
+  · exact hg
+  · exact h'g
+
+/-- Consider a nonnegative function `φ` with integral one, decaying quickly enough at infinity.
+Then suitable renormalizations of `φ` form a sequence of peak functions around any point:
+`∫ (c ^ d * φ (c • (x₀ - x)) • g x` converges to `g x₀` as `c → ∞` if `g` is continuous at `x₀`
+and integrable. -/
+theorem tendsto_integral_comp_smul_smul_of_integrable'
+    {φ : F → ℝ} (hφ : ∀ x, 0 ≤ φ x) (h'φ : ∫ x, φ x ∂μ = 1)
+    (h : Tendsto (fun x ↦ ‖x‖ ^ finrank ℝ F * φ x) (cobounded F) (𝓝 0))
+    {g : F → E} {x₀ : F} (hg : Integrable g μ) (h'g : ContinuousAt g x₀) :
+    Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • (x₀ - x))) • g x ∂μ)
+      atTop (𝓝 (g x₀)) := by
+  let f := fun x ↦ g (x₀ - x)
+  have If : Integrable f μ := by simpa [sub_eq_add_neg] using (hg.comp_add_left x₀).comp_neg
+  have : Tendsto (fun (c : ℝ) ↦ ∫ x, (c ^ (finrank ℝ F) * φ (c • x)) • f x ∂μ)
+      atTop (𝓝 (f 0)) := by
+    apply tendsto_integral_comp_smul_smul_of_integrable hφ h'φ h If
+    have A : ContinuousAt g (x₀ - 0) := by simpa using h'g
+    have B : ContinuousAt (fun x ↦ x₀ - x) 0 := Continuous.continuousAt (by continuity)
+    exact A.comp B
+  simp only [sub_zero] at this
+  convert this using 2 with c
+  conv_rhs => rw [← integral_add_left_eq_self x₀ (μ := μ)
+    (f := fun x ↦ (c ^ finrank ℝ F * φ (c • x)) • g (x₀ - x)), ← integral_neg_eq_self]
+  simp [smul_sub, sub_eq_add_neg]
chore(Analysis/SpecificLimits/* and others): rename _0 -> _zero, _1 -> _one (#10077)

See here on Zulip.

This PR changes a bunch of names containing nhds_0 or/and lt_1 to nhds_zero or/and lt_one.

Diff
@@ -265,7 +265,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       Tendsto (fun n => (μ (v ∩ s)).toReal⁻¹ * (t / t') ^ n) atTop
         (𝓝 ((μ (v ∩ s)).toReal⁻¹ * 0)) := by
       apply Tendsto.mul tendsto_const_nhds _
-      apply tendsto_pow_atTop_nhds_0_of_lt_1 (div_nonneg t_pos t'_pos.le)
+      apply tendsto_pow_atTop_nhds_zero_of_lt_one (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
     rw [mul_zero] at N
     refine' tendstoUniformlyOn_iff.2 fun ε εpos => _
chore: Rename pow monotonicity lemmas (#9095)

The names for lemmas about monotonicity of (a ^ ·) and (· ^ n) were a mess. This PR tidies up everything related by following the naming convention for (a * ·) and (· * b). Namely, (a ^ ·) is pow_right and (· ^ n) is pow_left in lemma names. All lemma renames follow the corresponding multiplication lemma names closely.

Renames

Algebra.GroupPower.Order

  • pow_monopow_right_mono
  • pow_le_powpow_le_pow_right
  • pow_le_pow_of_le_leftpow_le_pow_left
  • pow_lt_pow_of_lt_leftpow_lt_pow_left
  • strictMonoOn_powpow_left_strictMonoOn
  • pow_strictMono_rightpow_right_strictMono
  • pow_lt_powpow_lt_pow_right
  • pow_lt_pow_iffpow_lt_pow_iff_right
  • pow_le_pow_iffpow_le_pow_iff_right
  • self_lt_powlt_self_pow
  • strictAnti_powpow_right_strictAnti
  • pow_lt_pow_iff_of_lt_onepow_lt_pow_iff_right_of_lt_one
  • pow_lt_pow_of_lt_onepow_lt_pow_right_of_lt_one
  • lt_of_pow_lt_powlt_of_pow_lt_pow_left
  • le_of_pow_le_powle_of_pow_le_pow_left
  • pow_lt_pow₀pow_lt_pow_right₀

Algebra.GroupPower.CovariantClass

  • pow_le_pow_of_le_left'pow_le_pow_left'
  • nsmul_le_nsmul_of_le_rightnsmul_le_nsmul_right
  • pow_lt_pow'pow_lt_pow_right'
  • nsmul_lt_nsmulnsmul_lt_nsmul_left
  • pow_strictMono_leftpow_right_strictMono'
  • nsmul_strictMono_rightnsmul_left_strictMono
  • StrictMono.pow_right'StrictMono.pow_const
  • StrictMono.nsmul_leftStrictMono.const_nsmul
  • pow_strictMono_right'pow_left_strictMono
  • nsmul_strictMono_leftnsmul_right_strictMono
  • Monotone.pow_rightMonotone.pow_const
  • Monotone.nsmul_leftMonotone.const_nsmul
  • lt_of_pow_lt_pow'lt_of_pow_lt_pow_left'
  • lt_of_nsmul_lt_nsmullt_of_nsmul_lt_nsmul_right
  • pow_le_pow'pow_le_pow_right'
  • nsmul_le_nsmulnsmul_le_nsmul_left
  • pow_le_pow_of_le_one'pow_le_pow_right_of_le_one'
  • nsmul_le_nsmul_of_nonposnsmul_le_nsmul_left_of_nonpos
  • le_of_pow_le_pow'le_of_pow_le_pow_left'
  • le_of_nsmul_le_nsmul'le_of_nsmul_le_nsmul_right'
  • pow_le_pow_iff'pow_le_pow_iff_right'
  • nsmul_le_nsmul_iffnsmul_le_nsmul_iff_left
  • pow_lt_pow_iff'pow_lt_pow_iff_right'
  • nsmul_lt_nsmul_iffnsmul_lt_nsmul_iff_left

Data.Nat.Pow

  • Nat.pow_lt_pow_of_lt_leftNat.pow_lt_pow_left
  • Nat.pow_le_iff_le_leftNat.pow_le_pow_iff_left
  • Nat.pow_lt_iff_lt_leftNat.pow_lt_pow_iff_left

Lemmas added

  • pow_le_pow_iff_left
  • pow_lt_pow_iff_left
  • pow_right_injective
  • pow_right_inj
  • Nat.pow_le_pow_left to have the correct name since Nat.pow_le_pow_of_le_left is in Std.
  • Nat.pow_le_pow_right to have the correct name since Nat.pow_le_pow_of_le_right is in Std.

Lemmas removed

  • self_le_pow was a duplicate of le_self_pow.
  • Nat.pow_lt_pow_of_lt_right is defeq to pow_lt_pow_right.
  • Nat.pow_right_strictMono is defeq to pow_right_strictMono.
  • Nat.pow_le_iff_le_right is defeq to pow_le_pow_iff_right.
  • Nat.pow_lt_iff_lt_right is defeq to pow_lt_pow_iff_right.

Other changes

  • A bunch of proofs have been golfed.
  • Some lemma assumptions have been turned from 0 < n or 1 ≤ n to n ≠ 0.
  • A few Nat lemmas have been protected.
  • One docstring has been fixed.
Diff
@@ -252,12 +252,12 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
               exact lt_of_le_of_lt (measure_mono (inter_subset_right _ _)) hs.measure_lt_top
             · exact (I n).mono (inter_subset_right _ _) le_rfl
             · intro x hx
-              exact pow_le_pow_of_le_left t'_pos.le (le_of_lt (hv hx)) _
+              exact pow_le_pow_left t'_pos.le (le_of_lt (hv hx)) _
           _ ≤ ∫ y in s, c y ^ n ∂μ :=
             set_integral_mono_set (I n) (J n) (eventually_of_forall (inter_subset_right _ _))
       simp_rw [← div_eq_inv_mul, div_pow, div_div]
       apply div_le_div (pow_nonneg t_pos n) _ _ B
-      · exact pow_le_pow_of_le_left (hnc _ hx.1) (ht x hx) _
+      · exact pow_le_pow_left (hnc _ hx.1) (ht x hx) _
       · apply mul_pos (pow_pos (t_pos.trans_lt tt') _) (ENNReal.toReal_pos (hμ v v_open x₀_v).ne' _)
         have : μ (v ∩ s) ≤ μ s := measure_mono (inter_subset_right _ _)
         exact ne_of_lt (lt_of_le_of_lt this hs.measure_lt_top)
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -30,9 +30,6 @@ Note that there are related results about convolution with respect to peak funct
 `Analysis.Convolution`, such as `convolution_tendsto_right` there.
 -/
 
-
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
 
 open scoped Topology ENNReal
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -95,7 +95,7 @@ theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
         (𝓝 ((0 * ∫ x in s, ‖g x‖ ∂μ) + 0)) := by
       apply Tendsto.mono_left _ nhdsWithin_le_nhds
       exact (tendsto_id.mul tendsto_const_nhds).add tendsto_id
-    rw [MulZeroClass.zero_mul, zero_add] at A
+    rw [zero_mul, zero_add] at A
     exact (((tendsto_order.1 A).2 ε εpos).and self_mem_nhdsWithin).exists
   suffices ∀ᶠ i in l, ‖∫ x in s, φ i x • g x ∂μ‖ ≤ (δ * ∫ x in s, ‖g x‖ ∂μ) + δ by
     filter_upwards [this] with i hi
@@ -270,7 +270,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       apply Tendsto.mul tendsto_const_nhds _
       apply tendsto_pow_atTop_nhds_0_of_lt_1 (div_nonneg t_pos t'_pos.le)
       exact (div_lt_one t'_pos).2 tt'
-    rw [MulZeroClass.mul_zero] at N
+    rw [mul_zero] at N
     refine' tendstoUniformlyOn_iff.2 fun ε εpos => _
     filter_upwards [(tendsto_order.1 N).2 ε εpos] with n hn x hx
     simp only [Pi.zero_apply, dist_zero_left, Real.norm_of_nonneg (hnφ n x hx.1)]
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
@@ -39,13 +39,13 @@ open scoped Topology ENNReal
 
 /-- This lemma exists for finsets, but not for sets currently. porting note: move to
 data.set.basic after the port. -/
-theorem Set.disjoint_sdiff_inter {α : Type _} (s t : Set α) : Disjoint (s \ t) (s ∩ t) :=
+theorem Set.disjoint_sdiff_inter {α : Type*} (s t : Set α) : Disjoint (s \ t) (s ∩ t) :=
   disjoint_of_subset_right (inter_subset_right _ _) disjoint_sdiff_left
 #align set.disjoint_sdiff_inter Set.disjoint_sdiff_inter
 
 open Set
 
-variable {α E ι : Type _} {hm : MeasurableSpace α} {μ : Measure α} [TopologicalSpace α]
+variable {α E ι : Type*} {hm : MeasurableSpace α} {μ : Measure α} [TopologicalSpace α]
   [BorelSpace α] [NormedAddCommGroup E] [NormedSpace ℝ E] {g : α → E} {l : Filter ι} {x₀ : α}
   {s : Set α} {φ : ι → α → ℝ}
 
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -31,7 +31,7 @@ Note that there are related results about convolution with respect to peak funct
 -/
 
 
-local macro_rules | `($x ^ $y)   => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 open Set Filter MeasureTheory MeasureTheory.Measure TopologicalSpace Metric
 
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) 2023 Sébastien Gouëzel. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Sébastien Gouëzel
-
-! This file was ported from Lean 3 source module measure_theory.integral.peak_function
-! leanprover-community/mathlib commit 13b0d72fd8533ba459ac66e9a885e35ffabb32b2
-! 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.Function.LocallyIntegrable
 
+#align_import measure_theory.integral.peak_function from "leanprover-community/mathlib"@"13b0d72fd8533ba459ac66e9a885e35ffabb32b2"
+
 /-!
 # Integrals against peak functions
 
chore: remove superfluous parentheses around integrals (#5591)
Diff
@@ -56,7 +56,7 @@ variable {α E ι : Type _} {hm : MeasurableSpace α} {μ : Measure α} [Topolog
 `g` is integrable and continuous at `x₀`, then `φᵢ • g` is eventually integrable. -/
 theorem integrableOn_peak_smul_of_integrableOn_of_continuousWithinAt (hs : MeasurableSet s)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : ∀ᶠ i in l, (∫ x in s, φ i x ∂μ) = 1) (hmg : IntegrableOn g s μ)
+    (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ)
     (hcg : ContinuousWithinAt g s x₀) : ∀ᶠ i in l, IntegrableOn (fun x => φ i x • g x) s μ := by
   obtain ⟨u, u_open, x₀u, hu⟩ : ∃ u, IsOpen u ∧ x₀ ∈ u ∧ ∀ x ∈ u ∩ s, g x ∈ ball (g x₀) 1
   exact mem_nhdsWithin.1 (hcg (ball_mem_nhds _ zero_lt_one))
@@ -88,7 +88,7 @@ where one assumes additionally `g x₀ = 0`. -/
 theorem tendsto_set_integral_peak_smul_of_integrableOn_of_continuousWithinAt_aux
     (hs : MeasurableSet s) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
     (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
-    (hiφ : ∀ᶠ i in l, (∫ x in s, φ i x ∂μ) = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
+    (hiφ : ∀ᶠ i in l, ∫ x in s, φ i x ∂μ = 1) (hmg : IntegrableOn g s μ) (h'g : g x₀ = 0)
     (hcg : ContinuousWithinAt g s x₀) :
     Tendsto (fun i : ι => ∫ x in s, φ i x • g x ∂μ) l (𝓝 0) := by
   refine' Metric.tendsto_nhds.2 fun ε εpos => _
@@ -228,7 +228,7 @@ theorem tendsto_set_integral_pow_smul_of_unique_maximum_of_isCompact_of_measure_
       _root_.continuousOn_iff.1 hc x₀ h₀ (Ioi (0 : ℝ)) isOpen_Ioi hnc₀
     apply (hμ u u_open x₀_u).trans_le
     exact measure_mono fun x hx => ⟨ne_of_gt (pow_pos (a := c x) (hu hx) _), hx.2⟩
-  have hiφ : ∀ n, (∫ x in s, φ n x ∂μ) = 1 := fun n => by
+  have hiφ : ∀ n, ∫ x in s, φ n x ∂μ = 1 := fun n => by
     rw [integral_mul_left, inv_mul_cancel (P n).ne']
   have A : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 atTop (s \ u) := by
     intro u u_open x₀u
feat: port MeasureTheory.Integral.PeakFunction (#4772)

Dependencies 12 + 941

942 files ported (98.7%)
431560 lines ported (98.7%)
Show graph

The unported dependencies are

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