Path: blob/main/foundations/06-elliptic-curves/sage/06b-point-addition-geometry.ipynb
483 views
Notebook 06b: Point Addition, The Geometry
Module 06. Elliptic Curves
Motivating Question. We know that an elliptic curve is a set of points satisfying . But a set of points is not a group until we define an operation. How do we "add" two points on a curve? The answer is a beautiful geometric construction: draw a line, find the third intersection, reflect. This chord-and-tangent rule turns the curve into an abelian group, the engine behind elliptic curve cryptography.
Prerequisites. You should be comfortable with:
Elliptic curves over the reals and the Weierstrass equation (Notebook 06a)
The point at infinity and point negation (Notebook 06a)
Group axioms: closure, associativity, identity, inverses (Module 01)
Learning objectives. By the end of this notebook you will be able to:
Describe the chord-and-tangent construction for adding two points.
Handle all special cases: distinct points, doubling, vertical lines, identity.
Derive the algebraic formulas for point addition and doubling.
Verify the group axioms computationally.
Visualise the addition operation step by step.
1. The Big Idea: Line, Intersect, Reflect
In Notebook 06a we saw that a line generically meets an elliptic curve in three points (by Bézout's theorem). This gives us a recipe for addition:
To compute :
Draw the line through and .
Find the third intersection point of with the curve.
Reflect across the -axis: .
That's it! The reflection step is what makes the operation a group law (it ensures is the identity).
| Step | Geometric action | Algebraic result |
|---|---|---|
| 1 | Draw line through | Compute slope |
| 2 | Find third intersection | Solve cubic for |
| 3 | Reflect over -axis | Negate |
Checkpoint 1. In the plot above, trace the three steps: (1) the red dashed line passes through and , (2) it hits the curve a third time at , and (3) reflecting across the -axis gives . Why is the reflection step necessary? (Hint: without it, the operation would not have as identity.)
2. The Algebraic Formulas
Let and let , be points on with .
Case 1: (chord)
The slope of the line through and is:
Case 2: (tangent / point doubling)
We use implicit differentiation on to get the tangent slope:
(This requires ; if then the tangent is vertical and .)
In both cases:
The result is .
| Slope | Then | |
|---|---|---|
| , | ||
| Same formulas for (with ) |
Misconception alert. "Point addition on elliptic curves is the same as adding coordinates." Absolutely not! . The elliptic curve group law is a geometric operation defined by line intersections, which happens to produce algebraic formulas involving the curve equation.
3. Point Doubling ()
When , there is no "line through two distinct points", instead, we take the tangent line to the curve at . This tangent generically meets the curve in one more point (with multiplicity), which we reflect to get .
Checkpoint 2. In the doubling formula, the slope is . What happens when ? Geometrically, the tangent at a point with is vertical, the line goes to , so . Such points have order 2 in the group.
4. All the Special Cases
The chord-and-tangent rule has several special cases that we must handle:
| Case | Geometric situation | Result |
|---|---|---|
| plus identity | ||
| Vertical line through and | ||
| () | Secant line through | Use chord formula |
| () | Tangent line at | Use doubling formula |
| () | Vertical tangent |
5. Verifying the Group Axioms
For the elliptic curve points to form a group under , we need:
Closure: If , then .
Identity: for all .
Inverses: For each , there exists with .
Associativity: for all .
Closure, identity, and inverses are clear from the construction. Associativity is the hard part, the algebraic proof is tedious, so let us verify it computationally.
6. Building a Sequence:
Just as we computed in (Module 05), we can compute repeated additions on an elliptic curve. If generates a cyclic subgroup of order , then and the sequence cycles back.
Bridge from Module 01. In Module 01, the "power table" of a generator in listed . Here we build the analogous "multiple table" for a point in : . The notation is additive instead of multiplicative, but the structure is identical.
Notice how the multiples of appear to "scatter" across the finite field, there is no visible pattern. This is the elliptic curve analogue of the "scramble" we saw with discrete exponentiation in Module 05. Given , recovering is the Elliptic Curve Discrete Logarithm Problem (ECDLP).
Crypto foreshadowing. The ECDLP, given and , find , is believed to be even harder than the classical DLP in . The best known attack is Pollard's rho, which runs in time with no sub-exponential shortcuts. This is why 256-bit EC keys provide 128-bit security.
7. Derivation of the Addition Formulas (Optional)
For those who want to see why the formulas work, here is the derivation.
Setup: Let and with . The line through them is where and .
Substituting into :
This cubic has three roots: . By Vieta's formulas, the sum of roots equals the coefficient of (with sign):
Then (evaluating the line at and negating for the reflection).
Checkpoint 3. Why do we use Vieta's formulas instead of solving the cubic directly? Because Vieta's gives us using only addition and subtraction of the known roots , no need for the cubic formula or numerical methods. This is what makes the group law computationally efficient.
8. Exercises
Exercise 1 (Worked): Manual Point Addition
Problem. On over , compute where and .
Solution.
Step 1: Compute the slope.
Step 2: Compute .
Step 3: Compute .
So .
Exercise 2 (Guided): Point Doubling by Hand
Problem. On over , compute where .
Steps:
Compute with .
Compute .
Compute .
Verify with SageMath.
Exercise 3 (Independent): Exploring the Group Structure
Problem.
On over , start with and compute . At what point does ? (This is the order of .)
The point has order 2 (since ). Find for and . Is there a pattern?
Verify associativity for three specific points of your choice on .
Summary
| Concept | Key Fact |
|---|---|
| Addition rule | Draw line through → find 3rd intersection → reflect: |
| Chord formula | , then |
| Doubling formula | , same formulas |
| Identity | , the point at infinity is the identity |
| Inverses | and |
| Vieta's shortcut | comes from sum-of-roots, avoiding the cubic formula |
We now have a complete group law for elliptic curves over any field. In the next notebook, we move from the continuous real line to finite fields , where the curve becomes a discrete set of points, and where cryptography actually happens.