Download data/lean/OAI/Dynamics/ThreeTorus/PositiveLaws.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 74.4 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/ThreeTorus/PositiveLaws.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Dynamics/ThreeTorus/PositiveLaws.lean
-
curl -L -o PositiveLaws.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/ThreeTorus/PositiveLaws.lean
74.4 kB
import Mathlib
namespace OAI
/-! Positive Fourier laws, compact integral differentiation, affine densities, and prime-sieve signal laws. -/
noncomputable section
open MeasureTheory Filter Set Complex
open scoped Topology SchwartzMap FourierTransform Real
open scoped Topology
open MeasureTheory Set
open scoped ENNReal Topology
open Set Function Filter
open scoped Topology NNReal
open MeasureTheory Filter Set
open MeasureTheory Set Function
open scoped Topology ENNReal
open scoped Topology BigOperators
noncomputable section
open MeasureTheory Set Filter
open scoped Topology
namespace ThreeTorus
/-- Compact-parameter differentiation, used by the exact passage near epsilon=0. -/
lemma hasFDerivAt_compact_integral
{E : Type} {G : Type*} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
[NormedAddCommGroup G] [NormedSpace β G] [CompleteSpace G]
{F : E Γ β β G} (hF : ContDiff β 1 F) (a b : β) (x : E) :
HasFDerivAt (fun y => β« t in a..b, F (y,t))
(β« t in a..b, (fderiv β F (x,t)).comp (ContinuousLinearMap.inl β E β)) x := by
let D : E Γ β β E βL[β] G := fun p =>
(fderiv β F p).comp (ContinuousLinearMap.inl β E β)
have hD : Continuous D := hF.continuous_fderiv (by norm_num) |>.clm_comp continuous_const
obtain β¨C,hCβ© := ((isCompact_closedBall x 1).prod (isCompact_uIcc (a := a) (b := b))).exists_bound_of_continuousOn hD.continuousOn
refine hasFDerivAt_integral_of_dominated_of_fderiv_le''
(F := fun y t => F (y,t)) (F' := fun y t => D (y,t))
(bound := fun _ => C) (Metric.closedBall_mem_nhds x (by norm_num : (0:β)<1)) ?_ ?_ ?_ ?_
intervalIntegrable_const ?_
Β· exact Eventually.of_forall (fun y => (hF.continuous.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable)
Β· exact (hF.continuous.comp (continuous_const.prodMk continuous_id)).intervalIntegrable _ _
Β· exact (hD.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable
Β· filter_upwards [ae_restrict_mem measurableSet_uIoc] with t ht
intro y hy
exact hC (y,t) β¨hy,uIoc_subset_uIcc htβ©
Β· exact Eventually.of_forall (fun t y _ => by
simpa [D,Function.comp_def] using ((hF.differentiable one_ne_zero ((ContinuousLinearMap.inl β E β) y+(0,t))).hasFDerivAt).comp y
((ContinuousLinearMap.inl β E β).hasFDerivAt.add_const (0,t)))
/-- Smooth parameter integration over a fixed compact interval. -/
lemma contDiff_compact_integral
{E : Type} {G : Type*} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
[NormedAddCommGroup G] [NormedSpace β G] [CompleteSpace G]
(n : β) {F : E Γ β β G} (hF : ContDiff β n F) (a b : β) :
ContDiff β n (fun y => β« t in a..b, F (y,t)) := by
induction n generalizing G with
| zero =>
apply contDiff_zero.mpr
exact intervalIntegral.continuous_parametric_intervalIntegral_of_continuous'
(show Continuous (Function.uncurry (fun y t => F (y,t))) from hF.continuous) a b
| succ n ih =>
let D : E Γ β β E βL[β] G := fun p =>
(fderiv β F p).comp (ContinuousLinearMap.inl β E β)
have hD : ContDiff β n D := (hF.fderiv_right (by simp)).clm_comp contDiff_const
have hder (x : E) := hasFDerivAt_compact_integral (hF.of_le (by exact_mod_cast Nat.succ_pos n)) a b x
rw [show ((n+1 : β) : WithTop ββ) = (n : WithTop ββ)+1 by simp, contDiff_succ_iff_fderiv]
refine β¨fun x => (hder x).differentiableAt, ?_, ?_β©
Β· simp
Β· have heq : fderiv β (fun y => β« t in a..b, F (y,t)) =
fun y => β« t in a..b, D (y,t) := by
funext y
exact (hder y).fderiv
rw [heq]
exact ih hD
lemma smooth_compact_integral
{E : Type} {G : Type*} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
[NormedAddCommGroup G] [NormedSpace β G] [CompleteSpace G]
{F : E Γ β β G} (hF : ContDiff β ((β€ : ββ) : WithTop ββ) F) (a b : β) :
ContDiff β ((β€ : ββ) : WithTop ββ) (fun y => β« t in a..b, F (y,t)) := by
rw [contDiff_infty]
intro n
exact contDiff_compact_integral n (hF.of_le (by exact_mod_cast (le_top : (n : ββ) β€ β€))) a b
/-! The positive Fourier law. The sinc and averaged
baseline below are exactly those of the manuscript, including the scale and
normalization. -/
open scoped FourierTransform Convolution
lemma sinc_eq_integral_cos (x : β) :
Real.sinc x = β« t in (0 : β)..1, Real.cos (x*t) := by
by_cases hx : x = 0
Β· simp [hx]
Β· rw [intervalIntegral.integral_comp_mul_left _ hx,integral_cos]
simp only [mul_zero,mul_one,Real.sin_zero,sub_zero,smul_eq_mul]
rw [Real.sinc_of_ne_zero hx]
ring
lemma smooth_sinc : ContDiff β ((β€ : ββ) : WithTop ββ) Real.sinc := by
rw [show Real.sinc = (fun x => β« t in (0 : β)..1, Real.cos (x*t)) from
funext sinc_eq_integral_cos]
exact smooth_compact_integral (F := fun p : β Γ β => Real.cos (p.1*p.2)) (by fun_prop) 0 1
def signalSinc (Ξ± R : β) : β := Ξ± * Real.sinc (Real.pi*Ξ±*R)^2
def signalAverageRadius (Ξ± : β) : β := (2*Ξ±)β»ΒΉ
def signalBaseline (Ξ± R : β) : β :=
(2*signalAverageRadius Ξ±)β»ΒΉ *
β« t in -signalAverageRadius Ξ±..signalAverageRadius Ξ±, signalSinc Ξ± (R-t)
lemma signalSinc_nonneg {Ξ± : β} (hΞ± : 0 β€ Ξ±) (R : β) : 0 β€ signalSinc Ξ± R :=
mul_nonneg hΞ± (sq_nonneg _)
lemma smooth_signalSinc (Ξ± : β) :
ContDiff β ((β€ : ββ) : WithTop ββ) (signalSinc Ξ±) := by
exact contDiff_const.mul ((smooth_sinc.comp (by fun_prop)).pow 2)
lemma smooth_signalBaseline (Ξ± : β) :
ContDiff β ((β€ : ββ) : WithTop ββ) (signalBaseline Ξ±) := by
apply contDiff_const.mul
exact smooth_compact_integral (F := fun p : β Γ β => signalSinc Ξ± (p.1-p.2))
((smooth_signalSinc Ξ±).comp (by fun_prop)) _ _
lemma sinc_sq_le (x : β) : Real.sinc x ^ 2 β€ 1 := by
simpa only [sq_abs,one_pow] using
(sq_le_sqβ (abs_nonneg (Real.sinc x)) (by norm_num : (0:β) β€ 1)).2 (Real.abs_sinc_le_one x)
lemma sin_sq_le_one (x : β) : Real.sin x ^ 2 β€ 1 := by
simpa only [sq_abs,one_pow] using
(sq_le_sqβ (abs_nonneg (Real.sin x)) (by norm_num : (0:β) β€ 1)).2 (Real.abs_sin_le_one x)
lemma sinc_sq_mul_sq_le (x : β) : Real.sinc x ^ 2 * x^2 β€ 1 := by
by_cases hx : x = 0
Β· simp [hx]
Β· rw [Real.sinc_of_ne_zero hx]
field_simp
exact sin_sq_le_one x
lemma signalSinc_decay {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
signalSinc Ξ± R β€ (Ξ± + (Real.pi^2*Ξ±)β»ΒΉ) * (1+R^2)β»ΒΉ := by
have ha : Real.pi^2*Ξ± > 0 := by positivity
have hsmall : signalSinc Ξ± R β€ Ξ± :=
mul_le_of_le_one_right hΞ±.le (sinc_sq_le _)
have hlarge : signalSinc Ξ± R * R^2 β€ (Real.pi^2*Ξ±)β»ΒΉ := by
have := sinc_sq_mul_sq_le (Real.pi*Ξ±*R)
rw [β one_div]
apply (le_div_iffβ ha).2
dsimp [signalSinc]
nlinarith
have hd : 0 < 1+R^2 := by positivity
rw [β div_eq_mul_inv,le_div_iffβ hd]
nlinarith
lemma integrable_signalSinc {Ξ± : β} (hΞ± : 0 < Ξ±) : Integrable (signalSinc Ξ±) := by
apply (integrable_inv_one_add_sq.const_mul (Ξ± + (Real.pi^2*Ξ±)β»ΒΉ)).mono'
(smooth_signalSinc Ξ±).continuous.aestronglyMeasurable
filter_upwards [] with R
rw [Real.norm_eq_abs,abs_of_nonneg (signalSinc_nonneg hΞ±.le R)]
exact signalSinc_decay hΞ± R
lemma signalAverageRadius_pos {Ξ± : β} (hΞ± : 0 < Ξ±) : 0 < signalAverageRadius Ξ± := by
dsimp [signalAverageRadius]
positivity
lemma signalSinc_denominator {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
signalSinc Ξ± R * (Real.pi^2*Ξ±*R^2) = Real.sin (Real.pi*Ξ±*R)^2 := by
by_cases hR : R = 0
Β· simp [hR]
Β· dsimp [signalSinc]
rw [Real.sinc_of_ne_zero (by positivity : Real.pi*Ξ±*R β 0)]
field_simp
lemma integral_sin_sq_pi (x : β) :
β« t in x..x+Real.pi, Real.sin t^2 = Real.pi/2 := by
rw [integral_sin_sq,Real.sin_add_pi,Real.cos_add_pi]
ring
lemma signal_sin_sq_average {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
β« t in -signalAverageRadius Ξ±..signalAverageRadius Ξ±,
Real.sin (Real.pi*Ξ±*(R-t))^2 = signalAverageRadius Ξ± := by
rw [intervalIntegral.integral_comp_sub_left (fun u => Real.sin (Real.pi*Ξ±*u)^2) R]
rw [intervalIntegral.integral_comp_mul_left (fun v => Real.sin v^2)
(mul_ne_zero Real.pi_ne_zero hΞ±.ne')]
have hh : Real.pi*Ξ±*(R- -signalAverageRadius Ξ±) =
Real.pi*Ξ±*(R-signalAverageRadius Ξ±)+Real.pi := by
dsimp [signalAverageRadius]
field_simp
ring
rw [hh,integral_sin_sq_pi,smul_eq_mul]
dsimp [signalAverageRadius]
field_simp
lemma signalBaseline_nonneg {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
0 β€ signalBaseline Ξ± R := by
apply mul_nonneg (by dsimp [signalAverageRadius]; positivity)
apply intervalIntegral.integral_nonneg (by linarith [signalAverageRadius_pos hΞ±])
intro t _
exact signalSinc_nonneg hΞ±.le (R-t)
/-- The averaging interval has exactly one sine-square period. In fact the
manuscript's lower tail estimate holds at every point, including the origin. -/
lemma signalBaseline_lower {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
1 / (2*Real.pi^2*Ξ±*(|R|+signalAverageRadius Ξ±)^2) β€ signalBaseline Ξ± R := by
let a := signalAverageRadius Ξ±
have ha : 0 < a := signalAverageRadius_pos hΞ±
have hΞΊ : 0 < Real.pi^2*Ξ±*(|R|+a)^2 := by positivity
have hp : 0 < Real.pi^2*Ξ± := by positivity
have hi :
a β€ (Real.pi^2*Ξ±*(|R|+a)^2) * β« t in -a..a, signalSinc Ξ± (R-t) := by
calc
a = β« t in -a..a, Real.sin (Real.pi*Ξ±*(R-t))^2 := (signal_sin_sq_average hΞ± R).symm
_ β€ _ := ?_
rw [β intervalIntegral.integral_const_mul]
apply intervalIntegral.integral_mono_on (by linarith)
((by fun_prop : Continuous (fun t => Real.sin (Real.pi*Ξ±*(R-t))^2)).intervalIntegrable _ _)
(by exact (continuous_const.mul
((smooth_signalSinc Ξ±).continuous.comp (by fun_prop))).intervalIntegrable _ _)
intro t ht
have ht' : |t| β€ a := abs_le.mpr β¨ht.1,ht.2β©
have hdist : |R-t| β€ |R|+a := (abs_sub R t).trans (by linarith)
have hs : (R-t)^2 β€ (|R|+a)^2 := by
simpa only [sq_abs] using (sq_le_sqβ (abs_nonneg _) (by positivity)).2 hdist
rw [β signalSinc_denominator hΞ± (R-t)]
nlinarith [mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_left hs hp.le)
(signalSinc_nonneg hΞ±.le (R-t))]
rw [div_le_iffβ (by positivity : 0 < 2*Real.pi^2*Ξ±*(|R|+signalAverageRadius Ξ±)^2)]
dsimp [signalBaseline]
change 1 β€ ((2*a)β»ΒΉ * β« t in -a..a, signalSinc Ξ± (R-t)) *
(2*Real.pi^2*Ξ±*(|R|+a)^2)
field_simp
nlinarith
lemma shifted_quadratic_bound {a R t : β} (ha : 0 β€ a) (ht : |t| β€ a) :
1+R^2 β€ 2*(1+a^2)*(1+(R-t)^2) := by
have ht2 : t^2 β€ a^2 := by
simpa only [sq_abs] using (sq_le_sqβ (abs_nonneg _) ha).2 ht
nlinarith [sq_nonneg (R-2*t),mul_nonneg (sq_nonneg a) (sq_nonneg (R-t))]
lemma signalBaseline_upper {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
signalBaseline Ξ± R β€
(Ξ±+(Real.pi^2*Ξ±)β»ΒΉ)* (2*(1+(signalAverageRadius Ξ±)^2))* (1+R^2)β»ΒΉ := by
let a := signalAverageRadius Ξ±
let C := Ξ±+(Real.pi^2*Ξ±)β»ΒΉ
have ha : 0 < a := signalAverageRadius_pos hΞ±
have hC : 0 < C := by dsimp [C]; positivity
have hi : (β« t in -a..a, signalSinc Ξ± (R-t)) β€
(2*a) * (C * (2*(1+a^2))* (1+R^2)β»ΒΉ) := by
calc
_ β€ β« _t in -a..a, C * (2*(1+a^2))* (1+R^2)β»ΒΉ := by
apply intervalIntegral.integral_mono_on (by linarith)
(((smooth_signalSinc Ξ±).continuous.comp (by fun_prop)).intervalIntegrable _ _)
intervalIntegrable_const
intro t ht
have hs := shifted_quadratic_bound (R := R) ha.le (abs_le.mpr β¨ht.1,ht.2β©)
have hd : 0 < 1+(R-t)^2 := by positivity
have hD : 0 < 1+R^2 := by positivity
calc
signalSinc Ξ± (R-t) β€ C*(1+(R-t)^2)β»ΒΉ := signalSinc_decay hΞ± (R-t)
_ β€ C*(2*(1+a^2))*(1+R^2)β»ΒΉ := by
rw [β div_eq_mul_inv,β div_eq_mul_inv]
apply (div_le_div_iffβ hd hD).2
nlinarith
_ = _ := by rw [intervalIntegral.integral_const]; simp only [smul_eq_mul]; ring
dsimp [signalBaseline]
change (2*a)β»ΒΉ * _ β€ C*(2*(1+a^2))*(1+R^2)β»ΒΉ
rw [inv_mul_le_iffβ (by positivity : 0 < 2*a)]
exact hi
lemma integrable_signalBaseline {Ξ± : β} (hΞ± : 0 < Ξ±) : Integrable (signalBaseline Ξ±) := by
apply (integrable_inv_one_add_sq.const_mul
((Ξ±+(Real.pi^2*Ξ±)β»ΒΉ)*(2*(1+(signalAverageRadius Ξ±)^2)))).mono'
(smooth_signalBaseline Ξ±).continuous.aestronglyMeasurable
filter_upwards [] with R
rw [Real.norm_eq_abs,abs_of_nonneg (signalBaseline_nonneg hΞ± R)]
exact signalBaseline_upper hΞ± R
/-! Exact Fourier support, without assuming an interval inversion formula. -/
def signalBox (Ξ± : β) (x : β) : β := (Icc (-Ξ±/2) (Ξ±/2)).indicator (fun _ => 1) x
def signalTriangle (Ξ± v : β) : β := ((max (Ξ±-|v|) 0 / Ξ± : β) : β)
lemma integrable_signalBox (Ξ± : β) : Integrable (signalBox Ξ±) := by
exact (integrableOn_const (isCompact_Icc.measure_ne_top) :
IntegrableOn (fun _ : β => (1 : β)) (Icc (-Ξ±/2) (Ξ±/2))).integrable_indicator measurableSet_Icc
lemma fourier_const_mul (c : β) (f : β β β) (v : β) :
π (fun x => c*f x) v = c*π f v := by
simp only [Real.fourier_real_eq,Circle.smul_def,smul_eq_mul]
rw [β integral_const_mul]
congr 1
funext x
ring
lemma fourier_signalBox {Ξ± : β} (hΞ± : 0 < Ξ±) (v : β) :
π (signalBox Ξ±) v = (Ξ± * Real.sinc (Real.pi*Ξ±*v) : β) := by
rw [Real.fourier_real_eq_integral_exp_smul]
simp only [smul_eq_mul]
have heq : (fun x : β => Complex.exp (β(-2*Real.pi*x*v)*Complex.I)*signalBox Ξ± x) =
(Icc (-Ξ±/2) (Ξ±/2)).indicator (fun x => Complex.exp (β(-2*Real.pi*x*v)*Complex.I)) := by
funext x
by_cases hx : x β Icc (-Ξ±/2) (Ξ±/2) <;> simp [signalBox,Set.indicator,hx]
rw [heq,integral_indicator measurableSet_Icc,integral_Icc_eq_integral_Ioc,
β intervalIntegral.integral_of_le (by linarith : -Ξ±/2 β€ Ξ±/2)]
by_cases hv : v = 0
Β· simp [hv,intervalIntegral.integral_const]
ring
Β· let c : β := -2*Real.pi*v
have hc : c β 0 := by dsimp [c]; positivity
have he : (fun x : β => Complex.exp (β(-2*Real.pi*x*v)*Complex.I)) =
(fun x => Complex.exp (β(c*x)*Complex.I)) := by
funext x
congr 1
dsimp [c]
push_cast
ring
rw [he,intervalIntegral.integral_comp_mul_left (fun x => Complex.exp (βx*Complex.I)) hc]
rw [show c*(-Ξ±/2) = -(c*(Ξ±/2)) by ring,integral_exp_mul_I_eq_sinc]
rw [show c*(Ξ±/2) = -(Real.pi*Ξ±*v) by dsimp [c]; ring,Real.sinc_neg]
dsimp [c]
simp only [Complex.ofReal_inv,Complex.ofReal_mul,Complex.ofReal_neg,
Complex.ofReal_ofNat]
have hvC : (v : β) β 0 := Complex.ofReal_ne_zero.mpr hv
field_simp [hvC]
lemma signalBox_convolution {Ξ± : β} (_hΞ± : 0 < Ξ±) (v : β) :
(signalBox Ξ± β[ContinuousLinearMap.mul β β] signalBox Ξ±) v =
(max (Ξ±-|v|) 0 : β) := by
rw [convolution_def]
change (β« t : β, signalBox Ξ± t * signalBox Ξ± (v-t)) = _
let l := max (-Ξ±/2) (v-Ξ±/2)
let u := min (Ξ±/2) (v+Ξ±/2)
have heq : (fun t => signalBox Ξ± t * signalBox Ξ± (v-t)) =
(Icc l u).indicator (fun _ : β => (1 : β)) := by
funext t
have hm : t β Icc l u β t β Icc (-Ξ±/2) (Ξ±/2) β§ v-t β Icc (-Ξ±/2) (Ξ±/2) := by
dsimp [l,u]
simp only [mem_Icc,max_le_iff,le_min_iff]
constructor
Β· rintro β¨β¨h1,h2β©,h3,h4β©
exact β¨β¨h1,h3β©,by constructor <;> linarithβ©
Β· rintro β¨β¨h1,h2β©,h3,h4β©
exact β¨β¨h1,by linarithβ©,h2,by linarithβ©
by_cases hβ : t β Icc (-Ξ±/2) (Ξ±/2) <;>
by_cases hβ : v-t β Icc (-Ξ±/2) (Ξ±/2) <;>
simp [signalBox,Set.indicator,hm,hβ,hβ]
rw [heq,integral_indicator measurableSet_Icc,setIntegral_const,Real.volume_real_Icc]
simp only [Complex.real_smul,mul_one]
congr 1
dsimp [l,u]
by_cases hv : 0 β€ v
Β· rw [abs_of_nonneg hv,min_eq_left (by linarith),show max (-Ξ±/2) (v-Ξ±/2) = v-Ξ±/2 from max_eq_right (by linarith)]
congr 1
ring
Β· rw [abs_of_nonpos (le_of_not_ge hv),min_eq_right (by linarith),show max (-Ξ±/2) (v-Ξ±/2) = -Ξ±/2 from max_eq_left (by linarith)]
congr 1
ring
lemma signalTriangle_eq_convolution {Ξ± : β} (hΞ± : 0 < Ξ±) :
signalTriangle Ξ± = fun v => (Ξ± : β)β»ΒΉ *
(signalBox Ξ± β[ContinuousLinearMap.mul β β] signalBox Ξ±) v := by
funext v
rw [signalBox_convolution hΞ±]
simp [signalTriangle,div_eq_mul_inv,mul_comm]
lemma integrable_signalTriangle {Ξ± : β} (hΞ± : 0 < Ξ±) : Integrable (signalTriangle Ξ±) := by
rw [signalTriangle_eq_convolution hΞ±]
exact ((integrable_signalBox Ξ±).integrable_convolution
(ContinuousLinearMap.mul β β) (integrable_signalBox Ξ±)).const_mul _
lemma continuous_signalTriangle (Ξ± : β) : Continuous (signalTriangle Ξ±) := by
fun_prop [signalTriangle]
lemma fourier_signalTriangle {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) :
π (signalTriangle Ξ±) R = (signalSinc Ξ± R : β) := by
rw [signalTriangle_eq_convolution hΞ±,fourier_const_mul,
Real.fourier_mul_convolution_eq (integrable_signalBox Ξ±) (integrable_signalBox Ξ±),
fourier_signalBox hΞ±]
dsimp [signalSinc]
push_cast
field_simp
lemma fourierInv_signalSinc {Ξ± : β} (hΞ± : 0 < Ξ±) :
πβ» (fun R => (signalSinc Ξ± R : β)) = signalTriangle Ξ± := by
have heq : π (signalTriangle Ξ±) = (fun R => (signalSinc Ξ± R : β)) :=
funext (fourier_signalTriangle hΞ±)
rw [β heq]
exact (continuous_signalTriangle Ξ±).fourierInv_fourier_eq (integrable_signalTriangle hΞ±)
(by rw [heq]; exact (integrable_signalSinc hΞ±).ofReal)
lemma fourier_signalSinc {Ξ± : β} (hΞ± : 0 < Ξ±) (v : β) :
π (fun R => (signalSinc Ξ± R : β)) v = signalTriangle Ξ± v := by
have h := congrFun (fourierInv_signalSinc hΞ±) (-v)
rw [Real.fourierInv_eq_fourier_neg,neg_neg] at h
simpa only [signalTriangle,abs_neg] using h
lemma signalBaseline_eq_convolution {Ξ± : β} (hΞ± : 0 < Ξ±) :
(fun R => (signalBaseline Ξ± R : β)) = fun R => ((2*signalAverageRadius Ξ± : β) : β)β»ΒΉ *
(signalBox (2*signalAverageRadius Ξ±) β[ContinuousLinearMap.mul β β]
(fun x => (signalSinc Ξ± x : β))) R := by
funext R
have ha : 0 < signalAverageRadius Ξ± := signalAverageRadius_pos hΞ±
rw [convolution_def]
change β(signalBaseline Ξ± R) = _ * β« t, signalBox (2*signalAverageRadius Ξ±) t * β(signalSinc Ξ± (R-t))
have heq : (fun t => signalBox (2*signalAverageRadius Ξ±) t * (signalSinc Ξ± (R-t) : β)) =
(Icc (-signalAverageRadius Ξ±) (signalAverageRadius Ξ±)).indicator
(fun t => (signalSinc Ξ± (R-t) : β)) := by
funext t
have hl : -(2*signalAverageRadius Ξ±)/2 = -signalAverageRadius Ξ± := by ring
have hu : 2*signalAverageRadius Ξ±/2 = signalAverageRadius Ξ± := by ring
by_cases ht : t β Icc (-signalAverageRadius Ξ±) (signalAverageRadius Ξ±) <;>
simp [signalBox,hl,hu,Set.indicator,ht]
rw [heq,integral_indicator measurableSet_Icc,integral_Icc_eq_integral_Ioc,
β intervalIntegral.integral_of_le (by linarith : -signalAverageRadius Ξ± β€ signalAverageRadius Ξ±),
intervalIntegral.integral_ofReal]
simp only [signalBaseline,Complex.ofReal_mul,Complex.ofReal_inv]
lemma fourier_signalBaseline {Ξ± : β} (hΞ± : 0 < Ξ±) (v : β) :
π (fun R => (signalBaseline Ξ± R : β)) v =
(Real.sinc (Real.pi*(2*signalAverageRadius Ξ±)*v) : β)*signalTriangle Ξ± v := by
rw [signalBaseline_eq_convolution hΞ±,fourier_const_mul]
have hc := Real.fourier_mul_convolution_eq
(integrable_signalBox (2*signalAverageRadius Ξ±)) (integrable_signalSinc hΞ±).ofReal v
change π (signalBox (2*signalAverageRadius Ξ±) β[ContinuousLinearMap.mul β β]
(fun x => (signalSinc Ξ± x : β))) v = _ at hc
rw [hc,fourier_signalBox (mul_pos (by norm_num) (signalAverageRadius_pos hΞ±)) v]
have hs := fourier_signalSinc hΞ± v
change π (fun x => (signalSinc Ξ± x : β)) v = signalTriangle Ξ± v at hs
erw [hs]
have ha : (2*signalAverageRadius Ξ± : β) β 0 := (mul_pos (by norm_num) (signalAverageRadius_pos hΞ±)).ne'
have haC : ((2*signalAverageRadius Ξ± : β) : β) β 0 := Complex.ofReal_ne_zero.mpr ha
have ha0 : (signalAverageRadius Ξ± : β) β 0 := Complex.ofReal_ne_zero.mpr (signalAverageRadius_pos hΞ±).ne'
push_cast
field_simp [ha0]
lemma integral_signalBaseline {Ξ± : β} (hΞ± : 0 < Ξ±) : β« R, signalBaseline Ξ± R = 1 := by
have h := fourier_signalBaseline hΞ± 0
simp [Real.fourier_real_eq,signalTriangle,max_eq_left hΞ±.le,hΞ±.ne'] at h
apply Complex.ofReal_injective
calc
((β« R, signalBaseline Ξ± R : β) : β) = β« R, (signalBaseline Ξ± R : β) :=
(integral_ofReal (π := β)).symm
_ = (1 : β) := h
_ = ((1 : β) : β) := rfl
lemma signalBaseline_fourier_support {Ξ± v : β} (hΞ± : 0 < Ξ±) (hv : Ξ± β€ |v|) :
π (fun R => (signalBaseline Ξ± R : β)) v = 0 := by
rw [fourier_signalBaseline hΞ±]
simp [signalTriangle,max_eq_right (sub_nonpos.mpr hv)]
lemma signalBaseline_pos {Ξ± : β} (hΞ± : 0 < Ξ±) (R : β) : 0 < signalBaseline Ξ± R := by
have ha := signalAverageRadius_pos hΞ±
exact lt_of_lt_of_le (by positivity) (signalBaseline_lower hΞ± R)
theorem signalBaseline_quadratic_tails {Ξ± : β} (hΞ± : 0 < Ξ±) :
β c C : β, 0 < c β§ 0 < C β§ β R : β,
c/(1+R^2) β€ signalBaseline Ξ± R β§ signalBaseline Ξ± R β€ C/(1+R^2) := by
let a := signalAverageRadius Ξ±
have ha : 0 < a := signalAverageRadius_pos hΞ±
let c := (4*Real.pi^2*Ξ±*(1+a^2))β»ΒΉ
let C := (Ξ±+(Real.pi^2*Ξ±)β»ΒΉ)*(2*(1+a^2))
refine β¨c,C,by dsimp [c]; positivity,by dsimp [C]; positivity,fun R => β¨?_,?_β©β©
Β· apply le_trans ?_ (signalBaseline_lower hΞ± R)
change c/(1+R^2) β€ 1/(2*Real.pi^2*Ξ±*(|R|+a)^2)
have hD : 0 < 2*Real.pi^2*Ξ±*(|R|+a)^2 := by positivity
have hbig : (|R|+a)^2 β€ 2*(1+a^2)*(1+R^2) := by
nlinarith [sq_nonneg (|R|-a),sq_abs R,mul_nonneg (sq_nonneg a) (sq_nonneg R)]
have hp : 0 < 2*Real.pi^2*Ξ± := by positivity
dsimp [c]
rw [β one_div,div_div]
apply one_div_le_one_div_of_le hD
nlinarith [mul_le_mul_of_nonneg_left hbig hp.le]
Β· exact (signalBaseline_upper hΞ± R).trans_eq (by dsimp [C,a]; rw [div_eq_mul_inv])
open scoped ComplexConjugate
lemma fourier_hermitian_real (d : β β β) (hd : β v, d (-v) = conj (d v)) (R : β) :
conj (π d R) = π d R := by
rw [Real.fourier_real_eq_integral_exp_smul]
simp only [smul_eq_mul]
rw [β integral_conj]
calc
(β« v : β, conj (Complex.exp (β(-2*Real.pi*v*R)*Complex.I)*d v)) =
β« v : β, Complex.exp (β(-2*Real.pi*(-v)*R)*Complex.I)*d (-v) := by
apply integral_congr_ae
filter_upwards [] with v
rw [map_mul,β Complex.exp_conj,hd]
congr 2
simp only [map_mul,Complex.conj_ofReal,Complex.conj_I]
push_cast
ring
_ = β« v : β, Complex.exp (β(-2*Real.pi*v*R)*Complex.I)*d v :=
integral_neg_eq_self (fun v : β => Complex.exp (β(-2*Real.pi*v*R)*Complex.I)*d v) volume
def signalInverse (d : β β β) (R : β) : β := (π d R).re
lemma signalInverse_complex {d : β β β} (hd : β v, d (-v) = conj (d v)) (R : β) :
(signalInverse d R : β) = π d R :=
Complex.conj_eq_iff_re.mp (fourier_hermitian_real d hd R)
lemma signalInverse_contDiff {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) : ContDiff β ((β€ : ββ) : WithTop ββ) (signalInverse d) := by
let f := hc.toSchwartzMap hd
exact Complex.reCLM.contDiff.comp ((π f).smooth β€)
lemma signalInverse_integrable {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) : Integrable (signalInverse d) := by
let f := hc.toSchwartzMap hd
exact Complex.reCLM.integrable_comp (π f).integrable
lemma signalInverse_inversion {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) (hreal : β v, d (-v) = conj (d v)) :
πβ» (fun R => (signalInverse d R : β)) = d := by
have heq : (fun R => (signalInverse d R : β)) = π d :=
funext (signalInverse_complex hreal)
rw [heq]
let f := hc.toSchwartzMap hd
exact hd.continuous.fourierInv_fourier_eq (f.integrable) (π f).integrable
lemma integral_signalInverse {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) (hreal : β v, d (-v) = conj (d v)) (h0 : d 0 = 0) :
β« R, signalInverse d R = 0 := by
have h := congrFun (signalInverse_inversion hd hc hreal) 0
simp [Real.fourierInv_eq,h0] at h
apply Complex.ofReal_injective
calc
((β« R, signalInverse d R : β) : β) = β« R, (signalInverse d R : β) :=
(integral_ofReal (π := β)).symm
_ = 0 := h
_ = ((0 : β) : β) := rfl
lemma signalInverse_quadratic_bound {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) : β G : β, 0 β€ G β§ β R, (1+R^2)*|signalInverse d R| β€ G := by
let f := hc.toSchwartzMap hd
let g := π f
refine β¨SchwartzMap.seminorm β 0 0 g + SchwartzMap.seminorm β 2 0 g,by positivity,?_β©
intro R
have h0 := g.norm_le_seminorm β R
have h2 := g.norm_pow_mul_le_seminorm β 2 R
have hr : |signalInverse d R| β€ βg Rβ := Complex.abs_re_le_norm (g R)
rw [Real.norm_eq_abs,sq_abs] at h2
nlinarith [sq_nonneg R,mul_le_mul_of_nonneg_left hr (sq_nonneg R)]
lemma conj_stdAddChar {P : β} [NeZero P] (h : ZMod P) :
conj (ZMod.stdAddChar h) = ZMod.stdAddChar (-h) := by
rw [ZMod.stdAddChar_apply,ZMod.stdAddChar_apply,AddChar.map_neg_eq_inv,
Circle.coe_inv_eq_conj]
/-- The exact Ramanujan coefficient in the joint law of Section 3. -/
def signalRamanujanC (P : β) [NeZero P] (h : ZMod P) : β :=
β u : (ZMod P)Λ£, ZMod.stdAddChar (-(u.val*h))
def signalRamanujan (P : β) [NeZero P] (h : ZMod P) : β :=
(signalRamanujanC P h).re
lemma conj_signalRamanujanC {P : β} [NeZero P] (h : ZMod P) :
conj (signalRamanujanC P h) = signalRamanujanC P h := by
classical
simp only [signalRamanujanC,map_sum,conj_stdAddChar,neg_neg]
exact Fintype.sum_equiv (Equiv.neg ((ZMod P)Λ£)) _ _ (by
intro u
simp [Equiv.neg_apply,Units.val_neg,neg_mul])
lemma signalRamanujan_complex {P : β} [NeZero P] (h : ZMod P) :
(signalRamanujan P h : β) = signalRamanujanC P h :=
Complex.conj_eq_iff_re.mp (conj_signalRamanujanC h)
lemma signalRamanujan_bound {P : β} [NeZero P] (h : ZMod P) :
|signalRamanujan P h| β€ Fintype.card (ZMod P)Λ£ := by
apply (Complex.abs_re_le_norm (signalRamanujanC P h)).trans
calc
βsignalRamanujanC P hβ β€ β u : (ZMod P)Λ£, βZMod.stdAddChar (-(u.val*h))β :=
norm_sum_le _ _
_ = Fintype.card (ZMod P)Λ£ := by simp [ZMod.stdAddChar_apply,Circle.norm_coe]
lemma sum_stdAddChar_mul {P : β} [NeZero P] (k : ZMod P) :
β h : ZMod P, ZMod.stdAddChar (k*h) = if k = 0 then (P : β) else 0 := by
classical
split_ifs with hk
Β· simp [hk]
Β· exact AddChar.sum_eq_zero_of_ne_one (ZMod.isPrimitive_stdAddChar P hk)
lemma signalRamanujan_selector {P : β} [NeZero P] (k : ZMod P) :
β h : ZMod P, signalRamanujanC P h * ZMod.stdAddChar (k*h) =
if IsUnit k then (P : β) else 0 := by
classical
simp only [signalRamanujanC,Finset.sum_mul]
rw [Finset.sum_comm]
have heq (u : (ZMod P)Λ£) : β h : ZMod P,
ZMod.stdAddChar (-(u.val*h))*ZMod.stdAddChar (k*h) =
if u.val = k then (P : β) else 0 := by
simp_rw [β AddChar.map_add_eq_mul,show β h : ZMod P, -(u.val*h)+k*h = (k-u.val)*h by intro; ring]
rw [sum_stdAddChar_mul]
simp [sub_eq_zero,eq_comm]
simp_rw [heq]
split_ifs with hk
Β· rw [Finset.sum_eq_single hk.unit]
Β· simp
Β· intro u _ hne
simp only [ite_eq_right_iff]
intro hu
exfalso
exact hne (Units.ext (hu.trans hk.unit_spec.symm))
Β· simp
Β· apply Finset.sum_eq_zero
intro u _
rw [ite_eq_right]
intro hu
exact hk (hu βΈ u.isUnit)
/-- Joint law; its marginal over the residue coordinate has total mass one. -/
def signalJoint (Ξ± Ξ³ : β) (d : β β β) (P : β) [NeZero P] (h : ZMod P) (R : β) : β :=
(signalBaseline Ξ± R+Ξ³*signalRamanujan P h*signalInverse d R)/P
lemma signalJoint_smooth {Ξ± : β} (_hΞ± : 0 < Ξ±) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(P : β) [NeZero P] (h : ZMod P) :
ContDiff β ((β€ : ββ) : WithTop ββ) (signalJoint Ξ± Ξ³ d P h) := by
exact ((smooth_signalBaseline Ξ±).add
(contDiff_const.mul (signalInverse_contDiff hd hc))).div_const _
lemma signalJoint_integrable {Ξ± : β} (hΞ± : 0 < Ξ±) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(P : β) [NeZero P] (h : ZMod P) : Integrable (signalJoint Ξ± Ξ³ d P h) :=
((integrable_signalBaseline hΞ±).add
((signalInverse_integrable hd hc).const_mul (Ξ³*signalRamanujan P h))).div_const _
lemma integral_signalJoint {Ξ± : β} (hΞ± : 0 < Ξ±) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(hr : β v, d (-v) = conj (d v)) (h0 : d 0 = 0)
(P : β) [NeZero P] (h : ZMod P) : β« R, signalJoint Ξ± Ξ³ d P h R = 1/P := by
simp only [signalJoint]
rw [integral_div,integral_add (integrable_signalBaseline hΞ±)
((signalInverse_integrable hd hc).const_mul _),integral_const_mul,
integral_signalBaseline hΞ±,integral_signalInverse hd hc hr h0]
ring
lemma fourier_add_integrable {f g : β β β} (hf : Integrable f) (hg : Integrable g) (v : β) :
π (fun x => f x+g x) v = π f v+π g v := by
simp only [Real.fourier_eq,smul_add]
rw [integral_add ((Real.fourierIntegral_convergent_iff v).2 hf)
((Real.fourierIntegral_convergent_iff v).2 hg)]
lemma fourierInv_add_integrable {f g : β β β} (hf : Integrable f) (hg : Integrable g) (v : β) :
πβ» (fun x => f x+g x) v = πβ» f v+πβ» g v := by
simp only [Real.fourierInv_eq_fourier_neg,fourier_add_integrable hf hg]
lemma fourierInv_const_mul (c : β) (f : β β β) (v : β) :
πβ» (fun x => c*f x) v = c*πβ» f v := by
simp only [Real.fourierInv_eq_fourier_neg,fourier_const_mul]
lemma fourierInv_signalJoint {Ξ± : β} (hΞ± : 0 < Ξ±) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(hr : β v, d (-v) = conj (d v)) (P : β) [NeZero P] (h : ZMod P) (v : β) :
πβ» (fun R => (signalJoint Ξ± Ξ³ d P h R : β)) v =
(P : β)β»ΒΉ * (πβ» (fun R => (signalBaseline Ξ± R : β)) v+
(Ξ³ : β)*signalRamanujanC P h*d v) := by
have heq : (fun R => (signalJoint Ξ± Ξ³ d P h R : β)) =
fun R => (P : β)β»ΒΉ*((signalBaseline Ξ± R : β)+
((Ξ³ : β)*signalRamanujanC P h)*(signalInverse d R : β)) := by
funext R
simp only [signalJoint,div_eq_mul_inv,Complex.ofReal_mul,Complex.ofReal_add,
Complex.ofReal_inv,Complex.ofReal_natCast,signalRamanujan_complex]
ring
rw [heq,fourierInv_const_mul]
erw [fourierInv_add_integrable
(integrable_signalBaseline hΞ±).ofReal (((signalInverse_integrable hd hc).ofReal).const_mul _),
fourierInv_const_mul,signalInverse_inversion hd hc hr]
rfl
/-- Exact positive-exponent joint Fourier transform, not a conditional moment assumption. -/
theorem signalJoint_fourier {Ξ± : β} (hΞ± : 0 < Ξ±) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(hr : β v, d (-v) = conj (d v)) (P : β) [NeZero P] (v : β) (k : ZMod P) :
β h : ZMod P, (πβ» (fun R => (signalJoint Ξ± Ξ³ d P h R : β)) v)*
ZMod.stdAddChar (k*h) =
(if k = 0 then πβ» (fun R => (signalBaseline Ξ± R : β)) v else 0)+
(if IsUnit k then (Ξ³ : β)*d v else 0) := by
classical
simp_rw [fourierInv_signalJoint hΞ± Ξ³ hd hc hr]
calc
_ = (P : β)β»ΒΉ * ((πβ» (fun R => (signalBaseline Ξ± R : β)) v)*
(β h : ZMod P, ZMod.stdAddChar (k*h))+
(Ξ³ : β)*d v*(β h : ZMod P, signalRamanujanC P h*ZMod.stdAddChar (k*h))) := by
simp only [mul_add,add_mul,Finset.mul_sum,Finset.sum_add_distrib]
congr 1
all_goals apply Finset.sum_congr rfl; intro h _; ring
_ = _ := by
rw [sum_stdAddChar_mul,signalRamanujan_selector]
have hP : (P : β) β 0 := by exact_mod_cast NeZero.ne P
split_ifs <;> field_simp [hP] <;> ring
/-- Small strengths give the actual positive law, with the source's quantitative
two-sided domination. The choice is independent of the angular scale B. -/
theorem signalJoint_positive_strength {Ξ± : β} (hΞ± : 0 < Ξ±) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(P : β) [NeZero P] :
β Ξ³β : β, 0 < Ξ³β β§ β Ξ³ : β, 0 β€ Ξ³ β Ξ³ β€ Ξ³β β
(β h : ZMod P, β R : β, signalBaseline Ξ± R/(2*P) β€ signalJoint Ξ± Ξ³ d P h R β§
signalJoint Ξ± Ξ³ d P h R β€ 3*signalBaseline Ξ± R/(2*P)) β§
β v : β, 2*Ξ³*βd vβ β€ 1/2 := by
obtain β¨c,C,hc0,_hC,htailβ© := signalBaseline_quadratic_tails hΞ±
obtain β¨G,hG,hgbβ© := signalInverse_quadratic_bound hd hc
let Cu : β := Fintype.card (ZMod P)Λ£
have hCu : 0 β€ Cu := by dsimp [Cu]; positivity
let f := hc.toSchwartzMap hd
let D := SchwartzMap.seminorm β 0 0 f
have hD : 0 β€ D := apply_nonneg (SchwartzMap.seminorm β 0 0) f
have hdD (v : β) : βd vβ β€ D := f.norm_le_seminorm β v
let Ξ³β := min (c/(2*(Cu*G+1))) (1/(4*(D+1)))
have hCG : 0 < Cu*G+1 := by positivity
refine β¨Ξ³β,by dsimp [Ξ³β]; positivity,fun Ξ³ hΞ³ hΞ³β => β¨?_,?_β©β©
Β· intro h R
have hsmall : Ξ³*(Cu*G+1) β€ c/2 := by
have hh := hΞ³β.trans (min_le_left (c/(2*(Cu*G+1))) (1/(4*(D+1))))
have hh' := (le_div_iffβ (by positivity : 0 < 2*(Cu*G+1))).mp hh
nlinarith
have hgb' := hgb R
have hcb := signalRamanujan_bound h
have hb : |Ξ³*signalRamanujan P h*signalInverse d R| β€ signalBaseline Ξ± R/2 := by
have hprod : (1+R^2)*|Ξ³*signalRamanujan P h*signalInverse d R| β€ Ξ³*Cu*G := by
rw [abs_mul,abs_mul,abs_of_nonneg hΞ³]
calc
_ = Ξ³*|signalRamanujan P h| *((1+R^2)*|signalInverse d R| ) := by ring
_ β€ Ξ³*Cu*G := by gcongr
have ht := (htail R).1
have hpos : 0 < 1+R^2 := by positivity
have ht' := (div_le_iffβ hpos).mp ht
nlinarith
have hP : (0 : β) < P := by exact_mod_cast Nat.pos_of_ne_zero (NeZero.ne P)
obtain β¨hl,huβ© := abs_le.mp hb
dsimp [signalJoint]
constructor
Β· rw [div_le_div_iffβ (by positivity : 0 < 2*(P : β)) hP]
nlinarith
Β· rw [div_le_div_iffβ hP (by positivity : 0 < 2*(P : β))]
nlinarith
Β· intro v
have hh := hΞ³β.trans (min_le_right (c/(2*(Cu*G+1))) (1/(4*(D+1))))
have hh' := (le_div_iffβ (by positivity : 0 < 4*(D+1))).mp hh
have hbd := mul_le_mul_of_nonneg_left (hdD v) hΞ³
nlinarith
/-- The manuscript's finite sieve modulus, unchanged (not a factorial proxy). -/
def signalPrimeProduct (L : β) : β :=
β p β (Finset.range (L+1)).filter Nat.Prime, p
lemma signalPrimeProduct_pos (L : β) : 0 < signalPrimeProduct L := by
apply Finset.prod_pos
intro p hp
exact (Finset.mem_filter.mp hp).2.pos
instance (L : β) : NeZero (signalPrimeProduct L) := β¨(signalPrimeProduct_pos L).ne'β©
lemma dvd_signalPrimeProduct {p L : β} (hp : p.Prime) (hL : p β€ L) :
p β£ signalPrimeProduct L := by
exact Finset.dvd_prod_of_mem (fun p : β => p)
(Finset.mem_filter.mpr β¨Finset.mem_range.mpr (by omega),hpβ©)
lemma signalPrimeProduct_ge_two {L : β} (hL : 2 β€ L) : 2 β€ signalPrimeProduct L :=
Nat.le_of_dvd (signalPrimeProduct_pos L) (dvd_signalPrimeProduct Nat.prime_two hL)
lemma signal_sieve_no_unit {L β : β} (hβ : 2 β€ β) (hL : β β€ L)
(m : ZMod (signalPrimeProduct L)) : Β¬ IsUnit ((β : ZMod (signalPrimeProduct L))*m) := by
intro h
have hu := (ZMod.isUnit_iff_coprime β (signalPrimeProduct L)).mp
(isUnit_of_mul_isUnit_left h)
have hp := Nat.minFac_prime (n := β) (by omega)
exact (Nat.not_coprime_of_dvd_of_dvd hp.one_lt (Nat.minFac_dvd β)
(dvd_signalPrimeProduct hp ((Nat.minFac_le (by omega)).trans hL))) hu
/-- The exact ideal integer moments, with only the first nonzero harmonic. -/
theorem signalJoint_sieved_moments {Ξ± b D x : β} (hΞ± : 0 < Ξ±) (hΞ±b : Ξ± < b)
(hb : 0 < b) (hx : b β€ |x|) {L : β} (hL : D/b < L)
{d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) (hr : β v, d (-v) = conj (d v))
(hs : Function.support d β Icc (-D) D) (Ξ³ : β)
(m : ZMod (signalPrimeProduct L)) (β : β) (hβ : 1 β€ β) :
β h : ZMod (signalPrimeProduct L),
(πβ» (fun R => (signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R : β))) (β*x)*
ZMod.stdAddChar (((β : ZMod (signalPrimeProduct L))*m)*h) =
if β = 1 β§ IsUnit m then (Ξ³ : β)*d x else 0 := by
rw [signalJoint_fourier hΞ± Ξ³ hd hc hr]
have hβr : (1 : β) β€ β := by exact_mod_cast hβ
have hav : Ξ± β€ |(β : β)*x| := by
rw [abs_mul,abs_of_nonneg (Nat.cast_nonneg β)]
nlinarith [abs_nonneg x]
have hbase : πβ» (fun R => (signalBaseline Ξ± R : β)) ((β : β)*x) = 0 := by
rw [Real.fourierInv_eq_fourier_neg]
exact signalBaseline_fourier_support hΞ± (by simpa only [abs_neg] using hav)
rw [hbase]
simp only [ite_self,zero_add]
by_cases he : β = 1
Β· subst β
simp
Β· rw [ite_eq_right (show Β¬ (β = 1 β§ IsUnit m) from fun h => he h.1)]
by_cases hd0 : d ((β : β)*x) = 0
Β· simp [hd0]
Β· have hv := hs hd0
have ha : |(β : β)*x| β€ D := abs_le.mpr hv
rw [abs_mul,abs_of_nonneg (Nat.cast_nonneg β)] at ha
have hbound : (β : β) < L := by
have hcL := (div_lt_iffβ hb).mp hL
nlinarith
have hβL : β β€ L := (by exact_mod_cast hbound : β < L).le
rw [ite_eq_right (signal_sieve_no_unit (by omega) hβL m)]
/-- All choices of the positive-law construction precede the angular scale.
The interval support used below is the exact compact support condition on d. -/
theorem exists_signal_positive_law {b D : β} (hb : 0 < b)
{d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hc : HasCompactSupport d) (hr : β v, d (-v) = conj (d v))
(h0 : d 0 = 0) (hs : Function.support d β Icc (-D) D) :
β Ξ± : β, β L : β, β Ξ³β : β,
0 < Ξ± β§ Ξ± < b/2 β§ 2 β€ L β§ D/b < L β§ 0 < Ξ³β β§
β Ξ³ : β, 0 < Ξ³ β Ξ³ β€ Ξ³β β
(β h : ZMod (signalPrimeProduct L),
ContDiff β ((β€ : ββ) : WithTop ββ) (signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h) β§
Integrable (signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h) β§
(β« R, signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R) = 1/(signalPrimeProduct L) β§
β R, signalBaseline Ξ± R/(2*(signalPrimeProduct L)) β€
signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R β§
signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R β€
3*signalBaseline Ξ± R/(2*(signalPrimeProduct L))) β§
(β v, 2*Ξ³*βd vβ β€ 1/2) β§
β x, b β€ |x| β β m : ZMod (signalPrimeProduct L), β β : β, 1 β€ β β
β h : ZMod (signalPrimeProduct L),
(πβ» (fun R => (signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R : β))) (β*x)*
ZMod.stdAddChar (((β : ZMod (signalPrimeProduct L))*m)*h) =
if β = 1 β§ IsUnit m then (Ξ³ : β)*d x else 0 := by
obtain β¨L,hLβ© := exists_nat_gt (max 2 (D/b))
have hL2 : 2 β€ L := by
have hh : (2 : β) < L := (le_max_left _ _).trans_lt hL
exact_mod_cast hh.le
have hLD : D/b < L := (le_max_right _ _).trans_lt hL
have hΞ± : 0 < b/4 := by positivity
obtain β¨Ξ³β,hΞ³β,hΞ³β© := signalJoint_positive_strength hΞ± hd hc (signalPrimeProduct L)
refine β¨b/4,L,Ξ³β,hΞ±,by linarith,hL2,hLD,hΞ³β,?_β©
intro Ξ³ hΞ³pos hΞ³le
obtain β¨hbound,hdBoundβ© := hΞ³ Ξ³ hΞ³pos.le hΞ³le
refine β¨?_,hdBound,?_β©
Β· intro h
exact β¨signalJoint_smooth hΞ± Ξ³ hd hc _ h,signalJoint_integrable hΞ± Ξ³ hd hc _ h,
integral_signalJoint hΞ± Ξ³ hd hc hr h0 _ h,hbound hβ©
Β· intro x hx m β hβ
exact signalJoint_sieved_moments hΞ± (by linarith) hb hx hLD hd hc hr hs Ξ³ m β hβ
end ThreeTorus
noncomputable section
open MeasureTheory Set Filter
open scoped Topology FourierTransform
namespace ThreeTorus
def affineDensity (q : β β β) (a b y : β) : β := a*q (a*y+b)
lemma integrable_affineDensity {q : β β β} (hq : Integrable q) {a : β}
(ha : a β 0) (b : β) : Integrable (affineDensity q a b) := by
exact ((integrable_comp_mul_left_iff (fun x => q (x+b)) ha).2
(hq.comp_add_right b)).const_mul a
lemma integral_affineDensity {q : β β β} {a : β} (ha : 0 < a) (b : β) :
(β« y, affineDensity q a b y) = β« y, q y := by
unfold affineDensity
rw [integral_const_mul,Measure.integral_comp_mul_left (fun y => q (y+b)) a,
integral_add_right_eq_self]
simp only [smul_eq_mul,abs_of_pos (inv_pos.mpr ha)]
field_simp
lemma fourierInv_affineDensity {q : β β β} {a : β} (ha : 0 < a) (b v : β) :
πβ» (fun y => (affineDensity q a b y : β)) v =
Complex.exp ((-2*Real.pi*(v*b/a) : β)*Complex.I)*
πβ» (fun y => (q y : β)) (v/a) := by
simp only [Real.fourierInv_eq_fourier_neg,Real.fourier_real_eq_integral_exp_smul,
smul_eq_mul]
let f : β β β := fun x =>
Complex.exp (((2*Real.pi*v/a)*x : β)*Complex.I)*(q x : β)
have hf : β y : β,
Complex.exp (((-2*Real.pi*y*(-v)) : β)*Complex.I)*
(affineDensity q a b y : β) =
(a : β)*(Complex.exp ((-2*Real.pi*(v*b/a) : β)*Complex.I)*f (a*y+b)) := by
intro y
have hex : (-2*Real.pi*y*(-v)) =
-2*Real.pi*(v*b/a)+(2*Real.pi*v/a)*(a*y+b) := by
field_simp [ha.ne']
ring
dsimp only [affineDensity,f]
rw [hex,Complex.ofReal_add,add_mul,Complex.exp_add]
simp only [Complex.ofReal_mul]
ring
simp_rw [hf]
rw [integral_const_mul,integral_const_mul,Measure.integral_comp_mul_left (fun y => f (y+b)) a,
integral_add_right_eq_self]
simp only [abs_of_pos (inv_pos.mpr ha),Complex.real_smul,Complex.ofReal_inv]
have hg : (fun y : β => Complex.exp (((-2*Real.pi*y*(-(v/a))) : β)*Complex.I)*
(q y : β)) = f := by
funext y
dsimp [f]
congr 2
ring_nf
rw [hg]
field_simp [show (a : β) β 0 from Complex.ofReal_ne_zero.mpr ha.ne']
lemma affine_square_bound (a b y : β) :
1+(a*y+b)^2 β€ (1+2*a^2+2*b^2)*(1+y^2) := by
nlinarith [sq_nonneg (a*y-b),sq_nonneg a,sq_nonneg y,
mul_nonneg (sq_nonneg b) (sq_nonneg y)]
lemma affineDensity_quadratic_tails {q : β β β} {a c C : β}
(ha : 0 < a) (hc : 0 < c) (hC : 0 < C)
(hq : β y, c/(1+y^2) β€ q y β§ q y β€ C/(1+y^2)) (b : β) :
β c' C' : β, 0 < c' β§ 0 < C' β§ β y,
c'/(1+y^2) β€ affineDensity q a b y β§
affineDensity q a b y β€ C'/(1+y^2) := by
let K := 1+2*a^2+2*b^2
let K' := 1+2*(aβ»ΒΉ)^2+2*(-b/a)^2
have hK : 0 < K := by dsimp [K]; positivity
have hK' : 0 < K' := by dsimp [K']; positivity
refine β¨a*c/K,a*C*K',by positivity,by positivity,fun y => β¨?_,?_β©β©
Β· have hbnd := affine_square_bound a b y
have hp : 0 < 1+y^2 := by positivity
have hp' : 0 < 1+(a*y+b)^2 := by positivity
have he : a*c/K/(1+y^2) β€ a*(c/(1+(a*y+b)^2)) := by
rw [div_div,β mul_div_assoc]
exact div_le_div_of_nonneg_left (by positivity) hp' (by simpa [K] using hbnd)
exact he.trans (mul_le_mul_of_nonneg_left (hq _).1 ha.le)
Β· have hbnd := affine_square_bound aβ»ΒΉ (-b/a) (a*y+b)
have he : aβ»ΒΉ*(a*y+b)+ -b/a = y := by field_simp [ha.ne']; ring
rw [he] at hbnd
have hp : 0 < 1+y^2 := by positivity
have hp' : 0 < 1+(a*y+b)^2 := by positivity
apply (mul_le_mul_of_nonneg_left (hq _).2 ha.le).trans
rw [β mul_div_assoc,div_le_div_iffβ hp' hp]
have hh := mul_le_mul_of_nonneg_left hbnd (show 0 β€ a*C by positivity)
dsimp [K'] at *
nlinarith
end ThreeTorus
noncomputable section
open MeasureTheory Set Filter
open scoped Topology FourierTransform
namespace ThreeTorus
lemma finite_sum_quadratic_tails {ΞΉ : Type*} [Fintype ΞΉ] [Nonempty ΞΉ]
{q : ΞΉ β β β β}
(hq : β i, β c C : β, 0 < c β§ 0 < C β§ β y,
c/(1+y^2) β€ q i y β§ q i y β€ C/(1+y^2)) :
β c C : β, 0 < c β§ 0 < C β§ β y,
c/(1+y^2) β€ β i, q i y β§ β i, q i y β€ C/(1+y^2) := by
classical
choose c C hc hC hbound using hq
refine β¨β i, c i,β i, C i,
Finset.sum_pos (fun i _ => hc i) Finset.univ_nonempty,
Finset.sum_pos (fun i _ => hC i) Finset.univ_nonempty,?_β©
intro y
constructor
Β· rw [Finset.sum_div]
exact Finset.sum_le_sum fun i _ => (hbound i y).1
Β· rw [Finset.sum_div]
exact Finset.sum_le_sum fun i _ => (hbound i y).2
/-- Density of J_*=(R/B+h/P)/c; the finite representatives are h.val. -/
def signalJitter (Ξ± Ξ³ : β) (d : β β β) (P : β) [NeZero P]
(B c y : β) : β :=
c*B*β h : ZMod P, signalJoint Ξ± Ξ³ d P h (B*(c*y-h.val/P))
lemma signalJitter_affine (Ξ± Ξ³ : β) (d : β β β) (P : β) [NeZero P]
(B c y : β) :
signalJitter Ξ± Ξ³ d P B c y =
β h : ZMod P, affineDensity (signalJoint Ξ± Ξ³ d P h) (c*B) (-B*h.val/P) y := by
classical
simp only [signalJitter,Finset.mul_sum,affineDensity]
apply Finset.sum_congr rfl
intro h _
congr 2
ring
lemma signalJitter_smooth {Ξ± : β} (hΞ± : 0 < Ξ±) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hc : HasCompactSupport d)
(P : β) [NeZero P] (B c : β) :
ContDiff β ((β€ : ββ) : WithTop ββ) (signalJitter Ξ± Ξ³ d P B c) := by
classical
apply contDiff_const.mul
apply ContDiff.sum
intro h _
exact (signalJoint_smooth hΞ± Ξ³ hd hc P h).comp (by fun_prop)
lemma signalJitter_integrable {Ξ± B c : β} (hΞ± : 0 < Ξ±) (hB : 0 < B) (hc : 0 < c)
(Ξ³ : β) {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hcomp : HasCompactSupport d) (P : β) [NeZero P] :
Integrable (signalJitter Ξ± Ξ³ d P B c) := by
simp only [show signalJitter Ξ± Ξ³ d P B c = fun y =>
β h : ZMod P, affineDensity (signalJoint Ξ± Ξ³ d P h) (c*B) (-B*h.val/P) y from
funext (signalJitter_affine Ξ± Ξ³ d P B c)]
exact integrable_finsetSum _ (fun h _ => integrable_affineDensity
(signalJoint_integrable hΞ± Ξ³ hd hcomp P h) (mul_pos hc hB).ne' _)
lemma integral_signalJitter {Ξ± B c : β} (hΞ± : 0 < Ξ±) (hB : 0 < B) (hc : 0 < c)
(Ξ³ : β) {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hcomp : HasCompactSupport d) (hr : β v, d (-v) = starRingEnd β (d v))
(h0 : d 0 = 0) (P : β) [NeZero P] :
(β« y, signalJitter Ξ± Ξ³ d P B c y) = 1 := by
simp_rw [signalJitter_affine]
rw [integral_finsetSum _ (fun h _ => integrable_affineDensity
(signalJoint_integrable hΞ± Ξ³ hd hcomp P h) (mul_pos hc hB).ne' _)]
simp_rw [integral_affineDensity (mul_pos hc hB),integral_signalJoint hΞ± Ξ³ hd hcomp hr h0]
simp [ZMod.card P,NeZero.ne P]
lemma signalJitter_quadratic_tails {Ξ± B c Ξ³ : β} (hΞ± : 0 < Ξ±) (hB : 0 < B)
(hc : 0 < c) {d : β β β} (P : β) [NeZero P]
(hbound : β h R, signalBaseline Ξ± R/(2*P) β€ signalJoint Ξ± Ξ³ d P h R β§
signalJoint Ξ± Ξ³ d P h R β€ 3*signalBaseline Ξ± R/(2*P)) :
β a A : β, 0 < a β§ 0 < A β§ β y,
a/(1+y^2) β€ signalJitter Ξ± Ξ³ d P B c y β§
signalJitter Ξ± Ξ³ d P B c y β€ A/(1+y^2) := by
obtain β¨a,A,ha,hA,hqβ© := signalBaseline_quadratic_tails hΞ±
have hP : (0 : β) < P := Nat.cast_pos.mpr (NeZero.pos P)
have ht (h : ZMod P) : β y, (a/(2*P))/(1+y^2) β€ signalJoint Ξ± Ξ³ d P h y β§
signalJoint Ξ± Ξ³ d P h y β€ (3*A/(2*P))/(1+y^2) := by
intro y
constructor
Β· have hh := div_le_div_of_nonneg_right (hq y).1 (show 0 β€ 2*(P:β) by positivity)
have hh' : a/(2*P)/(1+y^2) β€ signalBaseline Ξ± y/(2*P) := by
convert hh using 1; first | rfl | ring
exact hh'.trans (hbound h y).1
Β· have hh := div_le_div_of_nonneg_right
(mul_le_mul_of_nonneg_left (hq y).2 (show 0 β€ (3:β) by norm_num))
(show 0 β€ 2*(P:β) by positivity)
exact (hbound h y).2.trans (by convert hh using 1; ring)
obtain β¨a',A',ha',hA',hbndβ© := finite_sum_quadratic_tails
(fun h : ZMod P => affineDensity_quadratic_tails (mul_pos hc hB)
(show 0 < a/(2*P) by positivity) (show 0 < 3*A/(2*P) by positivity) (ht h)
(-B*h.val/P))
exact β¨a',A',ha',hA',fun y => by simpa only [signalJitter_affine] using hbnd yβ©
lemma signalJitter_pos {Ξ± B c Ξ³ : β} (hΞ± : 0 < Ξ±) (hB : 0 < B)
(hc : 0 < c) {d : β β β} (P : β) [NeZero P]
(hbound : β h R, signalBaseline Ξ± R/(2*P) β€ signalJoint Ξ± Ξ³ d P h R β§
signalJoint Ξ± Ξ³ d P h R β€ 3*signalBaseline Ξ± R/(2*P)) (y : β) :
0 < signalJitter Ξ± Ξ³ d P B c y := by
obtain β¨a,A,ha,_hA,hbndβ© := signalJitter_quadratic_tails hΞ± hB hc P hbound
exact lt_of_lt_of_le (by positivity : 0 < a/(1+y^2)) (hbnd y).1
lemma fourierInv_finsetSum {ΞΉ : Type*} (S : Finset ΞΉ) {f : ΞΉ β β β β}
(hf : β i β S, Integrable (f i)) (v : β) :
πβ» (fun y => β i β S, f i y) v = β i β S, πβ» (f i) v := by
simp only [Real.fourierInv_eq_fourier_neg,Real.fourier_eq,Finset.smul_sum]
exact integral_finsetSum S (fun i hi => (Real.fourierIntegral_convergent_iff (-v)).2 (hf i hi))
lemma signalJitter_fourierInv {Ξ± B c : β} (hΞ± : 0 < Ξ±) (hB : 0 < B) (hc : 0 < c)
(Ξ³ : β) {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hcomp : HasCompactSupport d) (P : β) [NeZero P] (v : β) :
πβ» (fun y => (signalJitter Ξ± Ξ³ d P B c y : β)) v =
β h : ZMod P, Complex.exp ((2*Real.pi*(v*h.val/(c*P)) : β)*Complex.I)*
πβ» (fun y => (signalJoint Ξ± Ξ³ d P h y : β)) (v/(c*B)) := by
classical
have he : (fun y => (signalJitter Ξ± Ξ³ d P B c y : β)) = fun y =>
β h : ZMod P, (affineDensity (signalJoint Ξ± Ξ³ d P h) (c*B) (-B*h.val/P) y : β) := by
funext y
rw [signalJitter_affine]
push_cast
rfl
rw [he]
erw [fourierInv_finsetSum _ (fun h _ =>
(integrable_affineDensity (signalJoint_integrable hΞ± Ξ³ hd hcomp P h)
(mul_pos hc hB).ne' _).ofReal)]
apply Finset.sum_congr rfl
intro h _
erw [fourierInv_affineDensity (mul_pos hc hB)]
congr 3
field_simp [hB.ne',hc.ne',show (P : β) β 0 from Nat.cast_ne_zero.mpr (NeZero.ne P)]
lemma signal_character (P : β) [NeZero P] (n : β€) (h : ZMod P) :
ZMod.stdAddChar ((n : ZMod P)*h) =
Complex.exp ((2*Real.pi*((n:β)*h.val/P) : β)*Complex.I) := by
have he := ZMod.stdAddChar_coe (N := P) (n*(h.val:β€))
simp only [Int.cast_mul,Int.cast_natCast,ZMod.natCast_zmod_val] at he
rw [he]
push_cast
congr 1
ring
lemma signalJitter_integer_moments {Ξ± B c : β} (hΞ± : 0 < Ξ±) (hB : 0 < B) (hc : 0 < c)
(Ξ³ : β) {d : β β β} (hd : ContDiff β ((β€ : ββ) : WithTop ββ) d)
(hcomp : HasCompactSupport d) (P : β) [NeZero P] (n : β€) :
πβ» (fun y => (signalJitter Ξ± Ξ³ d P B c y : β)) ((n:β)*c) =
β h : ZMod P, (πβ» (fun y => (signalJoint Ξ± Ξ³ d P h y : β))) ((n:β)/B)*
ZMod.stdAddChar ((n : ZMod P)*h) := by
rw [signalJitter_fourierInv hΞ± hB hc Ξ³ hd hcomp]
have he : (n:β)*c/(c*B) = (n:β)/B := by field_simp
rw [he]
apply Finset.sum_congr rfl
intro h _
rw [signal_character,mul_comm]
congr 3
field_simp
lemma signalJitter_sieved_moments {Ξ± B c b D : β}
(hΞ± : 0 < Ξ±) (hΞ±b : Ξ± < b) (hB : 0 < B) (hc : 0 < c) (hb : 0 < b)
{L : β} (hL : D/b < L) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hcomp : HasCompactSupport d)
(hr : β v, d (-v) = starRingEnd β (d v))
(hs : Function.support d β Icc (-D) D) (m : β€) (hm : b β€ |(m:β)/B|)
(β : β) (hβ : 1 β€ β) :
πβ» (fun y => (signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B c y : β))
((β:β)*(m:β)*c) =
if β = 1 β§ IsUnit (m : ZMod (signalPrimeProduct L)) then (Ξ³ : β)*d ((m:β)/B) else 0 := by
have he := signalJitter_integer_moments hΞ± hB hc Ξ³ hd hcomp (signalPrimeProduct L)
((β:β€)*m)
push_cast at he
rw [he]
have hh := signalJoint_sieved_moments hΞ± hΞ±b hb hm hL hd hcomp hr hs Ξ³
(m : ZMod (signalPrimeProduct L)) β hβ
convert hh using 1
congr 2
ring_nf
end ThreeTorus
noncomputable section
open MeasureTheory Set Filter Asymptotics
open scoped Topology FourierTransform
namespace ThreeTorus
/-- Density under multiplication by a nonzero real scale, including negative scales. -/
def scaledDensity (q : β β β) (s y : β) : β := |s|β»ΒΉ*q (y/s)
lemma integrable_scaledDensity {q : β β β} (hq : Integrable q) {s : β} (hs : s β 0) :
Integrable (scaledDensity q s) := by
have hi := ((integrable_comp_mul_left_iff q (inv_ne_zero hs)).2 hq).const_mul |s|β»ΒΉ
change Integrable (fun y => |s|β»ΒΉ*q (y/s))
simpa only [div_eq_mul_inv,mul_comm] using hi
lemma integral_scaledDensity {q : β β β} {s : β} (hs : s β 0) :
(β« y, scaledDensity q s y) = β« y, q y := by
simp only [scaledDensity,div_eq_mul_inv]
rw [integral_const_mul,Measure.integral_comp_mul_right]
simp only [inv_inv,smul_eq_mul]
field_simp
lemma fourierInv_scaledDensity {q : β β β} {s : β} (hs : s β 0) (v : β) :
πβ» (fun y => (scaledDensity q s y : β)) v =
πβ» (fun y => (q y : β)) (v*s) := by
simp only [Real.fourierInv_eq_fourier_neg,Real.fourier_real_eq_integral_exp_smul,
smul_eq_mul]
let f : β β β := fun x => Complex.exp (((-2*Real.pi*x*(-(v*s))) : β)*Complex.I)*(q x : β)
have he : β y : β,
Complex.exp (((-2*Real.pi*y*(-v)) : β)*Complex.I)*(scaledDensity q s y : β) =
((|s| : β) : β)β»ΒΉ*f (sβ»ΒΉ*y) := by
intro y
have harg : -2*Real.pi*(sβ»ΒΉ*y)*(-(v*s)) = -2*Real.pi*y*(-v) := by
field_simp [hs]
dsimp only [f,scaledDensity]
rw [harg]
simp only [div_eq_mul_inv,Complex.ofReal_mul,Complex.ofReal_inv]
rw [mul_comm sβ»ΒΉ y]
ring
simp_rw [he]
rw [integral_const_mul,Measure.integral_comp_mul_left]
simp only [inv_inv,Complex.real_smul]
have hsC : ((|s| : β) : β) β 0 := Complex.ofReal_ne_zero.mpr (abs_ne_zero.mpr hs)
field_simp
apply integral_congr_ae
filter_upwards [] with x
dsimp only [f]
congr 3
ring_nf
lemma fourier_scaledDensity {q : β β β} {s : β} (hs : s β 0) (v : β) :
π (fun y => (scaledDensity q s y : β)) v = π (fun y => (q y : β)) (v*s) := by
have hh := fourierInv_scaledDensity (q := q) hs (-v)
simpa only [Real.fourierInv_eq_fourier_neg,neg_neg,neg_mul,neg_neg] using hh
lemma scaledDensity_quadratic_bound {q : β β β} {C s : β} (hC : 0 β€ C) (hs : s β 0)
(hq : β y, |q y| β€ C/(1+y^2)) :
β D : β, 0 β€ D β§ β y, |scaledDensity q s y| β€ D/(1+y^2) := by
let K := 1+2*s^2
have hK : 0 < K := by dsimp [K]; positivity
refine β¨|s|β»ΒΉ*C*K,by positivity,fun y => ?_β©
have hsq : y^2 = s^2*(y/s)^2 := by field_simp
have hbnd : 1+y^2 β€ K*(1+(y/s)^2) := by
dsimp [K]
nlinarith [sq_nonneg s,sq_nonneg (y/s)]
calc
|scaledDensity q s y| = |s|β»ΒΉ*|q (y/s)| := by
simp only [scaledDensity,abs_mul,abs_inv,abs_abs]
_ β€ |s|β»ΒΉ*(C/(1+(y/s)^2)) := mul_le_mul_of_nonneg_left (hq _) (by positivity)
_ β€ (|s|β»ΒΉ*C*K)/(1+y^2) := by
rw [β mul_div_assoc,div_le_div_iffβ (by positivity) (by positivity)]
nlinarith [mul_le_mul_of_nonneg_left hbnd (show 0 β€ |s|β»ΒΉ*C by positivity)]
lemma quadratic_norm_isBigO {f : β β β} {C : β} (hC : 0 β€ C)
(hf : β y, βf yβ β€ C/(1+y^2)) :
f =O[cocompact β] (fun y : β => |y| ^ (-(2:β))) := by
apply IsBigO.of_bound C
filter_upwards [(isCompact_Icc (a := (-1:β)) (b := 1)).compl_mem_cocompact] with y hy
have h0 : y β 0 := by intro h; subst y; simp at hy
have hsq : 0 < y^2 := sq_pos_of_ne_zero h0
have hr : |y| ^ (-(2:β)) = (y^2)β»ΒΉ := by
rw [Real.rpow_neg (abs_nonneg y),Real.rpow_two,sq_abs]
rw [hr,Real.norm_eq_abs,abs_of_nonneg (by positivity),β div_eq_mul_inv]
exact (hf y).trans (div_le_div_of_nonneg_left hC hsq (by nlinarith))
lemma summable_lattice_of_bounded_support {f : β β β} {D : β}
(hf : β v, D < |v| β f v = 0) : Summable (fun n : β€ => f (n:β)) := by
obtain β¨N,hNβ© := exists_nat_gt D
apply summable_of_ne_finset_zero (s := Finset.Icc (-(N:β€)) N)
intro n hn
apply hf
by_contra! hh
have hab := abs_le.mp (hh.trans hN.le)
exact hn (Finset.mem_Icc.mpr β¨by exact_mod_cast hab.1,by exact_mod_cast hab.2β©)
/-- Exact Poisson expansion for every continuously bandlimited quadratic-tail law. -/
theorem periodization_fourier {q : β β β} (hq : Continuous q) {C : β} (hC : 0 β€ C)
(hbnd : β y, |q y| β€ C/(1+y^2)) {D : β}
(hF : β v, D < |v| β π (fun y => (q y : β)) v = 0) (x : β) :
β' n : β€, (q (x+n) : β) =
β' n : β€, π (fun y => (q y : β)) (n:β)*fourier n (x : UnitAddCircle) := by
apply Real.tsum_eq_tsum_fourier_of_rpow_decay_of_summable
(Complex.continuous_ofReal.comp hq) (b := 2) (by norm_num)
Β· exact quadratic_norm_isBigO hC (fun y => by simpa only [Function.comp_apply,Complex.norm_real,Real.norm_eq_abs] using hbnd y)
Β· exact summable_lattice_of_bounded_support hF
lemma fourierInv_real_neg (q : β β β) (v : β) :
πβ» (fun y => (q y : β)) (-v) = starRingEnd β (πβ» (fun y => (q y : β)) v) := by
simp only [Real.fourierInv_eq_fourier_neg,Real.fourier_real_eq_integral_exp_smul,
smul_eq_mul,β integral_conj]
apply integral_congr_ae
filter_upwards [] with y
simp only [map_mul,Complex.conj_ofReal,β Complex.exp_conj,Complex.conj_I]
congr 2
push_cast
ring
lemma periodization_three_modes {q : β β β} (hq : Continuous q) {C : β} (hC : 0 β€ C)
(hbnd : β y, |q y| β€ C/(1+y^2)) (a : β)
(hmom : β n : β€, πβ» (fun y => (q y : β)) (n:β) =
if n = 0 then 1 else if n = 1 then a else if n = -1 then starRingEnd β a else 0)
(x : β) :
β' n : β€, (q (x+n) : β) = 1 + 2*((a * fourier (-1) (x : UnitAddCircle)).re : β) := by
have hF (n : β€) : π (fun y => (q y : β)) (n:β) =
if n = 0 then 1 else if n = 1 then starRingEnd β a else if n = -1 then a else 0 := by
have hh := hmom (-n)
simp only [Int.cast_neg,Real.fourierInv_eq_fourier_neg,neg_neg] at hh
rw [hh]
by_cases h0 : n = 0
Β· simp [h0]
by_cases h1 : n = 1
Β· simp [h1]
by_cases hn1 : n = -1
Β· simp [hn1]
have hh1 : -n β 1 := by omega
have hh2 : -n β -1 := by omega
simp [h0,h1,hn1,hh1,hh2]
have hs : Summable (fun n : β€ => π (fun y => (q y : β)) (n:β)) := by
apply summable_of_ne_finset_zero (s := {-1,0,1})
intro n hn
simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at hn
simp [hF,hn.1,hn.2.1,hn.2.2]
have hh := Real.tsum_eq_tsum_fourier_of_rpow_decay_of_summable
(Complex.continuous_ofReal.comp hq) (b := 2) (by norm_num)
(quadratic_norm_isBigO hC (fun y => by
simpa only [Function.comp_apply,Complex.norm_real,Real.norm_eq_abs] using hbnd y)) hs x
simp only [Function.comp_def] at hh
erw [hh]
rw [tsum_eq_sum (s := {-1,0,1}) (fun n hn => by
simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at hn
simp [hF,hn.1,hn.2.1,hn.2.2])]
simp only [Finset.sum_insert,Finset.sum_singleton,show (-1 : β€) β ({0,1} : Finset β€) by decide,
show (0 : β€) β ({1} : Finset β€) by decide,not_false_eq_true,hF]
norm_num only [fourier_zero,Int.reduceNeg,Int.reduceEq,ite_true,ite_false,one_mul,mul_one]
rw [fourier_neg]
have he : a * starRingEnd β (fourier 1 (x : UnitAddCircle)) +
starRingEnd β a * fourier 1 (x : UnitAddCircle) =
2*((a * starRingEnd β (fourier 1 (x : UnitAddCircle))).re : β) := by
simpa only [map_mul,starRingEnd_self_apply,Complex.ofReal_mul,Complex.ofReal_ofNat] using
Complex.add_conj (a * starRingEnd β (fourier 1 (x : UnitAddCircle)))
linear_combination he
/-- A compact Fourier bandwidth supplies a shared finite series near any nonzero scale. -/
lemma periodization_scaled_finite {q : β β β} (hq : Continuous q)
{C : β} (hC : 0 β€ C) (hbnd : β y, |q y| β€ C/(1+y^2))
{D Ξ΅ : β} (hΞ΅ : 0 < Ξ΅) (hF : β v, D < |v| β π (fun y => (q y : β)) v = 0)
{N : β} (hN : D < N*Ξ΅) {s : β} (hs : Ξ΅ β€ |s|) (x : β) :
β' n : β€, (scaledDensity q s (x+n) : β) =
β n β Finset.Icc (-(N:β€)) N,
π (fun y => (q y : β)) ((n:β)*s)*fourier n (x : UnitAddCircle) := by
have hs0 : s β 0 := by intro hh; simp [hh] at hs; linarith
obtain β¨C',hC',hboundβ© := scaledDensity_quadratic_bound hC hs0 hbnd
have hcont : Continuous (scaledDensity q s) :=
continuous_const.mul (hq.comp (continuous_id.div_const _))
have hband (n : β€) (hn : n β Finset.Icc (-(N:β€)) N) :
π (fun y => (q y : β)) ((n:β)*s) = 0 := by
apply hF
have hn' : (N : β) < |(n:β)| := by
by_contra! hab
have hle := abs_le.mp hab
apply hn
exact Finset.mem_Icc.mpr β¨by exact_mod_cast hle.1,by exact_mod_cast hle.2β©
rw [abs_mul]
exact hN.trans_le (mul_le_mul (le_of_lt hn') hs hΞ΅.le (abs_nonneg _))
have hsumm : Summable (fun n : β€ => π (fun y => (scaledDensity q s y : β)) (n:β)) := by
apply summable_of_ne_finset_zero (s := Finset.Icc (-(N:β€)) N)
intro n hn
rw [fourier_scaledDensity hs0]
exact hband n hn
have he := Real.tsum_eq_tsum_fourier_of_rpow_decay_of_summable
(Complex.continuous_ofReal.comp hcont) (b := 2) (by norm_num)
(quadratic_norm_isBigO hC' (fun y => by
simpa only [Function.comp_apply,Complex.norm_real,Real.norm_eq_abs] using hbound y)) hsumm x
simp only [Function.comp_def] at he
erw [he]
simp_rw [fourier_scaledDensity hs0]
exact tsum_eq_sum (fun n hn => by rw [hband n hn,zero_mul])
lemma periodization_scaled_tendstoUniformly {q : β β β} (hq : Continuous q)
(hqi : Integrable q) {C : β} (hC : 0 β€ C) (hbnd : β y, |q y| β€ C/(1+y^2))
{D : β} (hF : β v, D < |v| β π (fun y => (q y : β)) v = 0)
{sβ : β} (hsβ : sβ β 0) :
TendstoUniformly (fun s x => β' n : β€, (scaledDensity q s (x+n) : β))
(fun x => β' n : β€, (scaledDensity q sβ (x+n) : β)) (π sβ) := by
let Ξ΅ := |sβ|/2
have hΞ΅ : 0 < Ξ΅ := by dsimp [Ξ΅]; positivity
obtain β¨N,hNβ© := exists_nat_gt (D/Ξ΅)
have hN' : D < (N:β)*Ξ΅ := (div_lt_iffβ hΞ΅).mp hN
let S := Finset.Icc (-(N:β€)) N
let F : β β β := π (fun y => (q y : β))
have hFc : Continuous F := VectorFourier.fourierIntegral_continuous
Real.continuous_fourierChar continuous_inner hqi.ofReal
let G : β β UnitAddCircle β β := fun s x => β n β S, F ((n:β)*s)*fourier n x
have hGc : Continuous βΏG := by
change Continuous (fun p : β Γ UnitAddCircle => β n β S, F ((n:β)*p.1)*fourier n p.2)
apply continuous_finsetSum _
intro n _
exact (hFc.comp (continuous_const.mul continuous_fst)).mul
((fourier n).continuous.comp continuous_snd)
have hu := Continuous.tendstoUniformly G hGc sβ
have hnear : βαΆ s : β in π sβ, Ξ΅ β€ |s| := by
have hh : Ξ΅ < |sβ| := by dsimp [Ξ΅]; linarith [abs_pos.mpr hsβ]
exact ((continuous_abs.tendsto sβ).eventually (eventually_gt_nhds hh)).mono
(fun _ h => h.le)
have hsβ' : Ξ΅ β€ |sβ| := by dsimp [Ξ΅]; linarith [abs_nonneg sβ]
apply Metric.tendstoUniformly_iff.mpr
intro Ξ΄ hΞ΄
filter_upwards [Metric.tendstoUniformly_iff.mp hu Ξ΄ hΞ΄,hnear] with s hs hs'
intro x
rw [periodization_scaled_finite hq hC hbnd hΞ΅ hF hN' hs' x,
periodization_scaled_finite hq hC hbnd hΞ΅ hF hN' hsβ' x]
exact hs (x : UnitAddCircle)
lemma fourierInv_real_zero (q : β β β) :
πβ» (fun y => (q y : β)) 0 = ((β« y, q y : β) : β) := by
simp only [Real.fourierInv_eq_fourier_neg,Real.fourier_real_eq_integral_exp_smul,
neg_zero,mul_zero,Complex.ofReal_zero,zero_mul,Complex.exp_zero,one_smul]
exact integral_ofReal
lemma fourierInv_real_int_moments {q : β β β} (hmass : (β« y, q y) = 1) (a : β)
(hpos : β β : β, 1 β€ β β πβ» (fun y => (q y : β)) (β:β) = if β = 1 then a else 0)
(n : β€) :
πβ» (fun y => (q y : β)) (n:β) =
if n = 0 then 1 else if n = 1 then a else if n = -1 then starRingEnd β a else 0 := by
by_cases h0 : n = 0
Β· rw [h0,Int.cast_zero,ite_eq_left rfl,fourierInv_real_zero,hmass,Complex.ofReal_one]
rcases lt_or_gt_of_ne h0 with hn | hn
Β· have hneg : 0 β€ -n := by omega
let k := (-n).toNat
have hk : (k : β€) = -n := Int.toNat_of_nonneg hneg
have hkpos : 1 β€ k := by omega
have hnk : n = -(k : β€) := by omega
rw [hnk,Int.cast_neg,Int.cast_natCast,fourierInv_real_neg,hpos k hkpos]
by_cases hk1 : k = 1
Β· simp [hk1]
Β· have hk0 : k β 0 := by omega
have hn1 : -(k:β€) β 1 := by omega
have hnm1 : -(k:β€) β -1 := by omega
simp [hk1,hk0,hn1,hnm1]
Β· lift n to β using hn.le with k hk
have hkpos : 1 β€ k := by omega
rw [Int.cast_natCast,hpos k hkpos]
by_cases hk1 : k = 1
Β· simp [hk1]
Β· have hk0 : k β 0 := by omega
have hkn1 : (k:β€) β -1 := by omega
simp [hk1,hk0,hkn1]
end ThreeTorus
namespace ThreeTorus
lemma signalJitter_fourierInv_support {Ξ± B c D : β} (hΞ± : 0 < Ξ±) (hB : 0 < B)
(hc : 0 < c) (hΞ±D : Ξ± β€ D) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hcomp : HasCompactSupport d)
(hr : β v, d (-v) = starRingEnd β (d v))
(hs : Function.support d β Icc (-D) D) (P : β) [NeZero P] {v : β}
(hv : c*B*D < |v|) :
πβ» (fun y => (signalJitter Ξ± Ξ³ d P B c y : β)) v = 0 := by
rw [signalJitter_fourierInv hΞ± hB hc Ξ³ hd hcomp]
have hdiv : D < |v/(c*B)| := by
rw [abs_div,abs_of_pos (mul_pos hc hB),lt_div_iffβ (mul_pos hc hB)]
nlinarith
apply Finset.sum_eq_zero
intro h _
rw [fourierInv_signalJoint hΞ± Ξ³ hd hcomp hr]
have hbase : πβ» (fun y => (signalBaseline Ξ± y : β)) (v/(c*B)) = 0 := by
rw [Real.fourierInv_eq_fourier_neg]
exact signalBaseline_fourier_support hΞ± (by simpa only [abs_neg] using hΞ±D.trans hdiv.le)
have hd0 : d (v/(c*B)) = 0 := by
apply Function.notMem_support.mp
intro hn
have hh := hs hn
exact (not_le_of_gt hdiv) (abs_le.mpr β¨hh.1,hh.2β©)
rw [hbase,hd0,mul_zero,add_zero,mul_zero,mul_zero]
lemma signalJitter_scale_cancel {Ξ± Ξ³ : β} (d : β β β) (P : β) [NeZero P]
(B : β) {c : β} (hc : 0 < c) (m y : β) :
scaledDensity (signalJitter Ξ± Ξ³ d P B c) (m*c) y =
scaledDensity (signalJitter Ξ± Ξ³ d P B 1) m y := by
simp only [scaledDensity,signalJitter,abs_mul,abs_of_pos hc,mul_inv_rev,one_mul]
by_cases hm : m = 0
Β· simp [hm]
have he : c*(y/(m*c)) = y/m := by field_simp
rw [he]
field_simp
lemma signalJitter_periodic_ideal {Ξ± B c b D : β}
(hΞ± : 0 < Ξ±) (hΞ±b : Ξ± < b) (hB : 0 < B) (hc : 0 < c) (hb : 0 < b)
{L : β} (hL : D/b < L) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hcomp : HasCompactSupport d)
(hr : β v, d (-v) = starRingEnd β (d v)) (h0 : d 0 = 0)
(hs : Function.support d β Icc (-D) D) (m : β€) (hm : b β€ |(m:β)/B|)
(hbound : β h R, signalBaseline Ξ± R/(2*signalPrimeProduct L) β€
signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R β§
signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R β€
3*signalBaseline Ξ± R/(2*signalPrimeProduct L)) (y : β) :
β' k : β€, (scaledDensity (signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B c)
((m:β)*c) (y+k) : β) =
1 + 2*((((if IsUnit (m : ZMod (signalPrimeProduct L)) then (Ξ³:β)*d ((m:β)/B) else 0) *
fourier (-1) (y : UnitAddCircle)).re) : β) := by
have hm0 : (m:β) β 0 := by intro hh; rw [hh,zero_div,abs_zero] at hm; linarith
have hmc : (m:β)*c β 0 := mul_ne_zero hm0 hc.ne'
obtain β¨a,A,_ha,hA,hbndβ© := signalJitter_quadratic_tails hΞ± hB hc
(signalPrimeProduct L) hbound
have hqb : β y, |signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B c y| β€ A/(1+y^2) := by
intro y
rw [abs_of_pos (signalJitter_pos hΞ± hB hc _ hbound y)]
exact (hbnd y).2
obtain β¨C,hC,hCbβ© := scaledDensity_quadratic_bound hA.le hmc hqb
have hcq : Continuous (scaledDensity (signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B c)
((m:β)*c)) := continuous_const.mul
((signalJitter_smooth hΞ± Ξ³ hd hcomp _ B c).continuous.comp (continuous_id.div_const _))
apply periodization_three_modes hcq hC hCb
apply fourierInv_real_int_moments
Β· rw [integral_scaledDensity hmc,integral_signalJitter hΞ± hB hc Ξ³ hd hcomp hr h0]
Β· intro β hβ
erw [fourierInv_scaledDensity hmc]
have he : (β:β)*((m:β)*c) = (β:β)*(m:β)*c := by ring
rw [he,signalJitter_sieved_moments hΞ± hΞ±b hB hc hb hL Ξ³ hd hcomp hr hs m hm β hβ]
split_ifs <;> simp_all
end ThreeTorus
namespace ThreeTorus
/-- The finite-c approximation is uniform on every fixed old speed range.
The exact ideal law is independent of c after scaling, as required in section 3. -/
lemma periodization_scaled_uniform_perturbation {q : β β β} (hq : Continuous q)
(hqi : Integrable q) {C : β} (hC : 0 β€ C) (hbnd : β y, |q y| β€ C/(1+y^2))
{D : β} (hF : β v, D < |v| β π (fun y => (q y : β)) v = 0)
{sβ : β} (hsβ : sβ β 0) (V : β) :
β Ξ΅ > 0, βαΆ c : β in atTop, β v : β, |v| β€ V β β y : β,
dist (β' n : β€, (scaledDensity q (sβ*(1+v/c)) (y+n) : β))
(β' n : β€, (scaledDensity q sβ (y+n) : β)) < Ξ΅ := by
intro Ξ΅ hΞ΅
obtain β¨Ξ΄,hΞ΄,hdβ© := Metric.eventually_nhds_iff.mp
(Metric.tendstoUniformly_iff.mp
(periodization_scaled_tendstoUniformly hq hqi hC hbnd hF hsβ) Ξ΅ hΞ΅)
filter_upwards [eventually_gt_atTop (|sβ| * |V|/Ξ΄+1)] with c hc
intro v hv y
have hc0 : 0 < c := lt_trans (by positivity) hc
have hv' : |v| β€ |V| := hv.trans (le_abs_self V)
have hnear : dist (sβ*(1+v/c)) sβ < Ξ΄ := by
rw [Real.dist_eq,show sβ*(1+v/c)-sβ = sβ*v/c by ring,
abs_div,abs_mul,abs_of_pos hc0]
apply (div_lt_iffβ hc0).mpr
have hh : |sβ| * |V| < Ξ΄*c := by
have h := (div_lt_iffβ hΞ΄).mp (lt_trans (lt_add_one _) hc)
nlinarith
exact lt_of_le_of_lt (mul_le_mul_of_nonneg_left hv' (abs_nonneg _)) hh
simpa only [dist_comm] using hd hnear y
end ThreeTorus
namespace ThreeTorus
/-- The actual finite-c signal law, uniform in the bounded old speed and in
all phases. The modulus and strength are the exact fixed ones of the manuscript. -/
lemma signalJitter_periodic_approximation {Ξ± B b D : β}
(hΞ± : 0 < Ξ±) (hΞ±b : Ξ± < b) (hΞ±D : Ξ± β€ D) (hB : 0 < B) (hb : 0 < b)
{L : β} (hL : D/b < L) (Ξ³ : β) {d : β β β}
(hd : ContDiff β ((β€ : ββ) : WithTop ββ) d) (hcomp : HasCompactSupport d)
(hr : β v, d (-v) = starRingEnd β (d v)) (h0 : d 0 = 0)
(hs : Function.support d β Icc (-D) D) (m : β€) (hm : b β€ |(m:β)/B|)
(hbound : β h R, signalBaseline Ξ± R/(2*signalPrimeProduct L) β€
signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R β§
signalJoint Ξ± Ξ³ d (signalPrimeProduct L) h R β€
3*signalBaseline Ξ± R/(2*signalPrimeProduct L)) (V : β) :
β Ξ΅ > 0, βαΆ c : β in atTop, β v : β, |v| β€ V β β y : β,
dist (β' k : β€, (scaledDensity (signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B c)
((m:β)*(c+v)) (y+k) : β))
(1 + 2*((((if IsUnit (m : ZMod (signalPrimeProduct L)) then (Ξ³:β)*d ((m:β)/B) else 0) *
fourier (-1) (y : UnitAddCircle)).re) : β)) < Ξ΅ := by
have hm0 : (m:β) β 0 := by intro hh; rw [hh,zero_div,abs_zero] at hm; linarith
obtain β¨a,A,_ha,hA,hbndβ© := signalJitter_quadratic_tails hΞ± hB zero_lt_one
(signalPrimeProduct L) hbound
have hqb : β y, |signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B 1 y| β€ A/(1+y^2) := by
intro y
rw [abs_of_pos (signalJitter_pos hΞ± hB zero_lt_one _ hbound y)]
exact (hbnd y).2
have hF : β v, B*D < |v| β
π (fun y => (signalJitter Ξ± Ξ³ d (signalPrimeProduct L) B 1 y : β)) v = 0 := by
intro v hv
have hh := signalJitter_fourierInv_support hΞ± hB zero_lt_one hΞ±D Ξ³ hd hcomp hr hs
(signalPrimeProduct L) (v := -v) (by simpa only [one_mul,abs_neg] using hv)
simpa only [Real.fourierInv_eq_fourier_neg,neg_neg] using hh
intro Ξ΅ hΞ΅
have he := periodization_scaled_uniform_perturbation
(signalJitter_smooth hΞ± Ξ³ hd hcomp _ B 1).continuous
(signalJitter_integrable hΞ± hB zero_lt_one Ξ³ hd hcomp _)
hA.le hqb hF hm0 V Ξ΅ hΞ΅
filter_upwards [he,eventually_gt_atTop (0:β)] with c hc hc0
intro v hv y
have hscale : (m:β)*(c+v) = ((m:β)*(1+v/c))*c := by field_simp
simp_rw [hscale,signalJitter_scale_cancel d (signalPrimeProduct L) B hc0]
have hideal := signalJitter_periodic_ideal hΞ± hΞ±b hB zero_lt_one hb hL Ξ³ hd hcomp hr h0 hs
m hm hbound y
simp only [mul_one] at hideal
rw [β hideal]
exact hc v hv y
end ThreeTorus
end
end
end
end
end
end OAI
import Mathlib
namespace OAI
/-! Positive Fourier laws, compact integral differentiation, affine densities, and prime-sieve signal laws. -/
noncomputable section
open MeasureTheory Filter Set Complex
open scoped Topology SchwartzMap FourierTransform Real
open scoped Topology
open MeasureTheory Set
open scoped ENNReal Topology
open Set Function Filter
open scoped Topology NNReal
open MeasureTheory Filter Set
open MeasureTheory Set Function
open scoped Topology ENNReal
open scoped Topology BigOperators
noncomputable section
open MeasureTheory Set Filter
open scoped Topology
namespace ThreeTorus
/-- Compact-parameter differentiation, used by the exact passage near epsilon=0. -/
lemma hasFDerivAt_compact_integral
{E : Type} {G : Type*} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
[NormedAddCommGroup G] [NormedSpace β G] [CompleteSpace G]
{F : E Γ β β G} (hF : ContDiff β 1 F) (a b : β) (x : E) :
HasFDerivAt (fun y => β« t in a..b, F (y,t))
(β« t in a..b, (fderiv β F (x,t)).comp (ContinuousLinearMap.inl β E β)) x := by
let D : E Γ β β E βL[β] G := fun p =>
(fderiv β F p).comp (ContinuousLinearMap.inl β E β)
have hD : Continuous D := hF.continuous_fderiv (by norm_num) |>.clm_comp continuous_const
obtain β¨C,hCβ© := ((isCompact_closedBall x 1).prod (isCompact_uIcc (a := a) (b := b))).exists_bound_of_continuousOn hD.continuousOn
refine hasFDerivAt_integral_of_dominated_of_fderiv_le''
(F := fun y t => F (y,t)) (F' := fun y t => D (y,t))
(bound := fun _ => C) (Metric.closedBall_mem_nhds x (by norm_num : (0:β)<1)) ?_ ?_ ?_ ?_
intervalIntegrable_const ?_
Β· exact Eventually.of_forall (fun y => (hF.continuous.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable)
Β· exact (hF.continuous.comp (continuous_const.prodMk continuous_id)).intervalIntegrable _ _
Β· exact (hD.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable
Β· filter_upwards [ae_restrict_mem measurableSet_uIoc] with t ht
intro y hy
exact hC (y,t) β¨hy,uIoc_subset_uIcc htβ©
Β· exact Eventually.of_forall (fun t y _ => by
simpa [D,Function.comp_def] using ((hF.differentiable one_ne_zero ((ContinuousLinearMap.inl β E β) y+(0,t))).hasFDerivAt).comp y
((ContinuousLinearMap.inl β E β).hasFDerivAt.add_const (0,t)))
/-- Smooth parameter integration over a fixed compact interval. -/
lemma contDiff_compact_integral
{E : Type} {G : Type*} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
[NormedAddCommGroup G] [NormedSpace β G] [CompleteSpace G]
(n : β) {F : E Γ β β G} (hF : ContDiff β n F) (a b : β) :
ContDiff β n (fun y => β« t in a..b, F (y,t)) := by
induction n generalizing G with
| zero =>
apply contDiff_zero.mpr
exact intervalIntegral.continuous_parametric_intervalIntegral_of_continuous'
(show Continuous (Function.uncurry (fun y t => F (y,t))) from hF.continuous) a b
| succ n ih =>
let D : E Γ β β E βL[β] G := fun p =>
(fderiv β F p).comp (ContinuousLinearMap.inl β E β)
have hD : ContDiff β n D := (hF.fderiv_right (by simp)).clm_comp contDiff_const
have hder (x : E) := hasFDerivAt_compact_integral (hF.of_le (by exact_mod_cast Nat.succ_pos n)) a b x
rw [show ((n+1 : β) : WithTop ββ) = (n : WithTop ββ)+1 by simp, contDiff_succ_iff_fderiv]
refine β¨fun x => (hder x).differentiableAt, ?_, ?_β©
Β· simp
Β· have heq : fderiv β (fun y => β« t in a..b, F (y,t)) =
fun y => β« t in a..b, D (y,t) := by
funext y
exact (hder y).fderiv
rw [heq]
exact ih hD
lemma smooth_compact_integral
{E : Type} {G : Type*} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E]
[NormedAddCommGroup G] [NormedSpace β G] [CompleteSpace G]
{F : E Γ β β G} (hF : ContDiff β ((β€ : ββ) : WithTop ββ) F) (a b : β) :
ContDiff β ((β€ : ββ) : WithTop ββ) (fun y => β« t in a..b, F (y,t)) := by
rw [contDiff_infty]
intro n
exact contDiff_compact_integral n (hF.of_le (by exact_mod_cast (le_top : (n : ββ) β€ β€))) a b
/-! The positive Fourier law. The sinc and averaged
baseline below are exactly those of the manuscript, including the scale and
normalization. -/
open scoped FourierTransform Convolution
lemma sinc_eq_integral_cos (x : β) :
Real.sinc x = β« t in (0 : β)..1, Real.cos (x*t) := by
by_cases hx : x = 0
Β· simp [hx]
Β· rw [intervalIntegral.integral_comp_mul_left _ hx,integral_cos]
simp only [mul_zero,mul_one,Real.sin_zero,sub_zero,smul_eq_mul]
rw [Real.sinc_of_ne_zero hx]
ring
lemma smooth_sinc : ContDiff β ((β€ : ββ) : WithTop ββ) Real.sinc := by
rw [show Real.sinc = (fun x => β« t in (0 : β)..1, Real.cos (x*t)) from