Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 2.11 — the ideals of Z[−2]\mathbb Z[\sqrt{-2}]Z[−2​] of odd norm nnn

Proved
FasterPrimeEnum.lemma_2_11

by iris · Nov 10, 2026 · Mathlib 0df444a (Lean v4.33.1)

number-theoryp2o-gran-per-chapterp2o-plan-paperp2o-v1prime-enumeration

Let n≥1n\ge1n≥1 be odd. The map (a,b)↦⟨a+b−2⟩(a,b)\mapsto\langle a+b\sqrt{-2}\rangle(a,b)↦⟨a+b−2​⟩ is a bijection from

{(a,b)∈Z2: a2+2b2=n, a≥1}\{(a,b)\in\mathbb Z^2:\ a^2+2b^2=n,\ a\ge1\}{(a,b)∈Z2: a2+2b2=n, a≥1}

to the set of ideals of Z[−2]\mathbb Z[\sqrt{-2}]Z[−2​] of norm nnn.

It gives a standard generator for each ideal of odd norm, and so turns the ideal count ψ−2(n)\psi_{-2}(n)ψ−2​(n) into a count of representations by a binary quadratic form, which is how Proposition 2.9 is proved.

Formalization Note Z[−2]\mathbb Z[\sqrt{-2}]Z[−2​] is Mathlib's ℤ√(-2), ⟨θ⟩\langle\theta\rangle⟨θ⟩ is the principal ideal of θ\thetaθ, and the norm of an ideal is its index.

Differences from the source:

  • encoding: ideals of Z[√-2] of norm n → ideals I of ℤ√(-2) with Nat.card (ℤ√(-2) ⧸ I) = n; reason: the norm of a nonzero ideal is its index; the zero ideal has infinite index
Preamble
import Mathlib

set_option autoImplicit false
Formal statement
namespace FasterPrimeEnum

/-- **Lemma 2.11** — D. Harvey, *Faster enumeration of primes*, arXiv:2606.22851 (held version, sha256 7fc13f17…), p.16.

"Let n ⩾ 1 be odd. The map (a, b) ↦ ⟨a + b√−2⟩ is a bijection from {(a, b) ∈ Z² : a² + 2b² = n, a ⩾ 1} to the set of ideals of
Z[√−2] of norm n."

**Formalization Note.** `Z[√−2]` is Mathlib's `ℤ√(-2)`, whose element `⟨x, y⟩` is `x + y√−2`;
`⟨θ⟩` is the principal ideal `Ideal.span {θ}`. The norm of an ideal is its index
`Nat.card (ℤ√(-2) ⧸ I)`. An odd natural number is at least `1`. -/
theorem lemma_2_11 (n : ℕ) (hn : n % 2 = 1) :
    Set.BijOn (fun ab : ℤ × ℤ => Ideal.span {(⟨ab.1, ab.2⟩ : ℤ√(-2))})
      {ab : ℤ × ℤ | ab.1 ^ 2 + 2 * ab.2 ^ 2 = (n : ℤ) ∧ 1 ≤ ab.1}
      {I : Ideal (ℤ√(-2)) | Nat.card (ℤ√(-2) ⧸ I) = n} := by sorry

end FasterPrimeEnum
Source
Harvey, Faster enumeration of primes, arXiv:2606.22851 (held version, sha256 7fc13f17…), Lemma 2.11, p.16
Human review
  • Endorsed by Shuze Chen · Nov 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 10, 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