{
  "id": "778",
  "ident": "NS.00778",
  "slug": "erdos-1141",
  "title": "Erdős Problem 1141",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "**Theorem 1.3 of [Po17]**: for a quadratic character to a large enough modulus, the primes below\n$m^{1/4+\\varepsilon}$ on which the character is $1$ outnumber any fixed power of $\\log m$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1141.erdos_1141.variants.pollack_1_3",
  "statement_lean": "theorem erdos_1141.variants.pollack_1_3 (ε A : ℝ) (hε : 0 < ε) (hA : 0 < A) :\n    ∃ m₀ : ℕ, ∀ m : ℕ, m₀ < m → ∀ χ : DirichletCharacter ℂ m, MulChar.IsQuadratic χ →\n      Real.log m ^ A ≤ ((residuePrimesUpTo m χ ε).card : ℝ)",
  "challenge_source": "/-\nCopyright 2026 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# Erdős Problem 1141\n\n*References:*\n- [erdosproblems.com/1141](https://www.erdosproblems.com/1141)\n- [A214583](https://oeis.org/A214583)\n- [APSSV26b] B. Alexeev, M. Putterman, M. Sawhney, M. Sellke, and G. Valiant,\n  [Short proofs in combinatorics, probability and number theory II](https://arxiv.org/abs/2604.06609).\n  arXiv:2604.06609 (2026).\n- [Or26] Y. Oriike, [Lean formalisation of Erdős problem 1141](https://github.com/yuta0x89/ErdosProblems/blob/a1319f732cdee5140faf47d984e2c451c1184803/Erdos1141.lean) (2026)\n- [Po17] P. Pollack, Bounds for the first several prime character nonresidues. Proc. Amer. Math. Soc.\n  (2017), 2815--2826.\n- [Me1874] F. Mertens, Ein Beitrag zur analytischen Zahlentheorie. J. Reine Angew. Math. (1874),\n  46--62.\n- [Va99] Various, Some of Paul's favorite problems. Booklet produced for the conference \"Paul Erdős\n  and his mathematics\", Budapest, July 1999 (1999).\n-/\n\n@[expose] public section\n\nopen Nat Set\n\nnamespace Erdos1141\n\n/- ## The two external inputs\n\nThe formal proof linked on `erdos_1141` below assumes both of these, and states neither. They are\nrecorded here so the `assuming` clause on that theorem can name them. -/\n\n/-- The cutoff $m^{1/4 + \\varepsilon}$ of Theorem 1.3 of [Po17]. -/\nnoncomputable def residuePrimeUpperBound (m : ℕ) (ε : ℝ) : ℝ := (m : ℝ) ^ ((1 / 4 : ℝ) + ε)\n\n/--\nThe primes $\\ell \\leq m^{1/4+\\varepsilon}$ with $\\chi(\\ell) = 1$.\n\nThis does not require $\\chi$ to be quadratic. That hypothesis belongs to the theorem below, as it\ndoes in the paper.\n-/\nnoncomputable def residuePrimesUpTo (m : ℕ) (χ : DirichletCharacter ℂ m) (ε : ℝ) : Finset ℕ := by\n  classical\n  exact (Finset.range (⌈residuePrimeUpperBound m ε⌉₊ + 1)).filter fun ℓ =>\n    ℓ.Prime ∧ (ℓ : ℝ) ≤ residuePrimeUpperBound m ε ∧ χ (ℓ : ZMod m) = 1\n\n/--\n**Theorem 1.3 of [Po17]**: for a quadratic character to a large enough modulus, the primes below\n$m^{1/4+\\varepsilon}$ on which the character is $1$ outnumber any fixed power of $\\log m$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_1141.variants.pollack_1_3 (ε A : ℝ) (hε : 0 < ε) (hA : 0 < A) :\n    ∃ m₀ : ℕ, ∀ m : ℕ, m₀ < m → ∀ χ : DirichletCharacter ℂ m, MulChar.IsQuadratic χ →\n      Real.log m ^ A ≤ ((residuePrimesUpTo m χ ε).card : ℝ) := by\n  sorry\n\n/--\n**Mertens' third theorem** [Me1874], in the weakened form the linked proof assumes: the product\nover the primes up to $n$ of $1 - 1/p$ is at least $1/(3\\log n)$.\n\nThe true asymptotic is $e^{-\\gamma}/\\log n$, and $e^{-\\gamma} > 1/3$, so this bound is weaker than\nthe theorem and is what the deduction needs.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_1141.variants.mertens_third (n : ℕ) (hn : 3 ≤ n) :\n    1 / (3 * Real.log n) ≤ ∏ p ∈ (Finset.range (n + 1)).filter Nat.Prime, (1 - 1 / (p : ℝ)) := by\n  sorry\n\n/--\nThe property that $n-k^2$ is prime for all $k$ with $(n,k)=1$ and $k^2 < n$.\n-/\ndef Erdos1141Prop (n : ℕ) : Prop :=\n  ∀ k, k ^ 2 < n → Coprime n k → (n - k ^ 2).Prime\n\ninstance (n : ℕ) : Decidable (Erdos1141Prop n) :=\n  decidable_of_iff (∀ k ≤ .sqrt (n - 1), Coprime n k → (n - k ^ 2).Prime) <| by\n    cases n with\n    | zero => simp [Erdos1141Prop]\n    | succ n' =>\n      simp [Erdos1141Prop, le_sqrt, pow_two]\n\nset_option linter.style.formal_proof_palomar false in\n/--\nAre there infinitely many $n$ such that $n-k^2$ is prime for all $k$ with $(n,k)=1$ and $k^2 < n$?\n\nIn [Va99] it is asked whether $968$ is the largest integer with this property, but this is an\nerror, since for example $968-9=7\\cdot 137$.\n\nThe list of $n$ satisfying the given property is [A214583] in the OEIS. The largest known such $n$\nis $1722$.\n\nThe answer is negative: [APSSV26b] proves a stronger finiteness theorem, deducing it from\nPollack [Po17]. Oriike [Or26] formalised the deduction in Lean.\n-/\n@[category research solved, question, AMS 11,\n  formal_proof using lean4 at\n    \"https://github.com/Jayyhk/erdos-lean/blob/main/problems/1141/Erdos1141.lean\"]\ntheorem erdos_1141 :\n    ¬ Infinite { n | Erdos1141Prop n } := by\n  sorry\n\n@[category test, AMS 11]\nexample : ¬ Erdos1141Prop 968 := by\n  decide +native\n\n@[category test, AMS 11]\nexample : Erdos1141Prop 1722 := by\n  decide +native\n\nend Erdos1141\n",
  "statement_hash": "c428eae9ce76907797acca8467a45ba91a635c0463d41bf1ade5aed065641a1c",
  "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."
}