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 |