Skip to content

Commit 61b111b

Browse files
committed
feat(Analysis/SpecialFunctions/ImproperIntegrals): generalize Frullani's integral to complete real normed space
1 parent 29b9af9 commit 61b111b

1 file changed

Lines changed: 243 additions & 108 deletions

File tree

Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean

Lines changed: 243 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -290,125 +290,260 @@ namespace Frullani
290290

291291
open Metric
292292

293-
variable {f : ℝ → ℝ} {a b c d L R : ℝ}
294-
295-
lemma comp_mul_left_div (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) :
296-
ContinuousOn (fun x ↦ f (c * x) / x) (uIcc a b) := by
297-
have hsub : uIcc a b ⊆ Ioi 0 := by simp [uIcc, Icc_subset_Ioi_iff, ha, hb]
298-
apply hf.comp_mul_left_div continuousOn_id
299-
all_goals intro x hx
300-
· exact mul_pos hc (hsub hx)
301-
· exact ne_of_gt (hsub hx)
302-
303-
lemma intervalIntegrable_comp_mul_div (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
304-
(hc : 0 < c) : IntervalIntegrable (fun x ↦ f (c * x) / x) volume a b :=
305-
(comp_mul_left_div hf ha hb hc).intervalIntegrable
306-
307-
lemma exists_integral_div_eq_mul_log (hf : ContinuousOn f (Ici 0)) (ha : 0 < a) (hb : 0 < b)
308-
(hc : 0 < c) :
309-
∃ d ∈ uIcc (a * c) (b * c), ∫ x in (a * c)..(b * c), f x / x = f d * log (b / a) := by
310-
have hac := mul_pos ha hc
311-
have hbc := mul_pos hb hc
312-
have hf' : ContinuousOn f (uIcc (a * c) (b * c)) :=
313-
hf.mono (by simp [uIcc, Icc_subset_Ici_iff, hac.le, hbc.le])
314-
obtain ⟨d, hd, heq⟩ := _root_.exists_integral_div_eq_mul_log hac hbc hf'
315-
rw [mul_div_mul_right b a (ne_of_gt hc)] at heq
316-
exact ⟨d, hd, heq⟩
317-
318-
lemma integral_comp_mul_div {ε r : ℝ} (hc : 0 < c) :
319-
∫ x in ε..r, f (c * x) / x = ∫ x in c * ε..c * r, f x / x := by
320-
let u : ℝ → ℝ := fun x ↦ f x / x
321-
change _ = ∫ x in c * ε..c * r, u x
322-
have : (fun x ↦ f (c * x) / x) = fun x ↦ c * u (c * x) := by
323-
ext x
324-
field
325-
simp [this]
326-
327-
lemma min_mul_le_of_mem_uIcc_mul {y : ℝ} (hy : 0 ≤ y)
328-
(hd : d ∈ uIcc (a * y) (b * y)) : min a b * y ≤ d := by
329-
grind [mem_uIcc, min_mul_of_nonneg a b hy]
330-
331-
lemma le_max_mul_of_mem_uIcc_mul {y : ℝ} (hy : 0 ≤ y)
332-
(hd : d ∈ uIcc (a * y) (b * y)) : d ≤ max a b * y := by
333-
grind [mem_uIcc, max_mul_of_nonneg a b hy]
334-
335-
lemma pos_of_mem_uIcc_mul (ha : 0 < a) (hb : 0 < b) {y : ℝ} (hy : 0 < y)
336-
(hd : d ∈ uIcc (a * y) (b * y)) : 0 < d := by
337-
grind [mem_uIcc, mul_pos ha hy, mul_pos hb hy]
338-
339-
/-- **Frullani's integral**, limit form. If `f` is continuous on `(0, ∞)` with `f x → L` as `x → 0⁺`
340-
and `f x → R` as `x → +∞`, and `0 < a` and `0 < b`, then
341-
`∫ x in ε..r, (f (a * x) - f (b * x)) / x → (L - R) * log (b / a)` as `ε → 0⁺` and `r → +∞`. -/
293+
variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f : ℝ → E}
294+
{a b c : ℝ} {L R : E}
295+
296+
omit [CompleteSpace E] in
297+
lemma intervalIntegrable_inv_smul (hf : ContinuousOn f (Ioi 0)) {p q : ℝ}
298+
(hp : 0 < p) (hq : 0 < q) :
299+
IntervalIntegrable (fun x ↦ x⁻¹ • f x) volume p q := by
300+
apply ContinuousOn.intervalIntegrable
301+
have hsub : uIcc p q ⊆ Ioi 0 := by simp [uIcc, Icc_subset_Ioi_iff, hp, hq]
302+
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).smul (hf.mono hsub)
303+
304+
omit [CompleteSpace E] in
305+
lemma intervalIntegrable_inv_smul_comp_mul (hf : ContinuousOn f (Ioi 0))
306+
{p q : ℝ} (hp : 0 < p) (hq : 0 < q) (hc : 0 < c) :
307+
IntervalIntegrable (fun x ↦ x⁻¹ • f (c * x)) volume p q := by
308+
apply ContinuousOn.intervalIntegrable
309+
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) :
315+
∫ 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
317+
let u : ℝ → E := fun x ↦ x⁻¹ • f x
318+
have key : (fun x ↦ x⁻¹ • f (c * x)) = fun x ↦ c • u (c * x) := by
319+
funext x
320+
simp only [u, smul_smul]
321+
congr 1
322+
field_simp
323+
rw [key, intervalIntegral.integral_smul, smul_integral_comp_mul_left]
324+
325+
/-- If `f → L` as `x → 0⁺` and `f` is continuous on `(0, ∞)`, then the weighted integral
326+
`∫ x in a*ε..b*ε, x⁻¹ • f x` converges to `log(b/a) • L` as `ε → 0⁺`. -/
327+
lemma tendsto_integral_inv_smul_nhdsWithin
328+
(hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
329+
(hL : Tendsto f (𝓝[>] 0) (𝓝 L)) :
330+
Tendsto (fun ε ↦ ∫ x in (a * ε)..(b * ε), x⁻¹ • f x) (𝓝[>] 0)
331+
(𝓝 (log (b / a) • L)) := by
332+
rw [Metric.tendsto_nhds]
333+
intro δ hδ
334+
by_cases hlog : log (b / a) = 0
335+
· have hab : a = b := by
336+
have hba : (0 : ℝ) < b / a := div_pos hb ha
337+
rcases log_eq_zero.1 hlog with h | h | h
338+
all_goals grind
339+
filter_upwards [self_mem_nhdsWithin] with ε _
340+
rw [hab, integral_same, div_self (ne_of_gt hb), log_one, zero_smul, dist_self]
341+
exact hδ
342+
· set C := |log (b / a)| with hC_def
343+
have hC : 0 < C := abs_pos.2 hlog
344+
set δ' := δ / (C + 1)
345+
have hδ' : 0 < δ' := div_pos hδ (by positivity)
346+
have hev : ∀ᶠ x in 𝓝[>] (0 : ℝ), dist (f x) L < δ' :=
347+
hL.eventually (ball_mem_nhds L hδ')
348+
rw [Filter.Eventually, mem_nhdsWithin_iff] at hev
349+
obtain ⟨η, hη, hη_sub⟩ := hev
350+
set M := max a b with hM_def
351+
have hM : 0 < M := lt_max_of_lt_left ha
352+
filter_upwards [self_mem_nhdsWithin,
353+
nhdsWithin_le_nhds (Iio_mem_nhds (div_pos hη hM))] with ε hε_pos hε_bound
354+
have hε_pos : 0 < ε := hε_pos
355+
have haε : 0 < a * ε := mul_pos ha hε_pos
356+
have hbε : 0 < b * ε := mul_pos hb hε_pos
357+
have hfL : ∀ x ∈ uIoc (a * ε) (b * ε), ‖f x - L‖ ≤ δ' := by
358+
intro x hx
359+
have hx_pos : 0 < x :=
360+
lt_of_lt_of_le (lt_min haε hbε) (uIoc_subset_uIcc hx).1
361+
have hx_lt_η : dist x 0 < η := by
362+
rw [Real.dist_eq, sub_zero, abs_of_pos hx_pos]
363+
calc
364+
_ ≤ max (a * ε) (b * ε) := (uIoc_subset_uIcc hx).2
365+
_ = M * ε := by rw [hM_def, max_mul_of_nonneg _ _ hε_pos.le]
366+
_ < M * (η / M) := mul_lt_mul_of_pos_left hε_bound hM
367+
_ = η := mul_div_cancel₀ η (ne_of_gt hM)
368+
have := hη_sub ⟨mem_ball.2 hx_lt_η, hx_pos⟩
369+
rw [mem_setOf_eq, dist_eq_norm] at this
370+
exact le_of_lt this
371+
have hint_f : IntervalIntegrable (fun x ↦ x⁻¹ • f x) volume (a * ε) (b * ε) :=
372+
intervalIntegrable_inv_smul hf haε hbε
373+
have hint_L : IntervalIntegrable (fun x ↦ x⁻¹ • L) volume (a * ε) (b * ε) := by
374+
apply ContinuousOn.intervalIntegrable
375+
have hsub : uIcc (a * ε) (b * ε) ⊆ Ioi 0 := by
376+
simp [uIcc, Icc_subset_Ioi_iff, haε, hbε]
377+
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).smul continuousOn_const
378+
have hint_inv : IntervalIntegrable (fun x : ℝ ↦ x⁻¹ * δ') volume (a * ε) (b * ε) := by
379+
apply ContinuousOn.intervalIntegrable
380+
have hsub : uIcc (a * ε) (b * ε) ⊆ Ioi 0 := by
381+
simp [uIcc, Icc_subset_Ioi_iff, haε, hbε]
382+
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).mul continuousOn_const
383+
calc
384+
_ = ‖(∫ x in a * ε..b * ε, x⁻¹ • f x) - log (b / a) • L‖ := dist_eq_norm _ _
385+
_ = ‖∫ x in a * ε..b * ε, x⁻¹ • (f x - L)‖ := by
386+
congr 1
387+
have : log (b / a) • L = ∫ x in a * ε..b * ε, x⁻¹ • L := by
388+
rw [intervalIntegral.integral_smul_const (f := fun x ↦ (x⁻¹ : ℝ)) (c := L),
389+
integral_inv_of_pos haε hbε, mul_div_mul_right b a (ne_of_gt hε_pos)]
390+
rw [this, ← integral_sub hint_f hint_L]
391+
congr 1
392+
funext x
393+
exact (smul_sub _ _ _).symm
394+
_ ≤ |∫ x in a * ε..b * ε, x⁻¹ * δ'| := by
395+
apply norm_integral_le_abs_of_norm_le
396+
· exact (ae_restrict_mem measurableSet_uIoc).mono fun x hx ↦ by
397+
rw [norm_smul, Real.norm_eq_abs, abs_of_pos
398+
(inv_pos.2 (lt_of_lt_of_le (lt_min haε hbε) (uIoc_subset_uIcc hx).1))]
399+
exact mul_le_mul_of_nonneg_left (hfL x hx)
400+
(inv_nonneg.2 (le_of_lt (lt_of_lt_of_le (lt_min haε hbε)
401+
(uIoc_subset_uIcc hx).1)))
402+
· exact hint_inv
403+
_ = δ' * C := by
404+
have heq : (fun x : ℝ ↦ x⁻¹ * δ') = fun x ↦ δ' * x⁻¹ := by
405+
funext x
406+
ring
407+
rw [heq, intervalIntegral.integral_const_mul, integral_inv_of_pos haε hbε,
408+
mul_div_mul_right b a (ne_of_gt hε_pos)]
409+
exact (abs_mul δ' (log (b / a))).trans (by rw [abs_of_pos hδ'])
410+
_ < δ := by
411+
calc
412+
_ = δ * (C / (C + 1)) := by ring
413+
_ < δ * 1 := by
414+
exact mul_lt_mul_of_pos_left ((div_lt_one (by positivity)).2 (lt_add_one C)) hδ
415+
_ = δ := mul_one δ
416+
417+
/-- If `f → R` as `x → +∞` and `f` is continuous on `(0, ∞)`, then the weighted integral
418+
`∫ x in a*r..b*r, x⁻¹ • f x` converges to `log(b/a) • R` as `r → +∞`. -/
419+
lemma tendsto_integral_inv_smul_atTop
420+
(hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b) (hR : Tendsto f atTop (𝓝 R)) :
421+
Tendsto (fun r ↦ ∫ x in (a * r)..(b * r), x⁻¹ • f x) atTop (𝓝 (log (b / a) • R)) := by
422+
rw [Metric.tendsto_nhds]
423+
intro δ hδ
424+
by_cases hlog : log (b / a) = 0
425+
· have hab : a = b := by
426+
have hba : (0 : ℝ) < b / a := div_pos hb ha
427+
rcases log_eq_zero.1 hlog with h | h | h
428+
all_goals grind
429+
filter_upwards [eventually_atTop.21, fun r _ ↦ trivial⟩] with r _
430+
rw [hab, integral_same, div_self (ne_of_gt hb), log_one, zero_smul, dist_self]
431+
exact hδ
432+
· set C := |log (b / a)| with hC_def
433+
have hC : 0 < C := abs_pos.2 hlog
434+
set δ' := δ / (C + 1)
435+
have hδ' : 0 < δ' := div_pos hδ (by positivity)
436+
have hev : ∀ᶠ x in atTop, dist (f x) R < δ' :=
437+
hR.eventually (ball_mem_nhds R hδ')
438+
rw [Filter.eventually_atTop] at hev
439+
obtain ⟨N, hN⟩ := hev
440+
have hm : 0 < min a b := lt_min ha hb
441+
filter_upwards [eventually_atTop.2 ⟨max 1 (N / min a b), fun r hr ↦ hr⟩] with r hr
442+
have hr_pos : 0 < r := lt_of_lt_of_le one_pos ((le_max_left 1 _).trans hr)
443+
have haε : 0 < a * r := mul_pos ha hr_pos
444+
have hbε : 0 < b * r := mul_pos hb hr_pos
445+
have hfR : ∀ x ∈ uIoc (a * r) (b * r), ‖f x - R‖ ≤ δ' := by
446+
intro x hx
447+
have hNx : N ≤ x :=
448+
calc
449+
_ = min a b * (N / min a b) := by field_simp
450+
_ ≤ min a b * r :=
451+
mul_le_mul_of_nonneg_left ((le_max_right _ _).trans hr) hm.le
452+
_ = min (a * r) (b * r) := by rw [min_mul_of_nonneg _ _ hr_pos.le]
453+
_ ≤ x := (uIoc_subset_uIcc hx).1
454+
have hdist := hN x hNx
455+
rw [dist_eq_norm] at hdist
456+
exact le_of_lt hdist
457+
have hint_f := intervalIntegrable_inv_smul hf haε hbε
458+
have hint_R : IntervalIntegrable (fun x ↦ x⁻¹ • R) volume (a * r) (b * r) := by
459+
apply ContinuousOn.intervalIntegrable
460+
have hsub : uIcc (a * r) (b * r) ⊆ Ioi 0 := by
461+
simp [uIcc, Icc_subset_Ioi_iff, haε, hbε]
462+
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).smul continuousOn_const
463+
have hint_inv : IntervalIntegrable (fun x : ℝ ↦ x⁻¹ * δ') volume (a * r) (b * r) := by
464+
apply ContinuousOn.intervalIntegrable
465+
have hsub : uIcc (a * r) (b * r) ⊆ Ioi 0 := by
466+
simp [uIcc, Icc_subset_Ioi_iff, haε, hbε]
467+
exact (continuousOn_inv₀.mono (fun x hx ↦ ne_of_gt (hsub hx))).mul continuousOn_const
468+
calc
469+
_ = ‖(∫ x in a * r..b * r, x⁻¹ • f x) - log (b / a) • R‖ := dist_eq_norm _ _
470+
_ = ‖∫ x in a * r..b * r, x⁻¹ • (f x - R)‖ := by
471+
congr 1
472+
have : log (b / a) • R = ∫ x in a * r..b * r, x⁻¹ • R := by
473+
rw [intervalIntegral.integral_smul_const (f := fun x ↦ (x⁻¹ : ℝ)) (c := R),
474+
integral_inv_of_pos haε hbε, mul_div_mul_right b a (ne_of_gt hr_pos)]
475+
rw [this, ← integral_sub hint_f hint_R]
476+
congr 1
477+
funext x
478+
exact (smul_sub _ _ _).symm
479+
_ ≤ |∫ x in a * r..b * r, x⁻¹ * δ'| := by
480+
apply norm_integral_le_abs_of_norm_le
481+
· exact (ae_restrict_mem measurableSet_uIoc).mono fun x hx ↦ by
482+
rw [norm_smul, Real.norm_eq_abs, abs_of_pos
483+
(inv_pos.2 (lt_of_lt_of_le (lt_min haε hbε) (uIoc_subset_uIcc hx).1))]
484+
exact mul_le_mul_of_nonneg_left (hfR x hx)
485+
(inv_nonneg.2 (le_of_lt (lt_of_lt_of_le (lt_min haε hbε)
486+
(uIoc_subset_uIcc hx).1)))
487+
· exact hint_inv
488+
_ = δ' * C := by
489+
have heq : (fun x : ℝ ↦ x⁻¹ * δ') = fun x ↦ δ' * x⁻¹ := by
490+
funext x
491+
ring
492+
rw [heq, intervalIntegral.integral_const_mul, integral_inv_of_pos haε hbε,
493+
mul_div_mul_right b a (ne_of_gt hr_pos)]
494+
exact (abs_mul δ' (log (b / a))).trans (by rw [abs_of_pos hδ'])
495+
_ < δ := by
496+
calc
497+
_ = δ * (C / (C + 1)) := by ring
498+
_ < δ * 1 := by
499+
exact mul_lt_mul_of_pos_left ((div_lt_one (by positivity)).2 (lt_add_one C)) hδ
500+
_ = δ := mul_one δ
501+
502+
/-- **Frullani's integral**, limit form, for functions valued in a complete normed space.
503+
If `f` is continuous on `(0, ∞)` with `f x → L` as `x → 0⁺` and `f x → R` as `x → +∞`,
504+
and `0 < a` and `0 < b`, then `∫ x in ε..r, x⁻¹ • (f (a * x) - f (b * x)) → log (b / a) • (L - R)`
505+
as `ε → 0⁺` and `r → +∞`. -/
342506
theorem tendsto_intervalIntegral (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
343507
(hL : Tendsto f (𝓝[>] 0) (𝓝 L)) (hR : Tendsto f atTop (𝓝 R)) :
344-
Tendsto (fun p : ℝ × ℝ ↦ ∫ x in p.1..p.2, (f (a * x) - f (b * x)) / x) ((𝓝[>] 0) ×ˢ atTop)
345-
(𝓝 ((L - R) * log (b / a))) := by
346-
let u := fun x ↦ f x / x
347-
have hsubset {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : uIcc p q ⊆ Ioi 0 := by
348-
simp [uIcc, Icc_subset_Ioi_iff, hp, hq]
349-
have hint {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : IntervalIntegrable u volume p q := by
350-
simpa using intervalIntegrable_comp_mul_div hf hp hq one_pos
351-
have hint' {c p q : ℝ} (hc : 0 < c) (hp : 0 < p) (hq : 0 < q) :
352-
IntervalIntegrable (fun x ↦ f (c * x) / x) volume p q :=
353-
intervalIntegrable_comp_mul_div hf hp hq hc
354-
have hmvt {y : ℝ} (hy : 0 < y) : ∃ d ∈ uIcc (a * y) (b * y),
355-
∫ x in (a * y)..(b * y), u x = f d * log (b / a) := by
356-
have h := _root_.exists_integral_div_eq_mul_log (mul_pos ha hy) (mul_pos hb hy)
357-
(hf.mono (hsubset (mul_pos ha hy) (mul_pos hb hy)))
358-
field_simp at h
359-
simpa [mul_comm] using h
360-
choose! d hd_mem hd_eq using fun y (hy : 0 < y) ↦ hmvt hy
361-
have hsplit {ε r : ℝ} (hε : 0 < ε) (hr : 0 < r) : ∫ x in ε..r, (f (a * x) - f (b * x)) / x =
508+
Tendsto (fun p : ℝ × ℝ ↦ ∫ x in p.1..p.2, x⁻¹ • (f (a * x) - f (b * x)))
509+
((𝓝[>] 0) ×ˢ atTop) (𝓝 (log (b / a) • (L - R))) := by
510+
let u := fun x ↦ x⁻¹ • f x
511+
have hint {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : IntervalIntegrable u volume p q :=
512+
intervalIntegrable_inv_smul hf hp hq
513+
have hsplit {ε r : ℝ} (hε : 0 < ε) (hr : 0 < r) :
514+
∫ x in ε..r, x⁻¹ • (f (a * x) - f (b * x)) =
362515
(∫ x in (a * ε)..(b * ε), u x) - ∫ x in (a * r)..(b * r), u x := by
363516
calc
364-
_ = (∫ x in ε..r, f (a * x) / x) - ∫ x in ε..r, f (b * x) / x := by
365-
simp_rw [sub_div]
366-
exact integral_sub (hint' ha hε hr) (hint' hb hε hr)
517+
_ = (∫ x in ε..r, x⁻¹ • f (a * x)) - ∫ x in ε..r, x⁻¹ • f (b * x) := by
518+
simp_rw [smul_sub]
519+
exact integral_sub (intervalIntegrable_inv_smul_comp_mul hf hε hr ha)
520+
(intervalIntegrable_inv_smul_comp_mul hf hε hr hb)
367521
_ = (∫ y in a * ε..a * r, u y) - ∫ y in b * ε..b * r, u y := by
368-
rw [integral_comp_mul_div ha, integral_comp_mul_div hb]
522+
rw [integral_comp_mul_inv_smul ha, integral_comp_mul_inv_smul hb]
369523
_ = _ := integral_interval_sub_interval_comm
370-
(hint (mul_pos ha hε) (mul_pos ha hr))
371-
(hint (mul_pos hb hε) (mul_pos hb hr))
372-
(hint (mul_pos ha hε) (mul_pos hb hε))
373-
have hd_zero : Tendsto (fun ε ↦ f (d ε)) (𝓝[>] 0) (𝓝 L) := by
374-
apply hL.comp
375-
apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within
376-
· apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds
377-
· exact (by simpa using tendsto_const_nhds.mul (@tendsto_id ℝ (𝓝 0)) :
378-
Tendsto (fun ε ↦ max a b * ε) (𝓝 (0 : ℝ)) (𝓝 0)).mono_left nhdsWithin_le_nhds
379-
· exact eventually_nhdsWithin_of_forall fun ε (hε : 0 < ε) ↦
380-
(pos_of_mem_uIcc_mul ha hb hε (hd_mem ε hε)).le
381-
· exact eventually_nhdsWithin_of_forall fun ε (hε : 0 < ε) ↦
382-
le_max_mul_of_mem_uIcc_mul hε.le (hd_mem ε hε)
383-
· exact eventually_nhdsWithin_of_forall fun ε (hε : 0 < ε) ↦
384-
mem_Ioi.2 (pos_of_mem_uIcc_mul ha hb hε (hd_mem ε hε))
385-
have hd_atTop : Tendsto (fun r ↦ f (d r)) atTop (𝓝 R) := by
386-
apply hR.comp
387-
have hm : 0 < min a b := by grind
388-
have h_lim : Tendsto (fun y ↦ min a b * y) atTop atTop := by
389-
simpa [tendsto_const_mul_atTop_of_pos hm] using tendsto_id
390-
apply tendsto_atTop_mono' atTop _ h_lim
391-
exact eventually_atTop.21, fun r hr ↦
392-
min_mul_le_of_mem_uIcc_mul (by linarith) (hd_mem r (by linarith))⟩
393-
have h_ev : (fun p : ℝ × ℝ ↦ ∫ x in p.1..p.2, (f (a * x) - f (b * x)) / x) =ᶠ[(𝓝[>] 0) ×ˢ atTop]
394-
fun p ↦ (f (d p.1) - f (d p.2)) * log (b / a) := by
524+
(hint (mul_pos ha hε) (mul_pos ha hr))
525+
(hint (mul_pos hb hε) (mul_pos hb hr))
526+
(hint (mul_pos ha hε) (mul_pos hb hε))
527+
have h_ev : (fun p : ℝ × ℝ ↦ ∫ x in p.1..p.2, x⁻¹ • (f (a * x) - f (b * x))) =ᶠ[(𝓝[>] 0) ×ˢ atTop]
528+
fun p ↦ (∫ x in (a * p.1)..(b * p.1), u x) - ∫ x in (a * p.2)..(b * p.2), u x := by
395529
filter_upwards [prod_mem_prod (eventually_nhdsWithin_of_forall fun _ h ↦ h)
396530
(eventually_atTop.21, fun _ h ↦ lt_of_lt_of_le one_pos h⟩)] with ⟨ε, r⟩ ⟨hε, hr⟩
397-
rw [hsplit hε hr, hd_eq _ hε, hd_eq _ hr]
398-
ring
399-
rw [tendsto_congr' h_ev]
400-
exact ((hd_zero.comp tendsto_fst).sub (hd_atTop.comp tendsto_snd)).mul tendsto_const_nhds
401-
402-
/-- **Frullani's integral**. If `f` is continuous on `(0, ∞)` with `f x → L` as `x → 0⁺` and
403-
`f x → R` as `x → +∞`, `0 < a` and `0 < b`, and `x ↦ (f (a * x) - f (b * x)) / x` is integrable on
404-
`(0, ∞)`, then
405-
`∫ x in Ioi 0, (f (a * x) - f (b * x)) / x = (L - R) * log (b / a)`. -/
531+
exact hsplit hε hr
532+
rw [tendsto_congr' h_ev, show log (b / a) • (L - R) =
533+
log (b / a) • L - log (b / a) • R from smul_sub _ _ _]
534+
exact (tendsto_integral_inv_smul_nhdsWithin hf ha hb hL |>.comp tendsto_fst).sub
535+
(tendsto_integral_inv_smul_atTop hf ha hb hR |>.comp tendsto_snd)
536+
537+
/-- **Frullani's integral** for functions valued in a complete normed space.
538+
If `f` is continuous on `(0, ∞)` with `f x → L` as `x → 0⁺` and `f x → R` as `x → +∞`,
539+
`0 < a` and `0 < b`, and `x ↦ x⁻¹ • (f (a * x) - f (b * x))` is integrable on `(0, ∞)`, then
540+
`∫ x in Ioi 0, x⁻¹ • (f (a * x) - f (b * x)) = log (b / a) • (L - R)`. -/
406541
theorem integral_Ioi_eq (hf : ContinuousOn f (Ioi 0)) (ha : 0 < a) (hb : 0 < b)
407542
(hL : Tendsto f (𝓝[>] 0) (𝓝 L)) (hR : Tendsto f atTop (𝓝 R))
408-
(hint : IntegrableOn (fun x ↦ (f (a * x) - f (b * x)) / x) (Ioi 0)) :
409-
∫ x in Ioi 0, (f (a * x) - f (b * x)) / x = (L - R) * log (b / a) := by
543+
(hint : IntegrableOn (fun x ↦ x⁻¹ • (f (a * x) - f (b * x))) (Ioi 0)) :
544+
∫ x in Ioi 0, x⁻¹ • (f (a * x) - f (b * x)) = log (b / a) • (L - R) := by
410545
have h_lim := (tendsto_intervalIntegral hf ha hb hL hR).mono_left curry_le_prod
411-
set g := fun x ↦ (f (a * x) - f (b * x)) / x with hg
546+
set g := fun x ↦ x⁻¹ • (f (a * x) - f (b * x)) with hg
412547
apply tendsto_nhds_unique
413548
(hint.continuousWithinAt_Ici_primitive_Ioi.mono_left (nhdsWithin_mono 0 Ioi_subset_Ici_self))
414549
rw [tendsto_nhdsWithin_nhds]

0 commit comments

Comments
 (0)