The elliptic model of integer indices
The polynomial never manipulates an integer index directly. It represents the index \(n\) by the five rational coordinates of the point \([n]P_0\) on an elliptic curve over \(\mathbb Q(\sqrt2)\), and this chapter proves that the representation is faithful: the canonical codes form exactly the infinite cyclic group \(2E(K_0)=\mathbb ZP_0\) (input \(\mathsf G\) of the assembly lemma), the membership polynomial recognizes exactly those codes among arbitrary rational inputs, and raw addition computes the group law on canonical codes. Beyond the classical background (two-isogeny descent, reduction modulo primes, heights and division polynomials), the one input beyond the manuscript's elementary arguments is the Mordell-Weil theorem for \(E/K_0\), which is proved from the descent index with Mathlib's height theory, so it is not a hypothesis; every finite check is isolated as its own statement.
Point codes
The field \(K_0=\mathbb Q(s)\), the curve \(E\), the base point \(P_0\) and the code of a point by five rationals, with \(\iota(n)\) the code of \([n]P_0\), are defined in the generator curve chapter, which the specification also builds on.
Sections
The field facts and the division-polynomial formulas for fixed multiples come first; then the two-isogeny descent, torsion and rank; then heights and the finite search that pins down a generator.
- The field, the curve and division polynomials
- Descent, torsion and rank
- Heights and the finite search
The generator certificate
By rank one, \(R=(1+s,2s)\) on \(C:y^2=x^3-(3-s)^2x\) is \([m]S+T\) with \(S\) a generator modulo torsion and \(m\) odd. If \(|m|\ge3\), the generator has \(x\)-height below \(\log9\), and the finite search shows that every such nontorsion point is \(\pm(R+T')\) with \(T'\) two-torsion, so has the same canonical height as \(R\), contradicting \(\widehat h(R)=m^2\widehat h(S)>0\). Hence \(2C(K_0)\) is generated by \(2R\), and the change of variables sends \(2R\) to \(P_0\).
TheoremThe generator certificate#✓
The point \(P_0\) has infinite order and $\(2E(K_0)=\mathbb ZP_0 .\)$ Consequently \(n\mapsto[n]P_0\) is an isomorphism \(\mathbb Z\to2E(K_0)=D\), the carrier \(D\) is torsion-free, and \(n\mapsto\iota(n)\) is injective.
This is Proposition 3.1. The manuscript assumes the Mordell–Weil theorem to pass from the descent index and the torsion bound to rank one; here Mordell–Weil is itself proved from the descent, so the statement has no hypothesis. That \(P_0\) has infinite order already follows from the torsion theorem.
Proof sketch. Work on \(C\) through the isomorphism \(\theta\). By the rank-one theorem, \(C(K_0)=\mathbb ZS\oplus C(K_0)[2]\) with \(S\) of infinite order; write \(R=[m]S+T\) with \(T\in C(K_0)[2]\). Then \(m\) is odd, in particular \(m\ne0\). Suppose \(|m|\ge3\). Then \(h_x(S)<\log9\), so by the search box \(x(S)\) lies in the candidate set of the finite search, and \(f(x(S))=y(S)^2\) is a square; hence \(x(S)\) is one of the seven survivors. The survivors \(0,\pm\delta\) are abscissas of two-torsion points, excluded because \(S\) has infinite order. The other four are the abscissas of \(R+T'\) for \(T'\in C(K_0)[2]\), so \(S=\pm(R+T')\) for some \(T'\) (equal abscissas force equal or opposite points), and the basic properties give \(\widehat h(S)=\widehat h(R)\). But \(\widehat h(R)=\widehat h([m]S)=m^2\widehat h(S)=m^2\widehat h(R)\) with \(m^2\ge9\) and \(\widehat h(R)>0\), a contradiction. So \(m=\pm1\), \(C(K_0)=\mathbb ZR\oplus C(K_0)[2]\) and \(2C(K_0)=\mathbb Z\,[2]R\), with \([2]R\) of infinite order. Applying \(\theta^{-1}\), which sends \([2]R\) to \(P_0\) by the certificate for \(R\), gives \(2E(K_0)=\mathbb ZP_0\) with \(P_0\) of infinite order. Injectivity of \(\iota\) follows from injectivity of codes.
theorem generator_certificate :
¬ IsOfFinAddOrder genP0 ∧ carrierD = AddSubgroup.zmultiples genP0
theorem carrierD_eq_zmultiples : carrierD = AddSubgroup.zmultiples genP0
noncomputable def indexEquivCarrier : ℤ ≃+ carrierD :=
AddEquiv.ofBijective
((zmultiplesHom genCurve.toAffine.Point genP0).codRestrict carrierD fun n =>
mem_carrierD_iff_exists_zsmul.mpr ⟨n, rfl⟩)
⟨fun a b h => zsmul_genP0_injective (congrArg Subtype.val h), fun P => by
obtain ⟨n, hn⟩ := mem_carrierD_iff_exists_zsmul.mp P.2
exact ⟨n, Subtype.ext hn⟩⟩
def genP0 : genCurve.toAffine.Point := Point.mk genP0_equation
ZInQKernel/Model/Field/Curve.lean:118
def carrierD : AddSubgroup genCurve.toAffine.Point :=
(zsmulAddGroupHom (α := genCurve.toAffine.Point) 2).range
ZInQKernel/Model/Field/Codes.lean:32
def genCurve : WeierstrassCurve K0 where
a₁ := 0
a₂ := 0
a₃ := 0
a₄ := -genD ^ 2
a₆ := 0
ZInQKernel/Hypotheses/MordellWeil.lean:34
theorem mem_carrierD_iff_exists_zsmul {P : genCurve.toAffine.Point} :
P ∈ carrierD ↔ ∃ n : ℤ, n • genP0 = P
ZInQKernel/Model/Generator/Certificate.lean:169
theorem zsmul_genP0_injective : Function.Injective fun n : ℤ => n • genP0
ZInQKernel/Model/Generator/Certificate.lean:174
Uses 15 · Used by 11 · Informal links 2
Fixed-scalar templates
The fixed-scalar templates of the specification compute fixed multiples \([n]Q\) through the normalized division polynomials; their semantics uses that the division polynomials compute multiples on \(E\).
TheoremSemantics of the fixed-scalar templates#✓
Let \(e\) be a fixed integer expression with \(n=\mathrm{val}(e)\ge1\), let \(p\) be the code of a point \(P\in2E(K_0)\) and \(r\in\mathbb Q^5\). Then $\(\mathrm{Rel}_{S_e}(p,r)\iff r\text{ is the code of }[n]P .\)$ In particular, on codes of \(2E(K_0)=\mathbb ZP_0\), \(\mathrm{Rel}_{S_e}(\iota(a),r)\iff r=\iota(na)\).
Proof sketch. By the compilation theorem the polynomial vanishes exactly when one of the two branches holds. If \(P=O\) then \(p_0=1\), the second branch fails, and the first holds exactly when \(r=O=[n]O\). If \(P\ne O\) the first branch fails since \(p_0=0\). As \(2E(K_0)=\mathbb ZP_0\) with \(P_0\) of infinite order, \([n]P\ne O\), so by the multiplication formulas \(\psi_n(P)\ne0\) and \([n]P=(x-\psi_{n+1}\psi_{n-1}/\psi_n^2,\ \psi_{2n}/(2\psi_n^4))\), where the components of \(\psi_k(P)\) are \(\Psi_{k,0},\Psi_{k,1}\) evaluated at the coordinates of \(p\). By the pair arithmetic, the inverse witness exists exactly because \(\psi_n(P)\ne0\), and the two pair equations, after division by \(\psi_n^2\ne0\) and \(2\psi_n^4\ne0\), say that \(x(r)\) and \(y(r)\) are the coordinates of \([n]P\), while \(r_0=0\) says \(r\) is affine. Clearing these denominators is reversible.
theorem scalarTemplate_rel_iff_pointCode (I : Constructors E) (hI : I.psi = psiComponent)
{n : ℤ} (hn : 1 ≤ n) {P : genCurve.toAffine.Point} (hP : P ∈ carrierD) (r : Fin 5 → ℚ) :
(scalarTemplate I n).Rel (Fin.append (pointCode P) r) ↔ r = pointCode (n • P)
theorem scalarTemplate_rel_iff_iota (I : Constructors E) (hI : I.psi = psiComponent) {n : ℤ}
(hn : 1 ≤ n) (a : ℤ) (r : Fin 5 → ℚ) :
(scalarTemplate I n).Rel (Fin.append (iota a) r) ↔ r = iota (n * a)
structure Constructors (E : Type) where
/-- The value `val(e)` of a fixed integer expression. -/
val : E → ℤ
/-- The component polynomial `Ψ_{n,c}` in the four variables `x₀, x₁, y₀, y₁`. -/
psi : ℤ → Fin 2 → MvPolynomial (Fin 4) ℤ
/-- The guard polynomial `G_T` in fifteen variables (point-major order). -/
guard : ℤ → MvPolynomial (Fin 15) ℤ
ZInQKernel/Syntax/Language/Nodes.lean:29
noncomputable def psiComponent (n : ℤ) (c : Fin 2) : MvPolynomial (Fin 4) ℤ :=
let v : ComponentRing := psiEval componentA n ⟨.X 0, .X 1⟩ ⟨.X 2, .X 3⟩
![v.re, v.im] c
ZInQKernel/Model/DivisionPolynomials/Defs.lean:124
def genCurve : WeierstrassCurve K0 where
a₁ := 0
a₂ := 0
a₃ := 0
a₄ := -genD ^ 2
a₆ := 0
ZInQKernel/Hypotheses/MordellWeil.lean:34
def carrierD : AddSubgroup genCurve.toAffine.Point :=
(zsmulAddGroupHom (α := genCurve.toAffine.Point) 2).range
ZInQKernel/Model/Field/Codes.lean:32
noncomputable def scalarTemplate (I : Constructors E) (n : ℤ) : ExPoly :=
Build.template 10 (scalarBuild I n (varPoint 0) (varPoint 5))
ZInQKernel/Syntax/Templates/Multiply.lean:53
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
noncomputable def iota (n : ℤ) : Fin 5 → ℚ := pointCode (n • genP0)
ZInQKernel/Model/Field/Codes.lean:27
Uses 7 · Used by 3
Membership and raw addition
Membership in \(2E(K_0)\), apart from the identity, is expressed by choosing a preimage with nonzero ordinate and its tangent slope. It is an all-input statement, and with the generator certificate it shows that accepted inputs are exactly the codes \(\iota(n)\), each with a unique index. The template itself is defined in the specification chapter (the membership template).
TheoremPolynomial membership in the doubled group#✓
For every \(p\in\mathbb Q^5\), $\(\mathrm{Rel}_{\mathtt{member}}(p)\iff p=\operatorname{code}(Q)\ \text{for some }Q\in2E(K_0),\)$ where \(\mathrm{Rel}_{\mathtt{member}}(p)\) means that the polynomial of the membership template vanishes at \(p\) and some rational values of its seven witnesses \(X=(X_0,X_1)\), \(Y=(Y_0,Y_1)\), \(H=(H_0,H_1)\), \(u\). This is an all-input statement: \(p\) is an arbitrary rational \(5\)-tuple, not assumed to be a code.
Explicitly, apart from the identity branch \(p=(1,0,0,0,0)\), the template asks for \(X,Y,H\in K_0\) and \(u\in\mathbb Q\) with $\(p_0=0,\quad Y^2=X^3-d^2X,\quad u\operatorname N(Y)=1,\quad 2YH=3X^2-d^2,\quad x=H^2-2X,\quad y=H(X-x)-Y,\)$ where \(x=p_1+p_2s\), \(y=p_3+p_4s\), each field equation being two rational equations (the template writes the last as \(y=H(X-(H^2-2X))-Y\), equivalent given the abscissa equation).
Proof sketch. The template polynomial is the square of the compilation of its formula, so it vanishes exactly when one branch holds. If the identity branch holds, \(p=\operatorname{code}(O)\) and \(O\in2E(K_0)\). If the doubling branch holds, \((X,Y)\in E(K_0)\), \(Y\ne0\) because \(u\operatorname N(Y)=1\), \(H=(3X^2-d^2)/(2Y)\) is the tangent slope, and \((x,y)\) is given by the doubling formula, so \(p=\operatorname{code}([2](X,Y))\). Conversely let \(Q=[2]T\). If \(Q=O\), the identity branch holds with arbitrary witnesses. Otherwise \(T=(X,Y)\) is affine with \(Y\ne0\), since a point with \(Y=0\) has \([2]T=O\): every nonidentity double has a preimage with nonzero ordinate. Take \(H\) the tangent slope and \(u=\operatorname N(Y)^{-1}\); the doubling branch holds with \(p=\operatorname{code}(Q)\).
theorem rel_member_iff (p : Fin 5 → ℚ) :
memberTemplate.Rel p ↔
∃ Q ∈ (nsmulAddMonoidHom (α := genCurve.toAffine.Point) 2).range, p = pointCode Q
noncomputable def memberTemplate : ExPoly := Build.template 5 (memberBuild (varPoint 0))
ZInQKernel/Syntax/Templates/Member.lean:38
def genCurve : WeierstrassCurve K0 where
a₁ := 0
a₂ := 0
a₃ := 0
a₄ := -genD ^ 2
a₆ := 0
ZInQKernel/Hypotheses/MordellWeil.lean:34
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
Uses 5 · Used by 2 · Informal links 1
TheoremAccepted inputs have unique indices#✓
For every \(p\in\mathbb Q^5\), $\(\mathrm{Rel}_{\mathtt{member}}(p)\iff\exists n\in\mathbb Z:\ p=\iota(n),\)$ and the integer \(n\) is then unique. In words, the canonical point codes form exactly the infinite cyclic group \(2E(K_0)=\mathbb ZP_0\), and the membership polynomial types arbitrary inputs.
Proof sketch. Combine polynomial membership with the generator certificate: \(2E(K_0)=\{[n]P_0:n\in\mathbb Z\}\), so the codes of points of \(2E(K_0)\) are exactly the \(\iota(n)\); uniqueness of \(n\) is injectivity of \(\iota\).
theorem rel_member_iff_iota (p : Fin 5 → ℚ) : memberTemplate.Rel p ↔ ∃ n : ℤ, p = iota n
theorem rel_member_iff_existsUnique_iota (p : Fin 5 → ℚ) :
memberTemplate.Rel p ↔ ∃! n : ℤ, p = iota n
noncomputable def memberTemplate : ExPoly := Build.template 5 (memberBuild (varPoint 0))
ZInQKernel/Syntax/Templates/Member.lean:38
noncomputable def iota (n : ℤ) : Fin 5 → ℚ := pointCode (n • genP0)
ZInQKernel/Model/Field/Codes.lean:27
Uses 4 · Used by 8
Raw addition has the narrower contract \(\operatorname{Add}_{\rm raw}(\iota(a),\iota(b),R)\iff R=\iota(a+b)\); its five branches are the cases of the chord-and-tangent law, and it is correct on all canonical codes. The template is defined in the specification chapter (the raw addition template).
TheoremRaw addition on canonical codes#✓
For all \(P,Q\in E(K_0)\) and every \(r\in\mathbb Q^5\), $\(\mathrm{Rel}_{\mathtt{raw\_add}}\bigl(\operatorname{code}(P),\operatorname{code}(Q),r\bigr)\iff r=\operatorname{code}(P+Q),\)$ where \(\mathrm{Rel}_{\mathtt{raw\_add}}(p,q,r)\) means that the polynomial of the raw addition template vanishes at \((p,q,r)\) and some rational values of its six witnesses (two slope pairs \(m_g,m_d\) and two inverse witnesses \(u_g,u_d\)). No assumption beyond \(P,Q\in E(K_0)\) is needed; two-torsion inputs are included.
Write \(x,y\) for the abscissa and ordinate encoded by \(p\), \(x',y'\) for those of \(q\), and \(x_r,y_r\) for those of \(r\). The five branches of the template are: (1) \(p=O\) and \(q=r\); (2) \(p_0=0\), \(q=O\) and \(p=r\); (3) \(p_0=q_0=0\), \(x=x'\), \(y=-y'\) and \(r=O\); (4) \(p_0=q_0=0\), \(u_g\operatorname N(x'-x)=1\), \((x'-x)m_g=y'-y\), \(r_0=0\), \(x_r=m_g^2-x-x'\), \(y_r=m_g(x-x_r)-y\); (5) \(p_0=q_0=0\), \(x=x'\), \(y=y'\), \(u_d\operatorname N(y)=1\), \(2ym_d=3x^2-d^2\), \(r_0=0\), \(x_r=m_d^2-x-x'\), \(y_r=m_d(x-x_r)-y\). Here \(O=(1,0,0,0,0)\).
Proof sketch. The template polynomial is the square of the compilation of its formula, so it vanishes exactly when one branch holds, the witnesses of the other branches being arbitrary. Cases. \(P=O\): branches 2-5 need \(p_0=0\), and branch 1 holds exactly when \(r=\operatorname{code}(Q)=\operatorname{code}(P+Q)\). \(P\) affine, \(Q=O\): branch 1 needs \(p_0=1\), branches 3-5 need \(q_0=0\), and branch 2 holds exactly when \(r=\operatorname{code}(P)\). Both affine: if \(x\ne x'\), branches 3 and 5 fail, branch 4 is satisfiable (\(\operatorname N(x'-x)\ne0\)), it forces \(m_g\) to be the chord slope, and then \(r\) is the code of the chord sum. If \(x=x'\) then \(y'=\pm y\) by the curve equation, and branch 4 fails. If \(y=-y'\), branch 3 holds with \(r=\operatorname{code}(O)=\operatorname{code}(P+Q)\), and branch 5 would need \(y=y'\) and \(\operatorname N(y)\ne0\), i.e. \(y=0\) and \(y\ne0\). If \(y=y'\ne0\), branch 3 fails and branch 5 forces the tangent slope and \(r=\operatorname{code}([2]P)\). In each case the forced \(r\) is the code given by the group law of \(E\), and conversely that \(r\) with the forced witnesses satisfies the branch.
theorem rel_rawAdd_iff (P Q : genCurve.toAffine.Point) (r : Fin 5 → ℚ) :
rawAddTemplate.Rel (Fin.append (Fin.append (pointCode P) (pointCode Q)) r) ↔
r = pointCode (P + Q)
def genCurve : WeierstrassCurve K0 where
a₁ := 0
a₂ := 0
a₃ := 0
a₄ := -genD ^ 2
a₆ := 0
ZInQKernel/Hypotheses/MordellWeil.lean:34
noncomputable def rawAddTemplate : ExPoly :=
Build.template 15 (rawAddBuild (varPoint 0) (varPoint 5) (varPoint 10))
ZInQKernel/Syntax/Templates/Member.lean:101
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
Uses 5 · Used by 1
TheoremRaw addition#✓
For all \(a,b\in\mathbb Z\) and every \(R\in\mathbb Q^5\), $\(\operatorname{Add}_{\rm raw}(\iota(a),\iota(b),R)\iff R=\iota(a+b),\)$ where \(\operatorname{Add}_{\rm raw}(p,q,r)\) is \(\mathrm{Rel}_{\mathtt{raw\_add}}(p,q,r)\): the polynomial of the raw addition template vanishes at \((p,q,r)\) and some rational values of its six witnesses. The branches of the template cover both identities, opposite points, distinct abscissas and doubling with nonzero ordinate. The contract concerns canonical inputs only (with \(p=(1,0,0,0,0)\) the template accepts \(R=q\) for every \(q\in\mathbb Q^5\)); every later use supplies canonical input codes.
Proof sketch. \(\iota(a)\) and \(\iota(b)\) are the codes of \([a]P_0\) and \([b]P_0\), whose sum is \([a+b]P_0\) with code \(\iota(a+b)\); apply raw addition on canonical codes. No property of \(P_0\) beyond lying on \(E\) is used.
theorem rel_rawAdd_iota (a b : ℤ) (R : Fin 5 → ℚ) :
rawAddTemplate.Rel (Fin.append (Fin.append (iota a) (iota b)) R) ↔ R = iota (a + b)
noncomputable def rawAddTemplate : ExPoly :=
Build.template 15 (rawAddBuild (varPoint 0) (varPoint 5) (varPoint 10))
ZInQKernel/Syntax/Templates/Member.lean:101
noncomputable def iota (n : ℤ) : Fin 5 → ℚ := pointCode (n • genP0)
ZInQKernel/Model/Field/Codes.lean:27
Uses 4 · Used by 7 · Informal links 1
Later chapters supply canonical codes to raw addition: multiplication first imposes membership of its three root inputs, and in the natural predicate the four untyped tuples are typed by multiplication calls before their squares are added, after which Lagrange's four-square theorem gives exactly \(\iota(\mathbb N)\). That step uses multiplication completeness (see the multiplication template); the generator certificate alone does not supply the natural predicate.
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.