{
  "id": "7953",
  "ident": "NS.07953",
  "slug": "wikipedia-gausscircleproblem--error-isbigo",
  "title": "Gauss circle problem · error_isBigO",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "It is conjectured that the correct bound is\n$$\n  |E(r)| = O\\left(r^{1/2 + o(1)}\\right)\n$$\n\n[Ha59]  Hardy, G. H. (1959). _Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work_(3rd ed.). New York: Chelsea Publishing Company. p. 67\n\nSee also https://arxiv.org/abs/2305.03549",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "wikipedia",
  "source_url": "https://en.wikipedia.org/wiki/Gauss_circle_problem",
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "GaussCircleProblem.error_isBigO",
  "statement_lean": "theorem error_isBigO : ∃ (o : ℝ → ℝ) (_ : Tendsto o atTop (𝓝 0)),\n    E =O[atTop] fun r => r ^ (1/2 + o r)",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Gauss circle problem\n\n*Reference:* [Wikipedia](https://en.wikipedia.org/wiki/Gauss_circle_problem)\n-/\n\n@[expose] public section\n\nopen Filter\n\nopen scoped EuclideanGeometry Real Topology\n\n/-  # Gauss Circle Problem\n\nConsider a circle in $\\mathbb{R}^2$ with center at the origin and radius $r\\geq 0$.\nGauss's circle problem asks how many points there are inside this circle of the form\n$(m, n)$ where $m$ and $n$ are both integers. Equivalently, how many pairs of integers\n$m$ and $n$ are there such that\n$$\n  m^2 + n^2 \\leq r^2.\n$$\n-/\n\nnamespace GaussCircleProblem\n\n/--\nLet $N(r)$ be the number of points $(m, n)$ within a circle of radius $r$,\nwhere $m$ and $n$ are both integers.\n-/\nnoncomputable abbrev N (r : ℝ) : ℕ :=\n  { (m, n) : ℤ × ℤ | !₂[↑m, ↑n] ∈ Metric.closedBall (0 : ℝ²) r }.ncard\n\n/--\nLet $E(r)$ be the error term between the number of integral points inside the circle and the\narea of the circle; that is $N(r) = \\pi r^2 + E(r)$.\n-/\nnoncomputable abbrev E (r : ℝ) : ℝ := N r - π * r ^ 2\n\n/--\nGauss proved that\n$$\n  |E(r)|\\leq 2\\sqrt{2}\\pi r,\n$$\nfor sufficiently large $r$.\n\n[Ha59]  Hardy, G. H. (1959). _Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work_(3rd ed.). New York: Chelsea Publishing Company. p. 67\n-/\n@[category research solved, AMS 11]\ntheorem error_le : ∀ᶠ r in atTop, |E r| ≤ 2 * √2 * π * r := by\n  sorry\n\n/--\nHardy and Laundau independently found a lower bound by showing that\n$$\n  |E(r)| \\neq o\\left(r^{1/2}(\\log r)^{1/4}\\right)\n$$\n-/\n@[category research solved, AMS 11]\ntheorem error_not_isLittleO : ¬E =o[atTop] (fun r => √r * √√r.log) := by\n  sorry\n\n/--\nIt is conjectured that the correct bound is\n$$\n  |E(r)| = O\\left(r^{1/2 + o(1)}\\right)\n$$\n\n[Ha59]  Hardy, G. H. (1959). _Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work_(3rd ed.). New York: Chelsea Publishing Company. p. 67\n\nSee also https://arxiv.org/abs/2305.03549\n-/\n@[category research open, AMS 11]\ntheorem error_isBigO : ∃ (o : ℝ → ℝ) (_ : Tendsto o atTop (𝓝 0)),\n    E =O[atTop] fun r => r ^ (1/2 + o r) := by\n  sorry\n\n/--\nThe value of $N(r)$ can be expressed as\n$$\n  N(r) = 1 + 4\\sum_{i=0}^{\\infty}\\left(\\left\\lfloor\\frac{r^2}{4i+1}\\right\\rfloor -\n    \\left\\lfloor\\frac{r^2}{4i + 3}\\right\\rfloor\\right).\n$$\n-/\n@[category research solved, AMS 11]\ntheorem exact_form_floor (r : ℝ) (hr : 0 ≤ r) :\n    N r = 1 + 4 * ∑' (i : ℕ), (⌊r ^ 2 / (4 * i + 1)⌋ - ⌊r ^ 2 / (4 * i + 3)⌋) := by\n  sorry\n\nend GaussCircleProblem\n",
  "statement_hash": "bf125c74acec8a505c2a2d270787c454157d7996a3ac22f6e228e18528cf5f2d",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}