math / data /lean /OAI /Analysis /Fourier /WavePackets /KernelIdentity.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
9.13 kB
import OAI.Analysis.Fourier.WavePackets.Poisson
namespace OAI.Analysis.Fourier.WavePackets
open _root_.MeasureTheory
open scoped ContDiff RealInnerProductSpace FourierTransform
noncomputable def waveAmplitude {n : β„•} (Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚)
(h T : ℝ) (ΞΎ : EuclideanSpace ℝ (Fin n)) : β„‚ :=
Complex.exp (-Complex.I * (((T / h) * β€–ΞΎβ€– : ℝ) : β„‚)) * Ο† ΞΎ
theorem hasCompactSupport_waveAmplitude {n : β„•} {Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚}
(hs : HasCompactSupport Ο†) (h T : ℝ) : HasCompactSupport (waveAmplitude Ο† h T) :=
hs.mul_left
theorem contDiff_waveAmplitude {n : β„•} {Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚}
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
(h T : ℝ) : ContDiff ℝ ∞ (waveAmplitude Ο† h T) := by
rw [contDiff_iff_contDiffAt]
intro ΞΎ
by_cases hΞΎ : ΞΎ = 0
Β· subst ΞΎ
have hz : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport (waveAmplitude Ο† h T) := by
exact fun hz => hzero (tsupport_mul_subset_right hz)
exact contDiffAt_const.congr_of_eventuallyEq (notMem_tsupport_iff_eventuallyEq.mp hz)
Β· have hc := Complex.ofRealCLM.contDiff.contDiffAt.comp ΞΎ
((contDiffAt_const : ContDiffAt ℝ ∞ (fun _ : EuclideanSpace ℝ (Fin n) => T / h) ΞΎ).mul
(contDiffAt_norm ℝ hΞΎ))
exact (((contDiffAt_const.mul hc).cexp).mul hφ.contDiffAt)
/-- The Schwartz symbol expressed in the unit-torus dual coordinate. -/
noncomputable def periodicSchwartzSymbol {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) : SchwartzMap (EuclideanSpace ℝ (Fin n)) β„‚ :=
((hasCompactSupport_waveAmplitude hs h T).comp_smul
(show h * (2 * Real.pi / 100) β‰  0 by positivity)).toSchwartzMap
((contDiff_waveAmplitude hφ hzero h T).comp (by fun_prop))
theorem periodicSchwartzSymbol_apply {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) (ΞΎ : EuclideanSpace ℝ (Fin n)) :
periodicSchwartzSymbol hs hφ hzero hh T ξ =
waveAmplitude Ο† h T ((h * (2 * Real.pi / 100)) β€’ ΞΎ) := rfl
theorem periodicSchwartzSymbol_integer {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) (k : Fin n β†’ β„€) :
periodicSchwartzSymbol hs hφ hzero hh T (integerVector k) = periodicSymbol φ h T k := by
rw [periodicSchwartzSymbol_apply]
unfold waveAmplitude periodicSymbol periodicFrequency
rw [← smul_smul]
congr 2
rw [norm_smul, Real.norm_eq_abs, abs_of_pos hh]
field_simp
/-- The exact Poisson identity for the cutoff wave symbol, with the physical
side-100 kernel normalization. -/
theorem periodicKernel_eq_inverseSymbol_sum {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) (x : EuclideanSpace ℝ (Fin n)) :
periodicKernel Ο† h T (torusProjection x) =
βˆ‘' k : Fin n β†’ β„€, ((100 : β„‚) ^ n)⁻¹ *
(𝓕⁻ (periodicSchwartzSymbol hs hΟ† hzero hh T)) (integerVector k + x) := by
rw [tsum_mul_left, periodicKernel]
congr 1
rw [schwartz_poisson, FourierTransform.fourier_fourierInv_eq]
apply tsum_congr
intro k
rw [periodicSchwartzSymbol_integer]
theorem waveFourier_integrand_identity {n : β„•}
(Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚) {h : ℝ} (hh : h β‰  0) (T : ℝ)
(X ΞΎ : EuclideanSpace ℝ (Fin n)) :
Complex.exp (((2 * Real.pi * βŸͺΞΎ, (1 / 100 : ℝ) β€’ X⟫ : ℝ) : β„‚) * Complex.I) *
waveAmplitude Ο† h T ((h * (2 * Real.pi / 100)) β€’ ΞΎ) =
oscillation (euclideanWavePhase X T) h ((h * (2 * Real.pi / 100)) β€’ ΞΎ) *
Ο† ((h * (2 * Real.pi / 100)) β€’ ΞΎ) := by
unfold waveAmplitude oscillation euclideanWavePhase
rw [← mul_assoc, ← Complex.exp_add]
congr 2
simp only [inner_smul_right, real_inner_comm ΞΎ X]
push_cast
have hh' : (h : β„‚) β‰  0 := by exact_mod_cast hh
field_simp [hh']
ring
/-- Conversion from the unit-torus Fourier inversion convention to the
semiclassical angular-frequency kernel, including its `(2Ο€)⁻ⁿ` factor. -/
theorem inverseSymbol_eq_semiclassicalKernel {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) (X : EuclideanSpace ℝ (Fin n)) :
((100 : β„‚) ^ n)⁻¹ * (𝓕⁻ (periodicSchwartzSymbol hs hΟ† hzero hh T))
((1 / 100 : ℝ) β€’ X) =
(((2 * Real.pi : ℝ) : β„‚) ^ n)⁻¹ * semiclassicalWaveKernel volume Ο† h T X := by
rw [SchwartzMap.fourierInv_coe, Real.fourierInv_eq']
simp only [smul_eq_mul, periodicSchwartzSymbol_apply]
simp_rw [waveFourier_integrand_identity Ο† hh.ne' T X]
rw [Measure.integral_comp_smul_of_nonneg volume
(fun ΞΎ => oscillation (euclideanWavePhase X T) h ΞΎ * Ο† ΞΎ)
(h * (2 * Real.pi / 100)) (hR := by positivity)]
simp only [semiclassicalWaveKernel, finrank_euclideanSpace, Fintype.card_fin,
Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_pow, Complex.ofReal_mul,
Complex.ofReal_div, Complex.ofReal_ofNat]
have hh' : (h : β„‚) β‰  0 := by exact_mod_cast hh.ne'
have hpi : (Real.pi : β„‚) β‰  0 := by exact_mod_cast Real.pi_ne_zero
field_simp [hh', hpi]
have hfactor : (1 / 50 : β„‚) ^ n * (100 : β„‚) ^ n = (2 : β„‚) ^ n := by
rw [← mul_pow]
norm_num
linear_combination -(∫ ΞΎ, oscillation (euclideanWavePhase X T) h ΞΎ * Ο† ΞΎ) *
(Real.pi : β„‚) ^ n * (h : β„‚) ^ n * hfactor
/-- The Fourier-series kernel on the side-100 torus is exactly the lattice
periodization of the Euclidean semiclassical kernel. -/
theorem periodicKernel_eq_lattice_sum {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) (X : EuclideanSpace ℝ (Fin n)) :
periodicKernel Ο† h T (torusProjection ((1 / 100 : ℝ) β€’ X)) =
βˆ‘' k : Fin n β†’ β„€, (((2 * Real.pi : ℝ) : β„‚) ^ n)⁻¹ *
semiclassicalWaveKernel volume Ο† h T (X + (100 : ℝ) β€’ integerVector k) := by
rw [periodicKernel_eq_inverseSymbol_sum hs hφ hzero hh]
apply tsum_congr
intro k
have hx : integerVector k + (1 / 100 : ℝ) β€’ X =
(1 / 100 : ℝ) β€’ (X + (100 : ℝ) β€’ integerVector k) := by module
rw [hx, inverseSymbol_eq_semiclassicalKernel hs hφ hzero hh]
theorem periodicKernel_eq_kernel_add_remainder {n : β„•}
{Ο† : EuclideanSpace ℝ (Fin n) β†’ β„‚} (hs : HasCompactSupport Ο†)
(hΟ† : ContDiff ℝ ∞ Ο†) (hzero : (0 : EuclideanSpace ℝ (Fin n)) βˆ‰ tsupport Ο†)
{h : ℝ} (hh : 0 < h) (T : ℝ) (X : EuclideanSpace ℝ (Fin n)) :
periodicKernel Ο† h T (torusProjection ((1 / 100 : ℝ) β€’ X)) =
(((2 * Real.pi : ℝ) : β„‚) ^ n)⁻¹ *
(semiclassicalWaveKernel volume Ο† h T X + periodizationRemainder volume Ο† h T X) := by
classical
have hx (k : Fin n β†’ β„€) : integerVector k + (1 / 100 : ℝ) β€’ X =
(1 / 100 : ℝ) β€’ (X + (100 : ℝ) β€’ integerVector k) := by module
have hsum : Summable (fun k : Fin n β†’ β„€ => (((2 * Real.pi : ℝ) : β„‚) ^ n)⁻¹ *
semiclassicalWaveKernel volume Ο† h T (X + (100 : ℝ) β€’ integerVector k)) := by
apply ((summable_norm_schwartz_lattice_add
(𝓕⁻ (periodicSchwartzSymbol hs hΟ† hzero hh T)) ((1 / 100 : ℝ) β€’ X)).of_norm.mul_left
(((100 : β„‚) ^ n)⁻¹)).congr
intro k
rw [hx, inverseSymbol_eq_semiclassicalKernel hs hφ hzero hh]
have hzeroEq : integerLatticeEquiv n 0 = 0 := by
apply Subtype.ext
ext i
simp [integerLatticeEquiv, integerVector]
have hz (k : Fin n β†’ β„€) : integerLatticeEquiv n k = 0 ↔ k = 0 := by
rw [← hzeroEq]
exact (integerLatticeEquiv n).injective.eq_iff
have htail : (βˆ‘' k : Fin n β†’ β„€,
if k = 0 then 0 else semiclassicalWaveKernel volume Ο† h T (X + (100 : ℝ) β€’ integerVector k)) =
periodizationRemainder volume Ο† h T X := by
have he := (integerLatticeEquiv n).tsum_eq (periodizationRemainderTerm volume Ο† h T X)
unfold periodizationRemainder
convert he using 1
congr 1
funext k
simp only [periodizationRemainderTerm, hz]
rfl
rw [periodicKernel_eq_lattice_sum hs hφ hzero hh, hsum.tsum_eq_add_tsum_ite 0]
have hvec : integerVector (0 : Fin n β†’ β„€) = 0 := by ext i; simp [integerVector]
simp only [hvec, smul_zero, add_zero]
rw [mul_add]
congr 1
rw [← htail, ← tsum_mul_left]
apply tsum_congr
intro k
split_ifs <;> simp
end OAI.Analysis.Fourier.WavePackets