@@ -288,21 +288,21 @@ theorem integral_univ_inv_one_add_sq : ∫ (x : ℝ), (1 + x ^ 2)⁻¹ = π :=
288288
289289namespace Frullani
290290
291+ open Metric
292+
291293variable {f : ℝ → ℝ} {a b c d L R : ℝ}
292294
293- lemma comp_mul_left_div (hf : ContinuousOn f (Ici 0 )) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) :
295+ lemma comp_mul_left_div (hf : ContinuousOn f (Ioi 0 )) (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) :
294296 ContinuousOn (fun x ↦ f (c * x) / x) (uIcc a b) := by
295- have hsub : uIcc a b ⊆ Ici 0 := by simp [uIcc, Icc_subset_Ici_iff , ha.le , hb.le ]
297+ have hsub : uIcc a b ⊆ Ioi 0 := by simp [uIcc, Icc_subset_Ioi_iff , ha, hb]
296298 apply hf.comp_mul_left_div continuousOn_id
297299 all_goals intro x hx
298- · simpa [mem_Ici] using mul_nonneg (le_of_lt hc) (hsub hx)
299- · exact ((lt_min ha hb).trans_le hx. 1 ).ne'
300+ · exact mul_pos hc (hsub hx)
301+ · exact ne_of_gt (hsub hx)
300302
301- lemma intervalIntegrable_div (hf : ContinuousOn f (Ici 0 )) (ha : 0 < a) (hb : 0 < b) :
302- IntervalIntegrable (fun x ↦ f x / x) volume a b := by
303- have hcont : ContinuousOn (fun x ↦ f (1 * x) / x) (uIcc a b) :=
304- Frullani.comp_mul_left_div hf ha hb (by simp)
305- simpa using hcont.intervalIntegrable
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
306306
307307lemma exists_integral_div_eq_mul_log (hf : ContinuousOn f (Ici 0 )) (ha : 0 < a) (hb : 0 < b)
308308 (hc : 0 < c) :
@@ -315,175 +315,116 @@ lemma exists_integral_div_eq_mul_log (hf : ContinuousOn f (Ici 0)) (ha : 0 < a)
315315 rw [mul_div_mul_right b a (ne_of_gt hc)] at heq
316316 exact ⟨d, hd, heq⟩
317317
318- /-- **Frullani's integral** , limit form. Let `f` be continuous on `(0, ∞)` with
319- `f(x) → L` as `x → 0⁺` and `f(x) → R` as `x → ∞`. Then for `0 < a` and `0 < b`,
320- `∫ x in u..v, (f(a x) - f(b x)) / x → (L - R) * log(b / a)` as `u → 0⁺` and `v → ∞`. -/
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 → +∞`. -/
321342theorem tendsto_intervalIntegral (hf : ContinuousOn f (Ioi 0 )) (ha : 0 < a) (hb : 0 < b)
322- (h0 : Tendsto f (𝓝[>] 0 ) (𝓝 L)) (htop : Tendsto f atTop (𝓝 R)) :
343+ (hL : Tendsto f (𝓝[>] 0 ) (𝓝 L)) (hR : Tendsto f atTop (𝓝 R)) :
323344 Tendsto (fun p : ℝ × ℝ ↦ ∫ x in p.1 ..p.2 , (f (a * x) - f (b * x)) / x) ((𝓝[>] 0 ) ×ˢ atTop)
324345 (𝓝 ((L - R) * log (b / a))) := by
325- sorry
326-
327- /-- **Frullani's integral** . If `f` is continuous on `[0, ∞)` with `f(x) → R` as `x → ∞`,
328- and `0 < a`, `0 < b`, then `∫ x in Ioi 0, (f(a x) - f(b x)) / x = (f 0 - R) * log(b / a)`. -/
329- theorem integral_Ioi_eq (hf : ContinuousOn f (Ici 0 )) (ha : 0 < a) (hb : 0 < b)
330- (htop : Tendsto f atTop (𝓝 R))
331- (hint : IntegrableOn (fun x ↦ (f (a * x) - f (b * x)) / x) (Ioi 0 )) :
332- ∫ x in Ioi 0 , (f (a * x) - f (b * x)) / x = (f 0 - R) * log (b / a) := by
333- let g : ℝ → ℝ := fun x ↦ (f (a * x) - f (b * x)) / x
334- have hg (ε r : ℝ) (hε : 0 < ε) (hr : ε < r) : ∫ x in ε..r, g x =
335- (∫ x in a * ε..b * ε, f x / x) - (∫ x in a * r..b * r, f x / x) := by
336- let u x := f x / x
337- wlog hab : a ≤ b generalizing a b
338- · have hint_neg :
339- IntegrableOn (fun x ↦ - ((f (a * x) - f (b * x)) / x)) (Ioi 0 ) volume := hint.neg
340- have hint_neg' : IntegrableOn (fun x ↦ (f (b * x) - f (a * x)) / x) (Ioi 0 ) volume := by
341- convert hint_neg using 1
342- ext
343- ring
344- simp only [not_le] at hab
345- specialize this hb ha hint_neg' hab.le
346- have hg_neg : (fun x ↦ (f (b * x) - f (a * x)) / x) = fun x ↦ - g x := by
347- funext x
348- unfold g
349- ring
350- simp only [hg_neg, intervalIntegral.integral_neg] at this
351- rw [integral_symm (b * ε) (a * ε), integral_symm (b * r) (a * r), ← neg_inj, this]
352- ring
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 =
362+ (∫ x in (a * ε)..(b * ε), u x) - ∫ x in (a * r)..(b * r), u x := by
353363 calc
354364 _ = (∫ x in ε..r, f (a * x) / x) - ∫ x in ε..r, f (b * x) / x := by
355- simp_rw [g, sub_div]
356- have hr_pos : 0 < r := by nlinarith
357- apply intervalIntegral.integral_sub
358- all_goals apply ContinuousOn.intervalIntegrable
359- · exact Frullani.comp_mul_left_div hf hε hr_pos ha
360- · exact Frullani.comp_mul_left_div hf hε hr_pos hb
365+ simp_rw [sub_div]
366+ exact integral_sub (hint' ha hε hr) (hint' hb hε hr)
361367 _ = (∫ y in a * ε..a * r, u y) - ∫ y in b * ε..b * r, u y := by
362- have hfa_eq : ∫ x in ε..r, f (a * x) / x = ∫ y in a * ε..a * r, u y := by
363- calc
364- _ = ∫ x in ε..r, a * u (a * x) := by
365- unfold u
366- field_simp
367- _ = a * ∫ x in ε..r, u (a * x) := by apply intervalIntegral.integral_const_mul
368- _ = ∫ y in a * ε..a * r, u y := by apply mul_integral_comp_mul_left
369- have hfb_eq : ∫ x in ε..r, f (b * x) / x = ∫ y in b * ε..b * r, u y := by
370- calc
371- _ = ∫ x in ε..r, b * u (b * x) := by
372- congr
373- funext x
374- unfold u
375- field_simp
376- _ = b * ∫ x in ε..r, u (b * x) := by
377- apply intervalIntegral.integral_const_mul
378- _ = ∫ y in b * ε..b * r, u y := by
379- apply mul_integral_comp_mul_left
380- rw [hfa_eq, hfb_eq]
381- _ = (∫ x in a * ε..b * ε, u x) - (∫ x in a * r..b * r, u x) := by
382- apply integral_interval_sub_interval_comm
383- all_goals
384- apply intervalIntegrable_div hf
385- all_goals nlinarith
386- change ∫ x in Ioi 0 , g x = (f 0 - R) * log (b / a)
387- have hc (y : ℝ) (hy : 0 < y) : ∃ c ∈ uIcc (a * y) (b * y),
388- (∫ x in (a * y)..(b * y), f x / x) = f c * log (b / a) :=
389- exists_integral_div_eq_mul_log hf ha hb hy
390- let F : ℝ → ℝ := fun r ↦ ∫ x in 0 ..r, g x
391- have h_lhs : Tendsto F atTop (𝓝 (∫ x in Ioi 0 , g x)) :=
392- intervalIntegral_tendsto_integral_Ioi 0 hint tendsto_id
393- have h_rhs : Tendsto F atTop (𝓝 ((f 0 - R) * log (b / a))) := by
394- unfold F
395- choose! fc hy_mem hy_eq using hc
396- have hg' (ε r : ℝ) (hε : 0 < ε) (hεr : ε < r) :
397- ∫ x in ε..r, g x = (f (fc ε) - f (fc r)) * log (b / a) := by
398- have hr_pos : 0 < r := by linarith
399- rw [hg ε r hε hεr, hy_eq ε hε, hy_eq r hr_pos]
400- field_simp
401- have h_lim_R : Tendsto (fun r ↦ f (fc r)) atTop (𝓝 R) := by
402- apply htop.comp
403- let m := min a b
404- have hm_pos : 0 < m := by grind
405- have h_ev_le : (fun y ↦ m * y) ≤ᶠ[atTop] fc := by
406- rw [EventuallyLE, eventually_atTop]
407- use 1
408- intro y hy1
409- have hy_pos : 0 < y := by linarith
410- have hy := hy_mem y hy_pos
411- simp only [ge_iff_le]
412- rw [mem_uIcc] at hy
413- rcases hy with h | h
414- · have : m ≤ a := by grind
415- nlinarith
416- · have : m ≤ b := by grind
417- nlinarith
418- have h_lim_atTop : Tendsto (fun y ↦ m * y) atTop atTop := by
419- simpa [tendsto_const_mul_atTop_of_pos hm_pos] using tendsto_id
420- exact tendsto_atTop_mono' atTop h_ev_le h_lim_atTop
421- have h_tail (ε r : ℝ) (hε : 0 < ε) (hεr : ε < r) :
422- ∫ x in Ioi ε, g x = (f (fc ε) - R) * log (b / a) := by
423- have hr' : Tendsto (fun r ↦ ∫ x in ε..r, g x) atTop (𝓝 (∫ x in Ioi ε, g x)) := by
424- apply intervalIntegral_tendsto_integral_Ioi
425- · apply hint.mono_set (Ioi_subset_Ioi hε.le)
426- · exact tendsto_id
427- have hr : Tendsto (fun r ↦ ∫ x in ε..r, g x) atTop (𝓝 ((f (fc ε) - R) * log (b / a))) := by
428- have h_ev_eq : (fun r ↦ ∫ x in ε..r, g x) =ᶠ[atTop]
429- (fun r ↦ (f (fc ε) - f (fc r)) * log (b / a)) := by
430- apply (eventually_gt_atTop ε).mono
431- intro r hεr'
432- exact hg' ε r hε hεr'
433- rw [tendsto_congr' h_ev_eq]
434- have h_lim_const : Tendsto (fun _ : ℝ ↦ f (fc ε)) atTop (𝓝 (f (fc ε))) := tendsto_const_nhds
435- have h_sub : Tendsto (fun r ↦ (f (fc ε) - f (fc r))) atTop (𝓝 ((f (fc ε)) - R)) :=
436- h_lim_const.sub h_lim_R
437- have h_const_log : Tendsto (fun _ : ℝ ↦ log (b / a)) atTop (𝓝 (log (b / a))) :=
438- tendsto_const_nhds
439- exact h_sub.mul h_const_log
440- exact tendsto_nhds_unique hr' hr
441- have hε : Tendsto (fun ε ↦ ∫ x in Ioi ε, g x) (𝓝[>] 0 ) (𝓝 (∫ x in Ioi 0 , g x)) :=
442- IntegrableOn.tendsto_integral_Ioi hint
443- have h_lim_f_zero : Tendsto (fun ε ↦ f (fc ε)) (𝓝[>] 0 ) (𝓝 (f 0 )) := by
444- have h_lim_zero : Tendsto (fun ε ↦ (max a b) * ε) (𝓝[>] 0 ) (𝓝 0 ) := by
445- have hc : ContinuousWithinAt (fun ε : ℝ ↦ (max a b) * ε) (Ioi (0 : ℝ)) 0 :=
446- (continuous_const_mul (max a b)).continuousWithinAt
447- simpa using hc.tendsto
448- have h_ev_fc_nonneg : ∀ᶠ ε in 𝓝[>] 0 , 0 ≤ fc ε := by
449- apply eventually_of_mem self_mem_nhdsWithin
450- intro ε hε
451- have hmem := hy_mem ε hε
452- have hε_pos : 0 < ε := by grind
453- have hmin_nonneg : 0 ≤ min (a * ε) (b * ε) := by apply le_min (by nlinarith) (by nlinarith)
454- apply le_trans hmin_nonneg
455- rw [mem_uIcc] at hmem
456- grind
457- have h_ev_fc_le_max : ∀ᶠ ε in 𝓝[>] 0 , fc ε ≤ (max a b) * ε := by
458- apply eventually_of_mem self_mem_nhdsWithin
459- intro ε hε
460- have hmem := hy_mem ε hε
461- rw [max_mul_of_nonneg a b hε.le]
462- rw [mem_uIcc] at hmem
463- grind
464- have hcont_zero : ContinuousWithinAt f (Ici (0 : ℝ)) 0 := by
465- apply hf.continuousWithinAt (by simp)
466- have hfc_within : Tendsto fc (𝓝[>] 0 ) (𝓝[Ici (0 : ℝ)] 0 ) := by
467- apply tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within
468- · exact tendsto_of_tendsto_of_tendsto_of_le_of_le'
469- tendsto_const_nhds h_lim_zero h_ev_fc_nonneg h_ev_fc_le_max
470- · exact h_ev_fc_nonneg
471- exact hcont_zero.tendsto.comp hfc_within
472- have h_main : ∫ x in Ioi 0 , g x = (f 0 - R) * log (b / a) := by
473- have h_ev_eq : (fun ε ↦ ∫ x in Ioi ε, g x) =ᶠ[𝓝[>] 0 ]
474- (fun ε ↦ (f (fc ε) - R) * log (b / a)) := by
475- change (∀ᶠ ε in 𝓝[>] 0 , ∫ x in Ioi ε, g x = (f (fc ε) - R) * log (b / a))
476- apply eventually_of_mem self_mem_nhdsWithin
477- intro ε hε
478- simp [h_tail ε (ε + 1 ) hε]
479- have h_rhs_from_left : Tendsto (fun ε ↦ (f (fc ε) - R) * log (b / a))
480- (𝓝[>] 0 ) (𝓝 (∫ x in Ioi 0 , g x)) := by rwa [← tendsto_congr' h_ev_eq]
481- have h_lim_f_zero_sub_R : Tendsto (fun ε ↦ f (fc ε) - R) (𝓝[>] 0 ) (𝓝 (f 0 - R)) :=
482- h_lim_f_zero.sub tendsto_const_nhds
483- have h_rhs_goal : Tendsto (fun ε ↦ (f (fc ε) - R) * log (b / a))
484- (𝓝[>] 0 ) (𝓝 ((f 0 - R) * log (b / a))) := h_lim_f_zero_sub_R.mul_const (log (b / a))
485- exact tendsto_nhds_unique h_rhs_from_left h_rhs_goal
486- rwa [h_main] at h_lhs
487- exact tendsto_nhds_unique h_lhs h_rhs
368+ rw [integral_comp_mul_div ha, integral_comp_mul_div hb]
369+ _ = _ := 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.2 ⟨1 , 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
395+ filter_upwards [prod_mem_prod (eventually_nhdsWithin_of_forall fun _ h ↦ h)
396+ (eventually_atTop.2 ⟨1 , 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)`. -/
406+ theorem integral_Ioi_eq (hf : ContinuousOn f (Ioi 0 )) (ha : 0 < a) (hb : 0 < b)
407+ (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
410+ 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
412+ apply tendsto_nhds_unique
413+ (hint.continuousWithinAt_Ici_primitive_Ioi.mono_left (nhdsWithin_mono 0 Ioi_subset_Ici_self))
414+ rw [tendsto_nhdsWithin_nhds]
415+ intro ε hε
416+ rw [Metric.tendsto_nhds] at h_lim
417+ specialize h_lim (ε / 2 ) (by positivity)
418+ rw [eventually_curry_iff, Filter.Eventually, mem_nhdsWithin_iff] at h_lim
419+ obtain ⟨δ, hδ_pos, hδ⟩ := h_lim
420+ simp_rw [subset_def, mem_inter_iff, mem_ball] at hδ
421+ refine ⟨δ, hδ_pos, ?_⟩
422+ intro x hx hdist
423+ specialize hδ x ⟨hdist, hx⟩
424+ rw [mem_setOf] at hδ
425+ have hint' : IntegrableOn g (Ioi x) := hint.mono (by grind) (by simp)
426+ have htends := intervalIntegral_tendsto_integral_Ioi x hint' tendsto_id
427+ have hle := le_of_tendsto (htends.dist tendsto_const_nhds) (hδ.mono (fun _ hy ↦ hy.le))
428+ linarith
488429
489430end Frullani
0 commit comments