Miller functions and the Tate–Lichtenbaum pairing on a Weierstrass curve
DefinitionRank2Sha_TatePairingLet be a Weierstrass curve over a field , , and a point of with . For points let be the line through and (the tangent if , the vertical line if ), and let be the vertical line through , with . The Miller function
has divisor . Each factor has the form or , so has leading coefficient at with respect to the uniformiser . All zeros and poles of the factors lie in the subgroup .
For points the file defines
with read as . The point is admissible for if and , or and .
Let with odd and . For admissible , this value represents the Tate–Lichtenbaum pairing
at , evaluated on the divisor , or on when . Two admissible choices of give values whose quotient is an -th power: for by Weil reciprocity, and for because is normalised at up to sign and is an -th power.
Formalization Note The group law is that of Mathlib's WeierstrassCurve.Affine.Point, and the slope of a line is WeierstrassCurve.Affine.slope. The functions are evaluated at points through these explicit formulas; no function field or divisor is formalized. The statements of the last paragraph are not proved in this file.
import Mathlib.AlgebraicGeometry.EllipticCurve.Affine.Point
/-!
# Miller functions and the Tate–Lichtenbaum pairing
Let `W` be a Weierstrass curve over a field `F`, `n ≥ 1`, and `A` a point of `W` with
`n • A = 0`. For points `B, C` let `ℓ_{B,C}` be the line through `B` and `C` (the tangent
when `B = C`, the vertical line when `B = -C`, the vertical line through the other point
when one of them is `0`), and let `v_C` be the vertical line through `C`, with `v_0 = 1`.
The Miller function
f_{n,A} = ∏_{i=1}^{n-1} ℓ_{iA, A} / v_{(i+1)A}
has divisor `n (A) - n (0)`. Every factor is `y - λx - c` or `x - c`, so with respect to
the uniformiser `-x/y` at `0` each factor, and `f_{n,A}`, has leading coefficient `±1`.
All zeros and poles of the factors lie in the subgroup `⟨A⟩` generated by `A`.
For points `Q, R` this file defines
tatePairingWith n A Q R = f_{n,A}(Q + R) / f_{n,A}(R),
with the value of `f_{n,A}` at `0` read as `1`. Call `R` admissible for `(A, Q)` if
`R = 0` and `Q ∉ ⟨A⟩`, or `R ∉ ⟨A⟩` and `Q + R ∉ ⟨A⟩`; then every value used is a value of
each factor at a point outside its zeros and poles.
Let `F = 𝔽_q` with `n ∣ q - 1`, `n` odd. For admissible `R`, `tatePairingWith n A Q R` is a
representative in `𝔽_q^×` of the Tate–Lichtenbaum pairing
τ_n : W(𝔽_q)[n] × W(𝔽_q)/n W(𝔽_q) → 𝔽_q^× / (𝔽_q^×)^n
at `(A, Q)`, evaluated on the divisor `(Q + R) - (R)` (on `(Q) - (0)` when `R = 0`).
Two admissible `R` give values whose quotient is an `n`-th power: for `R ≠ 0` by Weil
reciprocity, and for `R = 0` because `f_{n,A}` is normalised at `0` up to sign and `-1` is
an `n`-th power. These facts are not proved in this file.
**Formalization Note** The group law is the one of `WeierstrassCurve.Affine.Point`. The
functions are evaluated at points through their explicit formulas; no function field is
used.
-/
namespace Rank2Sha
open WeierstrassCurve WeierstrassCurve.Affine
variable {F : Type*} [Field F] [DecidableEq F] {W : WeierstrassCurve.Affine F}
/-- The value at `S` of the line `ℓ_{A,B}` through `A` and `B`: `y - (λ (x - x_A) + y_A)` with
`λ` the slope of `WeierstrassCurve.Affine.slope` (the tangent when `A = B`), `x - x_A` when
`A = -B`, and the vertical line through the nonzero point when the other is `0`. The value
at `S = 0` is `1`. -/
def lineValue : W.Point → W.Point → W.Point → F
| _, _, .zero => 1
| .zero, .zero, _ => 1
| .zero, .some x₂ _ _, .some x _ _ => x - x₂
| .some x₁ _ _, .zero, .some x _ _ => x - x₁
| .some x₁ y₁ _, .some x₂ y₂ _, .some x y _ =>
if x₁ = x₂ ∧ y₁ = W.negY x₂ y₂ then x - x₁ else y - (W.slope x₁ x₂ y₁ y₂ * (x - x₁) + y₁)
/-- The value `x_S - x_C` at `S` of the vertical line `v_C` through `C`; `1` if `C = 0` or
`S = 0`. -/
def verticalValue : W.Point → W.Point → F
| .zero, _ => 1
| _, .zero => 1
| .some x₁ _ _, .some x _ _ => x - x₁
/-- `millerAux A S m = ((m + 1) • A, f_{m+1,A}(S))`, by `f_{1,A} = 1` and
`f_{i+1,A} = f_{i,A} · ℓ_{iA,A} / v_{(i+1)A}`. -/
def millerAux (A S : W.Point) : ℕ → W.Point × F
| 0 => (A, 1)
| m + 1 =>
let Bf := millerAux A S m
(Bf.1 + A, Bf.2 * lineValue Bf.1 A S / verticalValue (Bf.1 + A) S)
/-- The value `f_{n,A}(S)` of the Miller function `f_{n,A} = ∏_{i=1}^{n-1} ℓ_{iA,A} / v_{(i+1)A}`,
whose divisor is `n (A) - (nA) - (n - 1) (0)`; the value at `S = 0` is `1`. -/
def millerValue (n : ℕ) (A S : W.Point) : F := (millerAux A S (n - 1)).2
/-- `R` is an admissible auxiliary point for evaluating the pairing at `(A, Q)`: either `R = 0`
and `Q ∉ ⟨A⟩`, or `R ∉ ⟨A⟩` and `Q + R ∉ ⟨A⟩`, where `⟨A⟩ = {i • A : i < n}` when `n • A = 0`. -/
def IsAdmissibleAuxiliary (n : ℕ) (A Q R : W.Point) : Prop :=
(R = 0 ∨ ∀ i < n, R ≠ i • A) ∧ ∀ i < n, Q + R ≠ i • A
instance (n : ℕ) (A Q R : W.Point) : Decidable (IsAdmissibleAuxiliary n A Q R) := by
unfold IsAdmissibleAuxiliary; infer_instance
/-- `f_{n,A}(Q + R) / f_{n,A}(R)`: for `F = 𝔽_q`, `n ∣ q - 1` odd, `n • A = 0` and `R`
admissible, a representative of the Tate–Lichtenbaum pairing `τ_n(A, Q)` in
`𝔽_q^× / (𝔽_q^×)^n`. -/
def tatePairingWith (n : ℕ) (A Q R : W.Point) : F :=
millerValue n A (Q + R) / millerValue n A R
end Rank2Sha