Documentation

CslibFrontier.Foundations.Analysis.Fourier.ZModProd

The discrete Fourier transform on ZMod N × ZMod N #

The Fourier transform of f : ZMod N × ZMod N → ℂ at the frequency ξ is ∑ v, e (-(ξ.1 * v.1 + ξ.2 * v.2)) * f v, where e = ZMod.stdAddChar sends j to exp (2 π i j / N). This is Mathlib's ZMod.dft in each coordinate, written for the two coordinates together. The characters v ↦ e (ξ.1 * v.1 + ξ.2 * v.2) are orthogonal, so the transform preserves the ℓ² norm up to the factor N ^ 2 (Parseval's identity).

Translations and shears of the plane act on the transform by simple rules: a translation by t multiplies the transform at ξ by e (ξ.1 * t.1 + ξ.2 * t.2), and the shear (x, y) ↦ (x + k * y, y) acts on the frequencies by the transposed inverse shear (a, b) ↦ (a, b - k * a), and symmetrically for (x, y) ↦ (x, y + k * x).

Main definitions #

Main results #

noncomputable def ZMod.dftProd {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) (ξ : ZMod N × ZMod N) :

The discrete Fourier transform of f : ZMod N × ZMod N → ℂ at the frequency ξ: ∑ v, e (-(ξ.1 * v.1 + ξ.2 * v.2)) * f v with e = ZMod.stdAddChar.

@[simp]
theorem ZMod.dftProd_zero {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) :
dftProd f 0 = ∑ v : ZMod N × ZMod N, f v

The transform at the zero frequency is the sum of the values.

theorem ZMod.dftProd_sub {N : ℕ} [NeZero N] (f g : ZMod N × ZMod N → ℂ) :

The transform is additive.

theorem ZMod.sum_norm_sq_dftProd {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) :
∑ ξ : ZMod N × ZMod N, ‖dftProd f ξ‖ ^ 2 = ↑N ^ 2 * ∑ v : ZMod N × ZMod N, ‖f v‖ ^ 2

Parseval's identity on ZMod N × ZMod N.

theorem ZMod.dftProd_comp_add {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) (t ξ : ZMod N × ZMod N) :
dftProd (fun (v : ZMod N × ZMod N) => f (v + t)) ξ = stdAddChar (ξ.1 * t.1 + ξ.2 * t.2) * dftProd f ξ

Translation multiplies the transform at ξ by e (ξ.1 * t.1 + ξ.2 * t.2).

theorem ZMod.dftProd_comp_shearFst {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) (k : ZMod N) (ξ : ZMod N × ZMod N) :
dftProd (fun (v : ZMod N × ZMod N) => f (v.1 + k * v.2, v.2)) ξ = dftProd f (ξ.1, ξ.2 - k * ξ.1)

The shear (x, y) ↦ (x + k * y, y) acts on frequencies by (a, b) ↦ (a, b - k * a).

theorem ZMod.dftProd_comp_shearSnd {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) (k : ZMod N) (ξ : ZMod N × ZMod N) :
dftProd (fun (v : ZMod N × ZMod N) => f (v.1, v.2 + k * v.1)) ξ = dftProd f (ξ.1 - k * ξ.2, ξ.2)

The shear (x, y) ↦ (x, y + k * x) acts on frequencies by (a, b) ↦ (a - k * b, b).

theorem ZMod.dftProd_add {N : ℕ} [NeZero N] (f g : ZMod N × ZMod N → ℂ) :

The transform is additive.

theorem ZMod.dftProd_smul {N : ℕ} [NeZero N] (c : ℂ) (f : ZMod N × ZMod N → ℂ) :
dftProd (c • f) = c • dftProd f

The transform is homogeneous.

The transform is injective, by Parseval's identity.

The transform is surjective: an injective linear endomorphism of a finite-dimensional space.

theorem ZMod.dftProd_const_of_ne_zero {N : ℕ} [NeZero N] (c : ℂ) {ξ : ZMod N × ZMod N} (hξ : ξ ≠ 0) :
dftProd (fun (x : ZMod N × ZMod N) => c) ξ = 0

A constant has no nonzero frequencies: Parseval's identity puts all of its mass at 0.

theorem ZMod.sum_norm_sq_dftProd_translate {N : ℕ} [NeZero N] (f : ZMod N × ZMod N → ℂ) (t : ZMod N × ZMod N) :
∑ ξ : ZMod N × ZMod N, ‖stdAddChar (ξ.1 * t.1 + ξ.2 * t.2) - 1‖ ^ 2 * ‖dftProd f ξ‖ ^ 2 = ↑N ^ 2 * ∑ v : ZMod N × ZMod N, ‖f (v + t) - f v‖ ^ 2

Parseval's identity for the change along a translation: the transform of the change of f along the translation by t is the transform of f times e (ξ.1 * t.1 + ξ.2 * t.2) - 1.

theorem ZMod.sum_norm_sq_dftProd_shearFst_sub {N : ℕ} [NeZero N] (f g : ZMod N × ZMod N → ℂ) (k : ZMod N) :
∑ ξ : ZMod N × ZMod N, ‖dftProd f ((Cslib.shearSnd (-k)) ξ) - dftProd g ξ‖ ^ 2 = ↑N ^ 2 * ∑ v : ZMod N × ZMod N, ‖f ((Cslib.shearFst k) v) - g v‖ ^ 2

Parseval's identity for the difference of two functions along the shear (x, y) ↦ (x + k * y, y): it acts on the frequencies by the dual shear (a, b) ↦ (a, b - k * a).

theorem ZMod.sum_norm_sq_dftProd_shearSnd_sub {N : ℕ} [NeZero N] (f g : ZMod N × ZMod N → ℂ) (k : ZMod N) :
∑ ξ : ZMod N × ZMod N, ‖dftProd f ((Cslib.shearFst (-k)) ξ) - dftProd g ξ‖ ^ 2 = ↑N ^ 2 * ∑ v : ZMod N × ZMod N, ‖f ((Cslib.shearSnd k) v) - g v‖ ^ 2

Parseval's identity for the difference of two functions along the shear (x, y) ↦ (x, y + k * x): it acts on the frequencies by the dual shear (a, b) ↦ (a - k * b, b).