state
stringlengths
0
159k
srcUpToTactic
stringlengths
387
167k
nextTactic
stringlengths
3
9k
declUpToTactic
stringlengths
22
11.5k
declId
stringlengths
38
95
decl
stringlengths
16
1.89k
file_tag
stringlengths
17
73
case hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y ⊒ 0 ≀ x + R
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y ⊒ 0 ≀ y
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity
refine' this.trans _
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ (x + R) ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _
rw [← mul_rpow, rpow_neg, rpow_neg]
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ ((x + R) ^ b)⁻¹ ≀ ((1 / 2 * x) ^ b)⁻¹
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β·
gcongr
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β·
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.h.h₁ E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 1 / 2 * x ≀ x + R
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr
linarith
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ 1 / 2 * x case intro.hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ x + R case intro.hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ 1 / 2 case intro.hy E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith
all_goals positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ 1 / 2 * x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ x + R
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.hx E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ 1 / 2
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.hy E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S x y : ℝ hy : x + R ≀ y hx1 : 0 < x hx2 : -2 * R < x hxR : 0 < x + R hy' : 0 < y this : y ^ (-b) ≀ (x + R) ^ (-b) ⊒ 0 ≀ x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atTop] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof.
obtain ⟨c, hc, hc'⟩ := hf.exists_pos
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof.
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 hc' : IsBigOWith c atTop ⇑f fun x => |x| ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atTop] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos
simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 hc' : βˆƒ a, βˆ€ b_1 β‰₯ a, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– ⊒ βˆƒ c a, βˆ€ b_1 β‰₯ a, β€–β€–ContinuousMap.restrict (Icc (b_1 + R) (b_1 + S)) fβ€–β€– ≀ c * β€–|b_1| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒
obtain ⟨d, hd⟩ := hc'
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– ⊒ βˆƒ c a, βˆ€ b_1 β‰₯ a, β€–β€–ContinuousMap.restrict (Icc (b_1 + R) (b_1 + S)) fβ€–β€– ≀ c * β€–|b_1| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc'
refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc'
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : x β‰₯ max (1 + max 0 (-2 * R)) (d - R) ⊒ β€–β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩
rw [ge_iff_le, max_le_iff] at hx
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x ⊒ β€–β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx
have hx' : max 0 (-2 * R) < x := by linarith
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x ⊒ max 0 (-2 * R) < x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by
linarith
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : max 0 (-2 * R) < x ⊒ β€–β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith
rw [max_lt_iff] at hx'
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x ⊒ β€–β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx'
rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))]
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx'
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x ⊒ βˆ€ (x_1 : ↑(Icc (x + R) (x + S))), β€–(ContinuousMap.restrict (Icc (x + R) (x + S)) f) x_1β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))]
refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))]
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) ⊒ ↑y β‰₯ d
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by
linarith [hx.1, y.2.1]
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) ⊒ c * β€–|↑y| ^ (-b)β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _
have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x✝ : ℝ hx : 1 + max 0 (-2 * R) ≀ x✝ ∧ d - R ≀ x✝ hx' : 0 < x✝ ∧ -2 * R < x✝ y : ↑(Icc (x✝ + R) (x✝ + S)) x : ℝ ⊒ 0 ≀ |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by
positivity
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) A : βˆ€ (x : ℝ), 0 ≀ |x| ^ (-b) ⊒ c * β€–|↑y| ^ (-b)β€– ≀ c * (1 / 2) ^ (-b) * β€–|x| ^ (-b)β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity
rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)]
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.intro.intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) A : βˆ€ (x : ℝ), 0 ≀ |x| ^ (-b) ⊒ |↑y| ^ (-b) ≀ (1 / 2) ^ (-b) * |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)]
convert claim x (by linarith only [hx.1]) y.1 y.2.1
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)]
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) A : βˆ€ (x : ℝ), 0 ≀ |x| ^ (-b) ⊒ max 0 (-2 * R) < x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by
linarith only [hx.1]
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case h.e'_3.h.e'_5 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) A : βˆ€ (x : ℝ), 0 ≀ |x| ^ (-b) ⊒ |↑y| = ↑y
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β·
apply abs_of_nonneg
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β·
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case h.e'_3.h.e'_5.h E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) A : βˆ€ (x : ℝ), 0 ≀ |x| ^ (-b) ⊒ 0 ≀ ↑y
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg;
linarith [y.2.1]
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg;
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case h.e'_4.h.e'_6.h.e'_5 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atTop] fun x => |x| ^ (-b) R S : ℝ claim : βˆ€ (x : ℝ), max 0 (-2 * R) < x β†’ βˆ€ (y : ℝ), x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) c : ℝ hc : c > 0 d : ℝ hd : βˆ€ b_1 β‰₯ d, β€–f b_1β€– ≀ c * β€–|b_1| ^ (-b)β€– x : ℝ hx : 1 + max 0 (-2 * R) ≀ x ∧ d - R ≀ x hx' : 0 < x ∧ -2 * R < x y : ↑(Icc (x + R) (x + S)) A : βˆ€ (x : ℝ), 0 ≀ |x| ^ (-b) ⊒ |x| = x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β·
exact abs_of_pos hx'.1
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β·
Mathlib.Analysis.Fourier.PoissonSummation.131_0.1MbUAOzT9Ye0D34
/-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atBot] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by
have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ ⊒ ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case h.e'_8 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ ⊒ (fun x => |x| ^ (-b)) = (fun x => |x| ^ (-b)) ∘ Neg.neg
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
ext1 x
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case h.e'_8.h E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S x : ℝ ⊒ |x| ^ (-b) = ((fun x => |x| ^ (-b)) ∘ Neg.neg) x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x;
simp only [Function.comp_apply, abs_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x;
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atBot] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg]
have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg]
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] ((fun x => |x| ^ (-b)) ∘ Neg.neg) ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atBot] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] ((fun x => |x| ^ (-b)) ∘ Neg.neg) ⊒ (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
ext1 x
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case h E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] ((fun x => |x| ^ (-b)) ∘ Neg.neg) x : ℝ ⊒ ((fun x => |x| ^ (-b)) ∘ Neg.neg) x = |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x;
simp only [Function.comp_apply, abs_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x;
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] ((fun x => |x| ^ (-b)) ∘ Neg.neg) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atBot] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg]
rw [this] at h2
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg]
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–) =O[atBot] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2
refine' (isBigO_of_le _ fun x => _).trans h2
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x : ℝ ⊒ β€–β€–ContinuousMap.restrict (Icc (x + R) (x + S)) fβ€–β€– ≀ β€–((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) xβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone
rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x : ℝ ⊒ βˆ€ (x_1 : ↑(Icc (x + R) (x + S))), β€–(ContinuousMap.restrict (Icc (x + R) (x + S)) f) x_1β€– ≀ β€–ContinuousMap.restrict (Icc (-x + -S) (-x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
rintro ⟨x, hx⟩
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)]
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ β€–(ContinuousMap.restrict (Icc (x✝ + R) (x✝ + S)) f) { val := x, property := hx }β€– ≀ β€–ContinuousMap.restrict (Icc (-x✝ + -S) (-x✝ + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩
rw [ContinuousMap.restrict_apply_mk]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ β€–f xβ€– ≀ β€–ContinuousMap.restrict (Icc (-x✝ + -S) (-x✝ + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk]
refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk]
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ β€–f xβ€– = β€–(ContinuousMap.restrict (Icc (-x✝ + -S) (-x✝ + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))) { val := -x, property := ?mk.refine'_2 }β€– case mk.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ -x ∈ Icc (-x✝ + -S) (-x✝ + -R)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩)
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ -x ∈ Icc (-x✝ + -S) (-x✝ + -R) case mk.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ -x ∈ Icc (-x✝ + -S) (-x✝ + -R)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg]
exact ⟨by linarith [hx.2], by linarith [hx.1]⟩
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg]
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ -x✝ + -S ≀ -x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by
linarith [hx.2]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[atBot] fun x => |x| ^ (-b) R S : ℝ h1 : ⇑(ContinuousMap.comp f (ContinuousMap.mk fun a => -a)) =O[atTop] fun x => |x| ^ (-b) h2 : ((fun x => β€–ContinuousMap.restrict (Icc (x + -S) (x + -R)) (ContinuousMap.comp f (ContinuousMap.mk fun a => -a))β€–) ∘ Neg.neg) =O[atBot] fun x => |x| ^ (-b) this : (fun x => |x| ^ (-b)) ∘ Neg.neg = fun x => |x| ^ (-b) x✝ x : ℝ hx : x ∈ Icc (x✝ + R) (x✝ + S) ⊒ -x ≀ -x✝ + -R
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by
linarith [hx.1]
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by
Mathlib.Analysis.Fourier.PoissonSummation.178_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ ⊒ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[cocompact ℝ] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by
obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Metric.closedBall 0 r ⊒ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[cocompact ℝ] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0
rw [closedBall_eq_Icc, zero_add, zero_sub] at hr
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r ⊒ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[cocompact ℝ] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr
have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r ⊒ βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by
intro x
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x : ℝ ⊒ β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x
rw [ContinuousMap.norm_le _ (norm_nonneg _)]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x : ℝ ⊒ βˆ€ (x_1 : ↑↑K), β€–(ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))) x_1β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)]
rintro ⟨y, hy⟩
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)]
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x y : ℝ hy : y ∈ ↑K ⊒ β€–(ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))) { val := y, property := hy }β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩
refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩)
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk.refine'_1 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x y : ℝ hy : y ∈ ↑K ⊒ β€–(ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))) { val := y, property := hy }β€– = β€–(ContinuousMap.restrict (Icc (x - r) (x + r)) f) { val := y + x, property := ?mk.refine'_2 }β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β·
simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β·
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case mk.refine'_2 E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x y : ℝ hy : y ∈ ↑K ⊒ y + x ∈ Icc (x - r) (x + r)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β·
exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β·
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x y : ℝ hy : y ∈ ↑K ⊒ x - r ≀ y + x
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by
linarith [(hr hy).1]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r x y : ℝ hy : y ∈ ↑K ⊒ y + x ≀ x + r
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by
linarith [(hr hy).2]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b hf : ⇑f =O[cocompact ℝ] fun x => |x| ^ (-b) K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– ⊒ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[cocompact ℝ] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩
simp_rw [cocompact_eq, isBigO_sup] at hf ⊒
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ ((fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[atBot] fun x => |x| ^ (-b)) ∧ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[atTop] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒
constructor
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.left E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[atBot] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β·
refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r)
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β·
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.left E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ βˆ€ (x : ℝ), β€–β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–β€– ≀ β€–β€–ContinuousMap.restrict (Icc (x + -r) (x + r)) fβ€–β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r)
simp_rw [norm_norm]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r)
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.left E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x + -r) (x + r)) fβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm];
exact this
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm];
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.right E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ (fun x => β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–) =O[atTop] fun x => |x| ^ (-b)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β·
refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r)
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β·
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.right E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ βˆ€ (x : ℝ), β€–β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€–β€– ≀ β€–β€–ContinuousMap.restrict (Icc (x + -r) (x + r)) fβ€–β€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r)
simp_rw [norm_norm]
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r)
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
case intro.right E : Type u_1 inst✝ : NormedAddCommGroup E f : C(ℝ, E) b : ℝ hb : 0 < b K : Compacts ℝ r : ℝ hr : ↑K βŠ† Icc (-r) r this : βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x - r) (x + r)) fβ€– hf : (⇑f =O[atBot] fun x => |x| ^ (-b)) ∧ ⇑f =O[atTop] fun x => |x| ^ (-b) ⊒ βˆ€ (x : ℝ), β€–ContinuousMap.restrict (↑K) (ContinuousMap.comp f (ContinuousMap.addRight x))β€– ≀ β€–ContinuousMap.restrict (Icc (x + -r) (x + r)) fβ€–
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r) simp_rw [norm_norm];
exact this
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r) simp_rw [norm_norm];
Mathlib.Analysis.Fourier.PoissonSummation.200_0.1MbUAOzT9Ye0D34
theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b)
Mathlib_Analysis_Fourier_PoissonSummation
f g : SchwartzMap ℝ β„‚ hfg : 𝓕 ⇑f = ⇑g ⊒ βˆ‘' (n : β„€), f ↑n = βˆ‘' (n : β„€), g ↑n
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r) simp_rw [norm_norm]; exact this set_option linter.uppercaseLean3 false in #align is_O_norm_restrict_cocompact isBigO_norm_restrict_cocompact /-- **Poisson's summation formula**, assuming that `f` decays as `|x| ^ (-b)` for some `1 < b` and its Fourier transform is summable. -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := Real.tsum_eq_tsum_fourierIntegral (fun K => summable_of_isBigO (Real.summable_abs_int_rpow hb) ((isBigO_norm_restrict_cocompact (ContinuousMap.mk _ hc) (zero_lt_one.trans hb) hf K).comp_tendsto Int.tendsto_coe_cofinite)) hFf #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay_of_summable Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable /-- **Poisson's summation formula**, assuming that both `f` and its Fourier transform decay as `|x| ^ (-b)` for some `1 < b`. (This is the one-dimensional case of Corollary VII.2.6 of Stein and Weiss, *Introduction to Fourier analysis on Euclidean spaces*.) -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : IsBigO (cocompact ℝ) (𝓕 f) fun x : ℝ => |x| ^ (-b)) : βˆ‘' n : β„€, f n = βˆ‘' n : β„€, 𝓕 f n := Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable hc hb hf (summable_of_isBigO (Real.summable_abs_int_rpow hb) (hFf.comp_tendsto Int.tendsto_coe_cofinite)) #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay end RpowDecay section Schwartz /-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that.
simp_rw [← hfg]
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that.
Mathlib.Analysis.Fourier.PoissonSummation.253_0.1MbUAOzT9Ye0D34
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n)
Mathlib_Analysis_Fourier_PoissonSummation
f g : SchwartzMap ℝ β„‚ hfg : 𝓕 ⇑f = ⇑g ⊒ βˆ‘' (n : β„€), f ↑n = βˆ‘' (n : β„€), 𝓕 ⇑f ↑n
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r) simp_rw [norm_norm]; exact this set_option linter.uppercaseLean3 false in #align is_O_norm_restrict_cocompact isBigO_norm_restrict_cocompact /-- **Poisson's summation formula**, assuming that `f` decays as `|x| ^ (-b)` for some `1 < b` and its Fourier transform is summable. -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := Real.tsum_eq_tsum_fourierIntegral (fun K => summable_of_isBigO (Real.summable_abs_int_rpow hb) ((isBigO_norm_restrict_cocompact (ContinuousMap.mk _ hc) (zero_lt_one.trans hb) hf K).comp_tendsto Int.tendsto_coe_cofinite)) hFf #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay_of_summable Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable /-- **Poisson's summation formula**, assuming that both `f` and its Fourier transform decay as `|x| ^ (-b)` for some `1 < b`. (This is the one-dimensional case of Corollary VII.2.6 of Stein and Weiss, *Introduction to Fourier analysis on Euclidean spaces*.) -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : IsBigO (cocompact ℝ) (𝓕 f) fun x : ℝ => |x| ^ (-b)) : βˆ‘' n : β„€, f n = βˆ‘' n : β„€, 𝓕 f n := Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable hc hb hf (summable_of_isBigO (Real.summable_abs_int_rpow hb) (hFf.comp_tendsto Int.tendsto_coe_cofinite)) #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay end RpowDecay section Schwartz /-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that. simp_rw [← hfg]
rw [Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay f.continuous one_lt_two (f.isBigO_cocompact_rpow (-2))]
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that. simp_rw [← hfg]
Mathlib.Analysis.Fourier.PoissonSummation.253_0.1MbUAOzT9Ye0D34
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n)
Mathlib_Analysis_Fourier_PoissonSummation
f g : SchwartzMap ℝ β„‚ hfg : 𝓕 ⇑f = ⇑g ⊒ 𝓕 ⇑f =O[cocompact ℝ] fun x => |x| ^ (-2)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r) simp_rw [norm_norm]; exact this set_option linter.uppercaseLean3 false in #align is_O_norm_restrict_cocompact isBigO_norm_restrict_cocompact /-- **Poisson's summation formula**, assuming that `f` decays as `|x| ^ (-b)` for some `1 < b` and its Fourier transform is summable. -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := Real.tsum_eq_tsum_fourierIntegral (fun K => summable_of_isBigO (Real.summable_abs_int_rpow hb) ((isBigO_norm_restrict_cocompact (ContinuousMap.mk _ hc) (zero_lt_one.trans hb) hf K).comp_tendsto Int.tendsto_coe_cofinite)) hFf #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay_of_summable Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable /-- **Poisson's summation formula**, assuming that both `f` and its Fourier transform decay as `|x| ^ (-b)` for some `1 < b`. (This is the one-dimensional case of Corollary VII.2.6 of Stein and Weiss, *Introduction to Fourier analysis on Euclidean spaces*.) -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : IsBigO (cocompact ℝ) (𝓕 f) fun x : ℝ => |x| ^ (-b)) : βˆ‘' n : β„€, f n = βˆ‘' n : β„€, 𝓕 f n := Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable hc hb hf (summable_of_isBigO (Real.summable_abs_int_rpow hb) (hFf.comp_tendsto Int.tendsto_coe_cofinite)) #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay end RpowDecay section Schwartz /-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that. simp_rw [← hfg] rw [Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay f.continuous one_lt_two (f.isBigO_cocompact_rpow (-2))]
rw [hfg]
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that. simp_rw [← hfg] rw [Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay f.continuous one_lt_two (f.isBigO_cocompact_rpow (-2))]
Mathlib.Analysis.Fourier.PoissonSummation.253_0.1MbUAOzT9Ye0D34
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n)
Mathlib_Analysis_Fourier_PoissonSummation
f g : SchwartzMap ℝ β„‚ hfg : 𝓕 ⇑f = ⇑g ⊒ ⇑g =O[cocompact ℝ] fun x => |x| ^ (-2)
/- Copyright (c) 2023 David Loeffler. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: David Loeffler -/ import Mathlib.Analysis.Fourier.AddCircle import Mathlib.Analysis.Fourier.FourierTransform import Mathlib.Analysis.PSeries import Mathlib.Analysis.Distribution.SchwartzSpace import Mathlib.MeasureTheory.Measure.Lebesgue.Integral #align_import analysis.fourier.poisson_summation from "leanprover-community/mathlib"@"fd5edc43dc4f10b85abfe544b88f82cf13c5f844" /-! # Poisson's summation formula We prove Poisson's summation formula `βˆ‘ (n : β„€), f n = βˆ‘ (n : β„€), 𝓕 f n`, where `𝓕 f` is the Fourier transform of `f`, under the following hypotheses: * `f` is a continuous function `ℝ β†’ β„‚`. * The sum `βˆ‘ (n : β„€), 𝓕 f n` is convergent. * For all compacts `K βŠ‚ ℝ`, the sum `βˆ‘ (n : β„€), sup { β€–f(x + n)β€– | x ∈ K }` is convergent. See `Real.tsum_eq_tsum_fourierIntegral` for this formulation. These hypotheses are potentially a little awkward to apply, so we also provide the less general but easier-to-use result `Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay`, in which we assume `f` and `𝓕 f` both decay as `|x| ^ (-b)` for some `b > 1`, and the even more specific result `SchwartzMap.tsum_eq_tsum_fourierIntegral`, where we assume that both `f` and `𝓕 f` are Schwartz functions. ## TODO At the moment `SchwartzMap.tsum_eq_tsum_fourierIntegral` requires separate proofs that both `f` and `𝓕 f` are Schwartz functions. In fact, `𝓕 f` is automatically Schwartz if `f` is; and once we have this lemma in the library, we should adjust the hypotheses here accordingly. -/ noncomputable section open Function hiding comp_apply open Set hiding restrict_apply open Complex hiding abs_of_nonneg open Real open TopologicalSpace Filter MeasureTheory Asymptotics open scoped Real BigOperators Filter FourierTransform attribute [local instance] Real.fact_zero_lt_one open ContinuousMap /-- The key lemma for Poisson summation: the `m`-th Fourier coefficient of the periodic function `βˆ‘' n : β„€, f (x + n)` is the value at `m` of the Fourier transform of `f`. -/ theorem Real.fourierCoeff_tsum_comp_add {f : C(ℝ, β„‚)} (hf : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp (ContinuousMap.addRight n)).restrict Kβ€–) (m : β„€) : fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = 𝓕 f m := by -- NB: This proof can be shortened somewhat by telescoping together some of the steps in the calc -- block, but I think it's more legible this way. We start with preliminaries about the integrand. let e : C(ℝ, β„‚) := (fourier (-m)).comp ⟨((↑) : ℝ β†’ UnitAddCircle), continuous_quotient_mk'⟩ have neK : βˆ€ (K : Compacts ℝ) (g : C(ℝ, β„‚)), β€–(e * g).restrict Kβ€– = β€–g.restrict Kβ€– := by have : βˆ€ x : ℝ, β€–e xβ€– = 1 := fun x => abs_coe_circle (AddCircle.toCircle (-m β€’ x)) intro K g simp_rw [norm_eq_iSup_norm, restrict_apply, mul_apply, norm_mul, this, one_mul] have eadd : βˆ€ (n : β„€), e.comp (ContinuousMap.addRight n) = e := by intro n; ext1 x have : Periodic e 1 := Periodic.comp (fun x => AddCircle.coe_add_period 1 x) (fourier (-m)) simpa only [mul_one] using this.int_mul n x -- Now the main argument. First unwind some definitions. calc fourierCoeff (Periodic.lift <| f.periodic_tsum_comp_add_zsmul 1) m = ∫ x in (0 : ℝ)..1, e x * (βˆ‘' n : β„€, f.comp (ContinuousMap.addRight n)) x := by simp_rw [fourierCoeff_eq_intervalIntegral _ m 0, div_one, one_smul, zero_add, comp_apply, coe_mk, Periodic.lift_coe, zsmul_one, smul_eq_mul] -- Transform sum in C(ℝ, β„‚) evaluated at x into pointwise sum of values. _ = ∫ x in (0:ℝ)..1, βˆ‘' n : β„€, (e * f.comp (ContinuousMap.addRight n)) x := by simp_rw [coe_mul, Pi.mul_apply, ← ContinuousMap.tsum_apply (summable_of_locally_summable_norm hf), tsum_mul_left] -- Swap sum and integral. _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f.comp (ContinuousMap.addRight n)) x := by refine' (intervalIntegral.tsum_intervalIntegral_eq_of_summable_norm _).symm convert hf ⟨uIcc 0 1, isCompact_uIcc⟩ using 1 exact funext fun n => neK _ _ _ = βˆ‘' n : β„€, ∫ x in (0:ℝ)..1, (e * f).comp (ContinuousMap.addRight n) x := by simp only [ContinuousMap.comp_apply, mul_comp] at eadd ⊒ simp_rw [eadd] -- Rearrange sum of interval integrals into an integral over `ℝ`. _ = ∫ x, e x * f x := by suffices Integrable (e * f) from this.hasSum_intervalIntegral_comp_add_int.tsum_eq apply integrable_of_summable_norm_Icc convert hf ⟨Icc 0 1, isCompact_Icc⟩ using 1 simp_rw [mul_comp] at eadd ⊒ simp_rw [eadd] exact funext fun n => neK ⟨Icc 0 1, isCompact_Icc⟩ _ -- Minor tidying to finish _ = 𝓕 f m := by rw [fourierIntegral_eq_integral_exp_smul] congr 1 with x : 1 rw [smul_eq_mul, comp_apply, coe_mk, coe_mk, ContinuousMap.toFun_eq_coe, fourier_coe_apply] congr 2 push_cast ring #align real.fourier_coeff_tsum_comp_add Real.fourierCoeff_tsum_comp_add /-- **Poisson's summation formula**, most general form. -/ theorem Real.tsum_eq_tsum_fourierIntegral {f : C(ℝ, β„‚)} (h_norm : βˆ€ K : Compacts ℝ, Summable fun n : β„€ => β€–(f.comp <| ContinuousMap.addRight n).restrict Kβ€–) (h_sum : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := by let F : C(UnitAddCircle, β„‚) := ⟨(f.periodic_tsum_comp_add_zsmul 1).lift, continuous_coinduced_dom.mpr (map_continuous _)⟩ have : Summable (fourierCoeff F) := by convert h_sum exact Real.fourierCoeff_tsum_comp_add h_norm _ convert (has_pointwise_sum_fourier_series_of_summable this 0).tsum_eq.symm using 1 Β· have := (hasSum_apply (summable_of_locally_summable_norm h_norm).hasSum 0).tsum_eq simpa only [coe_mk, ← QuotientAddGroup.mk_zero, Periodic.lift_coe, zsmul_one, comp_apply, coe_addRight, zero_add] using this Β· congr 1 with n : 1 rw [← Real.fourierCoeff_tsum_comp_add h_norm n, fourier_eval_zero, smul_eq_mul, mul_one] rfl #align real.tsum_eq_tsum_fourier_integral Real.tsum_eq_tsum_fourierIntegral section RpowDecay variable {E : Type*} [NormedAddCommGroup E] /-- If `f` is `O(x ^ (-b))` at infinity, then so is the function `Ξ» x, β€–f.restrict (Icc (x + R) (x + S))β€–` for any fixed `R` and `S`. -/ theorem isBigO_norm_Icc_restrict_atTop {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atTop f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atTop (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by -- First establish an explicit estimate on decay of inverse powers. -- This is logically independent of the rest of the proof, but of no mathematical interest in -- itself, so it is proved using `async` rather than being formulated as a separate lemma. have claim : βˆ€ x : ℝ, max 0 (-2 * R) < x β†’ βˆ€ y : ℝ, x + R ≀ y β†’ y ^ (-b) ≀ (1 / 2) ^ (-b) * x ^ (-b) := by intro x hx y hy rw [max_lt_iff] at hx obtain ⟨hx1, hx2⟩ := hx have hxR : 0 < x + R := by rcases le_or_lt 0 R with (h | _) Β· positivity Β· linarith have hy' : 0 < y := hxR.trans_le hy have : y ^ (-b) ≀ (x + R) ^ (-b) := by rw [rpow_neg, rpow_neg, inv_le_inv] Β· gcongr all_goals positivity refine' this.trans _ rw [← mul_rpow, rpow_neg, rpow_neg] Β· gcongr linarith all_goals positivity -- Now the main proof. obtain ⟨c, hc, hc'⟩ := hf.exists_pos simp only [IsBigO, IsBigOWith, eventually_atTop] at hc' ⊒ obtain ⟨d, hd⟩ := hc' refine' ⟨c * (1 / 2) ^ (-b), ⟨max (1 + max 0 (-2 * R)) (d - R), fun x hx => _⟩⟩ rw [ge_iff_le, max_le_iff] at hx have hx' : max 0 (-2 * R) < x := by linarith rw [max_lt_iff] at hx' rw [norm_norm, ContinuousMap.norm_le _ (mul_nonneg (mul_nonneg hc.le <| rpow_nonneg_of_nonneg one_half_pos.le _) (norm_nonneg _))] refine' fun y => (hd y.1 (by linarith [hx.1, y.2.1])).trans _ have A : βˆ€ x : ℝ, 0 ≀ |x| ^ (-b) := fun x => by positivity rw [mul_assoc, mul_le_mul_left hc, norm_of_nonneg (A _), norm_of_nonneg (A _)] convert claim x (by linarith only [hx.1]) y.1 y.2.1 Β· apply abs_of_nonneg; linarith [y.2.1] Β· exact abs_of_pos hx'.1 set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_top isBigO_norm_Icc_restrict_atTop theorem isBigO_norm_Icc_restrict_atBot {f : C(ℝ, E)} {b : ℝ} (hb : 0 < b) (hf : IsBigO atBot f fun x : ℝ => |x| ^ (-b)) (R S : ℝ) : IsBigO atBot (fun x : ℝ => β€–f.restrict (Icc (x + R) (x + S))β€–) fun x : ℝ => |x| ^ (-b) := by have h1 : IsBigO atTop (f.comp (ContinuousMap.mk _ continuous_neg)) fun x : ℝ => |x| ^ (-b) := by convert hf.comp_tendsto tendsto_neg_atTop_atBot using 1 ext1 x; simp only [Function.comp_apply, abs_neg] have h2 := (isBigO_norm_Icc_restrict_atTop hb h1 (-S) (-R)).comp_tendsto tendsto_neg_atBot_atTop have : (fun x : ℝ => |x| ^ (-b)) ∘ Neg.neg = fun x : ℝ => |x| ^ (-b) := by ext1 x; simp only [Function.comp_apply, abs_neg] rw [this] at h2 refine' (isBigO_of_le _ fun x => _).trans h2 -- equality holds, but less work to prove `≀` alone rw [norm_norm, Function.comp_apply, norm_norm, ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨x, hx⟩ rw [ContinuousMap.restrict_apply_mk] refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨-x, _⟩) rw [ContinuousMap.restrict_apply_mk, ContinuousMap.comp_apply, ContinuousMap.coe_mk, ContinuousMap.coe_mk, neg_neg] exact ⟨by linarith [hx.2], by linarith [hx.1]⟩ set_option linter.uppercaseLean3 false in #align is_O_norm_Icc_restrict_at_bot isBigO_norm_Icc_restrict_atBot theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) : IsBigO (cocompact ℝ) (fun x => β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€–) fun x => |x| ^ (-b) := by obtain ⟨r, hr⟩ := K.isCompact.isBounded.subset_closedBall 0 rw [closedBall_eq_Icc, zero_add, zero_sub] at hr have : βˆ€ x : ℝ, β€–(f.comp (ContinuousMap.addRight x)).restrict Kβ€– ≀ β€–f.restrict (Icc (x - r) (x + r))β€– := by intro x rw [ContinuousMap.norm_le _ (norm_nonneg _)] rintro ⟨y, hy⟩ refine' (le_of_eq _).trans (ContinuousMap.norm_coe_le_norm _ ⟨y + x, _⟩) Β· simp_rw [ContinuousMap.restrict_apply, ContinuousMap.comp_apply, ContinuousMap.coe_addRight] Β· exact ⟨by linarith [(hr hy).1], by linarith [(hr hy).2]⟩ simp_rw [cocompact_eq, isBigO_sup] at hf ⊒ constructor Β· refine' (isBigO_of_le atBot _).trans (isBigO_norm_Icc_restrict_atBot hb hf.1 (-r) r) simp_rw [norm_norm]; exact this Β· refine' (isBigO_of_le atTop _).trans (isBigO_norm_Icc_restrict_atTop hb hf.2 (-r) r) simp_rw [norm_norm]; exact this set_option linter.uppercaseLean3 false in #align is_O_norm_restrict_cocompact isBigO_norm_restrict_cocompact /-- **Poisson's summation formula**, assuming that `f` decays as `|x| ^ (-b)` for some `1 < b` and its Fourier transform is summable. -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : Summable fun n : β„€ => 𝓕 f n) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, 𝓕 f n) := Real.tsum_eq_tsum_fourierIntegral (fun K => summable_of_isBigO (Real.summable_abs_int_rpow hb) ((isBigO_norm_restrict_cocompact (ContinuousMap.mk _ hc) (zero_lt_one.trans hb) hf K).comp_tendsto Int.tendsto_coe_cofinite)) hFf #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay_of_summable Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable /-- **Poisson's summation formula**, assuming that both `f` and its Fourier transform decay as `|x| ^ (-b)` for some `1 < b`. (This is the one-dimensional case of Corollary VII.2.6 of Stein and Weiss, *Introduction to Fourier analysis on Euclidean spaces*.) -/ theorem Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay {f : ℝ β†’ β„‚} (hc : Continuous f) {b : ℝ} (hb : 1 < b) (hf : IsBigO (cocompact ℝ) f fun x : ℝ => |x| ^ (-b)) (hFf : IsBigO (cocompact ℝ) (𝓕 f) fun x : ℝ => |x| ^ (-b)) : βˆ‘' n : β„€, f n = βˆ‘' n : β„€, 𝓕 f n := Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay_of_summable hc hb hf (summable_of_isBigO (Real.summable_abs_int_rpow hb) (hFf.comp_tendsto Int.tendsto_coe_cofinite)) #align real.tsum_eq_tsum_fourier_integral_of_rpow_decay Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay end RpowDecay section Schwartz /-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that. simp_rw [← hfg] rw [Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay f.continuous one_lt_two (f.isBigO_cocompact_rpow (-2))] rw [hfg]
exact g.isBigO_cocompact_rpow (-2)
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n) := by -- We know that Schwartz functions are `O(β€–x ^ (-b)β€–)` for *every* `b`; for this argument we take -- `b = 2` and work with that. simp_rw [← hfg] rw [Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay f.continuous one_lt_two (f.isBigO_cocompact_rpow (-2))] rw [hfg]
Mathlib.Analysis.Fourier.PoissonSummation.253_0.1MbUAOzT9Ye0D34
/-- **Poisson's summation formula** for Schwartz functions. -/ theorem SchwartzMap.tsum_eq_tsum_fourierIntegral (f g : SchwartzMap ℝ β„‚) (hfg : 𝓕 f = g) : βˆ‘' n : β„€, f n = (βˆ‘' n : β„€, g n)
Mathlib_Analysis_Fourier_PoissonSummation
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x ⊒ βˆ€ ⦃x : ℝ⦄, x ∈ Icc a b β†’ f x ≀ B x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by
change Icc a b βŠ† { x | f x ≀ B x }
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x ⊒ Icc a b βŠ† {x | f x ≀ B x}
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x }
set s := { x | f x ≀ B x } ∩ Icc a b
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x }
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b ⊒ Icc a b βŠ† {x | f x ≀ B x}
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b
have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) ⊒ Icc a b βŠ† {x | f x ≀ B x}
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB
have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le'
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) ⊒ IsClosed s
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by
simp only [inter_comm]
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) ⊒ IsClosed (Icc a b ∩ {x | f x ≀ B x})
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm]
exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le'
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm]
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s ⊒ Icc a b βŠ† {x | f x ≀ B x}
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le'
apply this.Icc_subset_of_forall_exists_gt ha
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le'
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s ⊒ βˆ€ x ∈ {x | f x ≀ B x} ∩ Ico a b, βˆ€ y ∈ Ioi x, Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha
rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy
cases' hxB.lt_or_eq with hxB hxB
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inl E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x < B x ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides
refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inl E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x < B x ⊒ {x | f x ≀ B x} ∈ 𝓝[>] x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))
have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB)
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inl E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this✝ : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x < B x this : βˆ€αΆ  (x : ℝ) in 𝓝[Icc a b] x, f x < B x ⊒ {x | f x ≀ B x} ∈ 𝓝[>] x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB)
have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB)
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inl E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this✝¹ : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x < B x this✝ : βˆ€αΆ  (x : ℝ) in 𝓝[Icc a b] x, f x < B x this : βˆ€αΆ  (x : ℝ) in 𝓝[>] x, f x < B x ⊒ {x | f x ≀ B x} ∈ 𝓝[>] x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this
exact this.mono fun y => le_of_lt
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β·
rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β·
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) hf' : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), f' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩
specialize hf' x xab r hfr
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr
have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB)
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r HB : βˆ€αΆ  (z : ℝ) in 𝓝[>] x, r < slope B x z ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB)
obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB)
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r HB : βˆ€αΆ  (z : ℝ) in 𝓝[>] x, r < slope B x z ⊒ βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y case intro.inr.intro.intro.intro.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r HB : βˆ€αΆ  (z : ℝ) in 𝓝[>] x, r < slope B x z z : ℝ hfz : slope f x z < r hzB : r < slope B x z hz : z ∈ Ioc x y ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y
exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr.intro.intro.intro.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r HB : βˆ€αΆ  (z : ℝ) in 𝓝[>] x, r < slope B x z z : ℝ hfz : slope f x z < r hzB : r < slope B x z hz : z ∈ Ioc x y ⊒ Set.Nonempty ({x | f x ≀ B x} ∩ Ioc x y)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists
refine' ⟨z, _, hz⟩
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr.intro.intro.intro.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r HB : βˆ€αΆ  (z : ℝ) in 𝓝[>] x, r < slope B x z z : ℝ hfz : slope f x z < r hzB : r < slope B x z hz : z ∈ Ioc x y ⊒ z ∈ {x | f x ≀ B x}
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩
have := (hfz.trans hzB).le
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case intro.inr.intro.intro.intro.intro.intro E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f f' : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x s : Set ℝ := {x | f x ≀ B x} ∩ Icc a b A : ContinuousOn (fun x => (f x, B x)) (Icc a b) this✝ : IsClosed s x : ℝ hxB✝ : f x ≀ B x xab : x ∈ Ico a b y : ℝ hy : y ∈ Ioi x hxB : f x = B x r : ℝ hfr : f' x < r hrB : r < B' x hf' : βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r HB : βˆ€αΆ  (z : ℝ) in 𝓝[>] x, r < slope B x z z : ℝ hfz : slope f x z < r hzB : r < slope B x z hz : z ∈ Ioc x y this : slope f x z ≀ slope B x z ⊒ z ∈ {x | f x ≀ B x}
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le
rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le
Mathlib.Analysis.Calculus.MeanValue.84_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r ⊒ βˆ€ ⦃x : ℝ⦄, x ∈ Icc a b β†’ f x ≀ B x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by
have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r) Β· intro x _ _ rw [mul_one] exact (lt_add_iff_pos_right _).2 hr exact hx
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x : ℝ hx : x ∈ Icc a b r : ℝ hr : r > 0 ⊒ f x ≀ B x + r * (x - a)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by
apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case ha E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x : ℝ hx : x ∈ Icc a b r : ℝ hr : r > 0 ⊒ f a ≀ B a + r * (a - a)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β·
rwa [sub_self, mul_zero, add_zero]
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β·
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case hB E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x : ℝ hx : x ∈ Icc a b r : ℝ hr : r > 0 ⊒ ContinuousOn (fun x => B x + r * (x - a)) (Icc a b)
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β·
exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const))
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β·
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case hB' E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x : ℝ hx : x ∈ Icc a b r : ℝ hr : r > 0 ⊒ βˆ€ x ∈ Ico a b, HasDerivWithinAt (fun x => B x + r * (x - a)) (?m.13033 x) (Ici x) x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β·
intro x hx
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β·
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case hB' E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x✝ : ℝ hx✝ : x✝ ∈ Icc a b r : ℝ hr : r > 0 x : ℝ hx : x ∈ Ico a b ⊒ HasDerivWithinAt (fun x => B x + r * (x - a)) (?m.13033 x) (Ici x) x
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx
exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r)
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case bound E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x : ℝ hx : x ∈ Icc a b r : ℝ hr : r > 0 ⊒ βˆ€ x ∈ Ico a b, f x = B x + r * (x - a) β†’ B' x < B' x + r * 1
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r) Β·
intro x _ _
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r) Β·
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue
case bound E : Type u_1 inst✝³ : NormedAddCommGroup E inst✝² : NormedSpace ℝ E F : Type u_2 inst✝¹ : NormedAddCommGroup F inst✝ : NormedSpace ℝ F f : ℝ β†’ ℝ a b : ℝ hf : ContinuousOn f (Icc a b) B B' : ℝ β†’ ℝ ha : f a ≀ B a hB : ContinuousOn B (Icc a b) hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x bound : βˆ€ x ∈ Ico a b, βˆ€ (r : ℝ), B' x < r β†’ βˆƒαΆ  (z : ℝ) in 𝓝[>] x, slope f x z < r x✝ : ℝ hx : x✝ ∈ Icc a b r : ℝ hr : r > 0 x : ℝ a✝¹ : x ∈ Ico a b a✝ : f x = B x + r * (x - a) ⊒ B' x < B' x + r * 1
/- Copyright (c) 2019 SΓ©bastien GouΓ«zel. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: SΓ©bastien GouΓ«zel, Yury Kudryashov -/ import Mathlib.Analysis.Calculus.Deriv.AffineMap import Mathlib.Analysis.Calculus.Deriv.Slope import Mathlib.Analysis.Calculus.Deriv.Mul import Mathlib.Analysis.Calculus.Deriv.Comp import Mathlib.Analysis.Calculus.LocalExtr.Rolle import Mathlib.Analysis.Convex.Slope import Mathlib.Analysis.Convex.Normed import Mathlib.Data.IsROrC.Basic import Mathlib.Topology.Instances.RealVectorSpace #align_import analysis.calculus.mean_value from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe" /-! # The mean value inequality and equalities In this file we prove the following facts: * `Convex.norm_image_sub_le_of_norm_deriv_le` : if `f` is differentiable on a convex set `s` and the norm of its derivative is bounded by `C`, then `f` is Lipschitz continuous on `s` with constant `C`; also a variant in which what is bounded by `C` is the norm of the difference of the derivative from a fixed linear map. This lemma and its versions are formulated using `IsROrC`, so they work both for real and complex derivatives. * `image_le_of*`, `image_norm_le_of_*` : several similar lemmas deducing `f x ≀ B x` or `β€–f xβ€– ≀ B x` from upper estimates on `f'` or `β€–f'β€–`, respectively. These lemmas differ by their assumptions: * `of_liminf_*` lemmas assume that limit inferior of some ratio is less than `B' x`; * `of_deriv_right_*`, `of_norm_deriv_right_*` lemmas assume that the right derivative or its norm is less than `B' x`; * `of_*_lt_*` lemmas assume a strict inequality whenever `f x = B x` or `β€–f xβ€– = B x`; * `of_*_le_*` lemmas assume a non-strict inequality everywhere on `[a, b)`; * name of a lemma ends with `'` if (1) it assumes that `B` is continuous on `[a, b]` and has a right derivative at every point of `[a, b)`, and (2) the lemma has a counterpart assuming that `B` is differentiable everywhere on `ℝ` * `norm_image_sub_le_*_segment` : if derivative of `f` on `[a, b]` is bounded above by a constant `C`, then `β€–f x - f aβ€– ≀ C * β€–x - aβ€–`; several versions deal with right derivative and derivative within `[a, b]` (`HasDerivWithinAt` or `derivWithin`). * `Convex.is_const_of_fderivWithin_eq_zero` : if a function has derivative `0` on a convex set `s`, then it is a constant on `s`. * `exists_ratio_hasDerivAt_eq_ratio_slope` and `exists_ratio_deriv_eq_ratio_slope` : Cauchy's Mean Value Theorem. * `exists_hasDerivAt_eq_slope` and `exists_deriv_eq_slope` : Lagrange's Mean Value Theorem. * `domain_mvt` : Lagrange's Mean Value Theorem, applied to a segment in a convex domain. * `Convex.image_sub_lt_mul_sub_of_deriv_lt`, `Convex.mul_sub_lt_image_sub_of_lt_deriv`, `Convex.image_sub_le_mul_sub_of_deriv_le`, `Convex.mul_sub_le_image_sub_of_le_deriv`, if `βˆ€ x, C (</≀/>/β‰₯) (f' x)`, then `C * (y - x) (</≀/>/β‰₯) (f y - f x)` whenever `x < y`. * `Convex.monotoneOn_of_deriv_nonneg`, `Convex.antitoneOn_of_deriv_nonpos`, `Convex.strictMono_of_deriv_pos`, `Convex.strictAnti_of_deriv_neg` : if the derivative of a function is non-negative/non-positive/positive/negative, then the function is monotone/antitone/strictly monotone/strictly monotonically decreasing. * `convexOn_of_deriv`, `convexOn_of_deriv2_nonneg` : if the derivative of a function is increasing or its second derivative is nonnegative, then the original function is convex. * `hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt` : a C^1 function over the reals is strictly differentiable. (This is a corollary of the mean value inequality.) -/ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] open Metric Set Asymptotics ContinuousLinearMap Filter open scoped Classical Topology NNReal /-! ### One-dimensional fencing inequalities -/ /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary' {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by change Icc a b βŠ† { x | f x ≀ B x } set s := { x | f x ≀ B x } ∩ Icc a b have A : ContinuousOn (fun x => (f x, B x)) (Icc a b) := hf.prod hB have : IsClosed s := by simp only [inter_comm] exact A.preimage_isClosed_of_isClosed isClosed_Icc OrderClosedTopology.isClosed_le' apply this.Icc_subset_of_forall_exists_gt ha rintro x ⟨hxB : f x ≀ B x, xab⟩ y hy cases' hxB.lt_or_eq with hxB hxB Β· -- If `f x < B x`, then all we need is continuity of both sides refine' nonempty_of_mem (inter_mem _ (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩)) have : βˆ€αΆ  x in 𝓝[Icc a b] x, f x < B x := A x (Ico_subset_Icc_self xab) (IsOpen.mem_nhds (isOpen_lt continuous_fst continuous_snd) hxB) have : βˆ€αΆ  x in 𝓝[>] x, f x < B x := nhdsWithin_le_of_mem (Icc_mem_nhdsWithin_Ioi xab) this exact this.mono fun y => le_of_lt Β· rcases exists_between (bound x xab hxB) with ⟨r, hfr, hrB⟩ specialize hf' x xab r hfr have HB : βˆ€αΆ  z in 𝓝[>] x, r < slope B x z := (hasDerivWithinAt_iff_tendsto_slope' <| lt_irrefl x).1 (hB' x xab).Ioi_of_Ici (Ioi_mem_nhds hrB) obtain ⟨z, hfz, hzB, hz⟩ : βˆƒ z, slope f x z < r ∧ r < slope B x z ∧ z ∈ Ioc x y exact (hf'.and_eventually (HB.and (Ioc_mem_nhdsWithin_Ioi ⟨le_rfl, hy⟩))).exists refine' ⟨z, _, hz⟩ have := (hfz.trans hzB).le rwa [slope_def_field, slope_def_field, div_le_div_right (sub_pos.2 hz.1), hxB, sub_le_sub_iff_right] at this #align image_le_of_liminf_slope_right_lt_deriv_boundary' image_le_of_liminf_slope_right_lt_deriv_boundary' /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has derivative `B'` everywhere on `ℝ`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by a function `f'`; * we have `f' x < B' x` whenever `f x = B x`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_lt_deriv_boundary {f f' : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) -- `hf'` actually says `liminf (f z - f x) / (z - x) ≀ f' x` (hf' : βˆ€ x ∈ Ico a b, βˆ€ r, f' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : βˆ€ x, HasDerivAt B (B' x) x) (bound : βˆ€ x ∈ Ico a b, f x = B x β†’ f' x < B' x) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := image_le_of_liminf_slope_right_lt_deriv_boundary' hf hf' ha (fun x _ => (hB x).continuousAt.continuousWithinAt) (fun x _ => (hB x).hasDerivWithinAt) bound #align image_le_of_liminf_slope_right_lt_deriv_boundary image_le_of_liminf_slope_right_lt_deriv_boundary /-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r) Β· intro x _ _
rw [mul_one]
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x := by have Hr : βˆ€ x ∈ Icc a b, βˆ€ r > 0, f x ≀ B x + r * (x - a) := fun x hx r hr => by apply image_le_of_liminf_slope_right_lt_deriv_boundary' hf bound Β· rwa [sub_self, mul_zero, add_zero] Β· exact hB.add (continuousOn_const.mul (continuousOn_id.sub continuousOn_const)) Β· intro x hx exact (hB' x hx).add (((hasDerivWithinAt_id x (Ici x)).sub_const a).const_mul r) Β· intro x _ _
Mathlib.Analysis.Calculus.MeanValue.149_0.ReDurB0qNQAwk9I
/-- General fencing theorem for continuous functions with an estimate on the derivative. Let `f` and `B` be continuous functions on `[a, b]` such that * `f a ≀ B a`; * `B` has right derivative `B'` at every point of `[a, b)`; * for each `x ∈ [a, b)` the right-side limit inferior of `(f z - f x) / (z - x)` is bounded above by `B'`. Then `f x ≀ B x` everywhere on `[a, b]`. -/ theorem image_le_of_liminf_slope_right_le_deriv_boundary {f : ℝ β†’ ℝ} {a b : ℝ} (hf : ContinuousOn f (Icc a b)) {B B' : ℝ β†’ ℝ} (ha : f a ≀ B a) (hB : ContinuousOn B (Icc a b)) (hB' : βˆ€ x ∈ Ico a b, HasDerivWithinAt B (B' x) (Ici x) x) -- `bound` actually says `liminf (f z - f x) / (z - x) ≀ B' x` (bound : βˆ€ x ∈ Ico a b, βˆ€ r, B' x < r β†’ βˆƒαΆ  z in 𝓝[>] x, slope f x z < r) : βˆ€ ⦃x⦄, x ∈ Icc a b β†’ f x ≀ B x
Mathlib_Analysis_Calculus_MeanValue