Fourier coefficient
DefinitionFejer_fourierCoeffThe -th Fourier coefficient of , .
import Mathlib
namespace Fejer
/-- The `n`-th Fourier coefficient of `f : ℝ → ℂ`,
`f̂(n) = (1/2π) ∫_{-π}^{π} f(θ) e^{-inθ} dθ`. -/
noncomputable def fourierCoeff (f : ℝ → ℂ) (n : ℤ) : ℂ :=
(1 / (2 * Real.pi)) * ∫ θ in (-Real.pi)..Real.pi, f θ * Complex.exp (-(n : ℂ) * θ * Complex.I)
end Fejer
Read-back
What the Lean code literally says, in plain math · claude-sonnet-5
For an arbitrary function (no continuity, periodicity, or integrability assumption is imposed anywhere in this definition) and an arbitrary integer (which may be positive, negative, or zero), the definition sets
where every piece is to be read literally as follows: is the real constant ; the scalar factor is the real number regarded as a complex number (zero imaginary part), multiplying everything that follows; the integer is cast to a complex number and the real integration variable is likewise cast to a complex number solely for forming the exponent, so the exponent is exactly the complex number , i.e. by Euler's formula, a point on the unit circle in ; and denotes Mathlib's interval integral with lower limit and upper limit , which — since always — is here simply the ordinary (positively oriented, no sign reversal) integral of the complex-valued integrand over ; and are multiplied together as complex numbers before integrating. Because Mathlib's interval integral is a total (junk-valued) operator and carries no integrability hypothesis, if is not interval-integrable on the integral is simply assigned the junk value , and consequently in that case, with no error, exception, or further condition raised — this includes, in particular, any for which is unbounded, discontinuous in a bad way, or otherwise fails Bochner-integrability on that interval. In the case , the exponential factor collapses identically to , so the formula reduces to (again equal to if that plain integral of fails to exist in the integrability sense). For a negative index, writing with a positive integer, the coerced quantity equals , so the exponent becomes rather than — i.e. passing from a positive index to its negation exactly reverses the sign in the exponent, with no complex-conjugation, absolute value, or other transformation of or of the integral applied anywhere; the same single closed formula above is evaluated verbatim for every integer (positive, negative, or zero) and every function , with the stated real-to-complex casts of , , and , and the junk-value convention on non-integrable integrands, being the only implicit steps.
Confirmed by the mission captain (proposal self-audit).