Buckets:
| import Mathlib.Analysis.Fourier.ZMod | |
| import Mathlib.Analysis.Complex.Basic | |
| import Mathlib.Tactic | |
| namespace OAI | |
| /-! | |
| # Probability-normalized additive Fourier identities | |
| These finite identities provide the normalization used in Section 6. | |
| Fourier inversion is the library's discrete Fourier inversion theorem. | |
| -/ | |
| namespace Ostmann | |
| open scoped BigOperators ComplexConjugate | |
| theorem stdAddChar_conj {p : ℕ} [NeZero p] (x : ZMod p) : | |
| conj (ZMod.stdAddChar x) = ZMod.stdAddChar (-x) := by | |
| have hn : ‖ZMod.stdAddChar x‖ = 1 := by simp [ZMod.stdAddChar_apply] | |
| rw [← Complex.inv_eq_conj hn, AddChar.map_neg_eq_inv] | |
| /-- The additive Fourier transform with probability normalization. -/ | |
| noncomputable def additiveFourier {p : ℕ} [NeZero p] | |
| (f : ZMod p → ℂ) (a : ZMod p) : ℂ := | |
| (p : ℂ)⁻¹ * ZMod.dft f a | |
| theorem additiveFourier_apply {p : ℕ} [NeZero p] (f : ZMod p → ℂ) (a : ZMod p) : | |
| additiveFourier f a = (p : ℂ)⁻¹ * | |
| ∑ x : ZMod p, f x * ZMod.stdAddChar (-(x * a)) := by | |
| simp only [additiveFourier, ZMod.dft_apply, smul_eq_mul, mul_comm] | |
| theorem additiveFourier_inversion {p : ℕ} [NeZero p] | |
| (f : ZMod p → ℂ) (x : ZMod p) : | |
| f x = ∑ a : ZMod p, additiveFourier f a * ZMod.stdAddChar (a * x) := by | |
| have hinv := congrFun (ZMod.dft.symm_apply_apply f) x | |
| rw [ZMod.invDFT_apply] at hinv | |
| calc | |
| f x = (p : ℂ)⁻¹ * ∑ a : ZMod p, ZMod.stdAddChar (a * x) * ZMod.dft f a := by | |
| simpa only [smul_eq_mul] using hinv.symm | |
| _ = _ := by | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| simp only [additiveFourier] | |
| ring | |
| theorem additiveFourier_conjugate_coefficient {p : ℕ} [NeZero p] | |
| (f : ZMod p → ℂ) (a : ZMod p) : | |
| (∑ x : ZMod p, ZMod.stdAddChar (x * a) * conj (f x)) = | |
| (p : ℂ) * conj (additiveFourier f a) := by | |
| have hp : (p : ℂ) ≠ 0 := by exact_mod_cast NeZero.ne p | |
| rw [additiveFourier_apply] | |
| simp only [map_mul, map_inv₀, map_natCast, map_sum, stdAddChar_conj, neg_neg] | |
| rw [← mul_assoc, mul_inv_cancel₀ hp, one_mul] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| ring | |
| theorem additiveFourier_energy {p : ℕ} [NeZero p] (f : ZMod p → ℂ) : | |
| (∑ x : ZMod p, ‖f x‖ ^ 2) = | |
| (p : ℝ) * ∑ a : ZMod p, ‖additiveFourier f a‖ ^ 2 := by | |
| have heq : (∑ x : ZMod p, f x * conj (f x)) = | |
| (p : ℂ) * ∑ a : ZMod p, additiveFourier f a * conj (additiveFourier f a) := by | |
| calc | |
| _ = ∑ x : ZMod p, ∑ a : ZMod p, | |
| additiveFourier f a * ZMod.stdAddChar (a * x) * conj (f x) := by | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| rw [← Finset.sum_mul, ← additiveFourier_inversion] | |
| _ = ∑ a : ZMod p, additiveFourier f a * | |
| ∑ x : ZMod p, ZMod.stdAddChar (x * a) * conj (f x) := by | |
| rw [Finset.sum_comm] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| rw [mul_comm x a] | |
| ring | |
| _ = _ := by | |
| simp_rw [additiveFourier_conjugate_coefficient] | |
| rw [Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro a _ | |
| ring | |
| simp_rw [Complex.mul_conj', ← Complex.ofReal_pow, ← Complex.ofReal_sum] at heq | |
| exact_mod_cast heq | |
| /-- Additive Parseval with the manuscript's probability convention. -/ | |
| theorem additiveFourier_parseval {p : ℕ} [NeZero p] (f : ZMod p → ℂ) : | |
| (∑ a : ZMod p, ‖additiveFourier f a‖ ^ 2) = | |
| (p : ℝ)⁻¹ * ∑ x : ZMod p, ‖f x‖ ^ 2 := by | |
| rw [additiveFourier_energy f] | |
| have hp : (p : ℝ) ≠ 0 := by exact_mod_cast NeZero.ne p | |
| rw [← mul_assoc, inv_mul_cancel₀ hp, one_mul] | |
| theorem additiveFourier_sub {p : ℕ} [NeZero p] | |
| (f g : ZMod p → ℂ) (a : ZMod p) : | |
| additiveFourier (fun x => f x - g x) a = additiveFourier f a - additiveFourier g a := by | |
| simp only [additiveFourier_apply, sub_mul, Finset.sum_sub_distrib, mul_sub] | |
| theorem additiveFourier_const {p : ℕ} [NeZero p] (c : ℂ) (a : ZMod p) : | |
| additiveFourier (fun _ : ZMod p => c) a = if a = 0 then c else 0 := by | |
| classical | |
| have hp : (p : ℂ) ≠ 0 := by exact_mod_cast NeZero.ne p | |
| rw [additiveFourier_apply] | |
| simp only [← mul_neg, ← Finset.mul_sum] | |
| rw [AddChar.sum_mulShift (-a) (ZMod.isPrimitive_stdAddChar p)] | |
| simp only [ZMod.card, neg_eq_zero] | |
| by_cases ha : a = 0 | |
| · simp only [ha, ite_true] | |
| field_simp | |
| · simp only [ha, ite_false, Nat.cast_zero, mul_zero] | |
| end Ostmann | |
| end OAI | |
Xet Storage Details
- Size:
- 4.5 kB
- Xet hash:
- b98e965a89bfdd0fb86931dea1d8b6fdaef692edb6a137005dcfa11e741c2a6e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.