Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Hua's inequality, fourth moment, k=2k=2k=2

Proved
CircleMethod.hua_L4_deg_two

by tabbott · Sep 1, 2026 · Mathlib c5ea003 (Lean v4.30.0)

analytic-number-theorycircle-methodexponential-sumsnumber-theory

Hua's inequality in its simplest instance: the fourth moment of the quadratic Weyl sum. For every ε>0\varepsilon>0ε>0 there is a constant C=C(ε)C=C(\varepsilon)C=C(ε) with

∫01∣∑x=0N−1e(θx2)∣4dθ  ≤  C N2+ε(N≥1).\int_0^1\left|\sum_{x=0}^{N-1}e(\theta x^{2})\right|^{4}d\theta\;\le\;C\,N^{2+\varepsilon}\qquad (N\ge 1).∫01​​x=0∑N−1​e(θx2)​4dθ≤CN2+ε(N≥1).

By the counting identity, the left-hand side equals the number of solutions of

x12+x22=y12+y22,0≤xi,yi<N,x_1^{2}+x_2^{2}=y_1^{2}+y_2^{2},\qquad 0\le x_i,y_i<N,x12​+x22​=y12​+y22​,0≤xi​,yi​<N,

so the assertion is that this system has only Oε(N2+ε)O_\varepsilon(N^{2+\varepsilon})Oε​(N2+ε) solutions — that is, essentially only the ≍N2\asymp N^2≍N2 diagonal ones {x1,x2}={y1,y2}\{x_1,x_2\}=\{y_1,y_2\}{x1​,x2​}={y1​,y2​}. The proof reduces to the divisor bound: for each fixed value of x12−y12x_1^2-y_1^2x12​−y12​ the number of ways of writing it as a difference of two squares is controlled by the number of its divisors.

Mean value estimates of this shape are the second pillar of the circle method, complementing the pointwise Weyl bound. The pointwise bound alone is too weak to make the minor arcs negligible; one interpolates, using Hölder's inequality, between the pointwise supremum bound and a mean value bound like this one. Hua's inequality is the general-kkk version, of which this is the case k=2k=2k=2.

Formalization Note. The integrand is the real-valued function θ↦∥∑x<Ne(θx2)∥4\theta\mapsto\bigl\|\sum_{x<N}e(\theta x^2)\bigr\|^4θ↦​∑x<N​e(θx2)​4, so the integral is real. Note the phase is θx2\theta x^2θx2, with xxx coerced from N\mathbb{N}N to R\mathbb{R}R before squaring. The constant CCC depends only on ε\varepsilonε, not on NNN.

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 hua_L4_deg_two {ε : ℝ} (hε : 0 < ε) :
    ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, 0 < N →
      (∫ θ in (0:ℝ)..1, ‖∑ x ∈ Finset.range N, e (θ * (x : ℝ) ^ 2)‖ ^ 4)
        ≤ C * (N : ℝ) ^ (2 + ε) := by sorry

end CircleMethod
Source
L.-K. Hua, On Waring's problem, Quarterly Journal of Mathematics 9 (1938), 199-202; see R. C. Vaughan, The Hardy-Littlewood Method, 2nd ed., 1997, Lemma 2.5 (Hua's inequality), case k = 2, j = 2.
Read-back

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

Read-back: hua_L4_deg_two

What the declaration asserts

Fix a real number ε\varepsilonε (supplied implicitly, so the statement is universally quantified over all real ε\varepsilonε) together with a hypothesis that ε>0\varepsilon > 0ε>0. The theorem then asserts:

There exists a real number CCC such that

C>0C > 0C>0

and such that for every natural number NNN satisfying N>0N > 0N>0,

∫01∥∑x∈{0,1,…,N−1}e ⁣(θ⋅x2)∥4 dθ  ≤  C⋅N 2+ε.\int_{0}^{1} \left\lVert \sum_{x \in \{0,1,\dots,N-1\}} e\!\left(\theta \cdot x^{2}\right) \right\rVert^{4} \, d\theta \;\le\; C \cdot N^{\,2+\varepsilon}.∫01​​x∈{0,1,…,N−1}∑​e(θ⋅x2)​4dθ≤C⋅N2+ε.

Meaning of the symbols

  • e(⋅)e(\cdot)e(⋅) is not the ordinary exponential; it is the bundle's own definition
e(θ)  =  exp⁡(2πi θ)∈C,e(\theta) \;=\; \exp\bigl(2\pi i\,\theta\bigr) \in \mathbb{C},e(θ)=exp(2πiθ)∈C,

where the real argument θ\thetaθ is coerced into C\mathbb{C}C. For real arguments e(θ)e(\theta)e(θ) therefore has modulus 111.

  • The summation index xxx ranges over the finite set {0,1,2,…,N−1}\{0,1,2,\dots,N-1\}{0,1,2,…,N−1} — that is, NNN terms starting at x=0x=0x=0, not {1,…,N}\{1,\dots,N\}{1,…,N}. In particular the term x=0x = 0x=0 is present and contributes e(0)=1e(0) = 1e(0)=1 for every θ\thetaθ. Each natural number xxx is coerced to a real number, squared in R\mathbb{R}R, and multiplied by θ\thetaθ; so the summand is exp⁡(2πi θx2)\exp\bigl(2\pi i\,\theta x^{2}\bigr)exp(2πiθx2) and the inner sum is the classical quadratic Weyl sum
SN(θ)  =  ∑x=0N−1exp⁡(2πi θx2).S_N(\theta) \;=\; \sum_{x=0}^{N-1} \exp\bigl(2\pi i\,\theta x^{2}\bigr).SN​(θ)=x=0∑N−1​exp(2πiθx2).
  • ∥⋅∥\lVert \cdot \rVert∥⋅∥ is the norm on C\mathbb{C}C, i.e. the complex modulus, so the integrand is the non-negative real quantity ∣SN(θ)∣4\lvert S_N(\theta)\rvert^{4}∣SN​(θ)∣4, the fourth power being a natural-number power. The integrand is real-valued; the outer expression is a real number.

  • The integral is the oriented interval integral from 000 to 111 with respect to θ\thetaθ (Lebesgue/Bochner integral over [0,1][0,1][0,1], taken with the positive orientation 0→10 \to 10→1). As a total function, this construct returns 000 when its integrand is not integrable; for the continuous integrand here that degenerate branch does not arise.

  • On the right-hand side, NNN is coerced to a real number and raised to the real exponent 2+ε2 + \varepsilon2+ε; this is the real power function N2+ε=exp⁡((2+ε)log⁡N)N^{2+\varepsilon} = \exp\bigl((2+\varepsilon)\log N\bigr)N2+ε=exp((2+ε)logN), well defined and positive because N≥1N \ge 1N≥1.

Quantifier structure and edge cases

  • The order of quantification is: ε\varepsilonε first (with ε>0\varepsilon > 0ε>0), then the constant CCC, then NNN. Hence CCC is allowed to depend on ε\varepsilonε, but a single CCC must work uniformly for all admissible NNN.

  • The hypothesis ε>0\varepsilon > 0ε>0 is satisfiable, so the statement is not vacuous on that count; nothing bounds ε\varepsilonε from above, so arbitrarily large ε\varepsilonε are also included.

  • CCC is only required to be strictly positive; no bound, effectivity, or dependence on ε\varepsilonε is specified, and no claim is made about how CCC behaves as ε→0+\varepsilon \to 0^{+}ε→0+.

  • The case N=0N = 0N=0 is excluded by the hypothesis 0<N0 < N0<N; the empty sum and the value 02+ε0^{2+\varepsilon}02+ε never occur. N=1N = 1N=1 is included, where the sum is the single constant term 111.

  • The inequality is non-strict (≤\le≤), and its direction is: the fourth-moment integral is bounded above by C⋅N2+εC \cdot N^{2+\varepsilon}C⋅N2+ε. No matching lower bound, no asymptotic equality, and no statement about any exponent other than 2+ε2+\varepsilon2+ε is asserted.

Items in scope but not used

The bundled definitions

f(A,θ)  =  ∑a∈Ae(aθ)(A⊆Z finite),nrm(θ)  =  ∣θ−round⁡(θ)∣f(A,\theta) \;=\; \sum_{a \in A} e(a\theta) \quad (A \subseteq \mathbb{Z} \text{ finite}), \qquad \mathrm{nrm}(\theta) \;=\; \lvert \theta - \operatorname{round}(\theta)\rvertf(A,θ)=a∈A∑​e(aθ)(A⊆Z finite),nrm(θ)=∣θ−round(θ)∣

are in scope in the surrounding namespace but do not appear anywhere in this statement.

The declaration carries no proof: its body is a placeholder, so the statement is asserted but not established by this code.

Human review
  • Endorsed by tianyipeng · Sep 2, 2026

  • Endorsed by tabbott · Sep 2, 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