import Mathlib.Data.ZMod.Basic/-!# Round 11: local cube conditions behind Theorems D and D2Write elements of `(ℤ/9)[s]/(s² - C)` as pairs `(a, b) ↔ a + b s`. Then `(x + y s)³ = (x³ + 3Cxy²) + (3x²y + Cy³) s`.* Theorem D (3 inert, `C ≡ 2` or `5 (mod 9)`): for the exponents in the theorem, `B² + Y s` is a cube mod 9 forevery `B` whose norm `B⁴ - CY²` is `±1` mod 9 (the norm of thesolution element is `±Z³` with `3 ∤ Z`). Since 3 is unramified, a unit is a 3-adic cube iff it is a cube mod 9.* Theorem D2 (2 inert, `C ≡ 5 (mod 8)`): in `𝔽₄ = 𝔽₂[ω]/(ω² + ω + 1)` the only nonzero cube is `1`.-/namespace BealUnitLocal/-- `C ≡ 2 (mod 9)`, `n ≡ 5 (mod 12)`: `Y ≡ C² = 4`. -/theorem cube_C2_Y4 : ∀ B : ZMod 9, (B ^ 4 - 2 * 4 ^ 2 = 1 ∨ B ^ 4 - 2 * 4 ^ 2 = -1) → ∃ x y : ZMod 9,x ^ 3 + 3 * 2 * x * y ^ 2 = B ^ 2 ∧ 3 * x ^ 2 * y + 2 * y ^ 3 = 4 := bydecide/-- `C ≡ 2 (mod 9)`, `n ≡ 11 (mod 12)`: `Y ≡ C⁵ ≡ 5`. -/theorem cube_C2_Y5 : ∀ B : ZMod 9, (B ^ 4 - 2 * 5 ^ 2 = 1 ∨ B ^ 4 - 2 * 5 ^ 2 = -1) → ∃ x y : ZMod 9,x ^ 3 + 3 * 2 * x * y ^ 2 = B ^ 2 ∧ 3 * x ^ 2 * y + 2 * y ^ 3 = 5 := bydecide/-- `C ≡ 5 (mod 9)`, `n ≡ 1 (mod 12)`: `Y ≡ 1`. -/theorem cube_C5_Y1 : ∀ B : ZMod 9, (B ^ 4 - 5 * 1 ^ 2 = 1 ∨ B ^ 4 - 5 * 1 ^ 2 = -1) → ∃ x y : ZMod 9,x ^ 3 + 3 * 5 * x * y ^ 2 = B ^ 2 ∧ 3 * x ^ 2 * y + 5 * y ^ 3 = 1 := bydecide/-- `C ≡ 5 (mod 9)`, `n ≡ 7 (mod 12)`: `Y ≡ C³ ≡ 8`. -/theorem cube_C5_Y8 : ∀ B : ZMod 9, (B ^ 4 - 5 * 8 ^ 2 = 1 ∨ B ^ 4 - 5 * 8 ^ 2 = -1) → ∃ x y : ZMod 9,x ^ 3 + 3 * 5 * x * y ^ 2 = B ^ 2 ∧ 3 * x ^ 2 * y + 5 * y ^ 3 = 8 := bydecide/-- In `𝔽₄`, represented as `a + b ω` with `ω² = ω + 1` over `𝔽₂`, the cube of every nonzero element is `1`:`(a + bω)³ = 1`. Coordinates of `(a + bω)²` are `(a² + b², b² + 2ab)`, then multiply once more. -/theorem f4_cubes_trivial : ∀ a b : ZMod 2, (a, b) ≠ (0, 0) →let s0 := a ^ 2 + b ^ 2let s1 := b ^ 2 + 2 * a * b(a * s0 + b * s1, a * s1 + b * s0 + b * s1) = (1, 0) := bydecideend BealUnitLocal#print axioms BealUnitLocal.cube_C2_Y4#print axioms BealUnitLocal.f4_cubes_trivial