Mode of #cas
fourierTransform
The Fourier transform of a Gaussian in Mathlib’s convention, with a theorem for every frequency.
#cas [fourierTransform x ξ] ffourierTransform computes the transform of a Gaussian . It covers those and nothing else. Conventions for the Fourier transform differ by factors of from one book to the next, and the first thing to know is which one you are getting. Here it is Mathlib’s, , the one Mathematica uses with FourierParameters -> {0, -2 Pi}. The theorem is about FourierTransform.fourier of f as a complex function, for every real .
The computation is the one from a first course, completing the square, which gives , times the phase when .
Examples (14)#
Basic Examples (2)
The transform of , with the theorem for every real :
#cas [fourierTransform x ξ] (exp (-x ^ 2))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
sqrt(pi)*exp(-(pi^2*ξ^2))- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(exp (-x ^ 2))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2))) ξ = ↑(√Real.pi * Real.exp (-(Real.pi ^ 2 * ξ ^ 2)))
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2))) ξ = ↑(√Real.pi * Real.exp (-(Real.pi ^ 2 * ξ ^ 2)))
A linear term in the exponent gives a phase, and completing the square gives the factor :
#cas [fourierTransform x ξ] (3 * exp (-(x ^ 2) + 2 * x))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
3*sqrt(pi)*exp(1 - pi^2*ξ^2)*exp(-(2*pi*ξ)*i)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(3 * exp (-(x ^ 2) + 2 * x))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(3 * Real.exp (-x ^ 2 + 2 * x))) ξ = ↑(3 * √Real.pi * Real.exp (1 - Real.pi ^ 2 * ξ ^ 2)) * Complex.exp (-↑(2 * (Real.pi * ξ)) * Complex.I)
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(3 * Real.exp (-x ^ 2 + 2 * x))) ξ = ↑(3 * √Real.pi * Real.exp (1 - Real.pi ^ 2 * ξ ^ 2)) * Complex.exp (-↑(2 * (Real.pi * ξ)) * Complex.I)
Scope (2)
Rational , and , and a negative coefficient. For the root is printed sqrt(2*pi/3):
#cas [fourierTransform x ξ] (-2 * exp (-(3 / 2) * x ^ 2 - x / 3 + 1))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
-2*sqrt(2*pi/3)*exp(55/54 - 2/3*pi^2*ξ^2)*exp(2/9*pi*ξ*i)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(-2 * exp (-(3 / 2) * x ^ 2 - x / 3 + 1))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(-2 * Real.exp (-(3 / 2) * x ^ 2 - x / 3 + 1))) ξ = ↑(-2 * √(2 * Real.pi / 3) * Real.exp (55 / 54 - 2 / 3 * (Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (↑(2 / 9 * (Real.pi * ξ)) * Complex.I)
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(-2 * Real.exp (-(3 / 2) * x ^ 2 - x / 3 + 1))) ξ = ↑(-2 * √(2 * Real.pi / 3) * Real.exp (55 / 54 - 2 / 3 * (Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (↑(2 / 9 * (Real.pi * ξ)) * Complex.I)
For the root is sqrt(7*pi/5), and the coefficient -1 * comes out as a sign:
#cas [fourierTransform x ξ] (-1 * exp (-(5 / 7) * x ^ 2 + 2 * x - 1))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
-(sqrt(7*pi/5)*exp(2/5 - 7/5*pi^2*ξ^2))*exp(-(14/5*pi*ξ)*i)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(-1 * exp (-(5 / 7) * x ^ 2 + 2 * x - 1))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(-1 * Real.exp (-(5 / 7) * x ^ 2 + 2 * x - 1))) ξ = ↑(-(√(7 * Real.pi / 5) * Real.exp (2 / 5 - 7 / 5 * (Real.pi ^ 2 * ξ ^ 2)))) * Complex.exp (-↑(14 / 5 * (Real.pi * ξ)) * Complex.I)
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(-1 * Real.exp (-(5 / 7) * x ^ 2 + 2 * x - 1))) ξ = ↑(-(√(7 * Real.pi / 5) * Real.exp (2 / 5 - 7 / 5 * (Real.pi ^ 2 * ξ ^ 2)))) * Complex.exp (-↑(14 / 5 * (Real.pi * ξ)) * Complex.I)
Applications (1)
The printed theorem as a hypothesis in a proof, evaluated at . Only the three standard axioms are used:
theorem fourierTransform_at_zero (h : ∀ ξ : ℝ, FourierTransform.fourier (fun x : ℝ ↦ ((Real.exp (-x ^ 2) : ℝ) : ℂ)) ξ = ((√Real.pi * Real.exp (-(Real.pi ^ 2 * ξ ^ 2)) : ℝ) : ℂ)) : FourierTransform.fourier (fun x : ℝ ↦ ((Real.exp (-x ^ 2) : ℝ) : ℂ)) 0 = (√Real.pi : ℂ) := by rw [h 0] simp #print axioms fourierTransform_at_zero
fourierTransform_at_zero depends on the axioms propext, Classical.choice, Quot.sound.
Properties and Relations (4)
Shifting by 1 multiplies the transform by the phase . Compare the transform of under Basic Examples:
#cas [fourierTransform x ξ] (exp (-(x - 1) ^ 2))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
sqrt(pi)*exp(-(pi^2*ξ^2))*exp(-(2*pi*ξ)*i)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(exp (-(x - 1) ^ 2))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-(x - 1) ^ 2))) ξ = ↑(√Real.pi * Real.exp (-(Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (-↑(2 * (Real.pi * ξ)) * Complex.I)
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-(x - 1) ^ 2))) ξ = ↑(√Real.pi * Real.exp (-(Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (-↑(2 * (Real.pi * ξ)) * Complex.I)
Reflecting in reflects the transform. These two Gaussians are mirror images, and their phases are conjugate:
#cas [fourierTransform x ξ] (exp (-(x ^ 2) / 2 + x / 2))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
sqrt(2*pi)*exp(1/8 - 2*pi^2*ξ^2)*exp(-(pi*ξ)*i)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(exp (-(x ^ 2) / 2 + x / 2))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2 / 2 + x / 2))) ξ = ↑(√(2 * Real.pi) * Real.exp (1 / 8 - 2 * (Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (-↑(Real.pi * ξ) * Complex.I)
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2 / 2 + x / 2))) ξ = ↑(√(2 * Real.pi) * Real.exp (1 / 8 - 2 * (Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (-↑(Real.pi * ξ) * Complex.I)
#cas [fourierTransform x ξ] (exp (-(x ^ 2) / 2 - x / 2))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
sqrt(2*pi)*exp(1/8 - 2*pi^2*ξ^2)*exp(pi*ξ*i)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(exp (-(x ^ 2) / 2 - x / 2))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2 / 2 - x / 2))) ξ = ↑(√(2 * Real.pi) * Real.exp (1 / 8 - 2 * (Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (↑(Real.pi * ξ) * Complex.I)
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2 / 2 - x / 2))) ξ = ↑(√(2 * Real.pi) * Real.exp (1 / 8 - 2 * (Real.pi ^ 2 * ξ ^ 2))) * Complex.exp (↑(Real.pi * ξ) * Complex.I)
A narrower Gaussian has a wider transform. For it is , here with a minus sign:
#cas [fourierTransform x ξ] (-exp (-3 * x ^ 2))
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
-(sqrt(pi/3)*exp(-(1/3*pi^2*ξ^2)))- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(-exp (-3 * x ^ 2))
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(-Real.exp (-3 * x ^ 2))) ξ = ↑(-(√(Real.pi / 3) * Real.exp (-(1 / 3 * (Real.pi ^ 2 * ξ ^ 2)))))
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(-Real.exp (-3 * x ^ 2))) ξ = ↑(-(√(Real.pi / 3) * Real.exp (-(1 / 3 * (Real.pi ^ 2 * ξ ^ 2)))))
At the transform is the integral of over . An antiderivative of is , with erf, and as , so the integral is :
#cas [integrate x] (exp (-x ^ 2))
antiderivative (with the interval integrals)
1/2*sqrt(pi)*erf(x)- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(exp (-x ^ 2))
Checked by Lean’s kernel: Integral of the input
∀ (a b : ℝ), ∫ (x : ℝ) in a..b, Real.exp (-x ^ 2) = 1 / 2 * √Real.pi * CAS.erf b - 1 / 2 * √Real.pi * CAS.erf a
from CAS.integral_gaussian_eq
The certificate: 2 checked steps
Integral of the input
∀ (a b : ℝ), ∫ (x : ℝ) in a..b, Real.exp (-x ^ 2) = 1 / 2 * √Real.pi * CAS.erf b - 1 / 2 * √Real.pi * CAS.erf a
Derivative of the primitive
∀ (x : ℝ), HasDerivAt (fun x ↦ 1 / 2 * √Real.pi * CAS.erf x) (Real.exp (-x ^ 2)) x
Possible Issues (4)
The coefficients are rational, so π in the exponent is refused. Mathlib’s theorem fourier_gaussian_pi gives the transform of exp (-π * b * x ^ 2):
#cas [fourierTransform x ξ] (exp (-pi * x ^ 2))
Error
fourierTransform: expected c * exp (-α x ^ 2 + β x + γ) with rational c, α, β, γ and α > 0 (parameters are not supported)
The Gaussian must decay. is not integrable, and the input is refused:
#cas [fourierTransform x ξ] (exp (x ^ 2))
Error
fourierTransform: expected c * exp (-α x ^ 2 + β x + γ) with rational c, α, β, γ and α > 0 (parameters are not supported)
A product with another function is refused, here with :
#cas [fourierTransform x ξ] (exp (-x ^ 2) * cos x)
Error
fourierTransform: expected c * exp (-α x ^ 2 + β x + γ) with rational c, α, β, γ and α > 0 (parameters are not supported)
The two variables must be different:
#cas [fourierTransform x x] (exp (-x ^ 2))
Error
fourierTransform: the variables x and ξ must be different
Neat Examples (1)
The function is times the density of the standard normal distribution. Without that factor, the transform is , the characteristic function of the distribution at :
#cas [fourierTransform x ξ] (exp (-(x ^ 2) / 2) / 2)
Fourier transform 𝓕 f ξ = ∫ e ^ (-2 π i x ξ) f x dx (Mathlib)
1/2*sqrt(2*pi)*exp(-(2*pi^2*ξ^2))- Input (c e ^ (-α x ^ 2 + β x + γ), α > 0)
(exp (-(x ^ 2) / 2) / 2)
Checked by Lean’s kernel: Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2 / 2) / 2)) ξ = ↑(1 / 2 * √(2 * Real.pi) * Real.exp (-(2 * (Real.pi ^ 2 * ξ ^ 2))))
The certificate: 1 checked step
Fourier transform
∀ (ξ : ℝ), FourierTransform.fourier (fun x ↦ ↑(Real.exp (-x ^ 2 / 2) / 2)) ξ = ↑(1 / 2 * √(2 * Real.pi) * Real.exp (-(2 * (Real.pi ^ 2 * ξ ^ 2))))
