Eisenstein integer triples — generation, statistical analysis, and proof verification on hexagonal lattices.
An Eisenstein triple satisfies:
a² − ab + b² = c²
This is the norm equation in ℤ[ω] where ω = e^{2πi/3}, making it the hexagonal lattice analog of the Pythagorean triple a² + b² = c².
The Pythagorean triples (a² + b² = c²) are deeply connected to the square lattice ℤ² and the Gaussian integers ℤ[i]. Eisenstein triples play the same role for the hexagonal lattice and the Eisenstein integers ℤ[ω]:
| Property | Pythagorean | Eisenstein |
|---|---|---|
| Ring | ℤ[i] | ℤ[ω] |
| Norm | a² + b² | a² − ab + b² |
| Lattice | Square | Hexagonal |
| Symmetry group | C₄ (4-fold) | D₆ (12-fold) |
| Units | {±1, ±i} (4) | {±1, ±ω, ±ω²} (6) |
| Primitivity | gcd(a,b) = 1 | gcd(a,b,a−b) = 1 |
Eisenstein triples are ~25% denser than Pythagorean triples, making them more useful for constraint systems on hexagonal lattices.
pip install -e .No external dependencies required — pure Python using only the standard library.
from eisenstein_triples import generate_triples, primitive_triples
# All triples with c ≤ 100
triples = generate_triples(100)
for a, b, c in triples[:10]:
print(f"({a}, {b}, {c})")
# Primitive triples only
prim = primitive_triples(50)
print(f"Primitive triples with c ≤ 50: {len(prim)}")Output:
(-7, 8, 7) norm=49
(-7, -1, 7) norm=49
(-5, 8, 7) norm=49
(-1, -7, 7) norm=49
(1, 8, 7) norm=49
(5, 3, 7) norm=49
(-8, -5, 7) norm=49
(-8, 7, 7) norm=49
(-8, -7, 7) norm=49
(-7, -8, 7) norm=49
from eisenstein_triples import parametric_form
# Analogous to Euclid's formula for Pythagorean triples
# Eisenstein: (m²−n², 2mn−n², m²−mn+n²)
for m in range(2, 8):
for n in range(1, m):
a, b, c, valid = parametric_form(m, n)
if valid:
print(f"m={m}, n={n} → ({a}, {b}, {c})")Every Eisenstein triple has a D₆ orbit of up to 12 related triples, generated by the 6 rotations and 2 conjugations of the hexagonal lattice:
from eisenstein_triples import weyl_orbit, norm
orbit = weyl_orbit(4, 1)
print(f"D₆ orbit of (4, 1): {len(orbit)} elements")
for a, b in orbit:
print(f" ({a}, {b}) norm = {norm(a, b)}")Output:
D₆ orbit of (4, 1): 12 elements
(-4, -1) norm = 13
(-4, 3) norm = 13
(-1, -4) norm = 13
(-1, 3) norm = 13
(1, -3) norm = 13
(1, 4) norm = 13
(3, -4) norm = 13
(3, 1) norm = 13
(4, -3) norm = 13
(4, 1) norm = 13
(-3, -1) norm = 13
(-3, 4) norm = 13
All 12 elements have the same norm (13) — the norm is D₆-invariant.
from eisenstein_triples import density_comparison
result = density_comparison(200)
print(f"Eisenstein triples: {result['eisenstein_count']}")
print(f"Pythagorean triples: {result['pythagorean_count']}")
print(f"Ratio (E/P): {result['ratio']:.4f}")
print(f"Eisenstein are {result['eisenstein_density_pct']:.1f}% denser")Eisenstein triples are closed under multiplication in ℤ[ω]:
from eisenstein_triples import multiplication_closure
result = multiplication_closure(100)
print(f"Closed: {result['closed']}, Failed: {result['failed']}")
# All should close: N(z₁z₂) = N(z₁)·N(z₂) always holdsThe analyze module provides comprehensive statistical analysis of Eisenstein triples compared to Pythagorean triples:
python analyze.py- Triple Density Comparison — count at various thresholds (100 to 65,536)
- Asymptotic Growth Analysis — log-log regression to determine growth exponent
- Weyl Orbit Analysis — group triples by orbit, compute orbit size distribution
- Prime Norm Distribution — classify norms by splitting behavior in ℤ[ω]
- Multiplication Closure Verification — statistical verification at scale
from analyze import eisenstein_triples, pythagorean_triples
eis = eisenstein_triples(65536)
pyt = pythagorean_triples(65536)
print(f"Eisenstein: {len(eis):>10,}")
print(f"Pythagorean: {len(pyt):>10,}")
print(f"Ratio: {len(eis)/len(pyt):.4f}")The growth exponent is approximately 2.0 for both families (consistent with quadratic parametrization), but the Eisenstein constant C is ~25% larger.
In ℤ[ω], primes split according to their residue mod 3:
| p mod 3 | Behavior in ℤ[ω] | Norm equation |
|---|---|---|
| 0 | Ramified (only p=3) | 3 = −ω²(1−ω)² |
| 1 | Split: p = π·π̄ | N(π) = p |
| 2 | Inert (stays prime) | N(p) = p² |
This means no prime ≡ 2 (mod 3) can appear as an Eisenstein norm — a deep connection between number theory and the hexagonal lattice.
from analyze import analyze_prime_distribution
analyze_prime_distribution(eis)
# Output confirms: all prime norms are ≡ 1 (mod 3) (except 3 itself)The verification suite checks all claimed mathematical results:
python verify_proofs.py- Hex Disk Formula —
3R² + 3R + 1counts hex lattice points within radius R - Eisenstein Norm Range — max norm in 12-bit range fits in 24 bits
- D₆ Orbit Count — 11 distinct orbits of neighbor colorings under D₆
- Triple Density Ratio — Eisenstein vs Pythagorean at multiple thresholds
- D₆ Norm Invariance — norm preserved under all 6 rotations + conjugation
- Parametric Form —
(m²−n², 2mn−n², m²−mn+n²)verified algebraically and numerically - Multiplication Closure —
N(z₁z₂) = N(z₁)·N(z₂)for random products - Laman Redundancy — convergence to 1.5× (2D) and 2.0× (3D FCC)
- FCC Nearest Neighbors — exactly 12 nearest neighbors at distance √2
## 6. Parametric Eisenstein Triple Form
✅ (m²-n², 2mn-n², m²-mn+n²) is always an Eisenstein triple (1000 trials)
Algebraic proof:
a² = m⁴ - 2m²n² + n⁴
-ab = -2m³n + m²n² + 2mn³ - n⁴
b² = 4m²n² - 4mn³ + n⁴
Sum = m⁴ - 2m³n + 3m²n² - 2mn³ + n⁴
c² = (m²-mn+n²)² = m⁴ - 2m³n + 3m²n² - 2mn³ + n⁴ ✓ QED
## 7. Eisenstein Multiplication Closure
✅ Norm multiplicativity: N(z₁z₂) = N(z₁)N(z₂) (1000 trials)
ω = e^{2πi/3} = −1/2 + i√3/2
ω² = ω̄ = −1/2 − i√3/2
ω³ = 1
1 + ω + ω² = 0
(a₁ + b₁ω)(a₂ + b₂ω) = (a₁a₂ − b₁b₂) + (a₁b₂ + b₁a₂ − b₁b₂)ω
N(a + bω) = a² − ab + b² = |a + bω|²
For m > n > 0, gcd(m, n) = 1, 3 ∤ (m − n):
a = m² − n²
b = 2mn − n²
c = m² − mn + n²
This is analogous to Euclid's formula for Pythagorean triples: (m² − n², 2mn, m² + n²).
- hex-graph-constraint — Hexagonal graph constraint theory, Laman rigidity, and ZHC algorithm
- constraint-solver-viz — Visualization tools for constraint solving
- constraint-theory-core — Core constraint solving engine
- lau-constellation — Monorepo containing all constraint theory tools
pip install -e ".[dev]"
pytestExtracted from lau-constellation. See parent repo for license information.