Algebraic infrastructure for R = QuadraticAlgebra ℤ (-2) 1 = ℤ[(1+√-7)/2] #
Following Michael Stoll's suggestion to work directly in QuadraticAlgebra ℤ (-2) 1
rather than through 𝓞 K where K = QuadraticAlgebra ℚ (-2) 1. The payoff:
θ ^ 2 = θ - 2,θ * θ' = 2,θ + θ' = 1,norm θ = 2,norm θ' = 2are all literalrfls (noSubtype.extceremony, noomega_mul_omega_eq_mk).units_pm_onereduces to a one-page completing-the-square argument over ℤ.EuclideanDomain R → IsPrincipalIdealRing R → UniqueFactorizationMonoid Rreplaces the discriminant / class-number-1 detour through Dirichlet.
The integer ring ℤ[(1 + √-7)/2], packaged as QuadraticAlgebra ℤ (-2) 1.
Equations
- RamanujanNagell.R = QuadraticAlgebra ℤ (-2) 1
Instances For
Norm form and positivity #
norm ⟨x, y⟩ = x² + xy + 2y²; the key identity is 4·N = (2x + y)² + 7y².
Units are ±1 #
θ and θ' are irreducible #
EuclideanDomain instance via smart rounding #
R = ℤ[(1+√-7)/2] with norm N(x, y) = x² + xy + 2y². To divide a by b ≠ 0,
we want q such that N(a - b·q) < N(b). Naive independent rounding of (a/b)
in the (re, im) basis can leave N = 1 exactly at the fundamental-domain
corner; the fix is to round im first, then re-round re shifted by half the
im residual. With that choice 16·N(rem) ≤ 11·N(b).
Smart-rounded quotient.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Smart-rounded remainder: rem a b = a - b * quot a b.
Equations
- RamanujanNagell.rem a b = a - b * RamanujanNagell.quot a b
Instances For
R is a Euclidean domain. Division of a by b ≠ 0 uses smart rounding of
a · star b / N(b) (round the im coordinate first, then shift-round re),
which guarantees 16 · N(rem) ≤ 11 · N(b), hence a strictly smaller norm.
Equations
- One or more equations did not get rendered due to their size.
R is a principal ideal ring, since every Euclidean domain is one.
R is a unique factorization domain, since every principal ideal ring is one.
θ, θ' are prime #
UFD scaffolding for the Ramanujan-Nagell argument #
These lemmas combine units_pm_one with UniqueFactorizationMonoid R to give
the key dichotomy α * β = θ^m · θ'^m ∧ IsCoprime α β → α = ±θ^m ∨ α = ±θ'^m.