Positive-definite kernel and its Fourier transform
DefinitionPosDefKernelThis bundle establishes two notions used throughout the mission: positive-definiteness of a real kernel, and the (real-valued) Fourier transform of such a kernel.
A function is positive definite (IsPosDefKernel f) if for every , every finite family of points , and every family of complex coefficients ,
This is the classical hypothesis of Bochner's theorem, which characterizes positive-definite continuous functions as Fourier transforms of finite positive measures.
The Fourier transform of (fourierTransform f) is the real-valued function
When is continuous, Lebesgue-integrable, positive definite, and normalized (), Bochner's theorem guarantees is nonnegative and integrates to , i.e. it is a genuine probability density on — this is the density from which the mission's random rotation frequencies are sampled.
Formalization Note The real part is taken explicitly because a general integral of a complex-valued integrand is complex; for a real, even kernel the imaginary part vanishes, but that fact is not assumed here and is left for the theorems that use fourierTransform to establish.
import Mathlib
namespace ClockRoPE
/-- A real-valued kernel `f : ℝ → ℝ` is *positive definite* if, for every finite family of
points `x : Fin n → ℝ` and complex coefficients `c : Fin n → ℂ`, the Hermitian quadratic form
`∑ i, ∑ j, conj (c i) * c j * f (x i - x j)` has nonnegative real part. This is the standard
positive-definiteness hypothesis of Bochner's theorem. -/
def IsPosDefKernel (f : ℝ → ℝ) : Prop :=
∀ (n : ℕ) (x : Fin n → ℝ) (c : Fin n → ℂ),
0 ≤ (∑ i : Fin n, ∑ j : Fin n,
starRingEnd ℂ (c i) * c j * (f (x i - x j) : ℂ)).re
/-- The Fourier transform `τ(ξ) = ∫_ℝ f(x) e^{-i2πξx} dx` of a real kernel `f`, taken as a real
number via its real part. For a continuous, Lebesgue-integrable, positive-definite kernel with
`f 0 = 1`, this coincides with the (real-valued) probability density furnished by Bochner's
theorem. -/
noncomputable def fourierTransform (f : ℝ → ℝ) (ξ : ℝ) : ℝ :=
(∫ x : ℝ, Complex.exp (-(2 * Real.pi * Complex.I * ξ * x)) * (f x : ℂ)).re
end ClockRoPE
Read-back
What the Lean code literally says, in plain math · claude-sonnet-5
Positive-definiteness of a real kernel. For a function , IsPosDefKernel f asserts: for every natural number (including ), every finite family of points (indexed by ), and every finite family of complex coefficients (also indexed by ), the real part of the double sum
is nonnegative, where is treated as a complex number (its real value embedded into with zero imaginary part) before being multiplied into the sum. There is no continuity, integrability, symmetry, or normalization hypothesis on anywhere in this definition — it is purely this quadratic-form condition, required to hold for all , all point-tuples, and all coefficient-tuples simultaneously. In particular the case makes both sums empty, so the condition holds trivially for every regardless of any other property of ; the substantive content resides entirely in the cases.
Fourier transform of a real kernel. For and , fourierTransform f ξ is defined as
where the integral is taken with respect to Lebesgue measure on (Mathlib's default volume measure, since no measure is specified), the integrand is the complex-valued function (with again coerced from into ), and only the real part of the resulting complex integral is retained as the output — any imaginary part the integral might have is silently discarded. Critically, this definition carries no hypothesis whatsoever that is integrable, continuous, or that the integral converges in any sense, for the given or for any . In Mathlib's convention, ∫ is a total function: whenever the integrand fails to be Bochner-integrable with respect to Lebesgue measure, the integral is defined to equal by fiat (the "junk value" convention), and consequently fourierTransform f ξ evaluates to in that case — a value indistinguishable, at the level of this definition, from a genuine Fourier coefficient of . Nothing in the two declarations shown ties IsPosDefKernel to fourierTransform, nor asserts that a positive-definite has an integrable Fourier transform, nor states any version of Bochner's theorem itself (e.g., that is a nonnegative or probability-density function, or that , or that ); the file's docstrings describe such a connection informally, but no theorem enforcing it appears in the code given.