Skip to content

Commit ba9b598

Browse files
committed
refactor(Analysis/SpecialFunctions/ImproperIntegrals): generalize Frullani's integral to locally integrable functions
Address review: weaken `ContinuousOn` to `LocallyIntegrableOn`, drop unused helper lemmas, require only `c ≠ 0` in `integral_comp_mul_inv_smul`, and localize `[CompleteSpace E]`.
1 parent d23e9f0 commit ba9b598

4 files changed

Lines changed: 43 additions & 76 deletions

File tree

Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean

Lines changed: 42 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ half-infinite intervals in `ℝ`.
1919
These lemmas are stated in terms of either `Iic` or `Ioi` (neglecting `Iio` and `Ici`) to match
2020
mathlib's conventions for integrals over finite intervals (see `intervalIntegral`).
2121
22+
The file also proves **Frullani's integral** (`Frullani.integral_Ioi_eq`), together with its limit
23+
form `Frullani.tendsto_intervalIntegral`.
24+
2225
## See also
2326
2427
- `Mathlib/Analysis/SpecialFunctions/Integrals/Basic.lean`: specific integrals over finite intervals
@@ -292,28 +295,32 @@ namespace Frullani
292295

293296
open Metric
294297

295-
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f : ℝ → E}
298+
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {f : ℝ → E}
296299
{a b c : ℝ} {L R : E}
297300

298-
omit [CompleteSpace E] in
299-
lemma intervalIntegrable_inv_smul (hf : ContinuousOn f (Ioi 0)) {p q : ℝ} (hp : 0 < p)
301+
lemma intervalIntegrable_inv_smul (hf : LocallyIntegrableOn f (Ioi 0)) {p q : ℝ} (hp : 0 < p)
300302
(hq : 0 < q) : IntervalIntegrable (fun x ↦ x⁻¹ • f x) volume p q := by
301-
apply ContinuousOn.intervalIntegrable
302303
have hsub : uIcc p q ⊆ Ioi 0 := by simp [uIcc, Icc_subset_Ioi_iff, hp, hq]
303-
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).smul (hf.mono hsub)
304-
305-
omit [CompleteSpace E] in
306-
lemma intervalIntegrable_inv_smul_comp_mul (hf : ContinuousOn f (Ioi 0)) {p q : ℝ} (hp : 0 < p)
307-
(hq : 0 < q) (hc : 0 < c) : IntervalIntegrable (fun x ↦ x⁻¹ • f (c * x)) volume p q := by
308-
apply ContinuousOn.intervalIntegrable
304+
have hf_int : IntervalIntegrable f volume p q :=
305+
intervalIntegrable_iff.mpr
306+
((hf.integrableOn_compact_subset hsub isCompact_uIcc).mono_set uIoc_subset_uIcc)
307+
exact hf_int.continuousOn_smul (continuousOn_inv₀.mono fun x hx ↦ ne_of_gt (hsub hx))
308+
309+
lemma intervalIntegrable_inv_smul_comp_mul (hf : LocallyIntegrableOn f (Ioi 0)) {p q : ℝ}
310+
(hp : 0 < p) (hq : 0 < q) (hc : 0 < c) :
311+
IntervalIntegrable (fun x ↦ x⁻¹ • f (c * x)) volume p q := by
309312
have hsub : uIcc p q ⊆ Ioi 0 := by simp [uIcc, Icc_subset_Ioi_iff, hp, hq]
310-
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).smul
311-
(hf.comp (continuousOn_const.mul continuousOn_id) fun x hx ↦ mul_pos hc (hsub hx))
312-
313-
omit [CompleteSpace E] in
314-
lemma integral_comp_mul_inv_smul {ε r : ℝ} (hc : 0 < c) :
313+
have hf_cint : IntervalIntegrable f volume (c * p) (c * q) :=
314+
intervalIntegrable_iff.mpr
315+
((hf.integrableOn_compact_subset (by simp [uIcc, Icc_subset_Ioi_iff, mul_pos hc hp,
316+
mul_pos hc hq]) isCompact_uIcc).mono_set uIoc_subset_uIcc)
317+
have hf_comp : IntervalIntegrable (fun x ↦ f (c * x)) volume p q := by
318+
have h := hf_cint.comp_mul_left (c := c)
319+
rwa [mul_div_cancel_left₀ p hc.ne', mul_div_cancel_left₀ q hc.ne'] at h
320+
exact hf_comp.continuousOn_smul (continuousOn_inv₀.mono fun x hx ↦ ne_of_gt (hsub hx))
321+
322+
lemma integral_comp_mul_inv_smul {ε r : ℝ} (hc : c ≠ 0) :
315323
∫ x in ε..r, x⁻¹ • f (c * x) = ∫ x in c * ε..c * r, x⁻¹ • f x := by
316-
have hc' : c ≠ 0 := ne_of_gt hc
317324
let u : ℝ → E := fun x ↦ x⁻¹ • f x
318325
have key : (fun x ↦ x⁻¹ • f (c * x)) = fun x ↦ c • u (c * x) := by
319326
funext x
@@ -322,7 +329,9 @@ lemma integral_comp_mul_inv_smul {ε r : ℝ} (hc : 0 < c) :
322329
field_simp
323330
rw [key, intervalIntegral.integral_smul, smul_integral_comp_mul_left]
324331

325-
lemma norm_integral_inv_smul_sub_le (hf : ContinuousOn f (Ioi 0)) {p q : ℝ} (hp : 0 < p)
332+
variable [CompleteSpace E]
333+
334+
lemma norm_integral_inv_smul_sub_le (hf : LocallyIntegrableOn f (Ioi 0)) {p q : ℝ} (hp : 0 < p)
326335
(hq : 0 < q) {V : E} {δ : ℝ} (hδ : 0 ≤ δ) (h : ∀ x ∈ uIoc p q, ‖f x - V‖ ≤ δ) :
327336
‖(∫ x in p..q, x⁻¹ • f x) - log (q / p) • V‖ ≤ δ * |log (q / p)| := by
328337
have hsub : uIcc p q ⊆ Ioi 0 := by simp [uIcc, Icc_subset_Ioi_iff, hp, hq]
@@ -334,7 +343,7 @@ lemma norm_integral_inv_smul_sub_le (hf : ContinuousOn f (Ioi 0)) {p q : ℝ} (h
334343
have hint_inv : IntervalIntegrable (fun x : ℝ ↦ x⁻¹ * δ) volume p q := by
335344
apply ContinuousOn.intervalIntegrable
336345
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).mul continuousOn_const
337-
calc
346+
calc ‖(∫ x in p..q, x⁻¹ • f x) - log (q / p) • V‖
338347
_ = ‖∫ x in p..q, x⁻¹ • (f x - V)‖ := by
339348
congr 1
340349
have : log (q / p) • V = ∫ x in p..q, x⁻¹ • V := by
@@ -359,7 +368,7 @@ lemma norm_integral_inv_smul_sub_le (hf : ContinuousOn f (Ioi 0)) {p q : ℝ} (h
359368
rw [heq, intervalIntegral.integral_const_mul, integral_inv_of_pos hp hq]
360369
exact (abs_mul δ (log (q / p))).trans (by rw [abs_of_nonneg hδ])
361370

362-
lemma tendsto_integral_inv_smul_of_tendsto_uniform (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a)
371+
lemma tendsto_integral_inv_smul_of_tendsto_uniform (hf : LocallyIntegrableOn f (Ioi 0)) (ha : 0 < a)
363372
(hb : 0 < b) {F : Filter ℝ} (hpos : ∀ᶠ t in F, 0 < t) {V : E}
364373
(huni : ∀ δ > 0, ∀ᶠ t in F, ∀ x ∈ uIoc (a * t) (b * t), ‖f x - V‖ ≤ δ) :
365374
Tendsto (fun t ↦ ∫ x in (a * t)..(b * t), x⁻¹ • f x) F (𝓝 (log (b / a) • V)) := by
@@ -373,21 +382,21 @@ lemma tendsto_integral_inv_smul_of_tendsto_uniform (hf : ContinuousOn f (Ioi 0))
373382
have hbε : 0 < b * t := mul_pos hb ht_pos
374383
have hlog_eq : log (b * t / (a * t)) = log (b / a) := by
375384
rw [mul_div_mul_right b a (ne_of_gt ht_pos)]
376-
calc
385+
calc dist (∫ x in a * t..b * t, x⁻¹ • f x) (log (b / a) • V)
377386
_ = ‖(∫ x in a * t..b * t, x⁻¹ • f x) - log (b / a) • V‖ := dist_eq_norm _ _
378387
_ = ‖(∫ x in a * t..b * t, x⁻¹ • f x) - log (b * t / (a * t)) • V‖ := by rw [hlog_eq]
379388
_ ≤ δ' * |log (b * t / (a * t))| :=
380389
norm_integral_inv_smul_sub_le hf haε hbε hδ'.le hbound
381390
_ = δ' * C := by rw [hlog_eq]
382391
_ < δ := by
383-
calc
392+
calc δ' * C
384393
_ = δ * (C / (C + 1)) := by ring
385394
_ < δ * 1 :=
386395
mul_lt_mul_of_pos_left ((div_lt_one (by positivity)).2 (lt_add_one C)) hδ
387396
_ = δ := mul_one δ
388397

389-
lemma tendsto_integral_inv_smul_nhdsWithin (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
390-
(hL : Tendsto f (𝓝[>] 0) (𝓝 L)) :
398+
lemma tendsto_integral_inv_smul_nhdsWithin (hf : LocallyIntegrableOn f (Ioi 0)) (ha : 0 < a)
399+
(hb : 0 < b) (hL : Tendsto f (𝓝[>] 0) (𝓝 L)) :
391400
Tendsto (fun ε ↦ ∫ x in (a * ε)..(b * ε), x⁻¹ • f x) (𝓝[>] 0) (𝓝 (log (b / a) • L)) := by
392401
apply tendsto_integral_inv_smul_of_tendsto_uniform hf ha hb self_mem_nhdsWithin
393402
intro δ hδ
@@ -405,7 +414,7 @@ lemma tendsto_integral_inv_smul_nhdsWithin (hf : ContinuousOn f (Ioi 0)) (ha : 0
405414
have hx_pos : 0 < x := lt_of_lt_of_le (lt_min haε hbε) (uIoc_subset_uIcc hx).1
406415
have hx_lt_η : dist x 0 < η := by
407416
rw [Real.dist_eq, sub_zero, abs_of_pos hx_pos]
408-
calc
417+
calc x
409418
_ ≤ max (a * t) (b * t) := (uIoc_subset_uIcc hx).2
410419
_ = M * t := by rw [hM_def, max_mul_of_nonneg _ _ ht_pos.le]
411420
_ < M * (η / M) := mul_lt_mul_of_pos_left ht_bound hM
@@ -414,9 +423,9 @@ lemma tendsto_integral_inv_smul_nhdsWithin (hf : ContinuousOn f (Ioi 0)) (ha : 0
414423
rw [mem_setOf_eq, dist_eq_norm] at this
415424
exact le_of_lt this
416425

417-
/-- If `f → R` as `x → +∞` and `f` is continuous on `(0, ∞)`, then the weighted integral
426+
/-- If `f → R` as `x → +∞` and `f` is locally integrable on `(0, ∞)`, then the weighted integral
418427
`∫ x in a*r..b*r, x⁻¹ • f x` converges to `log(b/a) • R` as `r → +∞`. -/
419-
lemma tendsto_integral_inv_smul_atTop (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
428+
lemma tendsto_integral_inv_smul_atTop (hf : LocallyIntegrableOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
420429
(hR : Tendsto f atTop (𝓝 R)) :
421430
Tendsto (fun r ↦ ∫ x in (a * r)..(b * r), x⁻¹ • f x) atTop (𝓝 (log (b / a) • R)) := by
422431
apply tendsto_integral_inv_smul_of_tendsto_uniform hf ha hb
@@ -433,7 +442,7 @@ lemma tendsto_integral_inv_smul_atTop (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a)
433442
have haε : 0 < a * t := mul_pos ha ht_pos
434443
have hbε : 0 < b * t := mul_pos hb ht_pos
435444
have hNx : N ≤ x :=
436-
calc
445+
calc N
437446
_ = min a b * (N / min a b) := by field_simp
438447
_ ≤ min a b * t :=
439448
mul_le_mul_of_nonneg_left ((le_max_right _ _).trans ht) hm.le
@@ -444,10 +453,10 @@ lemma tendsto_integral_inv_smul_atTop (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a)
444453
exact le_of_lt hdist
445454

446455
/-- **Frullani's integral**, limit form, for functions valued in a complete normed space.
447-
If `f` is continuous on `(0, ∞)` with `f x → L` as `x → 0⁺` and `f x → R` as `x → +∞`,
456+
If `f` is locally integrable on `(0, ∞)` with `f x → L` as `x → 0⁺` and `f x → R` as `x → +∞`,
448457
and `0 < a` and `0 < b`, then `∫ x in ε..r, x⁻¹ • (f (a * x) - f (b * x)) → log (b / a) • (L - R)`
449458
as `ε → 0⁺` and `r → +∞`. -/
450-
theorem tendsto_intervalIntegral (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
459+
theorem tendsto_intervalIntegral (hf : LocallyIntegrableOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
451460
(hL : Tendsto f (𝓝[>] 0) (𝓝 L)) (hR : Tendsto f atTop (𝓝 R)) :
452461
Tendsto (fun p : ℝ × ℝ ↦ ∫ x in p.1..p.2, x⁻¹ • (f (a * x) - f (b * x)))
453462
((𝓝[>] 0) ×ˢ atTop) (𝓝 (log (b / a) • (L - R))) := by
@@ -457,13 +466,13 @@ theorem tendsto_intervalIntegral (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb
457466
have hsplit {ε r : ℝ} (hε : 0 < ε) (hr : 0 < r) :
458467
∫ x in ε..r, x⁻¹ • (f (a * x) - f (b * x)) =
459468
(∫ x in (a * ε)..(b * ε), u x) - ∫ x in (a * r)..(b * r), u x := by
460-
calc
469+
calc ∫ x in ε..r, x⁻¹ • (f (a * x) - f (b * x))
461470
_ = (∫ x in ε..r, x⁻¹ • f (a * x)) - ∫ x in ε..r, x⁻¹ • f (b * x) := by
462471
simp_rw [smul_sub]
463472
exact integral_sub (intervalIntegrable_inv_smul_comp_mul hf hε hr ha)
464473
(intervalIntegrable_inv_smul_comp_mul hf hε hr hb)
465474
_ = (∫ y in a * ε..a * r, u y) - ∫ y in b * ε..b * r, u y := by
466-
rw [integral_comp_mul_inv_smul ha, integral_comp_mul_inv_smul hb]
475+
rw [integral_comp_mul_inv_smul ha.ne', integral_comp_mul_inv_smul hb.ne']
467476
_ = _ := integral_interval_sub_interval_comm
468477
(hint (mul_pos ha hε) (mul_pos ha hr))
469478
(hint (mul_pos hb hε) (mul_pos hb hr))
@@ -479,10 +488,10 @@ theorem tendsto_intervalIntegral (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb
479488
((tendsto_integral_inv_smul_atTop hf ha hb hR).comp tendsto_snd)
480489

481490
/-- **Frullani's integral** for functions valued in a complete normed space.
482-
If `f` is continuous on `(0, ∞)` with `f x → L` as `x → 0⁺` and `f x → R` as `x → +∞`,
491+
If `f` is locally integrable on `(0, ∞)` with `f x → L` as `x → 0⁺` and `f x → R` as `x → +∞`,
483492
`0 < a` and `0 < b`, and `x ↦ x⁻¹ • (f (a * x) - f (b * x))` is integrable on `(0, ∞)`, then
484493
`∫ x in Ioi 0, x⁻¹ • (f (a * x) - f (b * x)) = log (b / a) • (L - R)`. -/
485-
theorem integral_Ioi_eq (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
494+
theorem integral_Ioi_eq (hf : LocallyIntegrableOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
486495
(hL : Tendsto f (𝓝[>] 0) (𝓝 L)) (hR : Tendsto f atTop (𝓝 R))
487496
(hint : IntegrableOn (fun x ↦ x⁻¹ • (f (a * x) - f (b * x))) (Ioi 0)) :
488497
∫ x in Ioi 0, x⁻¹ • (f (a * x) - f (b * x)) = log (b / a) • (L - R) := by

Mathlib/MeasureTheory/Integral/IntervalIntegral/MeanValue.lean

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module
77

88
public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic
99
public import Mathlib.MeasureTheory.Integral.MeanValue
10-
public import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
1110

1211
/-!
1312
# First mean value theorem for interval integrals
@@ -34,7 +33,7 @@ mean value theorem, interval integral
3433

3534
public section
3635

37-
open MeasureTheory Set intervalIntegral Real
36+
open MeasureTheory Set intervalIntegral
3837

3938
open scoped Interval
4039

@@ -82,24 +81,3 @@ theorem exists_eq_const_mul_intervalIntegral_of_nonneg
8281
rw [ae_restrict_iff' measurableSet_uIoc]
8382
exact ae_of_all μ hg0
8483
exact exists_eq_const_mul_intervalIntegral_of_ae_nonneg hf hg hg0_ae
85-
86-
theorem exists_integral_div_eq_mul_log {p q : ℝ} {f : ℝ → ℝ} (hp : 0 < p) (hq : 0 < q)
87-
(hf : ContinuousOn f (uIcc p q)) :
88-
∃ c ∈ uIcc p q, ∫ x in p..q, f x / x = f c * log (q / p) := by
89-
let g : ℝ → ℝ := fun x ↦ 1 / x
90-
have hfg (x : ℝ) : f x / x = f x * g x := by unfold g; field_simp
91-
have h_integrand_eq : (∫ x in p..q, f x * g x) = (∫ x in p..q, f x / x) := by simp [hfg]
92-
rw [← h_integrand_eq]
93-
have hg' : IntervalIntegrable g volume p q := by
94-
unfold g
95-
simp only [one_div, intervalIntegrable_inv_iff]
96-
right
97-
exact notMem_uIcc_of_lt (by linarith) (by linarith)
98-
have hg_nonneg : ∀ x ∈ uIoc p q, 0 ≤ g x := by
99-
intro x hx
100-
rw [one_div_nonneg]
101-
rw [mem_uIoc] at hx
102-
rcases hx with h | h
103-
all_goals linarith
104-
rw [← integral_one_div_of_pos hp hq]
105-
exact exists_eq_const_mul_intervalIntegral_of_nonneg hf hg' hg_nonneg

Mathlib/Topology/Algebra/GroupWithZero.lean

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,6 @@ nonrec theorem ContinuousWithinAt.div (hf : ContinuousWithinAt f s a)
209209
theorem ContinuousOn.div (hf : ContinuousOn f s) (hg : ContinuousOn g s) (h₀ : ∀ x ∈ s, g x ≠ 0) :
210210
ContinuousOn (f / g) s := fun x hx => (hf x hx).div (hg x hx) (h₀ x hx)
211211

212-
theorem ContinuousOn.comp_mul_left_div {f g : G₀ → G₀} {s t : Set G₀} {c : G₀}
213-
(hf : ContinuousOn f t) (hg : ContinuousOn g s) (hct : Set.MapsTo (fun x ↦ c * x) s t)
214-
(hne : ∀ x ∈ s, g x ≠ 0) : ContinuousOn (fun x ↦ f (c * x) / g x) s :=
215-
(hf.comp_mul_left hct).div hg hne
216-
217-
theorem ContinuousOn.comp_mul_right_div {f g : G₀ → G₀} {s t : Set G₀} {c : G₀}
218-
(hf : ContinuousOn f t) (hg : ContinuousOn g s) (hct : Set.MapsTo (fun x ↦ x * c) s t)
219-
(hne : ∀ x ∈ s, g x ≠ 0) : ContinuousOn (fun x ↦ f (x * c) / g x) s :=
220-
(hf.comp_mul_right hct).div hg hne
221-
222212
/-- Continuity at a point of the result of dividing two functions continuous at that point, where
223213
the denominator is nonzero. -/
224214
nonrec theorem ContinuousAt.div (hf : ContinuousAt f a) (hg : ContinuousAt g a) (h₀ : g a ≠ 0) :

Mathlib/Topology/Algebra/Monoid.lean

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,6 @@ alias continuous_mul_left := continuous_const_mul
109109
@[to_additive existing, deprecated (since := "2026-02-20")]
110110
alias continuous_mul_right := continuous_mul_const
111111

112-
@[to_additive]
113-
theorem ContinuousOn.comp_mul_left {f : M → X} {s t : Set M} {c : M} (hf : ContinuousOn f t)
114-
(hct : Set.MapsTo (fun x : M => c * x) s t) : ContinuousOn (fun x => f (c * x)) s :=
115-
hf.comp (continuous_const_mul c).continuousOn hct
116-
117-
@[to_additive]
118-
theorem ContinuousOn.comp_mul_right {f : M → X} {s t : Set M} {c : M} (hf : ContinuousOn f t)
119-
(hct : Set.MapsTo (fun x : M => x * c) s t) : ContinuousOn (fun x => f (x * c)) s :=
120-
hf.comp (continuous_mul_const c).continuousOn hct
121-
122112
@[to_additive]
123113
theorem tendsto_mul {a b : M} : Tendsto (fun p : M × M => p.fst * p.snd) (𝓝 (a, b)) (𝓝 (a * b)) :=
124114
continuous_iff_continuousAt.mp ContinuousMul.continuous_mul (a, b)

0 commit comments

Comments
 (0)