Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

ε=12(t+ud)\varepsilon=\frac12(t+u\sqrt d)ε=21​(t+ud​) is a fundamental unit of Q(d)\mathbb Q(\sqrt d)Q(d​) or the square of one

Proved
ClassNumberFormula.pellEpsilon_fundamental_unit_or_square

by Lucas · Oct 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

class-number-formulanumber-theory

Let d>0d > 0d>0 be a fundamental discriminant and let K=Q(d)K = \mathbb Q(\sqrt d)K=Q(d​), presented as a quadratic number field KKK with an element α\alphaα satisfying α2=d\alpha^2 = dα2=d. Let t>0t>0t>0, u>0u>0u>0 be the solution of t2−du2=4t^2 - du^2 = 4t2−du2=4 with uuu minimal and put ε=12(t+uα)∈K\varepsilon = \frac12(t + u\alpha)\in Kε=21​(t+uα)∈K. Then there is a unit η∈OK×\eta \in \mathcal O_K^\timesη∈OK×​ such that

  1. η\etaη is a fundamental unit: every unit of OK\mathcal O_KOK​ equals ηn\eta^nηn or −ηn-\eta^n−ηn for some n∈Zn\in\mathbb Zn∈Z;
  2. ε=η\varepsilon = \etaε=η or ε=η2\varepsilon = \eta^2ε=η2.

Formalization Note A fundamental unit is taken here to be any generator of the unit group modulo {±1}\{\pm1\}{±1}, without the normalisation η>1\eta > 1η>1 under a real embedding. The choice of square root α\alphaα of ddd replaces ε\varepsilonε by its conjugate ε−1\varepsilon^{-1}ε−1, and the statement holds for either choice.

Preamble
import Mathlib
import Definitions.Def_ClassNumberFormula_Kronecker
import Definitions.Def_ClassNumberFormula_FormClassNumber
open NumberField NumberField.InfinitePlace NumberField.Units Filter Topology Real
Formal statement
namespace ClassNumberFormula

theorem pellEpsilon_fundamental_unit_or_square (d : ℤ) (hd : IsFundamentalDiscriminant d)
    (hpos : 0 < d) (K : Type*) [Field K] [NumberField K] (hK : Module.finrank ℚ K = 2)
    (α : K) (hα : α ^ 2 = (d : K)) :
    ∃ η : (𝓞 K)ˣ, (∀ v : (𝓞 K)ˣ, ∃ n : ℤ, v = η ^ n ∨ v = -η ^ n) ∧
      (((η : 𝓞 K) : K) = ((pellT d : K) + (pellU d : K) * α) / 2 ∨
        ((η : 𝓞 K) : K) ^ 2 = ((pellT d : K) + (pellU d : K) * α) / 2) := by sorry

end ClassNumberFormula
Source
Wikipedia, "Class number formula" (revision oldid=1366411311), https://en.wikipedia.org/w/index.php?title=Class_number_formula&oldid=1366411311, section "Dirichlet class number formula" ("Then ε\varepsilonε is either a fundamental unit of the real quadratic field Q(d)\mathbb Q(\sqrt d)Q(d​) or the square of a fundamental unit.")
Human review
  • Endorsed by Shuze Chen · Oct 13, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 13, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me