The field, the curve and division polynomials
Everything takes place over \(K_0=\mathbb Q(s)\), \(s^2=2\), written in the basis \(1,s\), so that each field equation is two rational equations. A field element is nonzero exactly when its norm is, which is how one rational witness expresses every nonvanishing condition; the pair arithmetic and the inverse witnesses are set up in the specification chapter (pair arithmetic, inverse witnesses).
The field, the curve \(E:y^2=x^3-d^2x\) with \(d=75-53s\), the base point \(P_0\) and the point codes are defined in the generator curve chapter.
Codes are injective, negation flips the two ordinate coordinates, and the code of a sum of multiples of \(P_0\) is the code of the summed index.
LemmaElementary properties of codes#✓
- The map \(\operatorname{code}:E(K_0)\to\mathbb Q^5\) is injective. The first coordinate of a code is \(1\) exactly for \(O\) and \(0\) for every affine point.
- For every point \(Q\), \(\operatorname{code}(-Q)\) is \(\operatorname{code}(Q)\) with its last two coordinates negated. In particular \(\iota(0)=(1,0,0,0,0)\) and, for every \(n\in\mathbb Z\), \(\iota(-n)\) is \(\iota(n)\) with its last two coordinates negated.
- \(\iota(1)=\bigl(0,\tfrac{1641}{8},-145,-\tfrac{15465}{4},\tfrac{87483}{32}\bigr)\).
- For all \(a,b\in\mathbb Z\), \(\iota(a)\) and \(\iota(b)\) are codes of the points \([a]P_0\) and \([b]P_0\), whose sum \([a+b]P_0\) has code \(\iota(a+b)\).
Proof sketch. (1) The components of an element of \(K_0\) determine it, so the code determines \(x\) and \(y\); the first coordinate separates \(O\) from affine points. (2) \(-(x,y)=(x,-y)\) and \(-O=O\). (3) Read off the coordinates of \(P_0\): \(1160/8=145\) and \(123720/32=15465/4\). (4) \([a]P_0+[b]P_0=[a+b]P_0\) in the group \(E(K_0)\).
theorem pointCode_injective : Function.Injective pointCode
theorem iota_add (a b : ℤ) : pointCode (a • genP0 + b • genP0) = iota (a + b)
def pointCode : genCurve.toAffine.Point → Fin 5 → ℚ
| .zero => ![1, 0, 0, 0, 0]
| .some x y _ => ![0, x.re, x.im, y.re, y.im]
ZInQKernel/Model/Field/Codes.lean:22
def genP0 : genCurve.toAffine.Point := Point.mk genP0_equation
ZInQKernel/Model/Field/Curve.lean:118
noncomputable def iota (n : ℤ) : Fin 5 → ℚ := pointCode (n • genP0)
ZInQKernel/Model/Field/Codes.lean:27
Uses 1 · Used by 13
Division polynomials
Fixed multiples \([n]Q\), for fixed integers \(n\) that may have millions of digits, are expressed by the normalized division polynomials of the specification (their definition). The specification chapter states their classical multiplication formulas as a proposition (the multiplication-by-n formulas). Here the proposition is proved as a background theorem; it gives the semantics of the fixed-scalar templates (fixed-scalar semantics) and, with the nonzero multiples of the generator, the fixed point codes \(\iota(n)\) (fixed point codes by division polynomials). The recursion is only ever used symbolically. The proof goes through Jacobian coordinates: the triples \((\phi_n,\omega_n,\psi_n)\) satisfy exact doubling and adding identities, first at the generic point of the curve, where no division polynomial vanishes, and an induction on \(n\) shows that these triples represent the multiples \([n]P\).
TheoremDivision polynomials compute multiples#✓
The multiplication-by-\(n\) formulas hold for \(E\) over \(K_0\): for every affine point \(P=(x,y)\in E(K_0)\) and every integer \(n\ne0\),
- \([n]P=O\) if and only if \(\psi_n(P)=0\);
- if \([n]P\ne O\), then $\(x([n]P)=x-\frac{\psi_{n+1}(P)\,\psi_{n-1}(P)}{\psi_n(P)^2},\qquad y([n]P)=\frac{\psi_{2n}(P)}{2\,\psi_n(P)^4},\)$
where \(\psi_k\) are the normalized division polynomials of \(y^2=x^3+Ax\) with \(A=-d^2=-11243+7950s\). More generally the same holds for \(y^2=x^3+Ax\) over any field of characteristic zero with \(A\ne0\).
Proof sketch. This is the classical theorem (Sutherland, Lecture 5, Lemmas 5.20 and 5.24 and Theorem 5.21; Silverman, Exercise 3.7). A route through Jacobian coordinates avoids divisors and handles the identity uniformly. Represent points of \(E\) by nonzero triples \((X,Y,Z)\) with \(Y^2=X^3+AXZ^4\), up to the weighted scaling \(u\cdot(X,Y,Z)=(u^2X,u^3Y,uZ)\) with \(u\ne0\): the triple represents the affine point \((X/Z^2,Y/Z^3)\) if \(Z\ne0\) and \(O\) if \(Z=0\). The Jacobian doubling formula sends a representative of \(Q\) to a representative of \([2]Q\), for every \(Q\), and the Jacobian addition formula sends representatives of two distinct points \(Q_1\ne Q_2\) to a representative of \(Q_1+Q_2\) (including the cases where one of them is \(O\) or \(Q_1=-Q_2\)).
Fix an affine \(P=(x,y)\), put \(\phi_n=x\psi_n^2-\psi_{n+1}\psi_{n-1}\) and \(\omega_n=\psi_{2n}/(2\psi_n)\) (a polynomial in \(x,y\)), and write \(J_n(P)=(\phi_n(P),\omega_n(P),\psi_n(P))\). The doubling and adding identities \(\mathrm{dbl}(J_k)=J_{2k}\) and \(\mathrm{add}(J_{k+1},J_k)=(-1)\cdot J_{2k+1}\) (\(k\ge1\)) hold at every point of the curve: at the generic point of \(y^2=x^3+Ax\), in the function field, no \(\psi_n\) with \(n\ne0\) vanishes, so there the abscissas of the multiples can be computed by strong induction from the recurrences of \(\psi\) (the duplication formula for \(n=2m\), the chord through \([m+1]P\) and \([m]P\) for \(n=2m+1\)), which gives the identities in the coordinate ring; evaluating at \(P\) gives them at \(P\). Claim: for every \(n\ge1\), \(J_n(P)\) is a representative of \([n]P\) (in particular a nonzero triple). Strong induction on \(n\):
- \(n=1\): \(\phi_1=x\), \(\omega_1=y\), \(\psi_1=1\).
- \(n=2k\), \(k\ge1\): \(J_k(P)\) represents \([k]P\), so its double represents \([2k]P\), and the double of \(J_k\) is \(J_{2k}\).
- \(n=2k+1\), \(k\ge1\): \(J_{k+1}(P)\) and \(J_k(P)\) represent \([k+1]P\) and \([k]P\), which are distinct because their difference is \(P\ne O\); so their sum \(\mathrm{add}(J_{k+1},J_k)(P)=(-1)\cdot J_{2k+1}(P)\) represents \([2k+1]P\), and so does \(J_{2k+1}(P)\).
Reading off the third coordinate gives part 1 for \(n\ge1\). If \(\psi_n(P)\ne0\), then \([n]P=(\phi_n/\psi_n^2,\ \omega_n/\psi_n^3)\) evaluated at \(P\), and \(\phi_n/\psi_n^2=x-\psi_{n+1}\psi_{n-1}/\psi_n^2\), \(\omega_n/\psi_n^3=2\psi_n\omega_n/(2\psi_n^4)=\psi_{2n}/(2\psi_n^4)\): part 2. Negative \(n\) follow from \(\psi_{-n}=-\psi_n\) (so \(\psi_{-n\pm1}=-\psi_{n\mp1}\) and \(\psi_{-2n}=-\psi_{2n}\)) and \([-n]P=-[n]P=(x([n]P),-y([n]P))\).
theorem mulByN_formulas : DivisionPolynomialMultiplication
def DivisionPolynomialMultiplication : Prop :=
∀ (x y : K0) (h : genCurve.toAffine.Nonsingular x y) (n : ℤ), n ≠ 0 →
(n • Affine.Point.some x y h = 0 ↔ psiEval genA n x y = 0) ∧
(n • Affine.Point.some x y h ≠ 0 →
∃ h' : genCurve.toAffine.Nonsingular
(x - psiEval genA (n + 1) x y * psiEval genA (n - 1) x y / psiEval genA n x y ^ 2)
(psiEval genA (2 * n) x y / (2 * psiEval genA n x y ^ 4)),
n • Affine.Point.some x y h = Affine.Point.some _ _ h')
ZInQKernel/Model/DivisionPolynomials/MulByN.lean:29
Arithmetic of \(\mathbb Z[\sqrt2]\)
The descent uses unique factorization in \(\mathbb Z[s]\), its units \(\pm(1+s)^k\), and the two special primes: \((s)\) above \(2\) and \((d)=(\delta)\) above \(7\).
Instance\(\mathbb Z[\sqrt2]\) is a principal ideal domain#✓
The ring \(\mathbb Z[s]\) is a principal ideal domain (the ring of integers of \(K_0\) has class number one). Consequently it is a unique factorization domain with fraction field \(K_0\): every \(x\in K_0^\times\) is \(x=u\prod_\pi\pi^{v_\pi(x)}\) with \(u\in\mathbb Z[s]^\times\), \(\pi\) running over a set of representatives of the prime elements up to units, and integers \(v_\pi(x)\), almost all zero, uniquely determined by \(x\). The valuations satisfy \(v_\pi(xy)=v_\pi(x)+v_\pi(y)\) and \(v_\pi(x+y)\ge\min(v_\pi(x),v_\pi(y))\), with equality when the two valuations differ.
Proof sketch. The manuscript's route: \(K_0\) has discriminant \(8\) and the Minkowski bound is \(\frac{2!}{2^2}\sqrt8=\sqrt2<2\), so every ideal class contains an integral ideal of norm \(1\), i.e. the unit ideal. An elementary route better suited to formalization: \(\mathbb Z[s]\) is Euclidean for \(|\operatorname N|\). Given \(a,b\in\mathbb Z[s]\), \(b\ne0\), write \(a/b=u+vs\) and let \(q=\lfloor u\rceil+\lfloor v\rceil s\) with nearest integers; then \(|\operatorname N(a/b-q)|\le\max(\tfrac14,\tfrac24)<1\), so \(a=qb+\rho\) with \(|\operatorname N(\rho)|<|\operatorname N(b)|\). Unique factorization and the valuation rules follow from the principal ideal property in the usual way.
instance Zs.isPrincipalIdealRing : IsPrincipalIdealRing Zs := inferInstance
instance Zs.uniqueFactorizationMonoid : UniqueFactorizationMonoid Zs := inferInstance
abbrev Zs : Type := QuadraticAlgebra ℤ 2 0
ZInQKernel/Model/Field/Basic.lean:148
Uses 2 · Used by 7
TheoremUnits of \(\mathbb Z[\sqrt2]\)#✓
- \(\mathbb Z[s]^\times=\{\pm\epsilon^k:k\in\mathbb Z\}\) with \(\epsilon=1+s\), and \(\epsilon^{-1}=s-1\), \(\operatorname N(\epsilon)=-1\).
- The unit squareclasses \(\mathbb Z[s]^\times/(\mathbb Z[s]^\times)^2\) are exactly the four classes of \(1,-1,\epsilon,-\epsilon\), whose sign vectors are \((+,+)\), \((-,-)\), \((+,-)\) and \((-,+)\) respectively.
- Every totally positive unit is the square of a unit.
Proof sketch. (1) \((1+s)(s-1)=1\). If \(u\) is a unit, replace it by \(\pm u\) so that \(\sigma_+(u)>0\), and choose \(k\) with \(1\le\sigma_+(u\epsilon^{-k})<1+\sqrt2\). A unit \(w=a+bs\) with \(1\le\sigma_+(w)<1+\sqrt2\) has \(|\sigma_-(w)|=1/\sigma_+(w)\le1\), so \(2a=\sigma_+(w)+\sigma_-(w)\in[0,2+\sqrt2)\) and \(2b\sqrt2=\sigma_+(w)-\sigma_-(w)\in[0,2+\sqrt2)\). Hence \(a,b\in\{0,1\}\); of \(0,1,s,1+s\) only \(1\) and \(1+s\) are units, and \(\sigma_+(1+s)=1+\sqrt2\) is excluded, so \(w=1\) and \(u=\pm\epsilon^k\). (2) By (1) the quotient is generated by \(-1\) and \(\epsilon\); \(\sigma_+(\epsilon)=1+\sqrt2>0>1-\sqrt2=\sigma_-(\epsilon)\), so the four sign vectors differ, and squares of units are totally positive, so the four classes are distinct. (3) A totally positive unit has sign vector \((+,+)\), so lies in the class of \(1\).
theorem Zs_unit_sqClass (u : Zsˣ) :
∃ w : Zsˣ, u = w ^ 2 ∨ u = -w ^ 2 ∨ u = epsUnit * w ^ 2 ∨ u = -(epsUnit * w ^ 2)
theorem isSquare_of_totallyPositive_unit (u : Zsˣ) (h : TotallyPositive (Zs.toK0 (u : Zs))) :
∃ w : Zsˣ, u = w ^ 2
abbrev Zs : Type := QuadraticAlgebra ℤ 2 0
ZInQKernel/Model/Field/Basic.lean:148
def epsUnit : Zsˣ where
val := epsilonZ
inv := ⟨-1, 1⟩
val_inv := by ext <;> simp [epsilonZ]
inv_val := by ext <;> simp [epsilonZ]
ZInQKernel/Model/Field/Units.lean:20
def TotallyPositive (z : K0) : Prop := 0 < embPlus z ∧ 0 < embMinus z
ZInQKernel/Model/Field/Basic.lean:103
noncomputable abbrev Zs.toK0 : Zs →+* K0 := algebraMap Zs K0
ZInQKernel/Model/Field/Basic.lean:162
Uses 2 · Used by 3
LemmaResidue computations modulo seven#✓
The following closed statements about integers modulo \(7\) hold:
- \(3^2\equiv2\pmod 7\);
- \(75-53\cdot3=-84\equiv0\pmod7\), and \(3-3=0\);
- for every \(t\in\mathbb Z/7\mathbb Z\), \(t^2\ne-1\) (the squares modulo \(7\) are \(0,1,2,4\)).
They say that \(s\mapsto3\) defines a ring homomorphism \(\mathbb Z[s]\to\mathbb F_7\) killing \(d\) and \(\delta\), and that \(-1\) is not a square in \(\mathbb F_7\). This is a finite computation.
Proof sketch. Direct evaluation; the third item is a check of the seven residues.
theorem residues_mod_seven :
(3 : ZMod 7) ^ 2 = 2 ∧ (75 - 53 * 3 : ℤ) = -84 ∧ (75 - 53 * 3 : ZMod 7) = 0 ∧
(3 - 3 : ZMod 7) = 0 ∧ ∀ t : ZMod 7, t ^ 2 ≠ -1
theorem not_isSquare_neg_one_zmod_seven : ¬ IsSquare (-1 : ZMod 7)
Used by 1
LemmaThe primes \((s)\) and \((d)\) of \(\mathbb Z[\sqrt2]\)#✓
- \(s\) is a prime element of \(\mathbb Z[s]\), \(2=s^2\), and \(\mathbb Z[s]/(s)\cong\mathbb F_2\) via \(a_0+a_1s\mapsto a_0\bmod2\). For \(c_0,c_1\in\mathbb Q\) not both zero, $\(v_s(c_0+c_1s)=\min\bigl(2v_2(c_0),\ 2v_2(c_1)+1\bigr),\)$ with \(v_2\) the \(2\)-adic valuation on \(\mathbb Q\) and \(v_2(0)=+\infty\).
- \(d=75-53s\) is a prime element with \(\operatorname N(d)=7\), and \(\mathbb Z[s]/(d)\cong\mathbb F_7\) via \(a_0+a_1s\mapsto a_0+3a_1\bmod7\). In this residue field \(-1\) is not a square.
- \(\delta=3-s=\epsilon^4d\) with \(\epsilon^4=17+12s\), so \(\delta\) and \(d\) are associates and \(v_d=v_\delta\). Moreover \(v_s(d)=v_s(\delta)=v_s(\epsilon)=0\), \(v_d(s)=v_d(2)=0\), and \(d\) is totally positive (\(\sigma_\pm(d)=75\mp53\sqrt2>0\)), as is \(\delta\).
Proof sketch. An element whose norm is \(\pm\) a rational prime is irreducible, hence prime in the principal ideal domain \(\mathbb Z[s]\); \(\operatorname N(s)=-2\), \(\operatorname N(d)=7\). The residue maps are ring homomorphisms by the residue computations modulo seven (and \(s^2=2\equiv0\) modulo \(2\)), surjective, with kernels \((s)\) and \((d)\) since the quotients have \(|\operatorname N|\) elements. For the formula in (1), \(v_s\) of a rational \(c\) is \(2v_2(c)\) and of \(cs\) is \(2v_2(c)+1\); the two values have different parity, so the valuation of the sum is their minimum. (3) is the identity \((75-53s)(17+12s)=3-s\), and \(75^2=5625>5618=2\cdot53^2\).
theorem prime_sqrt2Z : Prime sqrt2Z
theorem prime_genDZ : Prime genDZ
theorem vS_formula_withTop {c₀ c₁ : ℚ} (h : c₀ ≠ 0 ∨ c₁ ≠ 0) :
((vp sqrt2Z ⟨c₀, c₁⟩ : ℤ) : WithTop ℤ) = min (2 * v2Top c₀) (2 * v2Top c₁ + 1)
def sqrt2Z : Zs := ⟨0, 1⟩
ZInQKernel/Model/Field/Basic.lean:177
def genDZ : Zs := ⟨75, -53⟩
ZInQKernel/Model/Field/Basic.lean:179
noncomputable def vp (π : Zs) (z : K0) : ℤ :=
if hπ : Prime π then -log ((primeSpec π hπ).valuation K0 z) else 0
ZInQKernel/Model/Field/Valuation.lean:28
noncomputable def v2Top (c : ℚ) : WithTop ℤ := if c = 0 then ⊤ else ((padicValRat 2 c : ℤ) : WithTop ℤ)
ZInQKernel/Model/Field/SpecialPrimes.lean:140
Uses 4 · Used by 14
LemmaA dyadic valuation computation#✓
- Let \(A,B\in\mathbb Q\) with \(v_2(A)=0\) and \(v_2(B)\ge0\) (so \(A+Bs\) is a unit at the prime \((s)\)). Then \(v_s\bigl((A+Bs)^2+1\bigr)=2\) if \(v_2(B)\ge1\), and \(=3\) if \(v_2(B)=0\).
- Consequently, for \(a,b\in\mathbb Z[s]\) with \(s\nmid a\) and \(s\nmid b\), $\(v_s\bigl(a^2+\delta^2b^2\bigr)\in\{2,3\}.\)$
Proof sketch. (1) \((A+Bs)^2+1=(A^2+2B^2+1)+2ABs\). A \(2\)-adic unit has \(A^2\equiv1\pmod 8\). If \(B\) is even, the rational part is \(\equiv2\pmod8\), of \(2\)-adic valuation \(1\), while \(v_2(2AB)\ge2\); by the valuation formula at \((s)\) the valuation is \(\min(2,\ge5)=2\). If \(B\) is a \(2\)-adic unit, the rational part is \(\equiv4\pmod8\) (valuation \(2\)) and \(v_2(2AB)=1\), giving \(\min(4,3)=3\). (2) \(\delta b\) is prime to \(s\) since \(v_s(\delta)=0\). Put \(w=a/(\delta b)=a\,\overline{\delta b}/\operatorname N(\delta b)\); here \(\operatorname N(\delta b)\) is odd and \(a\,\overline{\delta b}\in\mathbb Z[s]\) is prime to \(s\), so its rational component is odd. Hence \(w=A+Bs\) as in (1), and \(a^2+\delta^2b^2=(\delta b)^2(w^2+1)\) with \(v_s((\delta b)^2)=0\).
theorem vS_sq_add_one (A B : ℚ) (hA : A ≠ 0) (hA2 : padicValRat 2 A = 0)
(hB : B = 0 ∨ 0 ≤ padicValRat 2 B) :
((B = 0 ∨ 1 ≤ padicValRat 2 B) → vp sqrt2Z ((⟨A, B⟩ : K0) ^ 2 + 1) = 2) ∧
((B ≠ 0 ∧ padicValRat 2 B = 0) → vp sqrt2Z ((⟨A, B⟩ : K0) ^ 2 + 1) = 3)
theorem val_s_sq_add_delta_sq {a b : Zs} (ha : ¬ sqrt2Z ∣ a) (hb : ¬ sqrt2Z ∣ b) :
vp sqrt2Z (Zs.toK0 (a ^ 2 + deltaZ ^ 2 * b ^ 2)) = 2 ∨
vp sqrt2Z (Zs.toK0 (a ^ 2 + deltaZ ^ 2 * b ^ 2)) = 3
noncomputable def vp (π : Zs) (z : K0) : ℤ :=
if hπ : Prime π then -log ((primeSpec π hπ).valuation K0 z) else 0
ZInQKernel/Model/Field/Valuation.lean:28
def sqrt2Z : Zs := ⟨0, 1⟩
ZInQKernel/Model/Field/Basic.lean:177
abbrev K0 : Type := QuadraticAlgebra ℚ 2 0
ZInQKernel/Hypotheses/MordellWeil.lean:25
abbrev Zs : Type := QuadraticAlgebra ℤ 2 0
ZInQKernel/Model/Field/Basic.lean:148
noncomputable abbrev Zs.toK0 : Zs →+* K0 := algebraMap Zs K0
ZInQKernel/Model/Field/Basic.lean:162
def deltaZ : Zs := ⟨3, -1⟩
ZInQKernel/Model/Field/Basic.lean:183
Uses 1 · Used by 1
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.