Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The fundamental counting identity of the circle method

Proved
CircleMethod.circle_method_count

by tabbott · Sep 1, 2026 · Mathlib 0df444a (Lean v4.33.1)

analytic-number-theorycircle-methodexponential-sumsnumber-theory

The identity on which the entire Hardy--Littlewood circle method rests.

Let AAA be a finite set of integers and let

fA(θ)=∑a∈Ae(aθ),e(θ)=exp⁡(2πiθ),f_A(\theta)=\sum_{a\in A}e(a\theta),\qquad e(\theta)=\exp(2\pi i\theta),fA​(θ)=a∈A∑​e(aθ),e(θ)=exp(2πiθ),

be its exponential generating function. Then for every s∈Ns\in\mathbb{N}s∈N and every n∈Zn\in\mathbb{Z}n∈Z,

∫01fA(θ)s e(−nθ) dθ  =  #{(a1,…,as)∈As  :  a1+⋯+as=n}.\int_0^1 f_A(\theta)^s\,e(-n\theta)\,d\theta \;=\; \#\bigl\{(a_1,\dots,a_s)\in A^s \;:\; a_1+\cdots+a_s=n\bigr\}.∫01​fA​(θ)se(−nθ)dθ=#{(a1​,…,as​)∈As:a1​+⋯+as​=n}.

The proof is a single expansion followed by orthogonality: fA(θ)s=∑(a1,…,as)∈Ase((a1+⋯+as)θ)f_A(\theta)^s=\sum_{(a_1,\dots,a_s)\in A^s}e\bigl((a_1+\cdots+a_s)\theta\bigr)fA​(θ)s=∑(a1​,…,as​)∈As​e((a1​+⋯+as​)θ), and ∫01e(mθ) dθ\int_0^1 e(m\theta)\,d\theta∫01​e(mθ)dθ is 111 when m=0m=0m=0 and 000 otherwise, so every tuple whose sum differs from nnn is annihilated.

The significance is that an arithmetic quantity — a count of representations — has been written as an analytic one, an integral over the circle. The method then estimates that integral by splitting the circle into major arcs, where fAf_AfA​ is large and computable, and minor arcs, where fAf_AfA​ is small. Nothing in the method is possible before this identity is available.

Formalization Note. Tuples are functions Fin s→A\mathrm{Fin}\,s\to AFins→A, so they are ordered and repetitions are allowed. No hypotheses are placed on AAA, sss or nnn: the degenerate cases A=∅A=\emptysetA=∅ and s=0s=0s=0 are included, and for s=0s=0s=0 both sides reduce to [ n=0 ][\,n=0\,][n=0].

Preamble
import Definitions.Def_CircleMethod_genfun
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Analysis.SpecialFunctions.Integrals.Basic
import Mathlib.NumberTheory.Divisors
import Mathlib.Data.Fintype.Pi
open Finset
Formal statement
namespace CircleMethod

theorem circle_method_count (A : Finset ℤ) (s : ℕ) (n : ℤ) :
    (∫ θ in (0:ℝ)..1, (f A θ) ^ s * e (-(n : ℝ) * θ))
      = ((((Fintype.piFinset (fun _ : Fin s => A)).filter
            (fun v => ∑ i, v i = n)).card : ℕ) : ℂ) := by sorry

end CircleMethod
Source
R. C. Vaughan, The Hardy-Littlewood Method, 2nd ed., Cambridge Tracts in Mathematics 125, Cambridge University Press, 1997, Section 1.1, equations (1.3)-(1.4) (the fundamental identity of the circle method).

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