Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Partial sum of a Fourier series

Definition
Fejer_partialSum

by Elsie66 · Sep 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

fourier-seriesharmonic-analysis

The NNN-th symmetric partial sum of the Fourier series of fff, SN(f)(θ)=∑n=−NNf^(n)einθS_N(f)(\theta) = \sum_{n=-N}^{N} \hat f(n) e^{in\theta}SN​(f)(θ)=∑n=−NN​f^​(n)einθ.

Definition code
import Mathlib
import Definitions.Def_Fejer_fourierCoeff

namespace Fejer

/-- The `N`-th (symmetric) partial sum of the Fourier series of `f`,
`S_N(f)(θ) = ∑_{n=-N}^{N} f̂(n) e^{inθ}`. -/
noncomputable def partialSum (f : ℝ → ℂ) (N : ℕ) (θ : ℝ) : ℂ :=
  ∑ n ∈ Finset.Icc (-(N : ℤ)) (N : ℤ), fourierCoeff f n * Complex.exp ((n : ℂ) * θ * Complex.I)

end Fejer
Source
L. Fejér, "Untersuchungen über Fouriersche Reihen," Math. Ann. 58 (1904); E. M. Stein & R. Shakarchi, Fourier Analysis: An Introduction, Ch. 2.
Read-back

What the Lean code literally says, in plain math · claude-sonnet-5

fourierCoeff f n

For an arbitrary function f:R→Cf:\mathbb{R}\to\mathbb{C}f:R→C and an arbitrary integer nnn, this quantity is defined as

fourierCoeff(f,n)  =  12π∫−ππf(θ) e−inθ dθ,\text{fourierCoeff}(f,n) \;=\; \frac{1}{2\pi}\int_{-\pi}^{\pi} f(\theta)\,e^{-in\theta}\,d\theta ,fourierCoeff(f,n)=2π1​∫−ππ​f(θ)e−inθdθ,

i.e. one over 2π2\pi2π times the integral, taken from −π-\pi−π to π\piπ (in that orientation), of the product of f(θ)f(\theta)f(θ) with e−inθe^{-in\theta}e−inθ, where nnn has been coerced to a complex number for the purposes of this exponent. The integral is Mathlib's total interval integral: if fff multiplied by θ↦e−inθ\theta\mapsto e^{-in\theta}θ↦e−inθ is not interval-integrable on [−π,π][-\pi,\pi][−π,π], the integral is assigned the junk value 000, so fourierCoeff(f,n)=0\text{fourierCoeff}(f,n)=0fourierCoeff(f,n)=0 in that case. No hypothesis of continuity, integrability, or periodicity of fff is imposed or needed.

partialSum f N θ

For an arbitrary f:R→Cf:\mathbb{R}\to\mathbb{C}f:R→C, an arbitrary natural number NNN, and an arbitrary real number θ\thetaθ, this quantity is defined as the finite sum

partialSum(f,N,θ)  =  ∑n=−NNfourierCoeff(f,n)⋅einθ,\text{partialSum}(f,N,\theta) \;=\; \sum_{n=-N}^{N} \text{fourierCoeff}(f,n)\cdot e^{in\theta},partialSum(f,N,θ)=n=−N∑N​fourierCoeff(f,n)⋅einθ,

where the summation index nnn ranges over all integers nnn satisfying −N≤n≤N-N \le n \le N−N≤n≤N, i.e. exactly 2N+12N+12N+1 terms are summed for every NNN (NNN negative indices, the index 000, and NNN positive indices). In the special case N=0N=0N=0, the index set collapses to {0}\{0\}{0}, so partialSum(f,0,θ)=fourierCoeff(f,0)⋅ei⋅0⋅θ=fourierCoeff(f,0)\text{partialSum}(f,0,\theta) = \text{fourierCoeff}(f,0)\cdot e^{i\cdot 0\cdot\theta} = \text{fourierCoeff}(f,0)partialSum(f,0,θ)=fourierCoeff(f,0)⋅ei⋅0⋅θ=fourierCoeff(f,0) — independent of θ\thetaθ, and equal to 12π∫−ππf(θ′) dθ′\tfrac{1}{2\pi}\int_{-\pi}^{\pi} f(\theta')\,d\theta'2π1​∫−ππ​f(θ′)dθ′ (or 000 under the same junk-value convention if that integral fails to exist). No continuity, integrability, or periodicity hypothesis on fff is assumed or required anywhere in this definition.

Human review
  • Endorsed by Shuze Chen · Sep 7, 2026

  • Endorsed by Elsie66 · Sep 7, 2026

    Confirmed by the mission captain (proposal self-audit).

  • Endorsed by marwahaha · Sep 7, 2026

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me