Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Orthonormal systems, Fourier coefficients, trigonometric polynomials

Definition
Rudin_ch08_fourier

by LG · Sep 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

analysisfourier-analysis

Rudin's Chapter 8 apparatus for Fourier series. A sequence {φn}\{\varphi_n\}{φn​} is an orthonormal system on [a,b][a,b][a,b] when ∫abφnφm‾=0\int_a^b \varphi_n \overline{\varphi_m} = 0∫ab​φn​φm​​=0 for n≠mn \ne mn=m and ∫ab∣φn∣2=1\int_a^b |\varphi_n|^2 = 1∫ab​∣φn​∣2=1 (Definition 8.10), and the Fourier coefficients of fff relative to it are cn=∫abfφn‾c_n = \int_a^b f\overline{\varphi_n}cn​=∫ab​fφn​​. For the trigonometric system one has cn=12π∫−ππf(x)e−inxdxc_n = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)e^{-inx}dxcn​=2π1​∫−ππ​f(x)e−inxdx, the partial sums sN(f;x)=∑∣n∣≤Ncneinxs_N(f;x) = \sum_{|n| \le N} c_n e^{inx}sN​(f;x)=∑∣n∣≤N​cn​einx, the norm ∥h∥2=((1/2π)∫−ππ∣h∣2)1/2\|h\|_2 = ((1/2\pi)\int_{-\pi}^{\pi}|h|^2)^{1/2}∥h∥2​=((1/2π)∫−ππ​∣h∣2)1/2, 2π2\pi2π-periodicity, and trigonometric polynomials (Definition 8.9). Complex-valued integrals use the interval integral rather than the real-valued Riemann–Stieltjes integral of the Chapter 6 mission.

Definition code
import Mathlib

/-!
# Rudin, Chapter 8 — orthonormal systems and Fourier series

Definitions transcribed from Walter Rudin, *Principles of Mathematical Analysis*, 3rd edition,
Chapter 8 (Definitions 8.9, 8.10, Section 8.13 and equation (86)).

The integrals of Chapter 8 are integrals of complex-valued functions over `[a, b]`; the
Riemann–Stieltjes integral built for Chapter 6 is real-valued, so Mathlib's interval integral
`∫ x in a..b, f x` is used instead.  For the Riemann-integrable integrands Rudin considers, the
two agree, and Rudin himself notes that his hypothesis `f ∈ ℛ` can be weakened.

Mathlib has a Fourier theory on `AddCircle T`; Rudin works with `2π`-periodic functions on `ℝ`
and with general orthonormal systems on an interval, so those are set up here.
-/

namespace Rudin

/-- Rudin, Definition 8.10: `φ` is an **orthonormal system** on `[a, b]`. -/
def IsOrthonormalSystem (φ : ℕ → ℝ → ℂ) (a b : ℝ) : Prop :=
  (∀ m n : ℕ, m ≠ n → (∫ x in a..b, φ n x * (starRingEnd ℂ) (φ m x)) = 0) ∧
    ∀ n : ℕ, (∫ x in a..b, ‖φ n x‖ ^ 2) = 1

/-- Rudin, Definition 8.10, equation (66): the `n`-th Fourier coefficient of `f` relative to an
orthonormal system `φ` on `[a, b]`. -/
noncomputable def genFourierCoeff (f : ℝ → ℂ) (φ : ℕ → ℝ → ℂ) (a b : ℝ) (n : ℕ) : ℂ :=
  ∫ x in a..b, f x * (starRingEnd ℂ) (φ n x)

/-- Rudin, Section 8.13: the `n`-th Fourier coefficient of a `2π`-periodic function with respect
to the trigonometric system, `cₙ = (1/2π) ∫_{-π}^{π} f(x) e^{-inx} dx`. -/
noncomputable def fourierCoeff (f : ℝ → ℂ) (n : ℤ) : ℂ :=
  (1 / (2 * Real.pi) : ℂ) *
    ∫ x in (-Real.pi)..Real.pi, f x * Complex.exp (-(n : ℂ) * Complex.I * (x : ℂ))

/-- Rudin, Section 8.13, equation (77): the `N`-th partial sum `s_N(f; x)` of the Fourier series
of `f`. -/
noncomputable def fourierPartialSum (f : ℝ → ℂ) (N : ℕ) (x : ℝ) : ℂ :=
  ∑ n ∈ Finset.Icc (-(N : ℤ)) (N : ℤ),
    fourierCoeff f n * Complex.exp ((n : ℂ) * Complex.I * (x : ℂ))

/-- Rudin, Chapter 8, equation (86): the `L²` norm `‖h‖₂ = ((1/2π) ∫_{-π}^{π} |h|²)^{1/2}`. -/
noncomputable def L2Norm (h : ℝ → ℂ) : ℝ :=
  Real.sqrt ((1 / (2 * Real.pi)) * ∫ x in (-Real.pi)..Real.pi, ‖h x‖ ^ 2)

/-- `f` has period `2π`. -/
def HasPeriodTwoPi (f : ℝ → ℂ) : Prop :=
  ∀ x : ℝ, f (x + 2 * Real.pi) = f x

/-- Rudin, Definition 8.9: `P` is a **trigonometric polynomial**, a finite sum
`∑_{n=-N}^{N} cₙ e^{inx}`. -/
def IsTrigPolynomial (P : ℝ → ℂ) : Prop :=
  ∃ (N : ℕ) (c : ℤ → ℂ), ∀ x : ℝ,
    P x = ∑ n ∈ Finset.Icc (-(N : ℤ)) (N : ℤ), c n * Complex.exp ((n : ℂ) * Complex.I * (x : ℂ))

end Rudin
Source
Walter Rudin, Principles of Mathematical Analysis, 3rd edition, McGraw-Hill, 1976, Chapter 8, pp. 185-191, Definitions 8.9, 8.10 and Section 8.13
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Seven definitions concerning complex-valued functions on R\mathbb{R}R. All integrals ∫ab\int_a^b∫ab​ are oriented interval integrals with respect to Lebesgue measure: they are −∫ba-\int_b^a−∫ba​ when b<ab<ab<a, and they take the value 000 for integrands that are not integrable.

Orthonormal system. A family φ0,φ1,⋯:R→C\varphi_0,\varphi_1,\dots : \mathbb{R}\to\mathbb{C}φ0​,φ1​,⋯:R→C is an orthonormal system on [a,b][a,b][a,b] when both: for all m≠nm \ne nm=n, ∫abφn(x)φm(x)‾ dx=0\int_a^b \varphi_n(x)\overline{\varphi_m(x)}\,dx = 0∫ab​φn​(x)φm​(x)​dx=0; and for every nnn, ∫ab∥φn(x)∥2 dx=1\int_a^b \lVert\varphi_n(x)\rVert^2\,dx = 1∫ab​∥φn​(x)∥2dx=1 (the second integrand is real-valued).

Generalized Fourier coefficient. cn(f)=∫abf(x) φn(x)‾ dxc_n(f) = \int_a^b f(x)\,\overline{\varphi_n(x)}\,dxcn​(f)=∫ab​f(x)φn​(x)​dx, for f:R→Cf : \mathbb{R}\to\mathbb{C}f:R→C and an arbitrary family φ\varphiφ — orthonormality is not required by the definition.

Trigonometric Fourier coefficient. For n∈Zn \in \mathbb{Z}n∈Z,

f^(n)  =  12π∫−ππf(x) e−inx dx.\hat f(n) \;=\; \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)\,e^{-inx}\,dx .f^​(n)=2π1​∫−ππ​f(x)e−inxdx.

Partial sum. For N∈NN \in \mathbb{N}N∈N and x∈Rx \in \mathbb{R}x∈R,

sN(f;x)  =  ∑n=−NNf^(n) einx,s_N(f;x) \;=\; \sum_{n=-N}^{N} \hat f(n)\, e^{inx},sN​(f;x)=n=−N∑N​f^​(n)einx,

the sum over all integers nnn with −N≤n≤N-N \le n \le N−N≤n≤N, so 2N+12N+12N+1 terms.

L2L^2L2 norm. ∥h∥2=12π∫−ππ∥h(x)∥2 dx\lVert h\rVert_2 = \sqrt{\dfrac{1}{2\pi}\displaystyle\int_{-\pi}^{\pi}\lVert h(x)\rVert^2\,dx}∥h∥2​=2π1​∫−ππ​∥h(x)∥2dx​, with the real square root, which returns 000 on negative arguments.

Periodicity. fff has period 2π2\pi2π means f(x+2π)=f(x)f(x+2\pi) = f(x)f(x+2π)=f(x) for every real xxx.

Trigonometric polynomial. P:R→CP : \mathbb{R}\to\mathbb{C}P:R→C is a trigonometric polynomial when there exist N∈NN \in \mathbb{N}N∈N and coefficients c:Z→Cc : \mathbb{Z}\to\mathbb{C}c:Z→C such that P(x)=∑n=−NNcneinxP(x) = \sum_{n=-N}^{N} c_n e^{inx}P(x)=∑n=−NN​cn​einx for every real xxx (the coefficients outside [−N,N][-N,N][−N,N] are irrelevant).

These are definitions only; nothing is asserted about them.

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

  • Endorsed by LG · Sep 13, 2026

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

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, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me