/-- The tangent construction: if `ℓ` is the tangent slope at `(x₁, y₁)` on `y² = x³ + ax + b`,
the third intersection point `(ℓ² − 2x₁, ℓ(x₃ − x₁) + y₁)` is on the curve.
Hint: copy the strategy of `chord_third_point` — solve the two hypotheses for `a` and `b`
(`linear_combination` does this), rewrite, and finish with `ring`. -/
theorem tangent_third_point {F : Type*} [Field F] {a b x₁ y₁ ℓ : F}
(h₁ : y₁ ^ 2 = x₁ ^ 3 + a * x₁ + b) (hℓ : 2 * y₁ * ℓ = 3 * x₁ ^ 2 + a) :
(ℓ * ((ℓ ^ 2 - 2 * x₁) - x₁) + y₁) ^ 2 =
(ℓ ^ 2 - 2 * x₁) ^ 3 + a * (ℓ ^ 2 - 2 * x₁) + b := by
sorryShow the compiled solution
/-- **The tangent construction.** If `P₁ = (x₁, y₁)` lies on `y² = x³ + ax + b` and `ℓ` is the
slope of the tangent there, `2y₁ℓ = 3x₁² + a` (implicit differentiation), then the point with
`x₃ = ℓ² − 2x₁` and `y₃ = ℓ(x₃ − x₁) + y₁` lies on the curve; its reflection is `2P₁`.
The tangent meets the curve at `P₁` twice, so Vieta now reads `2x₁ + x₃ = ℓ²`. -/
theorem tangent_third_point {F : Type*} [Field F] {a b x₁ y₁ ℓ : F}
(h₁ : y₁ ^ 2 = x₁ ^ 3 + a * x₁ + b) (hℓ : 2 * y₁ * ℓ = 3 * x₁ ^ 2 + a) :
(ℓ * ((ℓ ^ 2 - 2 * x₁) - x₁) + y₁) ^ 2 =
(ℓ ^ 2 - 2 * x₁) ^ 3 + a * (ℓ ^ 2 - 2 * x₁) + b := by
have ha : a = 2 * y₁ * ℓ - 3 * x₁ ^ 2 := by linear_combination -hℓ
have hb : b = y₁ ^ 2 - x₁ ^ 3 - a * x₁ := by linear_combination -h₁
rw [hb, ha]
ringAxioms used: propext, Quot.soundformal/Lumenary/ArithmeticGeometry.leanTry it in the Lean web editor