{
  "id": "7466",
  "ident": "NS.07466",
  "slug": "papers-partitionparity",
  "title": "Parities of partition numbers",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "`p(n)` is even for infinitely many `n` and odd for infinitely many `n`. (Kolberg)",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "papers",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "PartitionParity.kolberg",
  "statement_lean": "theorem kolberg :\n    {n : ℕ | Even (partitionNumber n)}.Infinite ∧ {n : ℕ | Odd (partitionNumber n)}.Infinite",
  "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# Parities of partition numbers\n\nThere are several conjectures on parities of partition numbers. The most famous conjecture is the\nParkin-Shanks conjecture, which states that the natural density of `n` where the partition number\n`p(n)` is even (resp. odd) exists and equals `1/2`.\n\nThere are several related (weaker) results toward the conjecture. Kolberg showed that `p(n)` takes\neach parity infinitely often. Subbarao conjectured that every arithmetic progression `r (mod t)`\ncontains infinitely many `n` with `p(n)` even and infinitely many `n` with `p(n)` odd; the even\ncase was proved by Ono and the odd case by Radu. Quantitative lower bounds for the number of\n`n ≤ X` with `p(n)` even (resp. odd) have also been studied. The best known bounds are\n`≫ √X log log X` for even values (Bellaïche–Nicolas) and `≫ √X` for odd values (Zheng, in an\nappendix to Ono–Swaminathan). Ono–Swaminathan also proved that both parities occur infinitely often\nalong the quadratic progressions `(D m² + 1) / 24`, and Ono conjectured the same for every nonconstant\ninteger-valued polynomial that is eventually positive.\n\n*References:*\n* [On the distribution of parity in the partition function](https://www.jstor.org/stable/2003251),\n  T. R. Parkin, D. Shanks, Math. Comp. 21 (1967), 466–480.\n* [Note on the parity of the partition function](https://doi.org/10.7146/math.scand.a-10584),\n  O. Kolberg, Math. Scand. 7 (1959), 377–378.\n* Some remarks on the partition function, M. V. Subbarao, Amer. Math. Monthly 73 (1966), 851–854.\n* [Parity of the partition function in arithmetic progressions](https://doi.org/10.1515/crll.1996.472.1),\n  K. Ono, J. Reine Angew. Math. 472 (1996), 1–16.\n* [Distribution of parity of the partition function in arithmetic progressions](https://doi.org/10.1016/S0019-3577(99)80014-7),\n  S. Ahlgren, Indag. Math. (N.S.) 10 (1999), 173–181.\n* [Parity of the partition function](https://doi.org/10.1016/j.aim.2010.02.023), K. Ono,\n  Adv. Math. 225 (2010), 349–366.\n* [A proof of Subbarao's conjecture](https://doi.org/10.1515/CRELLE.2011.165), C.-S. Radu,\n  J. Reine Angew. Math. 672 (2012), 161–175.\n* [Parité des coefficients de formes modulaires](https://doi.org/10.1007/s11139-014-9645-9),\n  J. Bellaïche, J.-L. Nicolas, Ramanujan J. 40 (2016), 1–44.\n* [Nonzero coefficients of half-integral weight modular forms mod ℓ](https://arxiv.org/abs/1704.07440),\n  J. Bellaïche, B. Green, K. Soundararajan, Res. Math. Sci. 5 (2018), Paper No. 6.\n* [Parity of the partition function in quadratic progressions](https://arxiv.org/abs/2509.09553)\n  (with an appendix by Q.-Y. Zheng), K. Ono, A. Swaminathan, arXiv:2509.09553.\n* [Cox] D. A. Cox, Primes of the Form $x^2 + ny^2$, 2nd ed., Wiley, 2013.\n-/\n\n@[expose] public section\n\nnamespace PartitionParity\n\nopen Nat Real Filter Topology Asymptotics Polynomial\n\n/-- `p(n)` is even for infinitely many `n` and odd for infinitely many `n`. (Kolberg) -/\n@[category research solved, AMS 11]\ntheorem kolberg :\n    {n : ℕ | Even (partitionNumber n)}.Infinite ∧ {n : ℕ | Odd (partitionNumber n)}.Infinite := by\n  sorry\n\n/-- The natural density of `n` where the partition number `p(n)` is even (resp. odd) exists and\nequals `1/2`. -/\n@[category research open, AMS 11]\ntheorem parkin_shanks :\n    {n : ℕ | Even (partitionNumber n)}.HasDensity (1 / 2) ∧\n    {n : ℕ | Odd (partitionNumber n)}.HasDensity (1 / 2) := by\n  sorry\n\n/-- Every arithmetic progression contains infinitely many `n` where `p(n)` is even.\nConjectured by Subbarao and proved by Ono. -/\n@[category research solved, AMS 11]\ntheorem subbarao.even : ∀ r t, 0 < t →\n    {n : ℕ | n ≡ r [MOD t] ∧ Even (partitionNumber n)}.Infinite := by\n  sorry\n\n/-- Every arithmetic progression contains infinitely many `n` where `p(n)` is odd.\nConjectured by Subbarao; Ono proved it for every progression containing at least one `n` with\n`p(n)` odd, and Radu showed that every progression contains such an `n`. -/\n@[category research solved, AMS 11]\ntheorem subbarao.odd : ∀ r t, 0 < t →\n    {n : ℕ | n ≡ r [MOD t] ∧ Odd (partitionNumber n)}.Infinite := by\n  sorry\n\n/-- For every arithmetic progression `r (mod t)`, the number of `n ≤ X` with `n ≡ r (mod t)` and\n`p(n)` even is `≫ √X`. (Ahlgren) -/\n@[category research solved, AMS 11]\ntheorem ahlgren.even : ∀ r t, 0 < t →\n    (fun X : ℝ ↦ √X) =O[atTop]\n      fun X : ℝ ↦ ({n : ℕ | n ≤ X ∧ n ≡ r [MOD t] ∧ Even (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- For every arithmetic progression `r (mod t)`, the number of `n ≤ X` with `n ≡ r (mod t)` and\n`p(n)` odd is `≫ √X / log X`. Ahlgren proved this for every progression containing at least one\n`n` with `p(n)` odd; by Radu's theorem every progression does. -/\n@[category research solved, AMS 11]\ntheorem ahlgren.odd : ∀ r t, 0 < t →\n    (fun X : ℝ ↦ √X / X.log) =O[atTop]\n      fun X : ℝ ↦ ({n : ℕ | n ≤ X ∧ n ≡ r [MOD t] ∧ Odd (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- The number of `n ≤ X` with `p(n)` even is `≫ √X log log X`. (Bellaïche–Nicolas) -/\n@[category research solved, AMS 11]\ntheorem bellaiche_nicolas.even :\n    (fun X : ℝ ↦ √X * X.log.log) =O[atTop]\n      fun X : ℝ ↦ ({n : ℕ | n ≤ X ∧ Even (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- The number of `n ≤ x` with `p(n)` even is at least `0.069 √x log log x` for every `x > 1`.\n(Bellaïche–Nicolas) -/\n@[category research solved, AMS 11]\ntheorem bellaiche_nicolas.even_explicit : ∀ x : ℝ, 1 < x →\n    0.069 * √x * x.log.log ≤ ({n : ℕ | n ≤ x ∧ Even (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- The number of `n ≤ x` with `p(n)` odd is at least `0.037 √x / (log x)^(7/8)` for every `x ≥ 2`.\n(Bellaïche–Nicolas) -/\n@[category research solved, AMS 11]\ntheorem bellaiche_nicolas.odd_explicit : ∀ x : ℝ, 2 ≤ x →\n    0.037 * √x / (x.log) ^ (7 / 8 : ℝ) ≤ ({n : ℕ | n ≤ x ∧ Odd (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- The number of `n ≤ X` with `p(n)` odd is `≫ √X / log log X`.\n(Bellaïche–Green–Soundararajan) -/\n@[category research solved, AMS 11]\ntheorem bellaiche_green_soundararajan.odd :\n    (fun X : ℝ ↦ √X / X.log.log) =O[atTop]\n      fun X : ℝ ↦ ({n : ℕ | n ≤ X ∧ Odd (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- For square-free `D > 1` with `D ≡ 23 (mod 24)`, both parities occur infinitely often among\n`p((D m² + 1) / 24)` as `m` ranges over the positive integers coprime to `6`. Note that\n`24 ∣ D m² + 1` for such `m`. Conjectured by Ono and proved by Ono–Swaminathan. -/\n@[category research solved, AMS 11]\ntheorem ono_swaminathan.quadratic : ∀ D : ℕ, 1 < D → Squarefree D → D % 24 = 23 →\n    {m : ℕ | m.Coprime 6 ∧ Even (partitionNumber ((D * m ^ 2 + 1) / 24))}.Infinite ∧\n    {m : ℕ | m.Coprime 6 ∧ Odd (partitionNumber ((D * m ^ 2 + 1) / 24))}.Infinite := by\n  sorry\n\n/-- The odd half of Theorem 1 of Ono–Swaminathan, with its effective bound: for square-free `D > 1`\nwith `D ≡ 23 (mod 24)` there is an `m` coprime to `6` with `m ≤ 12 h(-D) + 2` such that\n`p((D m² + 1) / 24)` is odd, where `h(-D)` is the class number of `ℚ(√-D)`. Here `ℚ(√-D)` is\n`AdjoinRoot (X ^ 2 + D)`, a number field since `X ^ 2 + D` is irreducible over `ℚ` for `D > 0`. -/\n@[category research solved, AMS 11]\ntheorem ono_swaminathan.odd_bound (D : ℕ) (hD : 1 < D) (hsq : Squarefree D) (h23 : D % 24 = 23) :\n    haveI : Fact (Irreducible (X ^ 2 + C (D : ℚ))) :=\n      ⟨irreducible_X_sq_add_C_of_pos (Nat.cast_pos.2 (by lia))⟩\n    ∃ m : ℕ, m.Coprime 6 ∧\n      m ≤ 12 * NumberField.classNumber (AdjoinRoot (X ^ 2 + C (D : ℚ))) + 2 ∧\n      Odd (partitionNumber ((D * m ^ 2 + 1) / 24)) := by\n  sorry\n\n/-- `[a, b, c]` is a reduced primitive positive-definite binary quadratic form of discriminant\n`-D`: `b² - 4ac = -D`, `|b| ≤ a ≤ c`, `gcd(a, b, c) = 1`, and `b ≥ 0` if `|b| = a` or `a = c`. -/\ndef IsReducedForm (D : ℕ) (a b c : ℤ) : Prop :=\n  b ^ 2 - 4 * a * c = -D ∧ |b| ≤ a ∧ a ≤ c ∧ Int.gcd (Int.gcd a b) c = 1 ∧\n    (|b| = a ∨ a = c → 0 ≤ b)\n\n/-- For square-free `D ≡ 3 (mod 4)`, the discriminant `-D` is fundamental and the class number of\n`ℚ(√-D)` equals the number of reduced primitive positive-definite binary quadratic forms of\ndiscriminant `-D` [Cox, Theorem 2.8].\nThis identification is used in Zheng's appendix to Ono–Swaminathan. -/\n@[category textbook, AMS 11]\ntheorem classNumber_eq_ncard_reducedForms (D : ℕ) (hsq : Squarefree D) (h3 : D % 4 = 3) :\n    haveI : Fact (Irreducible (X ^ 2 + C (D : ℚ))) :=\n      ⟨irreducible_X_sq_add_C_of_pos (Nat.cast_pos.2 (by lia))⟩\n    NumberField.classNumber (AdjoinRoot (X ^ 2 + C (D : ℚ))) =\n      {⟨a, b, c⟩ : ℤ × ℤ × ℤ | IsReducedForm D a b c}.ncard := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Zheng's explicit lower bound: `liminf_{X → ∞} N_odd(X) / √X ≥ 243 / (64 √6 π⁵)`, where\n`N_odd(X)` is the number of `n ≤ X` with `p(n)` odd [Ono-Swaminathan, Appendix A, Corollary 2]. -/\n@[category research solved, AMS 11,\n  conditional formal_proof using lean4 at\n    \"https://github.com/AxiomMath/PartitionZheng/blob/9bfb4326c4ea1e00016a842d7cc145e5c4e0684a/Solution/Basic.lean#L17\"\n    assuming ono_swaminathan.odd_bound classNumber_eq_ncard_reducedForms]\ntheorem zheng.liminf :\n    ((243 / (64 * √6 * π ^ 5) : ℝ) : EReal) ≤\n      liminf (fun X : ℝ ↦\n        ((({n : ℕ | n ≤ X ∧ Odd (partitionNumber n)}.ncard : ℝ) / √X : ℝ) : EReal)) atTop := by\n  sorry\n\n/-- The number of `n ≤ X` with `p(n)` odd is `≫ √X`. -/\n@[category research solved, AMS 11]\ntheorem zheng.odd :\n    (fun X : ℝ ↦ √X) =O[atTop]\n      fun X : ℝ ↦ ({n : ℕ | n ≤ X ∧ Odd (partitionNumber n)}.ncard : ℝ) := by\n  sorry\n\n/-- Ono's conjecture, as stated in Section 1 of Ono–Swaminathan: if `g` is a nonconstant\ninteger-valued polynomial that is eventually positive, then `p(g(n))` is even for infinitely many\n`n` and odd for infinitely many `n`. -/\n@[category research open, AMS 11]\ntheorem ono.polynomial (g : ℚ[X]) (hg : 0 < g.natDegree)\n    (hint : ∀ n : ℕ, ∃ k : ℤ, g.eval (n : ℚ) = k)\n    (hpos : ∀ᶠ n : ℕ in atTop, 0 < g.eval (n : ℚ)) :\n    {n : ℕ | Even (partitionNumber ⌊g.eval (n : ℚ)⌋₊)}.Infinite ∧\n    {n : ℕ | Odd (partitionNumber ⌊g.eval (n : ℚ)⌋₊)}.Infinite := by\n  sorry\n\nend PartitionParity\n",
  "statement_hash": "4b5eae70b769168c3c78855b9e9ac0c5b9954daff260c2c225efd818aaf78017",
  "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."
}