algebraic_geometry.elliptic_curve.pointMathlib.AlgebraicGeometry.EllipticCurve.Affine

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -220,7 +220,7 @@ theorem WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial :
       AdjoinRoot.mk W.Polynomial
         ((Y - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L)) *
           (W.negPolynomial - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L))) :=
-  AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [C_add_polynomial, add_sub_cancel', mul_one]⟩
+  AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [C_add_polynomial, add_sub_cancel_left, mul_one]⟩
 #align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial
 -/
 
@@ -752,7 +752,7 @@ theorem WeierstrassCurve.Affine.nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠
         contradiction
       ·
         rwa [add_Y', ← neg_sub, mul_neg, hx₂, slope_of_X_ne hx,
-          div_mul_cancel _ <| sub_ne_zero_of_ne hx, neg_sub, sub_add_cancel]
+          div_mul_cancel₀ _ <| sub_ne_zero_of_ne hx, neg_sub, sub_add_cancel]
     · apply W.nonsingular_add_of_eval_derivative_ne_zero _ _ _ _ (equation_add' h₁.1 h₂.1 hxy)
       rw [derivative_add_polynomial_slope h₁.left h₂.left hxy]
       run_tac
Diff
@@ -619,7 +619,7 @@ theorem WeierstrassCurve.Affine.baseChange_slope {R : Type u} [CommRing R] (W :
 
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
   by
-  rw [equation_iff] at h₁' h₂' 
+  rw [equation_iff] at h₁' h₂'
   rw [← sub_eq_zero, ← @sub_eq_zero _ _ y₁, ← mul_eq_zero, neg_Y]
   linear_combination (norm := (rw [hx]; ring1)) h₁' - h₂'
 #align weierstrass_curve.Y_eq_of_X_eq WeierstrassCurve.Y_eq_of_X_eq
@@ -664,9 +664,9 @@ theorem WeierstrassCurve.Affine.addPolynomial_slope (hxy : x₁ = x₂ → y₁
   rw [add_polynomial_eq, neg_inj, Cubic.prod_X_sub_C_eq, Cubic.toPoly_injective]
   by_cases hx : x₁ = x₂
   · rcases hx, Y_eq_of_Y_ne h₁' h₂' hx (hxy hx) with ⟨rfl, rfl⟩
-    rw [equation_iff] at h₁' h₂' 
+    rw [equation_iff] at h₁' h₂'
     rw [slope_of_Y_ne rfl <| hxy rfl]
-    rw [neg_Y, ← sub_ne_zero] at hxy 
+    rw [neg_Y, ← sub_ne_zero] at hxy
     ext
     · rfl
     · simp only [add_X]
@@ -674,9 +674,9 @@ theorem WeierstrassCurve.Affine.addPolynomial_slope (hxy : x₁ = x₂ → y₁
     · field_simp [hxy rfl]
       ring1
     · linear_combination (norm := (field_simp [hxy rfl]; ring1)) -h₁'
-  · rw [equation_iff] at h₁' h₂' 
+  · rw [equation_iff] at h₁' h₂'
     rw [slope_of_X_ne hx]
-    rw [← sub_eq_zero] at hx 
+    rw [← sub_eq_zero] at hx
     ext
     · rfl
     · simp only [add_X]
@@ -1114,9 +1114,9 @@ theorem WeierstrassCurve.Affine.Point.add_eq_zero (P Q : W.Point) : P + Q = 0 
       by_cases hx : x₁ = x₂
       · by_cases hy : y₁ = W.neg_Y x₂ y₂
         · exact ⟨hx, hy⟩
-        · rw [some_add_some_of_Y_ne hx hy] at h 
+        · rw [some_add_some_of_Y_ne hx hy] at h
           contradiction
-      · rw [some_add_some_of_X_ne hx] at h 
+      · rw [some_add_some_of_X_ne hx] at h
         contradiction
     · exact fun ⟨hx, hy⟩ => some_add_some_of_Y_eq hx hy
 #align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Affine.Point.add_eq_zero
Diff
@@ -129,23 +129,23 @@ theorem WeierstrassCurve.Affine.negY_negY : W.negY x₁ (W.negY x₁ y₁) = y
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.Affine.baseChange_negY /-
-theorem WeierstrassCurve.Affine.baseChange_negY :
+#print WeierstrassCurve.Affine.map_negY /-
+theorem WeierstrassCurve.Affine.map_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
   by simp only [neg_Y];
   run_tac
     map_simp;
   rfl
-#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.Affine.baseChange_negY
+#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.Affine.map_negY
 -/
 
-#print WeierstrassCurve.Affine.baseChange_negY_of_baseChange /-
-theorem WeierstrassCurve.Affine.baseChange_negY_of_baseChange (x₁ y₁ : A) :
+#print WeierstrassCurve.Affine.baseChange_negY /-
+theorem WeierstrassCurve.Affine.baseChange_negY (x₁ y₁ : A) :
     (W.base_change B).negY (algebraMap A B x₁) (algebraMap A B y₁) =
       algebraMap A B ((W.base_change A).negY x₁ y₁) :=
   by rw [← base_change_neg_Y, base_change_base_change]
-#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.Affine.baseChange_negY_of_baseChange
+#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.Affine.baseChange_negY
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
@@ -255,23 +255,23 @@ def WeierstrassCurve.Affine.addX : R :=
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.Affine.baseChange_addX /-
-theorem WeierstrassCurve.Affine.baseChange_addX :
+#print WeierstrassCurve.Affine.map_addX /-
+theorem WeierstrassCurve.Affine.map_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
   by simp only [add_X];
   run_tac
     map_simp;
   rfl
-#align weierstrass_curve.base_change_add_X WeierstrassCurve.Affine.baseChange_addX
+#align weierstrass_curve.base_change_add_X WeierstrassCurve.Affine.map_addX
 -/
 
-#print WeierstrassCurve.Affine.baseChange_addX_of_baseChange /-
-theorem WeierstrassCurve.Affine.baseChange_addX_of_baseChange (x₁ x₂ L : A) :
+#print WeierstrassCurve.Affine.baseChange_addX /-
+theorem WeierstrassCurve.Affine.baseChange_addX (x₁ x₂ L : A) :
     (W.base_change B).addX (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addX x₁ x₂ L) :=
   by rw [← base_change_add_X, base_change_base_change]
-#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.Affine.baseChange_addX_of_baseChange
+#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.Affine.baseChange_addX
 -/
 
 #print WeierstrassCurve.Affine.addY' /-
@@ -286,24 +286,24 @@ def WeierstrassCurve.Affine.addY' : R :=
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.Affine.baseChange_addY' /-
-theorem WeierstrassCurve.Affine.baseChange_addY' :
+#print WeierstrassCurve.Affine.map_addY' /-
+theorem WeierstrassCurve.Affine.map_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
       algebraMap R A (W.addY' x₁ x₂ y₁ L) :=
   by simp only [add_Y', base_change_add_X];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.Affine.baseChange_addY'
+#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.Affine.map_addY'
 -/
 
-#print WeierstrassCurve.Affine.baseChange_addY'_of_baseChange /-
-theorem WeierstrassCurve.Affine.baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
+#print WeierstrassCurve.Affine.baseChange_addY' /-
+theorem WeierstrassCurve.Affine.baseChange_addY' (x₁ x₂ y₁ L : A) :
     (W.base_change B).addY' (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
         (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addY' x₁ x₂ y₁ L) :=
   by rw [← base_change_add_Y', base_change_base_change]
-#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.Affine.baseChange_addY'_of_baseChange
+#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.Affine.baseChange_addY'
 -/
 
 #print WeierstrassCurve.Affine.addY /-
@@ -317,22 +317,22 @@ def WeierstrassCurve.Affine.addY : R :=
 #align weierstrass_curve.add_Y WeierstrassCurve.Affine.addY
 -/
 
-#print WeierstrassCurve.Affine.baseChange_addY /-
-theorem WeierstrassCurve.Affine.baseChange_addY :
+#print WeierstrassCurve.Affine.map_addY /-
+theorem WeierstrassCurve.Affine.map_addY :
     (W.base_change A).addY (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
       algebraMap R A (W.addY x₁ x₂ y₁ L) :=
   by simp only [add_Y, base_change_add_Y', base_change_add_X, base_change_neg_Y]
-#align weierstrass_curve.base_change_add_Y WeierstrassCurve.Affine.baseChange_addY
+#align weierstrass_curve.base_change_add_Y WeierstrassCurve.Affine.map_addY
 -/
 
-#print WeierstrassCurve.Affine.baseChange_addY_of_baseChange /-
-theorem WeierstrassCurve.Affine.baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
+#print WeierstrassCurve.Affine.baseChange_addY /-
+theorem WeierstrassCurve.Affine.baseChange_addY (x₁ x₂ y₁ L : A) :
     (W.base_change B).addY (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
         (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addY x₁ x₂ y₁ L) :=
   by rw [← base_change_add_Y, base_change_base_change]
-#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.Affine.baseChange_addY_of_baseChange
+#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.Affine.baseChange_addY
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
@@ -580,8 +580,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.Affine.baseChange_slope /-
-theorem WeierstrassCurve.Affine.baseChange_slope :
+#print WeierstrassCurve.Affine.map_slope /-
+theorem WeierstrassCurve.Affine.map_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
       algebraMap F K (W.slope x₁ x₂ y₁ y₂) :=
@@ -603,18 +603,18 @@ theorem WeierstrassCurve.Affine.baseChange_slope :
         map_simp
     · contrapose! hx
       exact NoZeroSMulDivisors.algebraMap_injective F K hx
-#align weierstrass_curve.base_change_slope WeierstrassCurve.Affine.baseChange_slope
+#align weierstrass_curve.base_change_slope WeierstrassCurve.Affine.map_slope
 -/
 
-#print WeierstrassCurve.Affine.baseChange_slope_of_baseChange /-
-theorem WeierstrassCurve.Affine.baseChange_slope_of_baseChange {R : Type u} [CommRing R]
-    (W : WeierstrassCurve R) (F : Type v) [Field F] [Algebra R F] (K : Type w) [Field K]
-    [Algebra R K] [Algebra F K] [IsScalarTower R F K] (x₁ x₂ y₁ y₂ : F) :
+#print WeierstrassCurve.Affine.baseChange_slope /-
+theorem WeierstrassCurve.Affine.baseChange_slope {R : Type u} [CommRing R] (W : WeierstrassCurve R)
+    (F : Type v) [Field F] [Algebra R F] (K : Type w) [Field K] [Algebra R K] [Algebra F K]
+    [IsScalarTower R F K] (x₁ x₂ y₁ y₂ : F) :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
       algebraMap F K ((W.base_change F).slope x₁ x₂ y₁ y₂) :=
   by rw [← base_change_slope, base_change_base_change]
-#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.Affine.baseChange_slope_of_baseChange
+#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.Affine.baseChange_slope
 -/
 
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
@@ -1201,22 +1201,22 @@ namespace Point
 
 open scoped WeierstrassCurve
 
-#print WeierstrassCurve.Affine.Point.ofBaseChangeFun /-
+#print WeierstrassCurve.Affine.Point.mapFun /-
 /-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
-def WeierstrassCurve.Affine.Point.ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
+def WeierstrassCurve.Affine.Point.mapFun : W⟮F⟯ → W⟮K⟯
   | 0 => 0
   | some h =>
     WeierstrassCurve.Affine.Point.some <|
-      (WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange W F K _ _).mp h
-#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Affine.Point.ofBaseChangeFun
+      (WeierstrassCurve.Affine.baseChange_nonsingular W F K _ _).mp h
+#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Affine.Point.mapFun
 -/
 
-#print WeierstrassCurve.Affine.Point.ofBaseChange /-
+#print WeierstrassCurve.Affine.Point.map /-
 /-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
 @[simps]
-def WeierstrassCurve.Affine.Point.ofBaseChange : W⟮F⟯ →+ W⟮K⟯
+def WeierstrassCurve.Affine.Point.map : W⟮F⟯ →+ W⟮K⟯
     where
-  toFun := WeierstrassCurve.Affine.Point.ofBaseChangeFun W F K
+  toFun := WeierstrassCurve.Affine.Point.mapFun W F K
   map_zero' := rfl
   map_add' := by
     rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
@@ -1241,12 +1241,12 @@ def WeierstrassCurve.Affine.Point.ofBaseChange : W⟮F⟯ →+ W⟮K⟯
         exact ⟨rfl, rfl⟩
       · contrapose! hx
         exact NoZeroSMulDivisors.algebraMap_injective F K hx
-#align weierstrass_curve.point.of_base_change WeierstrassCurve.Affine.Point.ofBaseChange
+#align weierstrass_curve.point.of_base_change WeierstrassCurve.Affine.Point.map
 -/
 
-#print WeierstrassCurve.Affine.Point.ofBaseChange_injective /-
-theorem WeierstrassCurve.Affine.Point.ofBaseChange_injective :
-    Function.Injective <| WeierstrassCurve.Affine.Point.ofBaseChange W F K :=
+#print WeierstrassCurve.Affine.Point.map_injective /-
+theorem WeierstrassCurve.Affine.Point.map_injective :
+    Function.Injective <| WeierstrassCurve.Affine.Point.map W F K :=
   by
   rintro (_ | _) (_ | _) h
   · rfl
@@ -1255,7 +1255,7 @@ theorem WeierstrassCurve.Affine.Point.ofBaseChange_injective :
   exact
     ⟨NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).left,
       NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).right⟩
-#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Affine.Point.ofBaseChange_injective
+#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Affine.Point.map_injective
 -/
 
 end Point
Diff
@@ -105,71 +105,75 @@ section Basic
 variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (A : Type v) [CommRing A] [Algebra R A]
   (B : Type w) [CommRing B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] (x₁ x₂ y₁ y₂ L : R)
 
-#print WeierstrassCurve.negPolynomial /-
+#print WeierstrassCurve.Affine.negPolynomial /-
 /-- The polynomial $-Y - a_1X - a_3$ associated to negation. -/
-noncomputable def negPolynomial : R[X][Y] :=
+noncomputable def WeierstrassCurve.Affine.negPolynomial : R[X][Y] :=
   -Y - C (C W.a₁ * X + C W.a₃)
-#align weierstrass_curve.neg_polynomial WeierstrassCurve.negPolynomial
+#align weierstrass_curve.neg_polynomial WeierstrassCurve.Affine.negPolynomial
 -/
 
-#print WeierstrassCurve.negY /-
+#print WeierstrassCurve.Affine.negY /-
 /-- The $Y$-coordinate of the negation of an affine point in `W`.
 
 This depends on `W`, and has argument order: $x_1$, $y_1$. -/
 @[simp]
-def negY : R :=
+def WeierstrassCurve.Affine.negY : R :=
   -y₁ - W.a₁ * x₁ - W.a₃
-#align weierstrass_curve.neg_Y WeierstrassCurve.negY
+#align weierstrass_curve.neg_Y WeierstrassCurve.Affine.negY
 -/
 
-#print WeierstrassCurve.negY_negY /-
-theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y]; ring1
-#align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
+#print WeierstrassCurve.Affine.negY_negY /-
+theorem WeierstrassCurve.Affine.negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y];
+  ring1
+#align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.Affine.negY_negY
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.baseChange_negY /-
-theorem baseChange_negY :
+#print WeierstrassCurve.Affine.baseChange_negY /-
+theorem WeierstrassCurve.Affine.baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
   by simp only [neg_Y];
   run_tac
     map_simp;
   rfl
-#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.baseChange_negY
+#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.Affine.baseChange_negY
 -/
 
-#print WeierstrassCurve.baseChange_negY_of_baseChange /-
-theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
+#print WeierstrassCurve.Affine.baseChange_negY_of_baseChange /-
+theorem WeierstrassCurve.Affine.baseChange_negY_of_baseChange (x₁ y₁ : A) :
     (W.base_change B).negY (algebraMap A B x₁) (algebraMap A B y₁) =
       algebraMap A B ((W.base_change A).negY x₁ y₁) :=
   by rw [← base_change_neg_Y, base_change_base_change]
-#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
+#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.Affine.baseChange_negY_of_baseChange
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
-#print WeierstrassCurve.eval_negPolynomial /-
+#print WeierstrassCurve.Affine.eval_negPolynomial /-
 @[simp]
-theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
-  rw [neg_Y, sub_sub, neg_polynomial];
+theorem WeierstrassCurve.Affine.eval_negPolynomial :
+    (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by rw [neg_Y, sub_sub, neg_polynomial];
   run_tac
     eval_simp
-#align weierstrass_curve.eval_neg_polynomial WeierstrassCurve.eval_negPolynomial
+#align weierstrass_curve.eval_neg_polynomial WeierstrassCurve.Affine.eval_negPolynomial
 -/
 
-#print WeierstrassCurve.linePolynomial /-
+#print WeierstrassCurve.Affine.linePolynomial /-
 /-- The polynomial $L(X - x_1) + y_1$ associated to the line $Y = L(X - x_1) + y_1$,
 with a slope of $L$ that passes through an affine point $(x_1, y_1)$.
 
 This does not depend on `W`, and has argument order: $x_1$, $y_1$, $L$. -/
-noncomputable def linePolynomial : R[X] :=
+noncomputable def WeierstrassCurve.Affine.linePolynomial : R[X] :=
   C L * (X - C x₁) + C y₁
-#align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
+#align weierstrass_curve.line_polynomial WeierstrassCurve.Affine.linePolynomial
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.XYIdeal_eq₁ /-
-theorem XYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal_eq₁ /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XYIdeal_eq₁ :
+    WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C y₁) =
+      WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁
+        (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L) :=
   by
   simp only [XY_ideal, X_class, Y_class, line_polynomial]
   rw [← span_pair_add_mul_right <| AdjoinRoot.mk _ <| C <| C <| -L, ← _root_.map_mul, ← map_add]
@@ -177,164 +181,168 @@ theorem XYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial
   run_tac
     C_simp
   ring1
-#align weierstrass_curve.XY_ideal_eq₁ WeierstrassCurve.XYIdeal_eq₁
+#align weierstrass_curve.XY_ideal_eq₁ WeierstrassCurve.Affine.CoordinateRing.XYIdeal_eq₁
 -/
 
-#print WeierstrassCurve.addPolynomial /-
+#print WeierstrassCurve.Affine.addPolynomial /-
 /-- The polynomial obtained by substituting the line $Y = L*(X - x_1) + y_1$, with a slope of $L$
 that passes through an affine point $(x_1, y_1)$, into the polynomial $W(X, Y)$ associated to `W`.
 If such a line intersects `W` at another point $(x_2, y_2)$, then the roots of this polynomial are
 precisely $x_1$, $x_2$, and the $X$-coordinate of the addition of $(x_1, y_1)$ and $(x_2, y_2)$.
 
 This depends on `W`, and has argument order: $x_1$, $y_1$, $L$. -/
-noncomputable def addPolynomial : R[X] :=
-  W.Polynomial.eval <| linePolynomial x₁ y₁ L
-#align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
+noncomputable def WeierstrassCurve.Affine.addPolynomial : R[X] :=
+  W.Polynomial.eval <| WeierstrassCurve.Affine.linePolynomial x₁ y₁ L
+#align weierstrass_curve.add_polynomial WeierstrassCurve.Affine.addPolynomial
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.C_addPolynomial /-
-theorem C_addPolynomial :
+#print WeierstrassCurve.Affine.C_addPolynomial /-
+theorem WeierstrassCurve.Affine.C_addPolynomial :
     C (W.addPolynomial x₁ y₁ L) =
-      (Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L)) +
+      (Y - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L)) *
+          (W.negPolynomial - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L)) +
         W.Polynomial :=
   by
-  rw [add_polynomial, line_polynomial, WeierstrassCurve.polynomial, neg_polynomial];
+  rw [add_polynomial, line_polynomial, WeierstrassCurve.Affine.polynomial, neg_polynomial];
   run_tac
     eval_simp
   run_tac
     C_simp;
   ring1
-#align weierstrass_curve.C_add_polynomial WeierstrassCurve.C_addPolynomial
+#align weierstrass_curve.C_add_polynomial WeierstrassCurve.Affine.C_addPolynomial
 -/
 
-#print WeierstrassCurve.CoordinateRing.C_addPolynomial /-
-theorem CoordinateRing.C_addPolynomial :
+#print WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial /-
+theorem WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial :
     AdjoinRoot.mk W.Polynomial (C (W.addPolynomial x₁ y₁ L)) =
       AdjoinRoot.mk W.Polynomial
-        ((Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L))) :=
+        ((Y - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L)) *
+          (W.negPolynomial - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L))) :=
   AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [C_add_polynomial, add_sub_cancel', mul_one]⟩
-#align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.C_addPolynomial
+#align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.addPolynomial_eq /-
-theorem addPolynomial_eq :
+#print WeierstrassCurve.Affine.addPolynomial_eq /-
+theorem WeierstrassCurve.Affine.addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
           ⟨1, -L ^ 2 - W.a₁ * L + W.a₂,
             2 * x₁ * L ^ 2 + (W.a₁ * x₁ - 2 * y₁ - W.a₃) * L + (-W.a₁ * y₁ + W.a₄),
             -x₁ ^ 2 * L ^ 2 + (2 * x₁ * y₁ + W.a₃ * x₁) * L - (y₁ ^ 2 + W.a₃ * y₁ - W.a₆)⟩ :=
   by
-  rw [add_polynomial, line_polynomial, WeierstrassCurve.polynomial, Cubic.toPoly];
+  rw [add_polynomial, line_polynomial, WeierstrassCurve.Affine.polynomial, Cubic.toPoly];
   run_tac
     eval_simp
   run_tac
     C_simp;
   ring1
-#align weierstrass_curve.add_polynomial_eq WeierstrassCurve.addPolynomial_eq
+#align weierstrass_curve.add_polynomial_eq WeierstrassCurve.Affine.addPolynomial_eq
 -/
 
-#print WeierstrassCurve.addX /-
+#print WeierstrassCurve.Affine.addX /-
 /-- The $X$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`,
 where the line through them is not vertical and has a slope of $L$.
 
 This depends on `W`, and has argument order: $x_1$, $x_2$, $L$. -/
 @[simp]
-def addX : R :=
+def WeierstrassCurve.Affine.addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
-#align weierstrass_curve.add_X WeierstrassCurve.addX
+#align weierstrass_curve.add_X WeierstrassCurve.Affine.addX
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.baseChange_addX /-
-theorem baseChange_addX :
+#print WeierstrassCurve.Affine.baseChange_addX /-
+theorem WeierstrassCurve.Affine.baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
   by simp only [add_X];
   run_tac
     map_simp;
   rfl
-#align weierstrass_curve.base_change_add_X WeierstrassCurve.baseChange_addX
+#align weierstrass_curve.base_change_add_X WeierstrassCurve.Affine.baseChange_addX
 -/
 
-#print WeierstrassCurve.baseChange_addX_of_baseChange /-
-theorem baseChange_addX_of_baseChange (x₁ x₂ L : A) :
+#print WeierstrassCurve.Affine.baseChange_addX_of_baseChange /-
+theorem WeierstrassCurve.Affine.baseChange_addX_of_baseChange (x₁ x₂ L : A) :
     (W.base_change B).addX (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addX x₁ x₂ L) :=
   by rw [← base_change_add_X, base_change_base_change]
-#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.baseChange_addX_of_baseChange
+#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.Affine.baseChange_addX_of_baseChange
 -/
 
-#print WeierstrassCurve.addY' /-
+#print WeierstrassCurve.Affine.addY' /-
 /-- The $Y$-coordinate, before applying the final negation, of the addition of two affine points
 $(x_1, y_1)$ and $(x_2, y_2)$, where the line through them is not vertical and has a slope of $L$.
 
 This depends on `W`, and has argument order: $x_1$, $x_2$, $y_1$, $L$. -/
 @[simp]
-def addY' : R :=
+def WeierstrassCurve.Affine.addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
-#align weierstrass_curve.add_Y' WeierstrassCurve.addY'
+#align weierstrass_curve.add_Y' WeierstrassCurve.Affine.addY'
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.baseChange_addY' /-
-theorem baseChange_addY' :
+#print WeierstrassCurve.Affine.baseChange_addY' /-
+theorem WeierstrassCurve.Affine.baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
       algebraMap R A (W.addY' x₁ x₂ y₁ L) :=
   by simp only [add_Y', base_change_add_X];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.baseChange_addY'
+#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.Affine.baseChange_addY'
 -/
 
-#print WeierstrassCurve.baseChange_addY'_of_baseChange /-
-theorem baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
+#print WeierstrassCurve.Affine.baseChange_addY'_of_baseChange /-
+theorem WeierstrassCurve.Affine.baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
     (W.base_change B).addY' (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
         (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addY' x₁ x₂ y₁ L) :=
   by rw [← base_change_add_Y', base_change_base_change]
-#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.baseChange_addY'_of_baseChange
+#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.Affine.baseChange_addY'_of_baseChange
 -/
 
-#print WeierstrassCurve.addY /-
+#print WeierstrassCurve.Affine.addY /-
 /-- The $Y$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`,
 where the line through them is not vertical and has a slope of $L$.
 
 This depends on `W`, and has argument order: $x_1$, $x_2$, $y_1$, $L$. -/
 @[simp]
-def addY : R :=
+def WeierstrassCurve.Affine.addY : R :=
   W.negY (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L)
-#align weierstrass_curve.add_Y WeierstrassCurve.addY
+#align weierstrass_curve.add_Y WeierstrassCurve.Affine.addY
 -/
 
-#print WeierstrassCurve.baseChange_addY /-
-theorem baseChange_addY :
+#print WeierstrassCurve.Affine.baseChange_addY /-
+theorem WeierstrassCurve.Affine.baseChange_addY :
     (W.base_change A).addY (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
       algebraMap R A (W.addY x₁ x₂ y₁ L) :=
   by simp only [add_Y, base_change_add_Y', base_change_add_X, base_change_neg_Y]
-#align weierstrass_curve.base_change_add_Y WeierstrassCurve.baseChange_addY
+#align weierstrass_curve.base_change_add_Y WeierstrassCurve.Affine.baseChange_addY
 -/
 
-#print WeierstrassCurve.baseChange_addY_of_baseChange /-
-theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
+#print WeierstrassCurve.Affine.baseChange_addY_of_baseChange /-
+theorem WeierstrassCurve.Affine.baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
     (W.base_change B).addY (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
         (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addY x₁ x₂ y₁ L) :=
   by rw [← base_change_add_Y, base_change_base_change]
-#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
+#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.Affine.baseChange_addY_of_baseChange
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.XYIdeal_add_eq /-
-theorem XYIdeal_add_eq :
-    XYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
-      span {AdjoinRoot.mk W.Polynomial <| W.negPolynomial - C (linePolynomial x₁ y₁ L)} ⊔
-        XIdeal W (W.addX x₁ x₂ L) :=
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal_add_eq /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XYIdeal_add_eq :
+    WeierstrassCurve.Affine.CoordinateRing.XYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
+      span
+          {AdjoinRoot.mk W.Polynomial <|
+              W.negPolynomial - C (WeierstrassCurve.Affine.linePolynomial x₁ y₁ L)} ⊔
+        WeierstrassCurve.Affine.CoordinateRing.XIdeal W (W.addX x₁ x₂ L) :=
   by
   simp only [XY_ideal, X_ideal, X_class, Y_class, add_Y, add_Y', neg_Y, neg_polynomial,
     line_polynomial]
@@ -345,27 +353,27 @@ theorem XYIdeal_add_eq :
   run_tac
     C_simp
   ring1
-#align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.XYIdeal_add_eq
+#align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.Affine.CoordinateRing.XYIdeal_add_eq
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
-#print WeierstrassCurve.equation_add_iff /-
-theorem equation_add_iff :
+#print WeierstrassCurve.Affine.equation_add_iff /-
+theorem WeierstrassCurve.Affine.equation_add_iff :
     W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
   by
-  rw [equation, add_Y', add_polynomial, line_polynomial, WeierstrassCurve.polynomial]
+  rw [equation, add_Y', add_polynomial, line_polynomial, WeierstrassCurve.Affine.polynomial]
   run_tac
     eval_simp
-#align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
+#align weierstrass_curve.equation_add_iff WeierstrassCurve.Affine.equation_add_iff
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2999436871.derivative_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
-#print WeierstrassCurve.nonsingular_add_of_eval_derivative_ne_zero /-
-theorem nonsingular_add_of_eval_derivative_ne_zero
+#print WeierstrassCurve.Affine.nonsingular_add_of_eval_derivative_ne_zero /-
+theorem WeierstrassCurve.Affine.nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
     W.nonsingular (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) :=
@@ -374,7 +382,7 @@ theorem nonsingular_add_of_eval_derivative_ne_zero
   run_tac
     eval_simp
   contrapose! hx
-  rw [add_polynomial, line_polynomial, WeierstrassCurve.polynomial]
+  rw [add_polynomial, line_polynomial, WeierstrassCurve.Affine.polynomial]
   run_tac
     eval_simp
   run_tac
@@ -383,21 +391,21 @@ theorem nonsingular_add_of_eval_derivative_ne_zero
   run_tac
     eval_simp
   linear_combination (norm := (norm_num1; ring1)) hx.left + L * hx.right
-#align weierstrass_curve.nonsingular_add_of_eval_derivative_ne_zero WeierstrassCurve.nonsingular_add_of_eval_derivative_ne_zero
+#align weierstrass_curve.nonsingular_add_of_eval_derivative_ne_zero WeierstrassCurve.Affine.nonsingular_add_of_eval_derivative_ne_zero
 -/
 
 /-! ### The type of nonsingular rational points on a Weierstrass curve -/
 
 
-#print WeierstrassCurve.Point /-
+#print WeierstrassCurve.Affine.Point /-
 /-- A nonsingular rational point on a Weierstrass curve `W` over `R`. This is either the point at
 infinity `weierstrass_curve.point.zero` or an affine point `weierstrass_curve.point.some` $(x, y)$
 satisfying the equation $y^2 + a_1xy + a_3y = x^3 + a_2x^2 + a_4x + a_6$ of `W`. For an algebraic
 extension `S` of `R`, the type of nonsingular `S`-rational points on `W` is denoted `W⟮S⟯`. -/
-inductive Point
+inductive WeierstrassCurve.Affine.Point
   | zero
   | some {x y : R} (h : W.nonsingular x y)
-#align weierstrass_curve.point WeierstrassCurve.Point
+#align weierstrass_curve.point WeierstrassCurve.Affine.Point
 -/
 
 scoped notation W "⟮" S "⟯" => (W.base_change S).Point
@@ -405,103 +413,112 @@ scoped notation W "⟮" S "⟯" => (W.base_change S).Point
 namespace Point
 
 instance : Inhabited W.Point :=
-  ⟨zero⟩
+  ⟨WeierstrassCurve.Affine.Point.zero⟩
 
 instance : Zero W.Point :=
-  ⟨zero⟩
+  ⟨WeierstrassCurve.Affine.Point.zero⟩
 
-#print WeierstrassCurve.Point.zero_def /-
+#print WeierstrassCurve.Affine.Point.zero_def /-
 @[simp]
-theorem zero_def : (zero : W.Point) = 0 :=
+theorem WeierstrassCurve.Affine.Point.zero_def :
+    (WeierstrassCurve.Affine.Point.zero : W.Point) = 0 :=
   rfl
-#align weierstrass_curve.point.zero_def WeierstrassCurve.Point.zero_def
+#align weierstrass_curve.point.zero_def WeierstrassCurve.Affine.Point.zero_def
 -/
 
 end Point
 
 variable {W x₁ y₁}
 
-#print WeierstrassCurve.equation_neg_iff /-
-theorem equation_neg_iff : W.equation x₁ (W.negY x₁ y₁) ↔ W.equation x₁ y₁ := by
-  rw [equation_iff, equation_iff, neg_Y]; congr 2; ring1
-#align weierstrass_curve.equation_neg_iff WeierstrassCurve.equation_neg_iff
+#print WeierstrassCurve.Affine.equation_neg_iff /-
+theorem WeierstrassCurve.Affine.equation_neg_iff :
+    W.equation x₁ (W.negY x₁ y₁) ↔ W.equation x₁ y₁ := by rw [equation_iff, equation_iff, neg_Y];
+  congr 2; ring1
+#align weierstrass_curve.equation_neg_iff WeierstrassCurve.Affine.equation_neg_iff
 -/
 
-#print WeierstrassCurve.equation_neg_of /-
-theorem equation_neg_of (h : W.equation x₁ <| W.negY x₁ y₁) : W.equation x₁ y₁ :=
-  equation_neg_iff.mp h
-#align weierstrass_curve.equation_neg_of WeierstrassCurve.equation_neg_of
+#print WeierstrassCurve.Affine.equation_neg_of /-
+theorem WeierstrassCurve.Affine.equation_neg_of (h : W.equation x₁ <| W.negY x₁ y₁) :
+    W.equation x₁ y₁ :=
+  WeierstrassCurve.Affine.equation_neg_iff.mp h
+#align weierstrass_curve.equation_neg_of WeierstrassCurve.Affine.equation_neg_of
 -/
 
-#print WeierstrassCurve.equation_neg /-
+#print WeierstrassCurve.Affine.equation_neg /-
 /-- The negation of an affine point in `W` lies in `W`. -/
-theorem equation_neg (h : W.equation x₁ y₁) : W.equation x₁ <| W.negY x₁ y₁ :=
-  equation_neg_iff.mpr h
-#align weierstrass_curve.equation_neg WeierstrassCurve.equation_neg
+theorem WeierstrassCurve.Affine.equation_neg (h : W.equation x₁ y₁) :
+    W.equation x₁ <| W.negY x₁ y₁ :=
+  WeierstrassCurve.Affine.equation_neg_iff.mpr h
+#align weierstrass_curve.equation_neg WeierstrassCurve.Affine.equation_neg
 -/
 
-#print WeierstrassCurve.nonsingular_neg_iff /-
-theorem nonsingular_neg_iff : W.nonsingular x₁ (W.negY x₁ y₁) ↔ W.nonsingular x₁ y₁ :=
+#print WeierstrassCurve.Affine.nonsingular_neg_iff /-
+theorem WeierstrassCurve.Affine.nonsingular_neg_iff :
+    W.nonsingular x₁ (W.negY x₁ y₁) ↔ W.nonsingular x₁ y₁ :=
   by
   rw [nonsingular_iff, equation_neg_iff, ← neg_Y, neg_Y_neg_Y, ← @ne_comm _ y₁, nonsingular_iff]
   exact
     and_congr_right'
       ((iff_congr not_and_distrib.symm not_and_distrib.symm).mpr <|
         not_congr <| and_congr_left fun h => by rw [← h])
-#align weierstrass_curve.nonsingular_neg_iff WeierstrassCurve.nonsingular_neg_iff
+#align weierstrass_curve.nonsingular_neg_iff WeierstrassCurve.Affine.nonsingular_neg_iff
 -/
 
-#print WeierstrassCurve.nonsingular_neg_of /-
-theorem nonsingular_neg_of (h : W.nonsingular x₁ <| W.negY x₁ y₁) : W.nonsingular x₁ y₁ :=
-  nonsingular_neg_iff.mp h
-#align weierstrass_curve.nonsingular_neg_of WeierstrassCurve.nonsingular_neg_of
+#print WeierstrassCurve.Affine.nonsingular_neg_of /-
+theorem WeierstrassCurve.Affine.nonsingular_neg_of (h : W.nonsingular x₁ <| W.negY x₁ y₁) :
+    W.nonsingular x₁ y₁ :=
+  WeierstrassCurve.Affine.nonsingular_neg_iff.mp h
+#align weierstrass_curve.nonsingular_neg_of WeierstrassCurve.Affine.nonsingular_neg_of
 -/
 
-#print WeierstrassCurve.nonsingular_neg /-
+#print WeierstrassCurve.Affine.nonsingular_neg /-
 /-- The negation of a nonsingular affine point in `W` is nonsingular. -/
-theorem nonsingular_neg (h : W.nonsingular x₁ y₁) : W.nonsingular x₁ <| W.negY x₁ y₁ :=
-  nonsingular_neg_iff.mpr h
-#align weierstrass_curve.nonsingular_neg WeierstrassCurve.nonsingular_neg
+theorem WeierstrassCurve.Affine.nonsingular_neg (h : W.nonsingular x₁ y₁) :
+    W.nonsingular x₁ <| W.negY x₁ y₁ :=
+  WeierstrassCurve.Affine.nonsingular_neg_iff.mpr h
+#align weierstrass_curve.nonsingular_neg WeierstrassCurve.Affine.nonsingular_neg
 -/
 
 namespace Point
 
-#print WeierstrassCurve.Point.neg /-
+#print WeierstrassCurve.Affine.Point.neg /-
 /-- The negation of a nonsingular rational point.
 
 Given a nonsingular rational point `P`, use `-P` instead of `neg P`. -/
-def neg : W.Point → W.Point
+def WeierstrassCurve.Affine.Point.neg : W.Point → W.Point
   | 0 => 0
-  | some h => some <| nonsingular_neg h
-#align weierstrass_curve.point.neg WeierstrassCurve.Point.neg
+  | some h => WeierstrassCurve.Affine.Point.some <| WeierstrassCurve.Affine.nonsingular_neg h
+#align weierstrass_curve.point.neg WeierstrassCurve.Affine.Point.neg
 -/
 
 instance : Neg W.Point :=
-  ⟨neg⟩
+  ⟨WeierstrassCurve.Affine.Point.neg⟩
 
-#print WeierstrassCurve.Point.neg_def /-
+#print WeierstrassCurve.Affine.Point.neg_def /-
 @[simp]
-theorem neg_def (P : W.Point) : P.neg = -P :=
+theorem WeierstrassCurve.Affine.Point.neg_def (P : W.Point) : P.neg = -P :=
   rfl
-#align weierstrass_curve.point.neg_def WeierstrassCurve.Point.neg_def
+#align weierstrass_curve.point.neg_def WeierstrassCurve.Affine.Point.neg_def
 -/
 
-#print WeierstrassCurve.Point.neg_zero /-
+#print WeierstrassCurve.Affine.Point.neg_zero /-
 @[simp]
-theorem neg_zero : (-0 : W.Point) = 0 :=
+theorem WeierstrassCurve.Affine.Point.neg_zero : (-0 : W.Point) = 0 :=
   rfl
-#align weierstrass_curve.point.neg_zero WeierstrassCurve.Point.neg_zero
+#align weierstrass_curve.point.neg_zero WeierstrassCurve.Affine.Point.neg_zero
 -/
 
-#print WeierstrassCurve.Point.neg_some /-
+#print WeierstrassCurve.Affine.Point.neg_some /-
 @[simp]
-theorem neg_some (h : W.nonsingular x₁ y₁) : -some h = some (nonsingular_neg h) :=
+theorem WeierstrassCurve.Affine.Point.neg_some (h : W.nonsingular x₁ y₁) :
+    -WeierstrassCurve.Affine.Point.some h =
+      WeierstrassCurve.Affine.Point.some (WeierstrassCurve.Affine.nonsingular_neg h) :=
   rfl
-#align weierstrass_curve.point.neg_some WeierstrassCurve.Point.neg_some
+#align weierstrass_curve.point.neg_some WeierstrassCurve.Affine.Point.neg_some
 -/
 
 instance : InvolutiveNeg W.Point :=
-  ⟨neg, by rintro (_ | _); · rfl; · simp; ring1⟩
+  ⟨WeierstrassCurve.Affine.Point.neg, by rintro (_ | _); · rfl; · simp; ring1⟩
 
 end Point
 
@@ -517,7 +534,7 @@ open scoped Classical
 variable {F : Type u} [Field F] (W : WeierstrassCurve F) (K : Type v) [Field K] [Algebra F K]
   (x₁ x₂ y₁ y₂ : F)
 
-#print WeierstrassCurve.slope /-
+#print WeierstrassCurve.Affine.slope /-
 /-- The slope of the line through two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`.
 If $x_1 \ne x_2$, then this line is the secant of `W` through $(x_1, y_1)$ and $(x_2, y_2)$,
 and has slope $(y_1 - y_2) / (x_1 - x_2)$. Otherwise, if $y_1 \ne -y_1 - a_1x_1 - a_3$,
@@ -526,40 +543,33 @@ $(3x_1^2 + 2a_2x_1 + a_4 - a_1y_1) / (2y_1 + a_1x_1 + a_3)$. Otherwise, this lin
 and has undefined slope, in which case this function returns the value 0.
 
 This depends on `W`, and has argument order: $x_1$, $x_2$, $y_1$, $y_2$. -/
-noncomputable def slope : F :=
+noncomputable def WeierstrassCurve.Affine.slope : F :=
   if hx : x₁ = x₂ then
     if hy : y₁ = W.negY x₂ y₂ then 0
     else (3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄ - W.a₁ * y₁) / (y₁ - W.negY x₁ y₁)
   else (y₁ - y₂) / (x₁ - x₂)
-#align weierstrass_curve.slope WeierstrassCurve.slope
+#align weierstrass_curve.slope WeierstrassCurve.Affine.slope
 -/
 
 variable {W x₁ x₂ y₁ y₂} (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂)
   (h₁' : W.equation x₁ y₁) (h₂' : W.equation x₂ y₂)
 
-#print WeierstrassCurve.slope_of_Y_eq /-
 @[simp]
 theorem slope_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : W.slope x₁ x₂ y₁ y₂ = 0 := by
   rw [slope, dif_pos hx, dif_pos hy]
 #align weierstrass_curve.slope_of_Y_eq WeierstrassCurve.slope_of_Y_eq
--/
 
-#print WeierstrassCurve.slope_of_Y_ne /-
 @[simp]
 theorem slope_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     W.slope x₁ x₂ y₁ y₂ = (3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄ - W.a₁ * y₁) / (y₁ - W.negY x₁ y₁) :=
   by rw [slope, dif_pos hx, dif_neg hy]
 #align weierstrass_curve.slope_of_Y_ne WeierstrassCurve.slope_of_Y_ne
--/
 
-#print WeierstrassCurve.slope_of_X_ne /-
 @[simp]
 theorem slope_of_X_ne (hx : x₁ ≠ x₂) : W.slope x₁ x₂ y₁ y₂ = (y₁ - y₂) / (x₁ - x₂) := by
   rw [slope, dif_neg hx]
 #align weierstrass_curve.slope_of_X_ne WeierstrassCurve.slope_of_X_ne
--/
 
-#print WeierstrassCurve.slope_of_Y_ne_eq_eval /-
 theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     W.slope x₁ x₂ y₁ y₂ =
       -(W.polynomialX.eval <| C y₁).eval x₁ / (W.polynomialY.eval <| C y₁).eval x₁ :=
@@ -567,12 +577,11 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   rw [slope_of_Y_ne hx hy, eval_polynomial_X, neg_sub]; congr 1; rw [neg_Y, eval_polynomial_Y]
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
--/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
-#print WeierstrassCurve.baseChange_slope /-
-theorem baseChange_slope :
+#print WeierstrassCurve.Affine.baseChange_slope /-
+theorem WeierstrassCurve.Affine.baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
       algebraMap F K (W.slope x₁ x₂ y₁ y₂) :=
@@ -594,40 +603,38 @@ theorem baseChange_slope :
         map_simp
     · contrapose! hx
       exact NoZeroSMulDivisors.algebraMap_injective F K hx
-#align weierstrass_curve.base_change_slope WeierstrassCurve.baseChange_slope
+#align weierstrass_curve.base_change_slope WeierstrassCurve.Affine.baseChange_slope
 -/
 
-#print WeierstrassCurve.baseChange_slope_of_baseChange /-
-theorem baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : WeierstrassCurve R)
-    (F : Type v) [Field F] [Algebra R F] (K : Type w) [Field K] [Algebra R K] [Algebra F K]
-    [IsScalarTower R F K] (x₁ x₂ y₁ y₂ : F) :
+#print WeierstrassCurve.Affine.baseChange_slope_of_baseChange /-
+theorem WeierstrassCurve.Affine.baseChange_slope_of_baseChange {R : Type u} [CommRing R]
+    (W : WeierstrassCurve R) (F : Type v) [Field F] [Algebra R F] (K : Type w) [Field K]
+    [Algebra R K] [Algebra F K] [IsScalarTower R F K] (x₁ x₂ y₁ y₂ : F) :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
       algebraMap F K ((W.base_change F).slope x₁ x₂ y₁ y₂) :=
   by rw [← base_change_slope, base_change_base_change]
-#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.baseChange_slope_of_baseChange
+#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.Affine.baseChange_slope_of_baseChange
 -/
 
-#print WeierstrassCurve.Y_eq_of_X_eq /-
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
   by
   rw [equation_iff] at h₁' h₂' 
   rw [← sub_eq_zero, ← @sub_eq_zero _ _ y₁, ← mul_eq_zero, neg_Y]
   linear_combination (norm := (rw [hx]; ring1)) h₁' - h₂'
 #align weierstrass_curve.Y_eq_of_X_eq WeierstrassCurve.Y_eq_of_X_eq
--/
 
-#print WeierstrassCurve.Y_eq_of_Y_ne /-
 theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁ = y₂ :=
   Or.resolve_right (Y_eq_of_X_eq h₁' h₂' hx) hy
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
--/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.XYIdeal_eq₂ /-
-theorem XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal_eq₂ /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₂ (C y₂) =
+      WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₂
+        (WeierstrassCurve.Affine.linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   have hy₂ : y₂ = (line_polynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂).eval x₂ :=
     by
@@ -646,11 +653,11 @@ theorem XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   run_tac
     C_simp
   ring1
-#align weierstrass_curve.XY_ideal_eq₂ WeierstrassCurve.XYIdeal_eq₂
+#align weierstrass_curve.XY_ideal_eq₂ WeierstrassCurve.Affine.CoordinateRing.XYIdeal_eq₂
 -/
 
-#print WeierstrassCurve.addPolynomial_slope /-
-theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+#print WeierstrassCurve.Affine.addPolynomial_slope /-
+theorem WeierstrassCurve.Affine.addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
   by
@@ -678,20 +685,23 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx]; ring1)) h₂' - h₁'
     · apply mul_right_injective₀ hx
       linear_combination (norm := (field_simp [hx]; ring1)) x₂ * h₁' - x₁ * h₂'
-#align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
+#align weierstrass_curve.add_polynomial_slope WeierstrassCurve.Affine.addPolynomial_slope
 -/
 
-#print WeierstrassCurve.CoordinateRing.C_addPolynomial_slope /-
-theorem CoordinateRing.C_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+#print WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial_slope /-
+theorem WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial_slope
+    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     AdjoinRoot.mk W.Polynomial (C <| W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
-      -(XClass W x₁ * XClass W x₂ * XClass W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) :=
+      -(WeierstrassCurve.Affine.CoordinateRing.XClass W x₁ *
+            WeierstrassCurve.Affine.CoordinateRing.XClass W x₂ *
+          WeierstrassCurve.Affine.CoordinateRing.XClass W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) :=
   by simpa only [add_polynomial_slope h₁' h₂' hxy, map_neg, neg_inj, _root_.map_mul]
-#align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.C_addPolynomial_slope
+#align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial_slope
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2999436871.derivative_simp -/
-#print WeierstrassCurve.derivative_addPolynomial_slope /-
-theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+#print WeierstrassCurve.Affine.derivative_addPolynomial_slope /-
+theorem WeierstrassCurve.Affine.derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
           (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
@@ -699,39 +709,39 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
   run_tac
     derivative_simp;
   ring1
-#align weierstrass_curve.derivative_add_polynomial_slope WeierstrassCurve.derivative_addPolynomial_slope
+#align weierstrass_curve.derivative_add_polynomial_slope WeierstrassCurve.Affine.derivative_addPolynomial_slope
 -/
 
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
-#print WeierstrassCurve.equation_add' /-
+#print WeierstrassCurve.Affine.equation_add' /-
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
-theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+theorem WeierstrassCurve.Affine.equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   rw [equation_add_iff, add_polynomial_slope h₁' h₂' hxy];
   run_tac
     eval_simp
   rw [neg_eq_zero, sub_self, MulZeroClass.mul_zero]
-#align weierstrass_curve.equation_add' WeierstrassCurve.equation_add'
+#align weierstrass_curve.equation_add' WeierstrassCurve.Affine.equation_add'
 -/
 
-#print WeierstrassCurve.equation_add /-
+#print WeierstrassCurve.Affine.equation_add /-
 /-- The addition of two affine points in `W` on a sloped line lies in `W`. -/
-theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+theorem WeierstrassCurve.Affine.equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
-  equation_neg <| equation_add' h₁' h₂' hxy
-#align weierstrass_curve.equation_add WeierstrassCurve.equation_add
+  WeierstrassCurve.Affine.equation_neg <| WeierstrassCurve.Affine.equation_add' h₁' h₂' hxy
+#align weierstrass_curve.equation_add WeierstrassCurve.Affine.equation_add
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
-#print WeierstrassCurve.nonsingular_add' /-
+#print WeierstrassCurve.Affine.nonsingular_add' /-
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
-theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+theorem WeierstrassCurve.Affine.nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   by_cases hx₁ : W.add_X x₁ x₂ (W.slope x₁ x₂ y₁ y₂) = x₁
@@ -749,106 +759,112 @@ theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
         eval_simp
       simpa only [neg_ne_zero, sub_self, MulZeroClass.mul_zero, add_zero] using
         mul_ne_zero (sub_ne_zero_of_ne hx₁) (sub_ne_zero_of_ne hx₂)
-#align weierstrass_curve.nonsingular_add' WeierstrassCurve.nonsingular_add'
+#align weierstrass_curve.nonsingular_add' WeierstrassCurve.Affine.nonsingular_add'
 -/
 
-#print WeierstrassCurve.nonsingular_add /-
+#print WeierstrassCurve.Affine.nonsingular_add /-
 /-- The addition of two nonsingular affine points in `W` on a sloped line is nonsingular. -/
-theorem nonsingular_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+theorem WeierstrassCurve.Affine.nonsingular_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
-  nonsingular_neg <| nonsingular_add' h₁ h₂ hxy
-#align weierstrass_curve.nonsingular_add WeierstrassCurve.nonsingular_add
+  WeierstrassCurve.Affine.nonsingular_neg <| WeierstrassCurve.Affine.nonsingular_add' h₁ h₂ hxy
+#align weierstrass_curve.nonsingular_add WeierstrassCurve.Affine.nonsingular_add
 -/
 
 namespace Point
 
 variable {h₁ h₂}
 
-#print WeierstrassCurve.Point.add /-
+#print WeierstrassCurve.Affine.Point.add /-
 /-- The addition of two nonsingular rational points.
 
 Given two nonsingular rational points `P` and `Q`, use `P + Q` instead of `add P Q`. -/
-noncomputable def add : W.Point → W.Point → W.Point
+noncomputable def WeierstrassCurve.Affine.Point.add : W.Point → W.Point → W.Point
   | 0, P => P
   | P, 0 => P
   | @some _ _ _ x₁ y₁ h₁, @some _ _ _ x₂ y₂ h₂ =>
     if hx : x₁ = x₂ then
-      if hy : y₁ = W.negY x₂ y₂ then 0 else some <| nonsingular_add h₁ h₂ fun _ => hy
-    else some <| nonsingular_add h₁ h₂ fun h => (hx h).elim
-#align weierstrass_curve.point.add WeierstrassCurve.Point.add
+      if hy : y₁ = W.negY x₂ y₂ then 0
+      else
+        WeierstrassCurve.Affine.Point.some <|
+          WeierstrassCurve.Affine.nonsingular_add h₁ h₂ fun _ => hy
+    else
+      WeierstrassCurve.Affine.Point.some <|
+        WeierstrassCurve.Affine.nonsingular_add h₁ h₂ fun h => (hx h).elim
+#align weierstrass_curve.point.add WeierstrassCurve.Affine.Point.add
 -/
 
 noncomputable instance : Add W.Point :=
-  ⟨add⟩
+  ⟨WeierstrassCurve.Affine.Point.add⟩
 
-#print WeierstrassCurve.Point.add_def /-
+#print WeierstrassCurve.Affine.Point.add_def /-
 @[simp]
-theorem add_def (P Q : W.Point) : P.add Q = P + Q :=
+theorem WeierstrassCurve.Affine.Point.add_def (P Q : W.Point) : P.add Q = P + Q :=
   rfl
-#align weierstrass_curve.point.add_def WeierstrassCurve.Point.add_def
+#align weierstrass_curve.point.add_def WeierstrassCurve.Affine.Point.add_def
 -/
 
 noncomputable instance : AddZeroClass W.Point :=
   ⟨0, (· + ·), by rintro (_ | _) <;> rfl, by rintro (_ | _) <;> rfl⟩
 
-#print WeierstrassCurve.Point.some_add_some_of_Y_eq /-
 @[simp]
-theorem some_add_some_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : some h₁ + some h₂ = 0 := by
+theorem WeierstrassCurve.Affine.Point.some_add_some_of_Y_eq (hx : x₁ = x₂)
+    (hy : y₁ = W.negY x₂ y₂) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ = 0 := by
   rw [← add_def, add, dif_pos hx, dif_pos hy]
-#align weierstrass_curve.point.some_add_some_of_Y_eq WeierstrassCurve.Point.some_add_some_of_Y_eq
--/
+#align weierstrass_curve.point.some_add_some_of_Y_eq WeierstrassCurve.Affine.Point.some_add_some_of_Y_eq
 
-#print WeierstrassCurve.Point.some_add_self_of_Y_eq /-
 @[simp]
-theorem some_add_self_of_Y_eq (hy : y₁ = W.negY x₁ y₁) : some h₁ + some h₁ = 0 :=
-  some_add_some_of_Y_eq rfl hy
-#align weierstrass_curve.point.some_add_self_of_Y_eq WeierstrassCurve.Point.some_add_self_of_Y_eq
--/
+theorem WeierstrassCurve.Affine.Point.some_add_self_of_Y_eq (hy : y₁ = W.negY x₁ y₁) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₁ = 0 :=
+  WeierstrassCurve.Affine.Point.some_add_some_of_Y_eq rfl hy
+#align weierstrass_curve.point.some_add_self_of_Y_eq WeierstrassCurve.Affine.Point.some_add_self_of_Y_eq
 
-#print WeierstrassCurve.Point.some_add_some_of_Y_ne /-
 @[simp]
-theorem some_add_some_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
-    some h₁ + some h₂ = some (nonsingular_add h₁ h₂ fun _ => hy) := by
-  rw [← add_def, add, dif_pos hx, dif_neg hy]
-#align weierstrass_curve.point.some_add_some_of_Y_ne WeierstrassCurve.Point.some_add_some_of_Y_ne
--/
+theorem WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne (hx : x₁ = x₂)
+    (hy : y₁ ≠ W.negY x₂ y₂) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ =
+      WeierstrassCurve.Affine.Point.some
+        (WeierstrassCurve.Affine.nonsingular_add h₁ h₂ fun _ => hy) :=
+  by rw [← add_def, add, dif_pos hx, dif_neg hy]
+#align weierstrass_curve.point.some_add_some_of_Y_ne WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne
+
+theorem WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne' (hx : x₁ = x₂)
+    (hy : y₁ ≠ W.negY x₂ y₂) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ =
+      -WeierstrassCurve.Affine.Point.some
+          (WeierstrassCurve.Affine.nonsingular_add' h₁ h₂ fun _ => hy) :=
+  WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne hx hy
+#align weierstrass_curve.point.some_add_some_of_Y_ne' WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne'
 
-#print WeierstrassCurve.Point.some_add_some_of_Y_ne' /-
-theorem some_add_some_of_Y_ne' (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
-    some h₁ + some h₂ = -some (nonsingular_add' h₁ h₂ fun _ => hy) :=
-  some_add_some_of_Y_ne hx hy
-#align weierstrass_curve.point.some_add_some_of_Y_ne' WeierstrassCurve.Point.some_add_some_of_Y_ne'
--/
-
-#print WeierstrassCurve.Point.some_add_self_of_Y_ne /-
 @[simp]
-theorem some_add_self_of_Y_ne (hy : y₁ ≠ W.negY x₁ y₁) :
-    some h₁ + some h₁ = some (nonsingular_add h₁ h₁ fun _ => hy) :=
-  some_add_some_of_Y_ne rfl hy
-#align weierstrass_curve.point.some_add_self_of_Y_ne WeierstrassCurve.Point.some_add_self_of_Y_ne
--/
+theorem WeierstrassCurve.Affine.Point.some_add_self_of_Y_ne (hy : y₁ ≠ W.negY x₁ y₁) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₁ =
+      WeierstrassCurve.Affine.Point.some
+        (WeierstrassCurve.Affine.nonsingular_add h₁ h₁ fun _ => hy) :=
+  WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne rfl hy
+#align weierstrass_curve.point.some_add_self_of_Y_ne WeierstrassCurve.Affine.Point.some_add_self_of_Y_ne
+
+theorem WeierstrassCurve.Affine.Point.some_add_self_of_Y_ne' (hy : y₁ ≠ W.negY x₁ y₁) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₁ =
+      -WeierstrassCurve.Affine.Point.some
+          (WeierstrassCurve.Affine.nonsingular_add' h₁ h₁ fun _ => hy) :=
+  WeierstrassCurve.Affine.Point.some_add_some_of_Y_ne rfl hy
+#align weierstrass_curve.point.some_add_self_of_Y_ne' WeierstrassCurve.Affine.Point.some_add_self_of_Y_ne'
 
-#print WeierstrassCurve.Point.some_add_self_of_Y_ne' /-
-theorem some_add_self_of_Y_ne' (hy : y₁ ≠ W.negY x₁ y₁) :
-    some h₁ + some h₁ = -some (nonsingular_add' h₁ h₁ fun _ => hy) :=
-  some_add_some_of_Y_ne rfl hy
-#align weierstrass_curve.point.some_add_self_of_Y_ne' WeierstrassCurve.Point.some_add_self_of_Y_ne'
--/
-
-#print WeierstrassCurve.Point.some_add_some_of_X_ne /-
 @[simp]
-theorem some_add_some_of_X_ne (hx : x₁ ≠ x₂) :
-    some h₁ + some h₂ = some (nonsingular_add h₁ h₂ fun h => (hx h).elim) := by
-  rw [← add_def, add, dif_neg hx]
-#align weierstrass_curve.point.some_add_some_of_X_ne WeierstrassCurve.Point.some_add_some_of_X_ne
--/
-
-#print WeierstrassCurve.Point.some_add_some_of_X_ne' /-
-theorem some_add_some_of_X_ne' (hx : x₁ ≠ x₂) :
-    some h₁ + some h₂ = -some (nonsingular_add' h₁ h₂ fun h => (hx h).elim) :=
-  some_add_some_of_X_ne hx
-#align weierstrass_curve.point.some_add_some_of_X_ne' WeierstrassCurve.Point.some_add_some_of_X_ne'
--/
+theorem WeierstrassCurve.Affine.Point.some_add_some_of_X_ne (hx : x₁ ≠ x₂) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ =
+      WeierstrassCurve.Affine.Point.some
+        (WeierstrassCurve.Affine.nonsingular_add h₁ h₂ fun h => (hx h).elim) :=
+  by rw [← add_def, add, dif_neg hx]
+#align weierstrass_curve.point.some_add_some_of_X_ne WeierstrassCurve.Affine.Point.some_add_some_of_X_ne
+
+theorem WeierstrassCurve.Affine.Point.some_add_some_of_X_ne' (hx : x₁ ≠ x₂) :
+    WeierstrassCurve.Affine.Point.some h₁ + WeierstrassCurve.Affine.Point.some h₂ =
+      -WeierstrassCurve.Affine.Point.some
+          (WeierstrassCurve.Affine.nonsingular_add' h₁ h₂ fun h => (hx h).elim) :=
+  WeierstrassCurve.Affine.Point.some_add_some_of_X_ne hx
+#align weierstrass_curve.point.some_add_some_of_X_ne' WeierstrassCurve.Affine.Point.some_add_some_of_X_ne'
 
 end Point
 
@@ -866,8 +882,11 @@ variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.XYIdeal_neg_mul /-
-theorem XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ :=
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal_neg_mul /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XYIdeal_neg_mul :
+    WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C <| W.negY x₁ y₁) *
+        WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C y₁) =
+      WeierstrassCurve.Affine.CoordinateRing.XIdeal W x₁ :=
   by
   have Y_rw :
     (Y - C (C y₁)) * (Y - C (C (W.neg_Y x₁ y₁))) -
@@ -876,7 +895,7 @@ theorem XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x
       W.polynomial * 1 :=
     by
     linear_combination (norm :=
-      (rw [neg_Y, WeierstrassCurve.polynomial];
+      (rw [neg_Y, WeierstrassCurve.Affine.polynomial];
         run_tac
           C_simp;
         ring1))
@@ -905,12 +924,14 @@ theorem XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x
     run_tac
       C_simp
     ring1
-#align weierstrass_curve.XY_ideal_neg_mul WeierstrassCurve.XYIdeal_neg_mul
+#align weierstrass_curve.XY_ideal_neg_mul WeierstrassCurve.Affine.CoordinateRing.XYIdeal_neg_mul
 -/
 
 private theorem XY_ideal'_mul_inv :
-    (XYIdeal W x₁ (C y₁) : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) *
-        (XYIdeal W x₁ (C <| W.negY x₁ y₁) * (XIdeal W x₁)⁻¹) =
+    (WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C y₁) :
+          FractionalIdeal W.CoordinateRing⁰ W.FunctionField) *
+        (WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C <| W.negY x₁ y₁) *
+          (WeierstrassCurve.Affine.CoordinateRing.XIdeal W x₁)⁻¹) =
       1 :=
   by
   rw [← mul_assoc, ← FractionalIdeal.coeIdeal_mul, mul_comm <| XY_ideal W _ _, XY_ideal_neg_mul h₁,
@@ -919,11 +940,15 @@ private theorem XY_ideal'_mul_inv :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
-#print WeierstrassCurve.XYIdeal_mul_XYIdeal /-
-theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (XYIdeal W x₁ (C y₁) * XYIdeal W x₂ (C y₂)) =
-      YIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
-        XYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal_mul_XYIdeal /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XYIdeal_mul_XYIdeal
+    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    WeierstrassCurve.Affine.CoordinateRing.XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) *
+        (WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C y₁) *
+          WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₂ (C y₂)) =
+      WeierstrassCurve.Affine.CoordinateRing.YIdeal W
+          (WeierstrassCurve.Affine.linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
+        WeierstrassCurve.Affine.CoordinateRing.XYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
           (C <| W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   have sup_rw : ∀ a b c d : Ideal W.coordinate_ring, a ⊔ (b ⊔ (c ⊔ d)) = a ⊔ d ⊔ b ⊔ c :=
@@ -953,7 +978,7 @@ theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
           0, C (C y⁻¹) * (Y - W.neg_polynomial), _⟩,
         by
         rw [map_add, map_one, _root_.map_mul, AdjoinRoot.mk_self, MulZeroClass.mul_zero, add_zero]⟩
-    rw [WeierstrassCurve.polynomial, neg_polynomial, ←
+    rw [WeierstrassCurve.Affine.polynomial, neg_polynomial, ←
       mul_right_inj' <| C_ne_zero.mpr <| C_ne_zero.mpr hxy]
     simp only [mul_add, ← mul_assoc, ← C_mul, mul_inv_cancel hxy]
     linear_combination (norm :=
@@ -969,27 +994,33 @@ theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     run_tac
       C_simp
     ring1
-#align weierstrass_curve.XY_ideal_mul_XY_ideal WeierstrassCurve.XYIdeal_mul_XYIdeal
+#align weierstrass_curve.XY_ideal_mul_XY_ideal WeierstrassCurve.Affine.CoordinateRing.XYIdeal_mul_XYIdeal
 -/
 
-#print WeierstrassCurve.XYIdeal' /-
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal' /-
 /-- The non-zero fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ for some $x, y \in F$. -/
 @[simp]
-noncomputable def XYIdeal' : (FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.XYIdeal' :
+    (FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
   Units.mkOfMulEqOne _ _ <| XY_ideal'_hMul_inv h₁
-#align weierstrass_curve.XY_ideal' WeierstrassCurve.XYIdeal'
+#align weierstrass_curve.XY_ideal' WeierstrassCurve.Affine.CoordinateRing.XYIdeal'
 -/
 
-#print WeierstrassCurve.XYIdeal'_eq /-
-theorem XYIdeal'_eq :
-    (XYIdeal' h₁ : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) = XYIdeal W x₁ (C y₁) :=
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal'_eq /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XYIdeal'_eq :
+    (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h₁ :
+        FractionalIdeal W.CoordinateRing⁰ W.FunctionField) =
+      WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x₁ (C y₁) :=
   rfl
-#align weierstrass_curve.XY_ideal'_eq WeierstrassCurve.XYIdeal'_eq
+#align weierstrass_curve.XY_ideal'_eq WeierstrassCurve.Affine.CoordinateRing.XYIdeal'_eq
 -/
 
-#print WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq /-
-theorem mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq :
-    ClassGroup.mk (XYIdeal' <| nonsingular_neg h₁) * ClassGroup.mk (XYIdeal' h₁) = 1 :=
+theorem mk_xYIdeal'_hMul_mk_xYIdeal'_of_Y_eq :
+    ClassGroup.mk
+          (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' <|
+            WeierstrassCurve.Affine.nonsingular_neg h₁) *
+        ClassGroup.mk (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h₁) =
+      1 :=
   by
   rw [← _root_.map_mul]
   exact
@@ -997,40 +1028,45 @@ theorem mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq :
           (FractionalIdeal.coeIdeal_mul _ _).symm.trans
             (fractional_ideal.coe_ideal_inj.mpr <| XY_ideal_neg_mul h₁)).mpr
       ⟨_, X_class_ne_zero W _, rfl⟩
-#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq
--/
-
-#print WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal' /-
-theorem mk_XYIdeal'_mul_mk_XYIdeal' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    ClassGroup.mk (XYIdeal' h₁) * ClassGroup.mk (XYIdeal' h₂) =
-      ClassGroup.mk (XYIdeal' <| nonsingular_add h₁ h₂ hxy) :=
+#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq WeierstrassCurve.mk_xYIdeal'_hMul_mk_xYIdeal'_of_Y_eq
+
+#print WeierstrassCurve.Affine.CoordinateRing.mk_XYIdeal'_mul_mk_XYIdeal' /-
+theorem WeierstrassCurve.Affine.CoordinateRing.mk_XYIdeal'_mul_mk_XYIdeal'
+    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    ClassGroup.mk (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h₁) *
+        ClassGroup.mk (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h₂) =
+      ClassGroup.mk
+        (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' <|
+          WeierstrassCurve.Affine.nonsingular_add h₁ h₂ hxy) :=
   by
   rw [← _root_.map_mul]
   exact
     (ClassGroup.mk_eq_mk_of_coe_ideal (FractionalIdeal.coeIdeal_mul _ _).symm <| XY_ideal'_eq _).mpr
       ⟨_, _, X_class_ne_zero W _, Y_class_ne_zero W _, XY_ideal_mul_XY_ideal h₁.left h₂.left hxy⟩
-#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal' WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal'
+#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal' WeierstrassCurve.Affine.CoordinateRing.mk_XYIdeal'_mul_mk_XYIdeal'
 -/
 
 namespace Point
 
-#print WeierstrassCurve.Point.toClassFun /-
+#print WeierstrassCurve.Affine.Point.toClassFun /-
 /-- The set function mapping an affine point $(x, y)$ of `W` to the class of the non-zero fractional
 ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
 @[simp]
-noncomputable def toClassFun : W.Point → Additive (ClassGroup W.CoordinateRing)
+noncomputable def WeierstrassCurve.Affine.Point.toClassFun :
+    W.Point → Additive (ClassGroup W.CoordinateRing)
   | 0 => 0
-  | some h => Additive.ofMul <| ClassGroup.mk <| XYIdeal' h
-#align weierstrass_curve.point.to_class_fun WeierstrassCurve.Point.toClassFun
+  | some h => Additive.ofMul <| ClassGroup.mk <| WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h
+#align weierstrass_curve.point.to_class_fun WeierstrassCurve.Affine.Point.toClassFun
 -/
 
-#print WeierstrassCurve.Point.toClass /-
+#print WeierstrassCurve.Affine.Point.toClass /-
 /-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
 fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
 @[simps]
-noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing)
+noncomputable def WeierstrassCurve.Affine.Point.toClass :
+    W.Point →+ Additive (ClassGroup W.CoordinateRing)
     where
-  toFun := toClassFun
+  toFun := WeierstrassCurve.Affine.Point.toClassFun
   map_zero' := rfl
   map_add' := by
     rintro (_ | @⟨x₁, y₁, h₁⟩) (_ | @⟨x₂, y₂, h₂⟩)
@@ -1046,25 +1082,28 @@ noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing)
     ·
       simpa only [some_add_some_of_X_ne hx] using
         (mk_XY_ideal'_mul_mk_XY_ideal' h₁ h₂ fun h => (hx h).elim).symm
-#align weierstrass_curve.point.to_class WeierstrassCurve.Point.toClass
+#align weierstrass_curve.point.to_class WeierstrassCurve.Affine.Point.toClass
 -/
 
-#print WeierstrassCurve.Point.toClass_zero /-
+#print WeierstrassCurve.Affine.Point.toClass_zero /-
 @[simp]
-theorem toClass_zero : toClass (0 : W.Point) = 0 :=
+theorem WeierstrassCurve.Affine.Point.toClass_zero :
+    WeierstrassCurve.Affine.Point.toClass (0 : W.Point) = 0 :=
   rfl
-#align weierstrass_curve.point.to_class_zero WeierstrassCurve.Point.toClass_zero
+#align weierstrass_curve.point.to_class_zero WeierstrassCurve.Affine.Point.toClass_zero
 -/
 
-#print WeierstrassCurve.Point.toClass_some /-
-theorem toClass_some : toClass (some h₁) = ClassGroup.mk (XYIdeal' h₁) :=
+#print WeierstrassCurve.Affine.Point.toClass_some /-
+theorem WeierstrassCurve.Affine.Point.toClass_some :
+    WeierstrassCurve.Affine.Point.toClass (WeierstrassCurve.Affine.Point.some h₁) =
+      ClassGroup.mk (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h₁) :=
   rfl
-#align weierstrass_curve.point.to_class_some WeierstrassCurve.Point.toClass_some
+#align weierstrass_curve.point.to_class_some WeierstrassCurve.Affine.Point.toClass_some
 -/
 
-#print WeierstrassCurve.Point.add_eq_zero /-
+#print WeierstrassCurve.Affine.Point.add_eq_zero /-
 @[simp]
-theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
+theorem WeierstrassCurve.Affine.Point.add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
   by
   rcases P, Q with ⟨_ | @⟨x₁, y₁, _⟩, _ | @⟨x₂, y₂, _⟩⟩
   any_goals rfl
@@ -1080,23 +1119,25 @@ theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
       · rw [some_add_some_of_X_ne hx] at h 
         contradiction
     · exact fun ⟨hx, hy⟩ => some_add_some_of_Y_eq hx hy
-#align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Point.add_eq_zero
+#align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Affine.Point.add_eq_zero
 -/
 
-#print WeierstrassCurve.Point.add_left_neg /-
+#print WeierstrassCurve.Affine.Point.add_left_neg /-
 @[simp]
-theorem add_left_neg (P : W.Point) : -P + P = 0 := by rw [add_eq_zero]
-#align weierstrass_curve.point.add_left_neg WeierstrassCurve.Point.add_left_neg
+theorem WeierstrassCurve.Affine.Point.add_left_neg (P : W.Point) : -P + P = 0 := by rw [add_eq_zero]
+#align weierstrass_curve.point.add_left_neg WeierstrassCurve.Affine.Point.add_left_neg
 -/
 
-#print WeierstrassCurve.Point.neg_add_eq_zero /-
+#print WeierstrassCurve.Affine.Point.neg_add_eq_zero /-
 @[simp]
-theorem neg_add_eq_zero (P Q : W.Point) : -P + Q = 0 ↔ P = Q := by rw [add_eq_zero, neg_inj]
-#align weierstrass_curve.point.neg_add_eq_zero WeierstrassCurve.Point.neg_add_eq_zero
+theorem WeierstrassCurve.Affine.Point.neg_add_eq_zero (P Q : W.Point) : -P + Q = 0 ↔ P = Q := by
+  rw [add_eq_zero, neg_inj]
+#align weierstrass_curve.point.neg_add_eq_zero WeierstrassCurve.Affine.Point.neg_add_eq_zero
 -/
 
-#print WeierstrassCurve.Point.toClass_eq_zero /-
-theorem toClass_eq_zero (P : W.Point) : toClass P = 0 ↔ P = 0 :=
+#print WeierstrassCurve.Affine.Point.toClass_eq_zero /-
+theorem WeierstrassCurve.Affine.Point.toClass_eq_zero (P : W.Point) :
+    WeierstrassCurve.Affine.Point.toClass P = 0 ↔ P = 0 :=
   ⟨by
     intro hP
     rcases P with (_ | @⟨_, _, ⟨h, _⟩⟩)
@@ -1106,42 +1147,43 @@ theorem toClass_eq_zero (P : W.Point) : toClass P = 0 ↔ P = 0 :=
       rw [← finrank_quotient_span_eq_natDegree_norm W.CoordinateRing.Basis h0, ←
         (quotient_equiv_alg_of_eq F hp).toLinearEquiv.finrank_eq,
         (quotient_XY_ideal_equiv W h).toLinearEquiv.finrank_eq, FiniteDimensional.finrank_self],
-    congr_arg toClass⟩
-#align weierstrass_curve.point.to_class_eq_zero WeierstrassCurve.Point.toClass_eq_zero
+    congr_arg WeierstrassCurve.Affine.Point.toClass⟩
+#align weierstrass_curve.point.to_class_eq_zero WeierstrassCurve.Affine.Point.toClass_eq_zero
 -/
 
-#print WeierstrassCurve.Point.toClass_injective /-
-theorem toClass_injective : Function.Injective <| @toClass _ _ W :=
+#print WeierstrassCurve.Affine.Point.toClass_injective /-
+theorem WeierstrassCurve.Affine.Point.toClass_injective :
+    Function.Injective <| @WeierstrassCurve.Affine.Point.toClass _ _ W :=
   by
   rintro (_ | h) _ hP
   all_goals rw [← neg_add_eq_zero, ← to_class_eq_zero, map_add, ← hP]
   · exact zero_add 0
   · exact mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq h
-#align weierstrass_curve.point.to_class_injective WeierstrassCurve.Point.toClass_injective
+#align weierstrass_curve.point.to_class_injective WeierstrassCurve.Affine.Point.toClass_injective
 -/
 
-#print WeierstrassCurve.Point.add_comm /-
-theorem add_comm (P Q : W.Point) : P + Q = Q + P :=
-  toClass_injective <| by simp only [map_add, add_comm]
-#align weierstrass_curve.point.add_comm WeierstrassCurve.Point.add_comm
+#print WeierstrassCurve.Affine.Point.add_comm /-
+theorem WeierstrassCurve.Affine.Point.add_comm (P Q : W.Point) : P + Q = Q + P :=
+  WeierstrassCurve.Affine.Point.toClass_injective <| by simp only [map_add, add_comm]
+#align weierstrass_curve.point.add_comm WeierstrassCurve.Affine.Point.add_comm
 -/
 
-#print WeierstrassCurve.Point.add_assoc /-
-theorem add_assoc (P Q R : W.Point) : P + Q + R = P + (Q + R) :=
-  toClass_injective <| by simp only [map_add, add_assoc]
-#align weierstrass_curve.point.add_assoc WeierstrassCurve.Point.add_assoc
+#print WeierstrassCurve.Affine.Point.add_assoc /-
+theorem WeierstrassCurve.Affine.Point.add_assoc (P Q R : W.Point) : P + Q + R = P + (Q + R) :=
+  WeierstrassCurve.Affine.Point.toClass_injective <| by simp only [map_add, add_assoc]
+#align weierstrass_curve.point.add_assoc WeierstrassCurve.Affine.Point.add_assoc
 -/
 
 noncomputable instance : AddCommGroup W.Point
     where
-  zero := zero
-  neg := neg
-  add := add
+  zero := WeierstrassCurve.Affine.Point.zero
+  neg := WeierstrassCurve.Affine.Point.neg
+  add := WeierstrassCurve.Affine.Point.add
   zero_add := zero_add
   add_zero := add_zero
-  add_left_neg := add_left_neg
-  add_comm := add_comm
-  add_assoc := add_assoc
+  add_left_neg := WeierstrassCurve.Affine.Point.add_left_neg
+  add_comm := WeierstrassCurve.Affine.Point.add_comm
+  add_assoc := WeierstrassCurve.Affine.Point.add_assoc
 
 end Point
 
@@ -1159,20 +1201,22 @@ namespace Point
 
 open scoped WeierstrassCurve
 
-#print WeierstrassCurve.Point.ofBaseChangeFun /-
+#print WeierstrassCurve.Affine.Point.ofBaseChangeFun /-
 /-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
-def ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
+def WeierstrassCurve.Affine.Point.ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
   | 0 => 0
-  | some h => some <| (nonsingular_iff_baseChange_of_baseChange W F K _ _).mp h
-#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Point.ofBaseChangeFun
+  | some h =>
+    WeierstrassCurve.Affine.Point.some <|
+      (WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange W F K _ _).mp h
+#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Affine.Point.ofBaseChangeFun
 -/
 
-#print WeierstrassCurve.Point.ofBaseChange /-
+#print WeierstrassCurve.Affine.Point.ofBaseChange /-
 /-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
 @[simps]
-def ofBaseChange : W⟮F⟯ →+ W⟮K⟯
+def WeierstrassCurve.Affine.Point.ofBaseChange : W⟮F⟯ →+ W⟮K⟯
     where
-  toFun := ofBaseChangeFun W F K
+  toFun := WeierstrassCurve.Affine.Point.ofBaseChangeFun W F K
   map_zero' := rfl
   map_add' := by
     rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
@@ -1197,11 +1241,12 @@ def ofBaseChange : W⟮F⟯ →+ W⟮K⟯
         exact ⟨rfl, rfl⟩
       · contrapose! hx
         exact NoZeroSMulDivisors.algebraMap_injective F K hx
-#align weierstrass_curve.point.of_base_change WeierstrassCurve.Point.ofBaseChange
+#align weierstrass_curve.point.of_base_change WeierstrassCurve.Affine.Point.ofBaseChange
 -/
 
-#print WeierstrassCurve.Point.ofBaseChange_injective /-
-theorem ofBaseChange_injective : Function.Injective <| ofBaseChange W F K :=
+#print WeierstrassCurve.Affine.Point.ofBaseChange_injective /-
+theorem WeierstrassCurve.Affine.Point.ofBaseChange_injective :
+    Function.Injective <| WeierstrassCurve.Affine.Point.ofBaseChange W F K :=
   by
   rintro (_ | _) (_ | _) h
   · rfl
@@ -1210,7 +1255,7 @@ theorem ofBaseChange_injective : Function.Injective <| ofBaseChange W F K :=
   exact
     ⟨NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).left,
       NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).right⟩
-#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Point.ofBaseChange_injective
+#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Affine.Point.ofBaseChange_injective
 -/
 
 end Point
@@ -1228,11 +1273,11 @@ namespace Point
 
 variable {R : Type} [Nontrivial R] [CommRing R] (E : EllipticCurve R)
 
-#print EllipticCurve.Point.mk /-
+#print EllipticCurve.Affine.Point.mk /-
 /-- An affine point on an elliptic curve `E` over `R`. -/
-def mk {x y : R} (h : E.equation x y) : E.Point :=
-  WeierstrassCurve.Point.some <| E.nonsingular h
-#align elliptic_curve.point.mk EllipticCurve.Point.mk
+def EllipticCurve.Affine.Point.mk {x y : R} (h : E.equation x y) : E.Point :=
+  WeierstrassCurve.Affine.Point.some <| E.nonsingular h
+#align elliptic_curve.point.mk EllipticCurve.Affine.Point.mk
 -/
 
 end Point
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
 -/
-import Mathbin.AlgebraicGeometry.EllipticCurve.Weierstrass
-import Mathbin.LinearAlgebra.FreeModule.Norm
-import Mathbin.RingTheory.ClassGroup
+import AlgebraicGeometry.EllipticCurve.Weierstrass
+import LinearAlgebra.FreeModule.Norm
+import RingTheory.ClassGroup
 
 #align_import algebraic_geometry.elliptic_curve.point from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
 
@@ -73,19 +73,19 @@ elliptic curve, rational point, group law
 -/
 
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:337:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def map_simp : tactic Unit :=
   sorry
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:337:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def eval_simp : tactic Unit :=
   sorry
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:337:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def C_simp : tactic Unit :=
   sorry
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:337:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def derivative_simp : tactic Unit :=
   sorry
 
Diff
@@ -976,7 +976,7 @@ theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 /-- The non-zero fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ for some $x, y \in F$. -/
 @[simp]
 noncomputable def XYIdeal' : (FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
-  Units.mkOfMulEqOne _ _ <| XY_ideal'_mul_inv h₁
+  Units.mkOfMulEqOne _ _ <| XY_ideal'_hMul_inv h₁
 #align weierstrass_curve.XY_ideal' WeierstrassCurve.XYIdeal'
 -/
 
Diff
@@ -127,7 +127,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
 #print WeierstrassCurve.baseChange_negY /-
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
@@ -147,7 +147,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 #print WeierstrassCurve.eval_negPolynomial /-
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
@@ -167,7 +167,7 @@ noncomputable def linePolynomial : R[X] :=
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.XYIdeal_eq₁ /-
 theorem XYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
   by
@@ -192,8 +192,8 @@ noncomputable def addPolynomial : R[X] :=
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.C_addPolynomial /-
 theorem C_addPolynomial :
     C (W.addPolynomial x₁ y₁ L) =
@@ -218,8 +218,8 @@ theorem CoordinateRing.C_addPolynomial :
 #align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.C_addPolynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.addPolynomial_eq /-
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
@@ -248,7 +248,7 @@ def addX : R :=
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
 #print WeierstrassCurve.baseChange_addX /-
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
@@ -279,7 +279,7 @@ def addY' : R :=
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
 #print WeierstrassCurve.baseChange_addY' /-
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
@@ -329,7 +329,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.XYIdeal_add_eq /-
 theorem XYIdeal_add_eq :
     XYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
@@ -348,7 +348,7 @@ theorem XYIdeal_add_eq :
 #align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.XYIdeal_add_eq
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 #print WeierstrassCurve.equation_add_iff /-
 theorem equation_add_iff :
     W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
@@ -360,10 +360,10 @@ theorem equation_add_iff :
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.238258113.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2999436871.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 #print WeierstrassCurve.nonsingular_add_of_eval_derivative_ne_zero /-
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
@@ -569,8 +569,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3610613541.map_simp -/
 #print WeierstrassCurve.baseChange_slope /-
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
@@ -623,8 +623,8 @@ theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.XYIdeal_eq₂ /-
 theorem XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
@@ -689,7 +689,7 @@ theorem CoordinateRing.C_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.n
 #align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.C_addPolynomial_slope
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.238258113.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2999436871.derivative_simp -/
 #print WeierstrassCurve.derivative_addPolynomial_slope /-
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
@@ -705,7 +705,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 #print WeierstrassCurve.equation_add' /-
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
@@ -727,7 +727,7 @@ theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.721409751.eval_simp -/
 #print WeierstrassCurve.nonsingular_add' /-
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
@@ -863,9 +863,9 @@ variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ :
   (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂) (h₁' : W.equation x₁ y₁)
   (h₂' : W.equation x₂ y₂)
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.XYIdeal_neg_mul /-
 theorem XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ :=
   by
@@ -917,8 +917,8 @@ private theorem XY_ideal'_mul_inv :
     X_ideal,
     FractionalIdeal.coe_ideal_span_singleton_mul_inv W.function_field <| X_class_ne_zero W x₁]
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3423248015.C_simp -/
 #print WeierstrassCurve.XYIdeal_mul_XYIdeal /-
 theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (XYIdeal W x₁ (C y₁) * XYIdeal W x₂ (C y₂)) =
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
-
-! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.AlgebraicGeometry.EllipticCurve.Weierstrass
 import Mathbin.LinearAlgebra.FreeModule.Norm
 import Mathbin.RingTheory.ClassGroup
 
+#align_import algebraic_geometry.elliptic_curve.point from "leanprover-community/mathlib"@"1a51edf13debfcbe223fa06b1cb353b9ed9751cc"
+
 /-!
 # Nonsingular rational points on Weierstrass curves
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit e2e7f2ac359e7514e4d40061d7c08bb69487ba4e
+! leanprover-community/mathlib commit 1a51edf13debfcbe223fa06b1cb353b9ed9751cc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.RingTheory.ClassGroup
 /-!
 # Nonsingular rational points on Weierstrass curves
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the type of nonsingular rational points on a Weierstrass curve over a field and
 proves that it forms an abelian group under a geometric secant-and-tangent process.
 
@@ -127,7 +130,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
 #print WeierstrassCurve.baseChange_negY /-
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
@@ -147,7 +150,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
 #print WeierstrassCurve.eval_negPolynomial /-
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
@@ -167,7 +170,7 @@ noncomputable def linePolynomial : R[X] :=
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.XYIdeal_eq₁ /-
 theorem XYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
   by
@@ -192,8 +195,8 @@ noncomputable def addPolynomial : R[X] :=
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.C_addPolynomial /-
 theorem C_addPolynomial :
     C (W.addPolynomial x₁ y₁ L) =
@@ -218,8 +221,8 @@ theorem CoordinateRing.C_addPolynomial :
 #align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.C_addPolynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.addPolynomial_eq /-
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
@@ -248,7 +251,7 @@ def addX : R :=
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
 #print WeierstrassCurve.baseChange_addX /-
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
@@ -279,7 +282,7 @@ def addY' : R :=
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
 #print WeierstrassCurve.baseChange_addY' /-
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
@@ -329,7 +332,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.XYIdeal_add_eq /-
 theorem XYIdeal_add_eq :
     XYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
@@ -348,7 +351,7 @@ theorem XYIdeal_add_eq :
 #align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.XYIdeal_add_eq
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
 #print WeierstrassCurve.equation_add_iff /-
 theorem equation_add_iff :
     W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
@@ -360,10 +363,10 @@ theorem equation_add_iff :
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.238258113.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
 #print WeierstrassCurve.nonsingular_add_of_eval_derivative_ne_zero /-
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
@@ -569,8 +572,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4021998751.map_simp -/
 #print WeierstrassCurve.baseChange_slope /-
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
@@ -623,8 +626,8 @@ theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.XYIdeal_eq₂ /-
 theorem XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
@@ -689,7 +692,7 @@ theorem CoordinateRing.C_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.n
 #align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.C_addPolynomial_slope
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.238258113.derivative_simp -/
 #print WeierstrassCurve.derivative_addPolynomial_slope /-
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
@@ -705,7 +708,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
 #print WeierstrassCurve.equation_add' /-
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
@@ -727,7 +730,7 @@ theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.806290513.eval_simp -/
 #print WeierstrassCurve.nonsingular_add' /-
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
@@ -863,9 +866,9 @@ variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ :
   (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂) (h₁' : W.equation x₁ y₁)
   (h₂' : W.equation x₂ y₂)
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.XYIdeal_neg_mul /-
 theorem XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ :=
   by
@@ -917,8 +920,8 @@ private theorem XY_ideal'_mul_inv :
     X_ideal,
     FractionalIdeal.coe_ideal_span_singleton_mul_inv W.function_field <| X_class_ne_zero W x₁]
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3192910857.C_simp -/
 #print WeierstrassCurve.XYIdeal_mul_XYIdeal /-
 theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (XYIdeal W x₁ (C y₁) * XYIdeal W x₂ (C y₂)) =
Diff
@@ -105,11 +105,14 @@ section Basic
 variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (A : Type v) [CommRing A] [Algebra R A]
   (B : Type w) [CommRing B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] (x₁ x₂ y₁ y₂ L : R)
 
+#print WeierstrassCurve.negPolynomial /-
 /-- The polynomial $-Y - a_1X - a_3$ associated to negation. -/
 noncomputable def negPolynomial : R[X][Y] :=
   -Y - C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.neg_polynomial WeierstrassCurve.negPolynomial
+-/
 
+#print WeierstrassCurve.negY /-
 /-- The $Y$-coordinate of the negation of an affine point in `W`.
 
 This depends on `W`, and has argument order: $x_1$, $y_1$. -/
@@ -117,11 +120,15 @@ This depends on `W`, and has argument order: $x_1$, $y_1$. -/
 def negY : R :=
   -y₁ - W.a₁ * x₁ - W.a₃
 #align weierstrass_curve.neg_Y WeierstrassCurve.negY
+-/
 
+#print WeierstrassCurve.negY_negY /-
 theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y]; ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+#print WeierstrassCurve.baseChange_negY /-
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -130,21 +137,27 @@ theorem baseChange_negY :
     map_simp;
   rfl
 #align weierstrass_curve.base_change_neg_Y WeierstrassCurve.baseChange_negY
+-/
 
+#print WeierstrassCurve.baseChange_negY_of_baseChange /-
 theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
     (W.base_change B).negY (algebraMap A B x₁) (algebraMap A B y₁) =
       algebraMap A B ((W.base_change A).negY x₁ y₁) :=
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+#print WeierstrassCurve.eval_negPolynomial /-
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
   rw [neg_Y, sub_sub, neg_polynomial];
   run_tac
     eval_simp
 #align weierstrass_curve.eval_neg_polynomial WeierstrassCurve.eval_negPolynomial
+-/
 
+#print WeierstrassCurve.linePolynomial /-
 /-- The polynomial $L(X - x_1) + y_1$ associated to the line $Y = L(X - x_1) + y_1$,
 with a slope of $L$ that passes through an affine point $(x_1, y_1)$.
 
@@ -152,9 +165,11 @@ This does not depend on `W`, and has argument order: $x_1$, $y_1$, $L$. -/
 noncomputable def linePolynomial : R[X] :=
   C L * (X - C x₁) + C y₁
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
+#print WeierstrassCurve.XYIdeal_eq₁ /-
+theorem XYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
   by
   simp only [XY_ideal, X_class, Y_class, line_polynomial]
   rw [← span_pair_add_mul_right <| AdjoinRoot.mk _ <| C <| C <| -L, ← _root_.map_mul, ← map_add]
@@ -162,8 +177,10 @@ theorem xYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial
   run_tac
     C_simp
   ring1
-#align weierstrass_curve.XY_ideal_eq₁ WeierstrassCurve.xYIdeal_eq₁
+#align weierstrass_curve.XY_ideal_eq₁ WeierstrassCurve.XYIdeal_eq₁
+-/
 
+#print WeierstrassCurve.addPolynomial /-
 /-- The polynomial obtained by substituting the line $Y = L*(X - x_1) + y_1$, with a slope of $L$
 that passes through an affine point $(x_1, y_1)$, into the polynomial $W(X, Y)$ associated to `W`.
 If such a line intersects `W` at another point $(x_2, y_2)$, then the roots of this polynomial are
@@ -173,10 +190,12 @@ This depends on `W`, and has argument order: $x_1$, $y_1$, $L$. -/
 noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem c_addPolynomial :
+#print WeierstrassCurve.C_addPolynomial /-
+theorem C_addPolynomial :
     C (W.addPolynomial x₁ y₁ L) =
       (Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L)) +
         W.Polynomial :=
@@ -187,17 +206,21 @@ theorem c_addPolynomial :
   run_tac
     C_simp;
   ring1
-#align weierstrass_curve.C_add_polynomial WeierstrassCurve.c_addPolynomial
+#align weierstrass_curve.C_add_polynomial WeierstrassCurve.C_addPolynomial
+-/
 
-theorem CoordinateRing.c_addPolynomial :
+#print WeierstrassCurve.CoordinateRing.C_addPolynomial /-
+theorem CoordinateRing.C_addPolynomial :
     AdjoinRoot.mk W.Polynomial (C (W.addPolynomial x₁ y₁ L)) =
       AdjoinRoot.mk W.Polynomial
         ((Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L))) :=
   AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [C_add_polynomial, add_sub_cancel', mul_one]⟩
-#align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.c_addPolynomial
+#align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.C_addPolynomial
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+#print WeierstrassCurve.addPolynomial_eq /-
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -212,7 +235,9 @@ theorem addPolynomial_eq :
     C_simp;
   ring1
 #align weierstrass_curve.add_polynomial_eq WeierstrassCurve.addPolynomial_eq
+-/
 
+#print WeierstrassCurve.addX /-
 /-- The $X$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`,
 where the line through them is not vertical and has a slope of $L$.
 
@@ -221,8 +246,10 @@ This depends on `W`, and has argument order: $x_1$, $x_2$, $L$. -/
 def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+#print WeierstrassCurve.baseChange_addX /-
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -231,13 +258,17 @@ theorem baseChange_addX :
     map_simp;
   rfl
 #align weierstrass_curve.base_change_add_X WeierstrassCurve.baseChange_addX
+-/
 
+#print WeierstrassCurve.baseChange_addX_of_baseChange /-
 theorem baseChange_addX_of_baseChange (x₁ x₂ L : A) :
     (W.base_change B).addX (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addX x₁ x₂ L) :=
   by rw [← base_change_add_X, base_change_base_change]
 #align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.baseChange_addX_of_baseChange
+-/
 
+#print WeierstrassCurve.addY' /-
 /-- The $Y$-coordinate, before applying the final negation, of the addition of two affine points
 $(x_1, y_1)$ and $(x_2, y_2)$, where the line through them is not vertical and has a slope of $L$.
 
@@ -246,8 +277,10 @@ This depends on `W`, and has argument order: $x_1$, $x_2$, $y_1$, $L$. -/
 def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+#print WeierstrassCurve.baseChange_addY' /-
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -256,14 +289,18 @@ theorem baseChange_addY' :
   run_tac
     map_simp
 #align weierstrass_curve.base_change_add_Y' WeierstrassCurve.baseChange_addY'
+-/
 
+#print WeierstrassCurve.baseChange_addY'_of_baseChange /-
 theorem baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
     (W.base_change B).addY' (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
         (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addY' x₁ x₂ y₁ L) :=
   by rw [← base_change_add_Y', base_change_base_change]
 #align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.baseChange_addY'_of_baseChange
+-/
 
+#print WeierstrassCurve.addY /-
 /-- The $Y$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`,
 where the line through them is not vertical and has a slope of $L$.
 
@@ -272,23 +309,29 @@ This depends on `W`, and has argument order: $x_1$, $x_2$, $y_1$, $L$. -/
 def addY : R :=
   W.negY (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L)
 #align weierstrass_curve.add_Y WeierstrassCurve.addY
+-/
 
+#print WeierstrassCurve.baseChange_addY /-
 theorem baseChange_addY :
     (W.base_change A).addY (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
       algebraMap R A (W.addY x₁ x₂ y₁ L) :=
   by simp only [add_Y, base_change_add_Y', base_change_add_X, base_change_neg_Y]
 #align weierstrass_curve.base_change_add_Y WeierstrassCurve.baseChange_addY
+-/
 
+#print WeierstrassCurve.baseChange_addY_of_baseChange /-
 theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
     (W.base_change B).addY (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
         (algebraMap A B L) =
       algebraMap A B ((W.base_change A).addY x₁ x₂ y₁ L) :=
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_add_eq :
+#print WeierstrassCurve.XYIdeal_add_eq /-
+theorem XYIdeal_add_eq :
     XYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
       span {AdjoinRoot.mk W.Polynomial <| W.negPolynomial - C (linePolynomial x₁ y₁ L)} ⊔
         XIdeal W (W.addX x₁ x₂ L) :=
@@ -302,9 +345,11 @@ theorem xYIdeal_add_eq :
   run_tac
     C_simp
   ring1
-#align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.xYIdeal_add_eq
+#align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.XYIdeal_add_eq
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+#print WeierstrassCurve.equation_add_iff /-
 theorem equation_add_iff :
     W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -313,11 +358,13 @@ theorem equation_add_iff :
   run_tac
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+#print WeierstrassCurve.nonsingular_add_of_eval_derivative_ne_zero /-
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -337,10 +384,12 @@ theorem nonsingular_add_of_eval_derivative_ne_zero
     eval_simp
   linear_combination (norm := (norm_num1; ring1)) hx.left + L * hx.right
 #align weierstrass_curve.nonsingular_add_of_eval_derivative_ne_zero WeierstrassCurve.nonsingular_add_of_eval_derivative_ne_zero
+-/
 
 /-! ### The type of nonsingular rational points on a Weierstrass curve -/
 
 
+#print WeierstrassCurve.Point /-
 /-- A nonsingular rational point on a Weierstrass curve `W` over `R`. This is either the point at
 infinity `weierstrass_curve.point.zero` or an affine point `weierstrass_curve.point.some` $(x, y)$
 satisfying the equation $y^2 + a_1xy + a_3y = x^3 + a_2x^2 + a_4x + a_6$ of `W`. For an algebraic
@@ -349,6 +398,7 @@ inductive Point
   | zero
   | some {x y : R} (h : W.nonsingular x y)
 #align weierstrass_curve.point WeierstrassCurve.Point
+-/
 
 scoped notation W "⟮" S "⟯" => (W.base_change S).Point
 
@@ -360,28 +410,37 @@ instance : Inhabited W.Point :=
 instance : Zero W.Point :=
   ⟨zero⟩
 
+#print WeierstrassCurve.Point.zero_def /-
 @[simp]
 theorem zero_def : (zero : W.Point) = 0 :=
   rfl
 #align weierstrass_curve.point.zero_def WeierstrassCurve.Point.zero_def
+-/
 
 end Point
 
 variable {W x₁ y₁}
 
+#print WeierstrassCurve.equation_neg_iff /-
 theorem equation_neg_iff : W.equation x₁ (W.negY x₁ y₁) ↔ W.equation x₁ y₁ := by
   rw [equation_iff, equation_iff, neg_Y]; congr 2; ring1
 #align weierstrass_curve.equation_neg_iff WeierstrassCurve.equation_neg_iff
+-/
 
+#print WeierstrassCurve.equation_neg_of /-
 theorem equation_neg_of (h : W.equation x₁ <| W.negY x₁ y₁) : W.equation x₁ y₁ :=
   equation_neg_iff.mp h
 #align weierstrass_curve.equation_neg_of WeierstrassCurve.equation_neg_of
+-/
 
+#print WeierstrassCurve.equation_neg /-
 /-- The negation of an affine point in `W` lies in `W`. -/
 theorem equation_neg (h : W.equation x₁ y₁) : W.equation x₁ <| W.negY x₁ y₁ :=
   equation_neg_iff.mpr h
 #align weierstrass_curve.equation_neg WeierstrassCurve.equation_neg
+-/
 
+#print WeierstrassCurve.nonsingular_neg_iff /-
 theorem nonsingular_neg_iff : W.nonsingular x₁ (W.negY x₁ y₁) ↔ W.nonsingular x₁ y₁ :=
   by
   rw [nonsingular_iff, equation_neg_iff, ← neg_Y, neg_Y_neg_Y, ← @ne_comm _ y₁, nonsingular_iff]
@@ -390,18 +449,24 @@ theorem nonsingular_neg_iff : W.nonsingular x₁ (W.negY x₁ y₁) ↔ W.nonsin
       ((iff_congr not_and_distrib.symm not_and_distrib.symm).mpr <|
         not_congr <| and_congr_left fun h => by rw [← h])
 #align weierstrass_curve.nonsingular_neg_iff WeierstrassCurve.nonsingular_neg_iff
+-/
 
+#print WeierstrassCurve.nonsingular_neg_of /-
 theorem nonsingular_neg_of (h : W.nonsingular x₁ <| W.negY x₁ y₁) : W.nonsingular x₁ y₁ :=
   nonsingular_neg_iff.mp h
 #align weierstrass_curve.nonsingular_neg_of WeierstrassCurve.nonsingular_neg_of
+-/
 
+#print WeierstrassCurve.nonsingular_neg /-
 /-- The negation of a nonsingular affine point in `W` is nonsingular. -/
 theorem nonsingular_neg (h : W.nonsingular x₁ y₁) : W.nonsingular x₁ <| W.negY x₁ y₁ :=
   nonsingular_neg_iff.mpr h
 #align weierstrass_curve.nonsingular_neg WeierstrassCurve.nonsingular_neg
+-/
 
 namespace Point
 
+#print WeierstrassCurve.Point.neg /-
 /-- The negation of a nonsingular rational point.
 
 Given a nonsingular rational point `P`, use `-P` instead of `neg P`. -/
@@ -409,24 +474,31 @@ def neg : W.Point → W.Point
   | 0 => 0
   | some h => some <| nonsingular_neg h
 #align weierstrass_curve.point.neg WeierstrassCurve.Point.neg
+-/
 
 instance : Neg W.Point :=
   ⟨neg⟩
 
+#print WeierstrassCurve.Point.neg_def /-
 @[simp]
 theorem neg_def (P : W.Point) : P.neg = -P :=
   rfl
 #align weierstrass_curve.point.neg_def WeierstrassCurve.Point.neg_def
+-/
 
+#print WeierstrassCurve.Point.neg_zero /-
 @[simp]
 theorem neg_zero : (-0 : W.Point) = 0 :=
   rfl
 #align weierstrass_curve.point.neg_zero WeierstrassCurve.Point.neg_zero
+-/
 
+#print WeierstrassCurve.Point.neg_some /-
 @[simp]
 theorem neg_some (h : W.nonsingular x₁ y₁) : -some h = some (nonsingular_neg h) :=
   rfl
 #align weierstrass_curve.point.neg_some WeierstrassCurve.Point.neg_some
+-/
 
 instance : InvolutiveNeg W.Point :=
   ⟨neg, by rintro (_ | _); · rfl; · simp; ring1⟩
@@ -445,6 +517,7 @@ open scoped Classical
 variable {F : Type u} [Field F] (W : WeierstrassCurve F) (K : Type v) [Field K] [Algebra F K]
   (x₁ x₂ y₁ y₂ : F)
 
+#print WeierstrassCurve.slope /-
 /-- The slope of the line through two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`.
 If $x_1 \ne x_2$, then this line is the secant of `W` through $(x_1, y_1)$ and $(x_2, y_2)$,
 and has slope $(y_1 - y_2) / (x_1 - x_2)$. Otherwise, if $y_1 \ne -y_1 - a_1x_1 - a_3$,
@@ -459,26 +532,34 @@ noncomputable def slope : F :=
     else (3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄ - W.a₁ * y₁) / (y₁ - W.negY x₁ y₁)
   else (y₁ - y₂) / (x₁ - x₂)
 #align weierstrass_curve.slope WeierstrassCurve.slope
+-/
 
 variable {W x₁ x₂ y₁ y₂} (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂)
   (h₁' : W.equation x₁ y₁) (h₂' : W.equation x₂ y₂)
 
+#print WeierstrassCurve.slope_of_Y_eq /-
 @[simp]
 theorem slope_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : W.slope x₁ x₂ y₁ y₂ = 0 := by
   rw [slope, dif_pos hx, dif_pos hy]
 #align weierstrass_curve.slope_of_Y_eq WeierstrassCurve.slope_of_Y_eq
+-/
 
+#print WeierstrassCurve.slope_of_Y_ne /-
 @[simp]
 theorem slope_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     W.slope x₁ x₂ y₁ y₂ = (3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄ - W.a₁ * y₁) / (y₁ - W.negY x₁ y₁) :=
   by rw [slope, dif_pos hx, dif_neg hy]
 #align weierstrass_curve.slope_of_Y_ne WeierstrassCurve.slope_of_Y_ne
+-/
 
+#print WeierstrassCurve.slope_of_X_ne /-
 @[simp]
 theorem slope_of_X_ne (hx : x₁ ≠ x₂) : W.slope x₁ x₂ y₁ y₂ = (y₁ - y₂) / (x₁ - x₂) := by
   rw [slope, dif_neg hx]
 #align weierstrass_curve.slope_of_X_ne WeierstrassCurve.slope_of_X_ne
+-/
 
+#print WeierstrassCurve.slope_of_Y_ne_eq_eval /-
 theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     W.slope x₁ x₂ y₁ y₂ =
       -(W.polynomialX.eval <| C y₁).eval x₁ / (W.polynomialY.eval <| C y₁).eval x₁ :=
@@ -486,9 +567,11 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   rw [slope_of_Y_ne hx hy, eval_polynomial_X, neg_sub]; congr 1; rw [neg_Y, eval_polynomial_Y]
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+#print WeierstrassCurve.baseChange_slope /-
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -512,7 +595,9 @@ theorem baseChange_slope :
     · contrapose! hx
       exact NoZeroSMulDivisors.algebraMap_injective F K hx
 #align weierstrass_curve.base_change_slope WeierstrassCurve.baseChange_slope
+-/
 
+#print WeierstrassCurve.baseChange_slope_of_baseChange /-
 theorem baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : WeierstrassCurve R)
     (F : Type v) [Field F] [Algebra R F] (K : Type w) [Field K] [Algebra R K] [Algebra F K]
     [IsScalarTower R F K] (x₁ x₂ y₁ y₂ : F) :
@@ -521,21 +606,27 @@ theorem baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : Weierstras
       algebraMap F K ((W.base_change F).slope x₁ x₂ y₁ y₂) :=
   by rw [← base_change_slope, base_change_base_change]
 #align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.baseChange_slope_of_baseChange
+-/
 
+#print WeierstrassCurve.Y_eq_of_X_eq /-
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
   by
   rw [equation_iff] at h₁' h₂' 
   rw [← sub_eq_zero, ← @sub_eq_zero _ _ y₁, ← mul_eq_zero, neg_Y]
   linear_combination (norm := (rw [hx]; ring1)) h₁' - h₂'
 #align weierstrass_curve.Y_eq_of_X_eq WeierstrassCurve.Y_eq_of_X_eq
+-/
 
+#print WeierstrassCurve.Y_eq_of_Y_ne /-
 theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁ = y₂ :=
   Or.resolve_right (Y_eq_of_X_eq h₁' h₂' hx) hy
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+#print WeierstrassCurve.XYIdeal_eq₂ /-
+theorem XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   have hy₂ : y₂ = (line_polynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂).eval x₂ :=
@@ -555,8 +646,10 @@ theorem xYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   run_tac
     C_simp
   ring1
-#align weierstrass_curve.XY_ideal_eq₂ WeierstrassCurve.xYIdeal_eq₂
+#align weierstrass_curve.XY_ideal_eq₂ WeierstrassCurve.XYIdeal_eq₂
+-/
 
+#print WeierstrassCurve.addPolynomial_slope /-
 theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
@@ -586,14 +679,18 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     · apply mul_right_injective₀ hx
       linear_combination (norm := (field_simp [hx]; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
+-/
 
-theorem CoordinateRing.c_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+#print WeierstrassCurve.CoordinateRing.C_addPolynomial_slope /-
+theorem CoordinateRing.C_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     AdjoinRoot.mk W.Polynomial (C <| W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -(XClass W x₁ * XClass W x₂ * XClass W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) :=
   by simpa only [add_polynomial_slope h₁' h₂' hxy, map_neg, neg_inj, _root_.map_mul]
-#align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.c_addPolynomial_slope
+#align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.C_addPolynomial_slope
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
+#print WeierstrassCurve.derivative_addPolynomial_slope /-
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -603,11 +700,13 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
     derivative_simp;
   ring1
 #align weierstrass_curve.derivative_add_polynomial_slope WeierstrassCurve.derivative_addPolynomial_slope
+-/
 
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+#print WeierstrassCurve.equation_add' /-
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -618,14 +717,18 @@ theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     eval_simp
   rw [neg_eq_zero, sub_self, MulZeroClass.mul_zero]
 #align weierstrass_curve.equation_add' WeierstrassCurve.equation_add'
+-/
 
+#print WeierstrassCurve.equation_add /-
 /-- The addition of two affine points in `W` on a sloped line lies in `W`. -/
 theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   equation_neg <| equation_add' h₁' h₂' hxy
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+#print WeierstrassCurve.nonsingular_add' /-
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -647,17 +750,21 @@ theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       simpa only [neg_ne_zero, sub_self, MulZeroClass.mul_zero, add_zero] using
         mul_ne_zero (sub_ne_zero_of_ne hx₁) (sub_ne_zero_of_ne hx₂)
 #align weierstrass_curve.nonsingular_add' WeierstrassCurve.nonsingular_add'
+-/
 
+#print WeierstrassCurve.nonsingular_add /-
 /-- The addition of two nonsingular affine points in `W` on a sloped line is nonsingular. -/
 theorem nonsingular_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   nonsingular_neg <| nonsingular_add' h₁ h₂ hxy
 #align weierstrass_curve.nonsingular_add WeierstrassCurve.nonsingular_add
+-/
 
 namespace Point
 
 variable {h₁ h₂}
 
+#print WeierstrassCurve.Point.add /-
 /-- The addition of two nonsingular rational points.
 
 Given two nonsingular rational points `P` and `Q`, use `P + Q` instead of `add P Q`. -/
@@ -669,60 +776,79 @@ noncomputable def add : W.Point → W.Point → W.Point
       if hy : y₁ = W.negY x₂ y₂ then 0 else some <| nonsingular_add h₁ h₂ fun _ => hy
     else some <| nonsingular_add h₁ h₂ fun h => (hx h).elim
 #align weierstrass_curve.point.add WeierstrassCurve.Point.add
+-/
 
 noncomputable instance : Add W.Point :=
   ⟨add⟩
 
+#print WeierstrassCurve.Point.add_def /-
 @[simp]
 theorem add_def (P Q : W.Point) : P.add Q = P + Q :=
   rfl
 #align weierstrass_curve.point.add_def WeierstrassCurve.Point.add_def
+-/
 
 noncomputable instance : AddZeroClass W.Point :=
   ⟨0, (· + ·), by rintro (_ | _) <;> rfl, by rintro (_ | _) <;> rfl⟩
 
+#print WeierstrassCurve.Point.some_add_some_of_Y_eq /-
 @[simp]
 theorem some_add_some_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : some h₁ + some h₂ = 0 := by
   rw [← add_def, add, dif_pos hx, dif_pos hy]
 #align weierstrass_curve.point.some_add_some_of_Y_eq WeierstrassCurve.Point.some_add_some_of_Y_eq
+-/
 
+#print WeierstrassCurve.Point.some_add_self_of_Y_eq /-
 @[simp]
 theorem some_add_self_of_Y_eq (hy : y₁ = W.negY x₁ y₁) : some h₁ + some h₁ = 0 :=
   some_add_some_of_Y_eq rfl hy
 #align weierstrass_curve.point.some_add_self_of_Y_eq WeierstrassCurve.Point.some_add_self_of_Y_eq
+-/
 
+#print WeierstrassCurve.Point.some_add_some_of_Y_ne /-
 @[simp]
 theorem some_add_some_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     some h₁ + some h₂ = some (nonsingular_add h₁ h₂ fun _ => hy) := by
   rw [← add_def, add, dif_pos hx, dif_neg hy]
 #align weierstrass_curve.point.some_add_some_of_Y_ne WeierstrassCurve.Point.some_add_some_of_Y_ne
+-/
 
+#print WeierstrassCurve.Point.some_add_some_of_Y_ne' /-
 theorem some_add_some_of_Y_ne' (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     some h₁ + some h₂ = -some (nonsingular_add' h₁ h₂ fun _ => hy) :=
   some_add_some_of_Y_ne hx hy
 #align weierstrass_curve.point.some_add_some_of_Y_ne' WeierstrassCurve.Point.some_add_some_of_Y_ne'
+-/
 
+#print WeierstrassCurve.Point.some_add_self_of_Y_ne /-
 @[simp]
 theorem some_add_self_of_Y_ne (hy : y₁ ≠ W.negY x₁ y₁) :
     some h₁ + some h₁ = some (nonsingular_add h₁ h₁ fun _ => hy) :=
   some_add_some_of_Y_ne rfl hy
 #align weierstrass_curve.point.some_add_self_of_Y_ne WeierstrassCurve.Point.some_add_self_of_Y_ne
+-/
 
+#print WeierstrassCurve.Point.some_add_self_of_Y_ne' /-
 theorem some_add_self_of_Y_ne' (hy : y₁ ≠ W.negY x₁ y₁) :
     some h₁ + some h₁ = -some (nonsingular_add' h₁ h₁ fun _ => hy) :=
   some_add_some_of_Y_ne rfl hy
 #align weierstrass_curve.point.some_add_self_of_Y_ne' WeierstrassCurve.Point.some_add_self_of_Y_ne'
+-/
 
+#print WeierstrassCurve.Point.some_add_some_of_X_ne /-
 @[simp]
 theorem some_add_some_of_X_ne (hx : x₁ ≠ x₂) :
     some h₁ + some h₂ = some (nonsingular_add h₁ h₂ fun h => (hx h).elim) := by
   rw [← add_def, add, dif_neg hx]
 #align weierstrass_curve.point.some_add_some_of_X_ne WeierstrassCurve.Point.some_add_some_of_X_ne
+-/
 
+#print WeierstrassCurve.Point.some_add_some_of_X_ne' /-
 theorem some_add_some_of_X_ne' (hx : x₁ ≠ x₂) :
     some h₁ + some h₂ = -some (nonsingular_add' h₁ h₂ fun h => (hx h).elim) :=
   some_add_some_of_X_ne hx
 #align weierstrass_curve.point.some_add_some_of_X_ne' WeierstrassCurve.Point.some_add_some_of_X_ne'
+-/
 
 end Point
 
@@ -740,7 +866,8 @@ variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ :=
+#print WeierstrassCurve.XYIdeal_neg_mul /-
+theorem XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ :=
   by
   have Y_rw :
     (Y - C (C y₁)) * (Y - C (C (W.neg_Y x₁ y₁))) -
@@ -778,7 +905,8 @@ theorem xYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x
     run_tac
       C_simp
     ring1
-#align weierstrass_curve.XY_ideal_neg_mul WeierstrassCurve.xYIdeal_neg_mul
+#align weierstrass_curve.XY_ideal_neg_mul WeierstrassCurve.XYIdeal_neg_mul
+-/
 
 private theorem XY_ideal'_mul_inv :
     (XYIdeal W x₁ (C y₁) : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) *
@@ -791,7 +919,8 @@ private theorem XY_ideal'_mul_inv :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_mul_xYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+#print WeierstrassCurve.XYIdeal_mul_XYIdeal /-
+theorem XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (XYIdeal W x₁ (C y₁) * XYIdeal W x₂ (C y₂)) =
       YIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
         XYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
@@ -840,21 +969,27 @@ theorem xYIdeal_mul_xYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     run_tac
       C_simp
     ring1
-#align weierstrass_curve.XY_ideal_mul_XY_ideal WeierstrassCurve.xYIdeal_mul_xYIdeal
+#align weierstrass_curve.XY_ideal_mul_XY_ideal WeierstrassCurve.XYIdeal_mul_XYIdeal
+-/
 
+#print WeierstrassCurve.XYIdeal' /-
 /-- The non-zero fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ for some $x, y \in F$. -/
 @[simp]
-noncomputable def xYIdeal' : (FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
+noncomputable def XYIdeal' : (FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
   Units.mkOfMulEqOne _ _ <| XY_ideal'_mul_inv h₁
-#align weierstrass_curve.XY_ideal' WeierstrassCurve.xYIdeal'
+#align weierstrass_curve.XY_ideal' WeierstrassCurve.XYIdeal'
+-/
 
-theorem xYIdeal'_eq :
-    (xYIdeal' h₁ : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) = XYIdeal W x₁ (C y₁) :=
+#print WeierstrassCurve.XYIdeal'_eq /-
+theorem XYIdeal'_eq :
+    (XYIdeal' h₁ : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) = XYIdeal W x₁ (C y₁) :=
   rfl
-#align weierstrass_curve.XY_ideal'_eq WeierstrassCurve.xYIdeal'_eq
+#align weierstrass_curve.XY_ideal'_eq WeierstrassCurve.XYIdeal'_eq
+-/
 
-theorem mk_xYIdeal'_mul_mk_xYIdeal'_of_Y_eq :
-    ClassGroup.mk (xYIdeal' <| nonsingular_neg h₁) * ClassGroup.mk (xYIdeal' h₁) = 1 :=
+#print WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq /-
+theorem mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq :
+    ClassGroup.mk (XYIdeal' <| nonsingular_neg h₁) * ClassGroup.mk (XYIdeal' h₁) = 1 :=
   by
   rw [← _root_.map_mul]
   exact
@@ -862,28 +997,34 @@ theorem mk_xYIdeal'_mul_mk_xYIdeal'_of_Y_eq :
           (FractionalIdeal.coeIdeal_mul _ _).symm.trans
             (fractional_ideal.coe_ideal_inj.mpr <| XY_ideal_neg_mul h₁)).mpr
       ⟨_, X_class_ne_zero W _, rfl⟩
-#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq WeierstrassCurve.mk_xYIdeal'_mul_mk_xYIdeal'_of_Y_eq
+#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal'_of_Y_eq
+-/
 
-theorem mk_xYIdeal'_mul_mk_xYIdeal' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    ClassGroup.mk (xYIdeal' h₁) * ClassGroup.mk (xYIdeal' h₂) =
-      ClassGroup.mk (xYIdeal' <| nonsingular_add h₁ h₂ hxy) :=
+#print WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal' /-
+theorem mk_XYIdeal'_mul_mk_XYIdeal' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    ClassGroup.mk (XYIdeal' h₁) * ClassGroup.mk (XYIdeal' h₂) =
+      ClassGroup.mk (XYIdeal' <| nonsingular_add h₁ h₂ hxy) :=
   by
   rw [← _root_.map_mul]
   exact
     (ClassGroup.mk_eq_mk_of_coe_ideal (FractionalIdeal.coeIdeal_mul _ _).symm <| XY_ideal'_eq _).mpr
       ⟨_, _, X_class_ne_zero W _, Y_class_ne_zero W _, XY_ideal_mul_XY_ideal h₁.left h₂.left hxy⟩
-#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal' WeierstrassCurve.mk_xYIdeal'_mul_mk_xYIdeal'
+#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal' WeierstrassCurve.mk_XYIdeal'_mul_mk_XYIdeal'
+-/
 
 namespace Point
 
+#print WeierstrassCurve.Point.toClassFun /-
 /-- The set function mapping an affine point $(x, y)$ of `W` to the class of the non-zero fractional
 ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
 @[simp]
 noncomputable def toClassFun : W.Point → Additive (ClassGroup W.CoordinateRing)
   | 0 => 0
-  | some h => Additive.ofMul <| ClassGroup.mk <| xYIdeal' h
+  | some h => Additive.ofMul <| ClassGroup.mk <| XYIdeal' h
 #align weierstrass_curve.point.to_class_fun WeierstrassCurve.Point.toClassFun
+-/
 
+#print WeierstrassCurve.Point.toClass /-
 /-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
 fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
 @[simps]
@@ -906,16 +1047,22 @@ noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing)
       simpa only [some_add_some_of_X_ne hx] using
         (mk_XY_ideal'_mul_mk_XY_ideal' h₁ h₂ fun h => (hx h).elim).symm
 #align weierstrass_curve.point.to_class WeierstrassCurve.Point.toClass
+-/
 
+#print WeierstrassCurve.Point.toClass_zero /-
 @[simp]
 theorem toClass_zero : toClass (0 : W.Point) = 0 :=
   rfl
 #align weierstrass_curve.point.to_class_zero WeierstrassCurve.Point.toClass_zero
+-/
 
-theorem toClass_some : toClass (some h₁) = ClassGroup.mk (xYIdeal' h₁) :=
+#print WeierstrassCurve.Point.toClass_some /-
+theorem toClass_some : toClass (some h₁) = ClassGroup.mk (XYIdeal' h₁) :=
   rfl
 #align weierstrass_curve.point.to_class_some WeierstrassCurve.Point.toClass_some
+-/
 
+#print WeierstrassCurve.Point.add_eq_zero /-
 @[simp]
 theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
   by
@@ -934,15 +1081,21 @@ theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
         contradiction
     · exact fun ⟨hx, hy⟩ => some_add_some_of_Y_eq hx hy
 #align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Point.add_eq_zero
+-/
 
+#print WeierstrassCurve.Point.add_left_neg /-
 @[simp]
 theorem add_left_neg (P : W.Point) : -P + P = 0 := by rw [add_eq_zero]
 #align weierstrass_curve.point.add_left_neg WeierstrassCurve.Point.add_left_neg
+-/
 
+#print WeierstrassCurve.Point.neg_add_eq_zero /-
 @[simp]
 theorem neg_add_eq_zero (P Q : W.Point) : -P + Q = 0 ↔ P = Q := by rw [add_eq_zero, neg_inj]
 #align weierstrass_curve.point.neg_add_eq_zero WeierstrassCurve.Point.neg_add_eq_zero
+-/
 
+#print WeierstrassCurve.Point.toClass_eq_zero /-
 theorem toClass_eq_zero (P : W.Point) : toClass P = 0 ↔ P = 0 :=
   ⟨by
     intro hP
@@ -955,7 +1108,9 @@ theorem toClass_eq_zero (P : W.Point) : toClass P = 0 ↔ P = 0 :=
         (quotient_XY_ideal_equiv W h).toLinearEquiv.finrank_eq, FiniteDimensional.finrank_self],
     congr_arg toClass⟩
 #align weierstrass_curve.point.to_class_eq_zero WeierstrassCurve.Point.toClass_eq_zero
+-/
 
+#print WeierstrassCurve.Point.toClass_injective /-
 theorem toClass_injective : Function.Injective <| @toClass _ _ W :=
   by
   rintro (_ | h) _ hP
@@ -963,14 +1118,19 @@ theorem toClass_injective : Function.Injective <| @toClass _ _ W :=
   · exact zero_add 0
   · exact mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq h
 #align weierstrass_curve.point.to_class_injective WeierstrassCurve.Point.toClass_injective
+-/
 
+#print WeierstrassCurve.Point.add_comm /-
 theorem add_comm (P Q : W.Point) : P + Q = Q + P :=
   toClass_injective <| by simp only [map_add, add_comm]
 #align weierstrass_curve.point.add_comm WeierstrassCurve.Point.add_comm
+-/
 
+#print WeierstrassCurve.Point.add_assoc /-
 theorem add_assoc (P Q R : W.Point) : P + Q + R = P + (Q + R) :=
   toClass_injective <| by simp only [map_add, add_assoc]
 #align weierstrass_curve.point.add_assoc WeierstrassCurve.Point.add_assoc
+-/
 
 noncomputable instance : AddCommGroup W.Point
     where
@@ -999,12 +1159,15 @@ namespace Point
 
 open scoped WeierstrassCurve
 
+#print WeierstrassCurve.Point.ofBaseChangeFun /-
 /-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
 def ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
   | 0 => 0
   | some h => some <| (nonsingular_iff_baseChange_of_baseChange W F K _ _).mp h
 #align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Point.ofBaseChangeFun
+-/
 
+#print WeierstrassCurve.Point.ofBaseChange /-
 /-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
 @[simps]
 def ofBaseChange : W⟮F⟯ →+ W⟮K⟯
@@ -1035,7 +1198,9 @@ def ofBaseChange : W⟮F⟯ →+ W⟮K⟯
       · contrapose! hx
         exact NoZeroSMulDivisors.algebraMap_injective F K hx
 #align weierstrass_curve.point.of_base_change WeierstrassCurve.Point.ofBaseChange
+-/
 
+#print WeierstrassCurve.Point.ofBaseChange_injective /-
 theorem ofBaseChange_injective : Function.Injective <| ofBaseChange W F K :=
   by
   rintro (_ | _) (_ | _) h
@@ -1046,6 +1211,7 @@ theorem ofBaseChange_injective : Function.Injective <| ofBaseChange W F K :=
     ⟨NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).left,
       NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).right⟩
 #align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Point.ofBaseChange_injective
+-/
 
 end Point
 
@@ -1062,10 +1228,12 @@ namespace Point
 
 variable {R : Type} [Nontrivial R] [CommRing R] (E : EllipticCurve R)
 
+#print EllipticCurve.Point.mk /-
 /-- An affine point on an elliptic curve `E` over `R`. -/
 def mk {x y : R} (h : E.equation x y) : E.Point :=
   WeierstrassCurve.Point.some <| E.nonsingular h
 #align elliptic_curve.point.mk EllipticCurve.Point.mk
+-/
 
 end Point
 
Diff
@@ -154,7 +154,7 @@ noncomputable def linePolynomial : R[X] :=
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_eq₁ : xYIdeal W x₁ (C y₁) = xYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
+theorem xYIdeal_eq₁ : XYIdeal W x₁ (C y₁) = XYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
   by
   simp only [XY_ideal, X_class, Y_class, line_polynomial]
   rw [← span_pair_add_mul_right <| AdjoinRoot.mk _ <| C <| C <| -L, ← _root_.map_mul, ← map_add]
@@ -289,9 +289,9 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_add_eq :
-    xYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
+    XYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
       span {AdjoinRoot.mk W.Polynomial <| W.negPolynomial - C (linePolynomial x₁ y₁ L)} ⊔
-        xIdeal W (W.addX x₁ x₂ L) :=
+        XIdeal W (W.addX x₁ x₂ L) :=
   by
   simp only [XY_ideal, X_ideal, X_class, Y_class, add_Y, add_Y', neg_Y, neg_polynomial,
     line_polynomial]
@@ -306,7 +306,7 @@ theorem xYIdeal_add_eq :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 theorem equation_add_iff :
-    W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
+    W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
   by
   rw [equation, add_Y', add_polynomial, line_polynomial, WeierstrassCurve.polynomial]
@@ -319,9 +319,9 @@ theorem equation_add_iff :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
-    (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
+    (hx' : W.equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
-    W.Nonsingular (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) :=
+    W.nonsingular (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) :=
   by
   rw [nonsingular, and_iff_right hx', add_Y', polynomial_X, polynomial_Y]
   run_tac
@@ -347,7 +347,7 @@ satisfying the equation $y^2 + a_1xy + a_3y = x^3 + a_2x^2 + a_4x + a_6$ of `W`.
 extension `S` of `R`, the type of nonsingular `S`-rational points on `W` is denoted `W⟮S⟯`. -/
 inductive Point
   | zero
-  | some {x y : R} (h : W.Nonsingular x y)
+  | some {x y : R} (h : W.nonsingular x y)
 #align weierstrass_curve.point WeierstrassCurve.Point
 
 scoped notation W "⟮" S "⟯" => (W.base_change S).Point
@@ -369,20 +369,20 @@ end Point
 
 variable {W x₁ y₁}
 
-theorem equation_neg_iff : W.Equation x₁ (W.negY x₁ y₁) ↔ W.Equation x₁ y₁ := by
+theorem equation_neg_iff : W.equation x₁ (W.negY x₁ y₁) ↔ W.equation x₁ y₁ := by
   rw [equation_iff, equation_iff, neg_Y]; congr 2; ring1
 #align weierstrass_curve.equation_neg_iff WeierstrassCurve.equation_neg_iff
 
-theorem equation_neg_of (h : W.Equation x₁ <| W.negY x₁ y₁) : W.Equation x₁ y₁ :=
+theorem equation_neg_of (h : W.equation x₁ <| W.negY x₁ y₁) : W.equation x₁ y₁ :=
   equation_neg_iff.mp h
 #align weierstrass_curve.equation_neg_of WeierstrassCurve.equation_neg_of
 
 /-- The negation of an affine point in `W` lies in `W`. -/
-theorem equation_neg (h : W.Equation x₁ y₁) : W.Equation x₁ <| W.negY x₁ y₁ :=
+theorem equation_neg (h : W.equation x₁ y₁) : W.equation x₁ <| W.negY x₁ y₁ :=
   equation_neg_iff.mpr h
 #align weierstrass_curve.equation_neg WeierstrassCurve.equation_neg
 
-theorem nonsingular_neg_iff : W.Nonsingular x₁ (W.negY x₁ y₁) ↔ W.Nonsingular x₁ y₁ :=
+theorem nonsingular_neg_iff : W.nonsingular x₁ (W.negY x₁ y₁) ↔ W.nonsingular x₁ y₁ :=
   by
   rw [nonsingular_iff, equation_neg_iff, ← neg_Y, neg_Y_neg_Y, ← @ne_comm _ y₁, nonsingular_iff]
   exact
@@ -391,12 +391,12 @@ theorem nonsingular_neg_iff : W.Nonsingular x₁ (W.negY x₁ y₁) ↔ W.Nonsin
         not_congr <| and_congr_left fun h => by rw [← h])
 #align weierstrass_curve.nonsingular_neg_iff WeierstrassCurve.nonsingular_neg_iff
 
-theorem nonsingular_neg_of (h : W.Nonsingular x₁ <| W.negY x₁ y₁) : W.Nonsingular x₁ y₁ :=
+theorem nonsingular_neg_of (h : W.nonsingular x₁ <| W.negY x₁ y₁) : W.nonsingular x₁ y₁ :=
   nonsingular_neg_iff.mp h
 #align weierstrass_curve.nonsingular_neg_of WeierstrassCurve.nonsingular_neg_of
 
 /-- The negation of a nonsingular affine point in `W` is nonsingular. -/
-theorem nonsingular_neg (h : W.Nonsingular x₁ y₁) : W.Nonsingular x₁ <| W.negY x₁ y₁ :=
+theorem nonsingular_neg (h : W.nonsingular x₁ y₁) : W.nonsingular x₁ <| W.negY x₁ y₁ :=
   nonsingular_neg_iff.mpr h
 #align weierstrass_curve.nonsingular_neg WeierstrassCurve.nonsingular_neg
 
@@ -424,7 +424,7 @@ theorem neg_zero : (-0 : W.Point) = 0 :=
 #align weierstrass_curve.point.neg_zero WeierstrassCurve.Point.neg_zero
 
 @[simp]
-theorem neg_some (h : W.Nonsingular x₁ y₁) : -some h = some (nonsingular_neg h) :=
+theorem neg_some (h : W.nonsingular x₁ y₁) : -some h = some (nonsingular_neg h) :=
   rfl
 #align weierstrass_curve.point.neg_some WeierstrassCurve.Point.neg_some
 
@@ -460,8 +460,8 @@ noncomputable def slope : F :=
   else (y₁ - y₂) / (x₁ - x₂)
 #align weierstrass_curve.slope WeierstrassCurve.slope
 
-variable {W x₁ x₂ y₁ y₂} (h₁ : W.Nonsingular x₁ y₁) (h₂ : W.Nonsingular x₂ y₂)
-  (h₁' : W.Equation x₁ y₁) (h₂' : W.Equation x₂ y₂)
+variable {W x₁ x₂ y₁ y₂} (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂)
+  (h₁' : W.equation x₁ y₁) (h₂' : W.equation x₂ y₂)
 
 @[simp]
 theorem slope_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : W.slope x₁ x₂ y₁ y₂ = 0 := by
@@ -536,7 +536,7 @@ theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    xYIdeal W x₂ (C y₂) = xYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+    XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   have hy₂ : y₂ = (line_polynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂).eval x₂ :=
     by
@@ -589,7 +589,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 
 theorem CoordinateRing.c_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     AdjoinRoot.mk W.Polynomial (C <| W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
-      -(xClass W x₁ * xClass W x₂ * xClass W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) :=
+      -(XClass W x₁ * XClass W x₂ * XClass W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) :=
   by simpa only [add_polynomial_slope h₁' h₂' hxy, map_neg, neg_inj, _root_.map_mul]
 #align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.c_addPolynomial_slope
 
@@ -611,7 +611,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    W.Equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+    W.equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   rw [equation_add_iff, add_polynomial_slope h₁' h₂' hxy];
   run_tac
@@ -621,7 +621,7 @@ theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 
 /-- The addition of two affine points in `W` on a sloped line lies in `W`. -/
 theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    W.Equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+    W.equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   equation_neg <| equation_add' h₁' h₂' hxy
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
 
@@ -629,7 +629,7 @@ theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    W.Nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+    W.nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   by_cases hx₁ : W.add_X x₁ x₂ (W.slope x₁ x₂ y₁ y₂) = x₁
   · rwa [add_Y', hx₁, sub_self, MulZeroClass.mul_zero, zero_add]
@@ -650,7 +650,7 @@ theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 
 /-- The addition of two nonsingular affine points in `W` on a sloped line is nonsingular. -/
 theorem nonsingular_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    W.Nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+    W.nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   nonsingular_neg <| nonsingular_add' h₁ h₂ hxy
 #align weierstrass_curve.nonsingular_add WeierstrassCurve.nonsingular_add
 
@@ -734,13 +734,13 @@ section Group
 
 
 variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ : F}
-  (h₁ : W.Nonsingular x₁ y₁) (h₂ : W.Nonsingular x₂ y₂) (h₁' : W.Equation x₁ y₁)
-  (h₂' : W.Equation x₂ y₂)
+  (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂) (h₁' : W.equation x₁ y₁)
+  (h₂' : W.equation x₂ y₂)
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
-theorem xYIdeal_neg_mul : xYIdeal W x₁ (C <| W.negY x₁ y₁) * xYIdeal W x₁ (C y₁) = xIdeal W x₁ :=
+theorem xYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ :=
   by
   have Y_rw :
     (Y - C (C y₁)) * (Y - C (C (W.neg_Y x₁ y₁))) -
@@ -781,8 +781,8 @@ theorem xYIdeal_neg_mul : xYIdeal W x₁ (C <| W.negY x₁ y₁) * xYIdeal W x
 #align weierstrass_curve.XY_ideal_neg_mul WeierstrassCurve.xYIdeal_neg_mul
 
 private theorem XY_ideal'_mul_inv :
-    (xYIdeal W x₁ (C y₁) : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) *
-        (xYIdeal W x₁ (C <| W.negY x₁ y₁) * (xIdeal W x₁)⁻¹) =
+    (XYIdeal W x₁ (C y₁) : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) *
+        (XYIdeal W x₁ (C <| W.negY x₁ y₁) * (XIdeal W x₁)⁻¹) =
       1 :=
   by
   rw [← mul_assoc, ← FractionalIdeal.coeIdeal_mul, mul_comm <| XY_ideal W _ _, XY_ideal_neg_mul h₁,
@@ -792,9 +792,9 @@ private theorem XY_ideal'_mul_inv :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_mul_xYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
-    xIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (xYIdeal W x₁ (C y₁) * xYIdeal W x₂ (C y₂)) =
-      yIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
-        xYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
+    XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (XYIdeal W x₁ (C y₁) * XYIdeal W x₂ (C y₂)) =
+      YIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
+        XYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
           (C <| W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   have sup_rw : ∀ a b c d : Ideal W.coordinate_ring, a ⊔ (b ⊔ (c ⊔ d)) = a ⊔ d ⊔ b ⊔ c :=
@@ -849,7 +849,7 @@ noncomputable def xYIdeal' : (FractionalIdeal W.CoordinateRing⁰ W.FunctionFiel
 #align weierstrass_curve.XY_ideal' WeierstrassCurve.xYIdeal'
 
 theorem xYIdeal'_eq :
-    (xYIdeal' h₁ : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) = xYIdeal W x₁ (C y₁) :=
+    (xYIdeal' h₁ : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) = XYIdeal W x₁ (C y₁) :=
   rfl
 #align weierstrass_curve.XY_ideal'_eq WeierstrassCurve.xYIdeal'_eq
 
@@ -1063,8 +1063,8 @@ namespace Point
 variable {R : Type} [Nontrivial R] [CommRing R] (E : EllipticCurve R)
 
 /-- An affine point on an elliptic curve `E` over `R`. -/
-def mk {x y : R} (h : E.Equation x y) : E.Point :=
-  WeierstrassCurve.Point.some <| E.Nonsingular h
+def mk {x y : R} (h : E.equation x y) : E.Point :=
+  WeierstrassCurve.Point.some <| E.nonsingular h
 #align elliptic_curve.point.mk EllipticCurve.Point.mk
 
 end Point
Diff
@@ -121,7 +121,7 @@ def negY : R :=
 theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y]; ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -137,7 +137,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
   rw [neg_Y, sub_sub, neg_polynomial];
@@ -153,7 +153,7 @@ noncomputable def linePolynomial : R[X] :=
   C L * (X - C x₁) + C y₁
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_eq₁ : xYIdeal W x₁ (C y₁) = xYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
   by
   simp only [XY_ideal, X_class, Y_class, line_polynomial]
@@ -174,8 +174,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem c_addPolynomial :
     C (W.addPolynomial x₁ y₁ L) =
       (Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L)) +
@@ -196,8 +196,8 @@ theorem CoordinateRing.c_addPolynomial :
   AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [C_add_polynomial, add_sub_cancel', mul_one]⟩
 #align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.c_addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -222,7 +222,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -247,7 +247,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -287,7 +287,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_add_eq :
     xYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
       span {AdjoinRoot.mk W.Polynomial <| W.negPolynomial - C (linePolynomial x₁ y₁ L)} ⊔
@@ -304,7 +304,7 @@ theorem xYIdeal_add_eq :
   ring1
 #align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.xYIdeal_add_eq
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -314,10 +314,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.671719271.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -487,8 +487,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2652570801.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -533,8 +533,8 @@ theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁
   Or.resolve_right (Y_eq_of_X_eq h₁' h₂' hx) hy
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     xYIdeal W x₂ (C y₂) = xYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
@@ -593,7 +593,7 @@ theorem CoordinateRing.c_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.n
   by simpa only [add_polynomial_slope h₁' h₂' hxy, map_neg, neg_inj, _root_.map_mul]
 #align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.c_addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.671719271.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1686593491.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -607,7 +607,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -625,7 +625,7 @@ theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   equation_neg <| equation_add' h₁' h₂' hxy
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2062814307.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -737,9 +737,9 @@ variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ :
   (h₁ : W.Nonsingular x₁ y₁) (h₂ : W.Nonsingular x₂ y₂) (h₁' : W.Equation x₁ y₁)
   (h₂' : W.Equation x₂ y₂)
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_neg_mul : xYIdeal W x₁ (C <| W.negY x₁ y₁) * xYIdeal W x₁ (C y₁) = xIdeal W x₁ :=
   by
   have Y_rw :
@@ -789,8 +789,8 @@ private theorem XY_ideal'_mul_inv :
     X_ideal,
     FractionalIdeal.coe_ideal_span_singleton_mul_inv W.function_field <| X_class_ne_zero W x₁]
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008755739.C_simp -/
 theorem xYIdeal_mul_xYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     xIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (xYIdeal W x₁ (C y₁) * xYIdeal W x₂ (C y₂)) =
       yIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
Diff
@@ -4,25 +4,27 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
+! leanprover-community/mathlib commit e2e7f2ac359e7514e4d40061d7c08bb69487ba4e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.AlgebraicGeometry.EllipticCurve.Weierstrass
+import Mathbin.LinearAlgebra.FreeModule.Norm
+import Mathbin.RingTheory.ClassGroup
 
 /-!
-# The group of nonsingular rational points on a Weierstrass curve over a field
+# Nonsingular rational points on Weierstrass curves
 
 This file defines the type of nonsingular rational points on a Weierstrass curve over a field and
-(TODO) proves that it forms an abelian group under a geometric secant-and-tangent process.
+proves that it forms an abelian group under a geometric secant-and-tangent process.
 
 ## Mathematical background
 
 Let `W` be a Weierstrass curve over a field `F`. A rational point on `W` is simply a point
-$[A:B:C]$ defined over `F` in the projective plane satisfying the homogeneous cubic equation
-$B^2C + a_1ABC + a_3BC^2 = A^3 + a_2A^2C + a_4AC^2 + a_6C^3$. Any such point either lies in the
-affine chart $C \ne 0$ and satisfies the Weierstrass equation obtained by setting $X := A/C$ and
-$Y := B/C$, or is the unique point at infinity $0 := [0:1:0]$ when $C = 0$. With this new
+$[X:Y:Z]$ defined over `F` in the projective plane satisfying the homogeneous cubic equation
+$Y^2Z + a_1XYZ + a_3YZ^2 = X^3 + a_2X^2Z + a_4XZ^2 + a_6Z^3$. Any such point either lies in the
+affine chart $Z \ne 0$ and satisfies the Weierstrass equation obtained by replacing $X/Z$ with $X$
+and $Y/Z$ with $Y$, or is the unique point at infinity $0 := [0:1:0]$ when $Z = 0$. With this new
 description, a nonsingular rational point on `W` is either $0$ or an affine point $(x, y)$ where
 the partial derivatives $W_X(X, Y)$ and $W_Y(X, Y)$ do not vanish simultaneously. For a field
 extension `K` of `F`, a `K`-rational point is simply a rational point on `W` base changed to `K`.
@@ -54,11 +56,12 @@ The group law on this set is then uniquely determined by these constructions.
 
 ## Main statements
 
- * TODO: the addition of two nonsingular rational points on `W` forms a group.
+ * `weierstrass_curve.point.add_comm_group`: the type of nonsingular rational points on `W` forms an
+    abelian group under addition.
 
 ## Notations
 
- * `W⟮K⟯`: the group of nonsingular rational points on a Weierstrass curve `W` base changed to `K`.
+ * `W⟮K⟯`: the group of nonsingular rational points on `W` base changed to `K`.
 
 ## References
 
@@ -90,9 +93,9 @@ universe u v w
 
 namespace WeierstrassCurve
 
-open Polynomial
+open CoordinateRing Ideal Polynomial
 
-open scoped Polynomial PolynomialPolynomial
+open scoped nonZeroDivisors Polynomial PolynomialPolynomial
 
 section Basic
 
@@ -118,7 +121,7 @@ def negY : R :=
 theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y]; ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -134,7 +137,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
   rw [neg_Y, sub_sub, neg_polynomial];
@@ -150,7 +153,18 @@ noncomputable def linePolynomial : R[X] :=
   C L * (X - C x₁) + C y₁
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 
-/-- The polynomial obtained by substituting the line $Y = L(X - x_1) + y_1$, with a slope of $L$
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+theorem xYIdeal_eq₁ : xYIdeal W x₁ (C y₁) = xYIdeal W x₁ (linePolynomial x₁ y₁ L) :=
+  by
+  simp only [XY_ideal, X_class, Y_class, line_polynomial]
+  rw [← span_pair_add_mul_right <| AdjoinRoot.mk _ <| C <| C <| -L, ← _root_.map_mul, ← map_add]
+  apply congr_arg (_ ∘ _ ∘ _ ∘ _)
+  run_tac
+    C_simp
+  ring1
+#align weierstrass_curve.XY_ideal_eq₁ WeierstrassCurve.xYIdeal_eq₁
+
+/-- The polynomial obtained by substituting the line $Y = L*(X - x_1) + y_1$, with a slope of $L$
 that passes through an affine point $(x_1, y_1)$, into the polynomial $W(X, Y)$ associated to `W`.
 If such a line intersects `W` at another point $(x_2, y_2)$, then the roots of this polynomial are
 precisely $x_1$, $x_2$, and the $X$-coordinate of the addition of $(x_1, y_1)$ and $(x_2, y_2)$.
@@ -160,8 +174,30 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1032930279.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+theorem c_addPolynomial :
+    C (W.addPolynomial x₁ y₁ L) =
+      (Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L)) +
+        W.Polynomial :=
+  by
+  rw [add_polynomial, line_polynomial, WeierstrassCurve.polynomial, neg_polynomial];
+  run_tac
+    eval_simp
+  run_tac
+    C_simp;
+  ring1
+#align weierstrass_curve.C_add_polynomial WeierstrassCurve.c_addPolynomial
+
+theorem CoordinateRing.c_addPolynomial :
+    AdjoinRoot.mk W.Polynomial (C (W.addPolynomial x₁ y₁ L)) =
+      AdjoinRoot.mk W.Polynomial
+        ((Y - C (linePolynomial x₁ y₁ L)) * (W.negPolynomial - C (linePolynomial x₁ y₁ L))) :=
+  AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [C_add_polynomial, add_sub_cancel', mul_one]⟩
+#align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.CoordinateRing.c_addPolynomial
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -186,7 +222,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -211,7 +247,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -251,7 +287,24 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+theorem xYIdeal_add_eq :
+    xYIdeal W (W.addX x₁ x₂ L) (C (W.addY x₁ x₂ y₁ L)) =
+      span {AdjoinRoot.mk W.Polynomial <| W.negPolynomial - C (linePolynomial x₁ y₁ L)} ⊔
+        xIdeal W (W.addX x₁ x₂ L) :=
+  by
+  simp only [XY_ideal, X_ideal, X_class, Y_class, add_Y, add_Y', neg_Y, neg_polynomial,
+    line_polynomial]
+  conv_rhs => rw [sub_sub, ← neg_add', map_neg, span_singleton_neg, sup_comm, ← span_insert]
+  rw [← span_pair_add_mul_right <| AdjoinRoot.mk _ <| C <| C <| W.a₁ + L, ← _root_.map_mul, ←
+    map_add]
+  apply congr_arg (_ ∘ _ ∘ _ ∘ _)
+  run_tac
+    C_simp
+  ring1
+#align weierstrass_curve.XY_ideal_add_eq WeierstrassCurve.xYIdeal_add_eq
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -261,10 +314,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.809290655.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.671719271.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -434,8 +487,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1493480517.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -480,6 +533,30 @@ theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁
   Or.resolve_right (Y_eq_of_X_eq h₁' h₂' hx) hy
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
 
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+theorem xYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    xYIdeal W x₂ (C y₂) = xYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+  by
+  have hy₂ : y₂ = (line_polynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂).eval x₂ :=
+    by
+    by_cases hx : x₁ = x₂
+    · rcases hx, Y_eq_of_Y_ne h₁' h₂' hx <| hxy hx with ⟨rfl, rfl⟩
+      field_simp [line_polynomial, sub_ne_zero_of_ne (hxy rfl)]
+    · field_simp [line_polynomial, slope_of_X_ne hx, sub_ne_zero_of_ne hx]
+      ring1
+  nth_rw_lhs 1 [hy₂]
+  simp only [XY_ideal, X_class, Y_class, line_polynomial]
+  rw [← span_pair_add_mul_right <| AdjoinRoot.mk W.polynomial <| C <| C <| -W.slope x₁ x₂ y₁ y₂, ←
+    _root_.map_mul, ← map_add]
+  apply congr_arg (_ ∘ _ ∘ _ ∘ _)
+  run_tac
+    eval_simp
+  run_tac
+    C_simp
+  ring1
+#align weierstrass_curve.XY_ideal_eq₂ WeierstrassCurve.xYIdeal_eq₂
+
 theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
@@ -510,7 +587,13 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx]; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.809290655.derivative_simp -/
+theorem CoordinateRing.c_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    AdjoinRoot.mk W.Polynomial (C <| W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
+      -(xClass W x₁ * xClass W x₂ * xClass W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) :=
+  by simpa only [add_polynomial_slope h₁' h₂' hxy, map_neg, neg_inj, _root_.map_mul]
+#align weierstrass_curve.coordinate_ring.C_add_polynomial_slope WeierstrassCurve.CoordinateRing.c_addPolynomial_slope
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.671719271.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -524,7 +607,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -542,7 +625,7 @@ theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   equation_neg <| equation_add' h₁' h₂' hxy
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2551845879.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -650,10 +733,189 @@ section Group
 /-! ### The axioms for nonsingular rational points on a Weierstrass curve -/
 
 
-variable {F : Type u} [Field F] {W : WeierstrassCurve F}
+variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ : F}
+  (h₁ : W.Nonsingular x₁ y₁) (h₂ : W.Nonsingular x₂ y₂) (h₁' : W.Equation x₁ y₁)
+  (h₂' : W.Equation x₂ y₂)
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+theorem xYIdeal_neg_mul : xYIdeal W x₁ (C <| W.negY x₁ y₁) * xYIdeal W x₁ (C y₁) = xIdeal W x₁ :=
+  by
+  have Y_rw :
+    (Y - C (C y₁)) * (Y - C (C (W.neg_Y x₁ y₁))) -
+        C (X - C x₁) *
+          (C (X ^ 2 + C (x₁ + W.a₂) * X + C (x₁ ^ 2 + W.a₂ * x₁ + W.a₄)) - C (C W.a₁) * Y) =
+      W.polynomial * 1 :=
+    by
+    linear_combination (norm :=
+      (rw [neg_Y, WeierstrassCurve.polynomial];
+        run_tac
+          C_simp;
+        ring1))
+      congr_arg C (congr_arg C ((W.equation_iff _ _).mp h₁.left).symm)
+  simp_rw [XY_ideal, X_class, Y_class, span_pair_mul_span_pair, mul_comm, ← _root_.map_mul,
+    adjoin_root.mk_eq_mk.mpr ⟨1, Y_rw⟩, _root_.map_mul, span_insert, ←
+    span_singleton_mul_span_singleton, ← mul_sup, ← span_insert]
+  convert mul_top _ using 2
+  simp_rw [← @Set.image_singleton _ _ <| AdjoinRoot.mk _, ← Set.image_insert_eq, ← map_span]
+  convert map_top (AdjoinRoot.mk W.polynomial) using 1
+  apply congr_arg
+  simp_rw [eq_top_iff_one, mem_span_insert', mem_span_singleton']
+  cases' ((W.nonsingular_iff' _ _).mp h₁).right with hx hy
+  · let W_X := W.a₁ * y₁ - (3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄)
+    refine'
+      ⟨C (C W_X⁻¹ * -(X + C (2 * x₁ + W.a₂))), C (C <| W_X⁻¹ * W.a₁), 0, C (C <| W_X⁻¹ * -1), _⟩
+    rw [← mul_right_inj' <| C_ne_zero.mpr <| C_ne_zero.mpr hx]
+    simp only [mul_add, ← mul_assoc, ← C_mul, mul_inv_cancel hx]
+    run_tac
+      C_simp
+    ring1
+  · let W_Y := 2 * y₁ + W.a₁ * x₁ + W.a₃
+    refine' ⟨0, C (C W_Y⁻¹), C (C <| W_Y⁻¹ * -1), 0, _⟩
+    rw [neg_Y, ← mul_right_inj' <| C_ne_zero.mpr <| C_ne_zero.mpr hy]
+    simp only [mul_add, ← mul_assoc, ← C_mul, mul_inv_cancel hy]
+    run_tac
+      C_simp
+    ring1
+#align weierstrass_curve.XY_ideal_neg_mul WeierstrassCurve.xYIdeal_neg_mul
+
+private theorem XY_ideal'_mul_inv :
+    (xYIdeal W x₁ (C y₁) : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) *
+        (xYIdeal W x₁ (C <| W.negY x₁ y₁) * (xIdeal W x₁)⁻¹) =
+      1 :=
+  by
+  rw [← mul_assoc, ← FractionalIdeal.coeIdeal_mul, mul_comm <| XY_ideal W _ _, XY_ideal_neg_mul h₁,
+    X_ideal,
+    FractionalIdeal.coe_ideal_span_singleton_mul_inv W.function_field <| X_class_ne_zero W x₁]
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.930477999.C_simp -/
+theorem xYIdeal_mul_xYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    xIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (xYIdeal W x₁ (C y₁) * xYIdeal W x₂ (C y₂)) =
+      yIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
+        xYIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)
+          (C <| W.addY x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
+  by
+  have sup_rw : ∀ a b c d : Ideal W.coordinate_ring, a ⊔ (b ⊔ (c ⊔ d)) = a ⊔ d ⊔ b ⊔ c :=
+    fun _ _ c _ => by rw [← sup_assoc, @sup_comm _ _ c, sup_sup_sup_comm, ← sup_assoc]
+  rw [XY_ideal_add_eq, X_ideal, mul_comm, W.XY_ideal_eq₁ x₁ y₁ <| W.slope x₁ x₂ y₁ y₂, XY_ideal,
+    XY_ideal_eq₂ h₁' h₂' hxy, XY_ideal, span_pair_mul_span_pair]
+  simp_rw [span_insert, sup_rw, sup_mul, span_singleton_mul_span_singleton]
+  rw [← neg_eq_iff_eq_neg.mpr <| coordinate_ring.C_add_polynomial_slope h₁' h₂' hxy,
+    span_singleton_neg, coordinate_ring.C_add_polynomial, _root_.map_mul, Y_class]
+  simp_rw [mul_comm <| X_class W x₁, mul_assoc, ← span_singleton_mul_span_singleton, ← mul_sup]
+  rw [span_singleton_mul_span_singleton, ← span_insert, ←
+    span_pair_add_mul_right <| -(X_class W <| W.add_X x₁ x₂ <| W.slope x₁ x₂ y₁ y₂), mul_neg, ←
+    sub_eq_add_neg, ← sub_mul, ← map_sub, sub_sub_sub_cancel_right, span_insert, ←
+    span_singleton_mul_span_singleton, ← sup_rw, ← sup_mul, ← sup_mul]
+  apply congr_arg (_ ∘ _)
+  convert top_mul _
+  simp_rw [X_class, ← @Set.image_singleton _ _ <| AdjoinRoot.mk _, ← map_span, ← Ideal.map_sup,
+    eq_top_iff_one, mem_map_iff_of_surjective _ <| AdjoinRoot.mk_surjective W.monic_polynomial, ←
+    span_insert, mem_span_insert', mem_span_singleton']
+  by_cases hx : x₁ = x₂
+  · rcases hx, Y_eq_of_Y_ne h₁' h₂' hx (hxy hx) with ⟨rfl, rfl⟩
+    let y := (y₁ - W.neg_Y x₁ y₁) ^ 2
+    replace hxy := pow_ne_zero 2 (sub_ne_zero_of_ne <| hxy rfl)
+    refine'
+      ⟨1 + C (C <| y⁻¹ * 4) * W.polynomial,
+        ⟨C <| C y⁻¹ * (C 4 * X ^ 2 + C (4 * x₁ + W.b₂) * X + C (4 * x₁ ^ 2 + W.b₂ * x₁ + 2 * W.b₄)),
+          0, C (C y⁻¹) * (Y - W.neg_polynomial), _⟩,
+        by
+        rw [map_add, map_one, _root_.map_mul, AdjoinRoot.mk_self, MulZeroClass.mul_zero, add_zero]⟩
+    rw [WeierstrassCurve.polynomial, neg_polynomial, ←
+      mul_right_inj' <| C_ne_zero.mpr <| C_ne_zero.mpr hxy]
+    simp only [mul_add, ← mul_assoc, ← C_mul, mul_inv_cancel hxy]
+    linear_combination (norm :=
+      (rw [b₂, b₄, neg_Y];
+        run_tac
+          C_simp;
+        ring1))
+      -4 * congr_arg C (congr_arg C <| (W.equation_iff _ _).mp h₁')
+  · replace hx := sub_ne_zero_of_ne hx
+    refine' ⟨_, ⟨⟨C <| C (x₁ - x₂)⁻¹, C <| C <| (x₁ - x₂)⁻¹ * -1, 0, _⟩, map_one _⟩⟩
+    rw [← mul_right_inj' <| C_ne_zero.mpr <| C_ne_zero.mpr hx]
+    simp only [← mul_assoc, mul_add, ← C_mul, mul_inv_cancel hx]
+    run_tac
+      C_simp
+    ring1
+#align weierstrass_curve.XY_ideal_mul_XY_ideal WeierstrassCurve.xYIdeal_mul_xYIdeal
+
+/-- The non-zero fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ for some $x, y \in F$. -/
+@[simp]
+noncomputable def xYIdeal' : (FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
+  Units.mkOfMulEqOne _ _ <| XY_ideal'_mul_inv h₁
+#align weierstrass_curve.XY_ideal' WeierstrassCurve.xYIdeal'
+
+theorem xYIdeal'_eq :
+    (xYIdeal' h₁ : FractionalIdeal W.CoordinateRing⁰ W.FunctionField) = xYIdeal W x₁ (C y₁) :=
+  rfl
+#align weierstrass_curve.XY_ideal'_eq WeierstrassCurve.xYIdeal'_eq
+
+theorem mk_xYIdeal'_mul_mk_xYIdeal'_of_Y_eq :
+    ClassGroup.mk (xYIdeal' <| nonsingular_neg h₁) * ClassGroup.mk (xYIdeal' h₁) = 1 :=
+  by
+  rw [← _root_.map_mul]
+  exact
+    (ClassGroup.mk_eq_one_of_coe_ideal <|
+          (FractionalIdeal.coeIdeal_mul _ _).symm.trans
+            (fractional_ideal.coe_ideal_inj.mpr <| XY_ideal_neg_mul h₁)).mpr
+      ⟨_, X_class_ne_zero W _, rfl⟩
+#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq WeierstrassCurve.mk_xYIdeal'_mul_mk_xYIdeal'_of_Y_eq
+
+theorem mk_xYIdeal'_mul_mk_xYIdeal' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
+    ClassGroup.mk (xYIdeal' h₁) * ClassGroup.mk (xYIdeal' h₂) =
+      ClassGroup.mk (xYIdeal' <| nonsingular_add h₁ h₂ hxy) :=
+  by
+  rw [← _root_.map_mul]
+  exact
+    (ClassGroup.mk_eq_mk_of_coe_ideal (FractionalIdeal.coeIdeal_mul _ _).symm <| XY_ideal'_eq _).mpr
+      ⟨_, _, X_class_ne_zero W _, Y_class_ne_zero W _, XY_ideal_mul_XY_ideal h₁.left h₂.left hxy⟩
+#align weierstrass_curve.mk_XY_ideal'_mul_mk_XY_ideal' WeierstrassCurve.mk_xYIdeal'_mul_mk_xYIdeal'
 
 namespace Point
 
+/-- The set function mapping an affine point $(x, y)$ of `W` to the class of the non-zero fractional
+ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
+@[simp]
+noncomputable def toClassFun : W.Point → Additive (ClassGroup W.CoordinateRing)
+  | 0 => 0
+  | some h => Additive.ofMul <| ClassGroup.mk <| xYIdeal' h
+#align weierstrass_curve.point.to_class_fun WeierstrassCurve.Point.toClassFun
+
+/-- The group homomorphism mapping an affine point $(x, y)$ of `W` to the class of the non-zero
+fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ in the class group of $F[W]$. -/
+@[simps]
+noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing)
+    where
+  toFun := toClassFun
+  map_zero' := rfl
+  map_add' := by
+    rintro (_ | @⟨x₁, y₁, h₁⟩) (_ | @⟨x₂, y₂, h₂⟩)
+    any_goals simp only [zero_def, to_class_fun, _root_.zero_add, _root_.add_zero]
+    by_cases hx : x₁ = x₂
+    · by_cases hy : y₁ = W.neg_Y x₂ y₂
+      · substs hx hy
+        simpa only [some_add_some_of_Y_eq rfl rfl] using
+          (mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq h₂).symm
+      ·
+        simpa only [some_add_some_of_Y_ne hx hy] using
+          (mk_XY_ideal'_mul_mk_XY_ideal' h₁ h₂ fun _ => hy).symm
+    ·
+      simpa only [some_add_some_of_X_ne hx] using
+        (mk_XY_ideal'_mul_mk_XY_ideal' h₁ h₂ fun h => (hx h).elim).symm
+#align weierstrass_curve.point.to_class WeierstrassCurve.Point.toClass
+
+@[simp]
+theorem toClass_zero : toClass (0 : W.Point) = 0 :=
+  rfl
+#align weierstrass_curve.point.to_class_zero WeierstrassCurve.Point.toClass_zero
+
+theorem toClass_some : toClass (some h₁) = ClassGroup.mk (xYIdeal' h₁) :=
+  rfl
+#align weierstrass_curve.point.to_class_some WeierstrassCurve.Point.toClass_some
+
 @[simp]
 theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
   by
@@ -681,6 +943,46 @@ theorem add_left_neg (P : W.Point) : -P + P = 0 := by rw [add_eq_zero]
 theorem neg_add_eq_zero (P Q : W.Point) : -P + Q = 0 ↔ P = Q := by rw [add_eq_zero, neg_inj]
 #align weierstrass_curve.point.neg_add_eq_zero WeierstrassCurve.Point.neg_add_eq_zero
 
+theorem toClass_eq_zero (P : W.Point) : toClass P = 0 ↔ P = 0 :=
+  ⟨by
+    intro hP
+    rcases P with (_ | @⟨_, _, ⟨h, _⟩⟩)
+    · rfl
+    · rcases(ClassGroup.mk_eq_one_of_coe_ideal <| by rfl).mp hP with ⟨p, h0, hp⟩
+      apply (p.nat_degree_norm_ne_one _).elim
+      rw [← finrank_quotient_span_eq_natDegree_norm W.CoordinateRing.Basis h0, ←
+        (quotient_equiv_alg_of_eq F hp).toLinearEquiv.finrank_eq,
+        (quotient_XY_ideal_equiv W h).toLinearEquiv.finrank_eq, FiniteDimensional.finrank_self],
+    congr_arg toClass⟩
+#align weierstrass_curve.point.to_class_eq_zero WeierstrassCurve.Point.toClass_eq_zero
+
+theorem toClass_injective : Function.Injective <| @toClass _ _ W :=
+  by
+  rintro (_ | h) _ hP
+  all_goals rw [← neg_add_eq_zero, ← to_class_eq_zero, map_add, ← hP]
+  · exact zero_add 0
+  · exact mk_XY_ideal'_mul_mk_XY_ideal'_of_Y_eq h
+#align weierstrass_curve.point.to_class_injective WeierstrassCurve.Point.toClass_injective
+
+theorem add_comm (P Q : W.Point) : P + Q = Q + P :=
+  toClass_injective <| by simp only [map_add, add_comm]
+#align weierstrass_curve.point.add_comm WeierstrassCurve.Point.add_comm
+
+theorem add_assoc (P Q R : W.Point) : P + Q + R = P + (Q + R) :=
+  toClass_injective <| by simp only [map_add, add_assoc]
+#align weierstrass_curve.point.add_assoc WeierstrassCurve.Point.add_assoc
+
+noncomputable instance : AddCommGroup W.Point
+    where
+  zero := zero
+  neg := neg
+  add := add
+  zero_add := zero_add
+  add_zero := add_zero
+  add_left_neg := add_left_neg
+  add_comm := add_comm
+  add_assoc := add_assoc
+
 end Point
 
 end Group
Diff
@@ -297,7 +297,6 @@ inductive Point
   | some {x y : R} (h : W.Nonsingular x y)
 #align weierstrass_curve.point WeierstrassCurve.Point
 
--- mathport name: «expr ⟮ ⟯»
 scoped notation W "⟮" S "⟯" => (W.base_change S).Point
 
 namespace Point
@@ -470,8 +469,6 @@ theorem baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : Weierstras
   by rw [← base_change_slope, base_change_base_change]
 #align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.baseChange_slope_of_baseChange
 
-include h₁' h₂'
-
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
   by
   rw [equation_iff] at h₁' h₂' 
@@ -545,10 +542,6 @@ theorem equation_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   equation_neg <| equation_add' h₁' h₂' hxy
 #align weierstrass_curve.equation_add WeierstrassCurve.equation_add
 
-omit h₁' h₂'
-
-include h₁ h₂
-
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
@@ -578,8 +571,6 @@ theorem nonsingular_add (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   nonsingular_neg <| nonsingular_add' h₁ h₂ hxy
 #align weierstrass_curve.nonsingular_add WeierstrassCurve.nonsingular_add
 
-omit h₁ h₂
-
 namespace Point
 
 variable {h₁ h₂}
Diff
@@ -70,19 +70,19 @@ elliptic curve, rational point, group law
 -/
 
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def map_simp : tactic Unit :=
   sorry
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def eval_simp : tactic Unit :=
   sorry
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def C_simp : tactic Unit :=
   sorry
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:336:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def derivative_simp : tactic Unit :=
   sorry
 
Diff
@@ -474,7 +474,7 @@ include h₁' h₂'
 
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
   by
-  rw [equation_iff] at h₁' h₂'
+  rw [equation_iff] at h₁' h₂' 
   rw [← sub_eq_zero, ← @sub_eq_zero _ _ y₁, ← mul_eq_zero, neg_Y]
   linear_combination (norm := (rw [hx]; ring1)) h₁' - h₂'
 #align weierstrass_curve.Y_eq_of_X_eq WeierstrassCurve.Y_eq_of_X_eq
@@ -490,27 +490,27 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   rw [add_polynomial_eq, neg_inj, Cubic.prod_X_sub_C_eq, Cubic.toPoly_injective]
   by_cases hx : x₁ = x₂
   · rcases hx, Y_eq_of_Y_ne h₁' h₂' hx (hxy hx) with ⟨rfl, rfl⟩
-    rw [equation_iff] at h₁' h₂'
+    rw [equation_iff] at h₁' h₂' 
     rw [slope_of_Y_ne rfl <| hxy rfl]
-    rw [neg_Y, ← sub_ne_zero] at hxy
+    rw [neg_Y, ← sub_ne_zero] at hxy 
     ext
     · rfl
     · simp only [add_X]
       ring1
     · field_simp [hxy rfl]
       ring1
-    · linear_combination (norm := (field_simp [hxy rfl] ; ring1)) -h₁'
-  · rw [equation_iff] at h₁' h₂'
+    · linear_combination (norm := (field_simp [hxy rfl]; ring1)) -h₁'
+  · rw [equation_iff] at h₁' h₂' 
     rw [slope_of_X_ne hx]
-    rw [← sub_eq_zero] at hx
+    rw [← sub_eq_zero] at hx 
     ext
     · rfl
     · simp only [add_X]
       ring1
     · apply mul_right_injective₀ hx
-      linear_combination (norm := (field_simp [hx] ; ring1)) h₂' - h₁'
+      linear_combination (norm := (field_simp [hx]; ring1)) h₂' - h₁'
     · apply mul_right_injective₀ hx
-      linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
+      linear_combination (norm := (field_simp [hx]; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.809290655.derivative_simp -/
@@ -675,9 +675,9 @@ theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
       by_cases hx : x₁ = x₂
       · by_cases hy : y₁ = W.neg_Y x₂ y₂
         · exact ⟨hx, hy⟩
-        · rw [some_add_some_of_Y_ne hx hy] at h
+        · rw [some_add_some_of_Y_ne hx hy] at h 
           contradiction
-      · rw [some_add_some_of_X_ne hx] at h
+      · rw [some_add_some_of_X_ne hx] at h 
         contradiction
     · exact fun ⟨hx, hy⟩ => some_add_some_of_Y_eq hx hy
 #align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Point.add_eq_zero
Diff
@@ -92,7 +92,7 @@ namespace WeierstrassCurve
 
 open Polynomial
 
-open Polynomial PolynomialPolynomial
+open scoped Polynomial PolynomialPolynomial
 
 section Basic
 
@@ -388,7 +388,7 @@ section Addition
 /-! ### Slopes of lines through nonsingular rational points on a Weierstrass curve -/
 
 
-open Classical
+open scoped Classical
 
 variable {F : Type u} [Field F] (W : WeierstrassCurve F) (K : Type v) [Field K] [Algebra F K]
   (x₁ x₂ y₁ y₂ : F)
@@ -704,7 +704,7 @@ variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (F : Type v) [Field
 
 namespace Point
 
-open WeierstrassCurve
+open scoped WeierstrassCurve
 
 /-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
 def ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
Diff
@@ -706,12 +706,6 @@ namespace Point
 
 open WeierstrassCurve
 
-/- warning: weierstrass_curve.point.of_base_change_fun -> WeierstrassCurve.Point.ofBaseChangeFun is a dubious translation:
-lean 3 declaration is
-  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (W : WeierstrassCurve.{u1} R) (F : Type.{u2}) [_inst_2 : Field.{u2} F] [_inst_3 : Algebra.{u1, u2} R F (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2)))] (K : Type.{u3}) [_inst_4 : Field.{u3} K] [_inst_5 : Algebra.{u1, u3} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))] [_inst_6 : Algebra.{u2, u3} F K (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2)) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))] [_inst_7 : IsScalarTower.{u1, u2, u3} R F K (SMulZeroClass.toHasSmul.{u1, u2} R F (AddZeroClass.toHasZero.{u2} F (AddMonoid.toAddZeroClass.{u2} F (AddCommMonoid.toAddMonoid.{u2} F (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R F (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)))))) (AddZeroClass.toHasZero.{u2} F (AddMonoid.toAddZeroClass.{u2} F (AddCommMonoid.toAddMonoid.{u2} F (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R F (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (AddZeroClass.toHasZero.{u2} F (AddMonoid.toAddZeroClass.{u2} F (AddCommMonoid.toAddMonoid.{u2} F (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))))))))) (Module.toMulActionWithZero.{u1, u2} R F (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2)))))) (Algebra.toModule.{u1, u2} R F (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))) _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} F K (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (SMulWithZero.toSmulZeroClass.{u2, u3} F K (MulZeroClass.toHasZero.{u2} F (MulZeroOneClass.toMulZeroClass.{u2} F (MonoidWithZero.toMulZeroOneClass.{u2} F (Semiring.toMonoidWithZero.{u2} F (CommSemiring.toSemiring.{u2} F (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2))))))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (MulActionWithZero.toSMulWithZero.{u2, u3} F K (Semiring.toMonoidWithZero.{u2} F (CommSemiring.toSemiring.{u2} F (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2)))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (Module.toMulActionWithZero.{u2, u3} F K (CommSemiring.toSemiring.{u2} F (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))))) (Algebra.toModule.{u2, u3} F K (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2)) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))) _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R K (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R K (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)))))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R K (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (Module.toMulActionWithZero.{u1, u3} R K (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))))) (Algebra.toModule.{u1, u3} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))) _inst_5)))))], (WeierstrassCurve.Point.{u2} F (EuclideanDomain.toCommRing.{u2} F (Field.toEuclideanDomain.{u2} F _inst_2)) (WeierstrassCurve.baseChange.{u1, u2} R _inst_1 W F (EuclideanDomain.toCommRing.{u2} F (Field.toEuclideanDomain.{u2} F _inst_2)) _inst_3)) -> (WeierstrassCurve.Point.{u3} K (EuclideanDomain.toCommRing.{u3} K (Field.toEuclideanDomain.{u3} K _inst_4)) (WeierstrassCurve.baseChange.{u1, u3} R _inst_1 W K (EuclideanDomain.toCommRing.{u3} K (Field.toEuclideanDomain.{u3} K _inst_4)) _inst_5))
-but is expected to have type
-  PUnit.{max (max (succ (succ u1)) (succ (succ u2))) (succ (succ u3))}
-Case conversion may be inaccurate. Consider using '#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Point.ofBaseChangeFunₓ'. -/
 /-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
 def ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
   | 0 => 0
Diff
@@ -115,20 +115,16 @@ def negY : R :=
   -y₁ - W.a₁ * x₁ - W.a₃
 #align weierstrass_curve.neg_Y WeierstrassCurve.negY
 
-theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
-  by
-  simp only [neg_Y]
-  ring1
+theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ := by simp only [neg_Y]; ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
-  by
-  simp only [neg_Y]
+  by simp only [neg_Y];
   run_tac
-    map_simp
+    map_simp;
   rfl
 #align weierstrass_curve.base_change_neg_Y WeierstrassCurve.baseChange_negY
 
@@ -140,9 +136,8 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 @[simp]
-theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
-  by
-  rw [neg_Y, sub_sub, neg_polynomial]
+theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ := by
+  rw [neg_Y, sub_sub, neg_polynomial];
   run_tac
     eval_simp
 #align weierstrass_curve.eval_neg_polynomial WeierstrassCurve.eval_negPolynomial
@@ -174,11 +169,11 @@ theorem addPolynomial_eq :
             2 * x₁ * L ^ 2 + (W.a₁ * x₁ - 2 * y₁ - W.a₃) * L + (-W.a₁ * y₁ + W.a₄),
             -x₁ ^ 2 * L ^ 2 + (2 * x₁ * y₁ + W.a₃ * x₁) * L - (y₁ ^ 2 + W.a₃ * y₁ - W.a₆)⟩ :=
   by
-  rw [add_polynomial, line_polynomial, WeierstrassCurve.polynomial, Cubic.toPoly]
+  rw [add_polynomial, line_polynomial, WeierstrassCurve.polynomial, Cubic.toPoly];
   run_tac
     eval_simp
   run_tac
-    C_simp
+    C_simp;
   ring1
 #align weierstrass_curve.add_polynomial_eq WeierstrassCurve.addPolynomial_eq
 
@@ -195,10 +190,9 @@ def addX : R :=
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
-  by
-  simp only [add_X]
+  by simp only [add_X];
   run_tac
-    map_simp
+    map_simp;
   rfl
 #align weierstrass_curve.base_change_add_X WeierstrassCurve.baseChange_addX
 
@@ -222,8 +216,7 @@ theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
       algebraMap R A (W.addY' x₁ x₂ y₁ L) :=
-  by
-  simp only [add_Y', base_change_add_X]
+  by simp only [add_Y', base_change_add_X];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_add_Y' WeierstrassCurve.baseChange_addY'
@@ -324,11 +317,8 @@ end Point
 
 variable {W x₁ y₁}
 
-theorem equation_neg_iff : W.Equation x₁ (W.negY x₁ y₁) ↔ W.Equation x₁ y₁ :=
-  by
-  rw [equation_iff, equation_iff, neg_Y]
-  congr 2
-  ring1
+theorem equation_neg_iff : W.Equation x₁ (W.negY x₁ y₁) ↔ W.Equation x₁ y₁ := by
+  rw [equation_iff, equation_iff, neg_Y]; congr 2; ring1
 #align weierstrass_curve.equation_neg_iff WeierstrassCurve.equation_neg_iff
 
 theorem equation_neg_of (h : W.Equation x₁ <| W.negY x₁ y₁) : W.Equation x₁ y₁ :=
@@ -387,11 +377,7 @@ theorem neg_some (h : W.Nonsingular x₁ y₁) : -some h = some (nonsingular_neg
 #align weierstrass_curve.point.neg_some WeierstrassCurve.Point.neg_some
 
 instance : InvolutiveNeg W.Point :=
-  ⟨neg, by
-    rintro (_ | _)
-    · rfl
-    · simp
-      ring1⟩
+  ⟨neg, by rintro (_ | _); · rfl; · simp; ring1⟩
 
 end Point
 
@@ -445,9 +431,7 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
     W.slope x₁ x₂ y₁ y₂ =
       -(W.polynomialX.eval <| C y₁).eval x₁ / (W.polynomialY.eval <| C y₁).eval x₁ :=
   by
-  rw [slope_of_Y_ne hx hy, eval_polynomial_X, neg_sub]
-  congr 1
-  rw [neg_Y, eval_polynomial_Y]
+  rw [slope_of_Y_ne hx hy, eval_polynomial_X, neg_sub]; congr 1; rw [neg_Y, eval_polynomial_Y]
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
@@ -534,10 +518,9 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
           (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
-  by
-  rw [add_polynomial_slope h₁' h₂' hxy]
+  by rw [add_polynomial_slope h₁' h₂' hxy];
   run_tac
-    derivative_simp
+    derivative_simp;
   ring1
 #align weierstrass_curve.derivative_add_polynomial_slope WeierstrassCurve.derivative_addPolynomial_slope
 
@@ -550,7 +533,7 @@ before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.Equation (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
-  rw [equation_add_iff, add_polynomial_slope h₁' h₂' hxy]
+  rw [equation_add_iff, add_polynomial_slope h₁' h₂' hxy];
   run_tac
     eval_simp
   rw [neg_eq_zero, sub_self, MulZeroClass.mul_zero]
Diff
@@ -73,22 +73,18 @@ elliptic curve, rational point, group law
 /- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def map_simp : tactic Unit :=
   sorry
-#align map_simp map_simp
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def eval_simp : tactic Unit :=
   sorry
-#align eval_simp eval_simp
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def C_simp : tactic Unit :=
   sorry
-#align C_simp C_simp
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def derivative_simp : tactic Unit :=
   sorry
-#align derivative_simp derivative_simp
 
 universe u v w
 
Diff
@@ -125,7 +125,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -142,7 +142,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -169,8 +169,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008198739.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1032930279.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -195,7 +195,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -221,7 +221,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -262,7 +262,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -272,10 +272,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1297540107.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.809290655.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -455,8 +455,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3769451639.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -533,7 +533,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1297540107.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.809290655.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -548,7 +548,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -570,7 +570,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2574636079.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
Diff
@@ -125,7 +125,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -142,7 +142,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -169,8 +169,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.567420095.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1008198739.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -195,7 +195,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -221,7 +221,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -262,7 +262,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -272,10 +272,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2485142647.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1297540107.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -455,8 +455,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.744928483.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -533,7 +533,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2485142647.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1297540107.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -548,7 +548,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -570,7 +570,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2689713307.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
Diff
@@ -4,13 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit 2196ab363eb097c008d4497125e0dde23fb36db2
+! leanprover-community/mathlib commit f0c8bf9245297a541f468be517f1bde6195105e9
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.AlgebraicGeometry.EllipticCurve.Weierstrass
-import Mathbin.FieldTheory.Galois
-import Mathbin.RingTheory.ClassGroup
 
 /-!
 # The group of nonsingular rational points on a Weierstrass curve over a field
@@ -73,8 +71,6 @@ elliptic curve, rational point, group law
 
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
--- temporary import to enable point notation
--- temporary import to enable point notation
 private unsafe def map_simp : tactic Unit :=
   sorry
 #align map_simp map_simp
@@ -129,7 +125,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -146,7 +142,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -173,8 +169,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.874962071.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.567420095.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -199,7 +195,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -225,7 +221,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -266,7 +262,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -276,10 +272,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3104640079.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2485142647.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -459,8 +455,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3801564495.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -537,7 +533,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3104640079.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2485142647.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -552,7 +548,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -574,7 +570,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.626857223.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
Diff
@@ -129,7 +129,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -146,7 +146,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -173,8 +173,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4157056569.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.874962071.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -199,7 +199,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -225,7 +225,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -266,7 +266,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -276,10 +276,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.162409969.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3104640079.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -459,8 +459,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.739313959.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -537,7 +537,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.162409969.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3104640079.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -552,7 +552,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -574,7 +574,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1342216415.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
Diff
@@ -511,7 +511,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
   by
-  rw [add_polynomial_eq, neg_inj, Cubic.prod_x_sub_c_eq, Cubic.toPoly_injective]
+  rw [add_polynomial_eq, neg_inj, Cubic.prod_X_sub_C_eq, Cubic.toPoly_injective]
   by_cases hx : x₁ = x₂
   · rcases hx, Y_eq_of_Y_ne h₁' h₂' hx (hxy hx) with ⟨rfl, rfl⟩
     rw [equation_iff] at h₁' h₂'
Diff
@@ -129,7 +129,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -146,7 +146,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -173,8 +173,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.170323567.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4157056569.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -199,7 +199,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -225,7 +225,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -266,7 +266,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -276,10 +276,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.162409969.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -459,8 +459,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2137773769.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -537,7 +537,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.162409969.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -552,7 +552,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -574,7 +574,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3102772865.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit 03994e05d8bfc59a41d2ec99523d6553d21848ac
+! leanprover-community/mathlib commit 2196ab363eb097c008d4497125e0dde23fb36db2
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -693,7 +693,7 @@ theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
   by
   rcases P, Q with ⟨_ | @⟨x₁, y₁, _⟩, _ | @⟨x₂, y₂, _⟩⟩
   any_goals rfl
-  · rw [zero_def, zero_add, eq_neg_iff_eq_neg, neg_zero]
+  · rw [zero_def, zero_add, ← neg_eq_iff_eq_neg, neg_zero, eq_comm]
   · simp only [neg_some]
     constructor
     · intro h
Diff
@@ -294,7 +294,7 @@ theorem nonsingular_add_of_eval_derivative_ne_zero
     eval_simp
   run_tac
     derivative_simp
-  simp only [zero_add, add_zero, sub_zero, zero_mul, mul_one]
+  simp only [zero_add, add_zero, sub_zero, MulZeroClass.zero_mul, mul_one]
   run_tac
     eval_simp
   linear_combination (norm := (norm_num1; ring1)) hx.left + L * hx.right
@@ -561,7 +561,7 @@ theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   rw [equation_add_iff, add_polynomial_slope h₁' h₂' hxy]
   run_tac
     eval_simp
-  rw [neg_eq_zero, sub_self, mul_zero]
+  rw [neg_eq_zero, sub_self, MulZeroClass.mul_zero]
 #align weierstrass_curve.equation_add' WeierstrassCurve.equation_add'
 
 /-- The addition of two affine points in `W` on a sloped line lies in `W`. -/
@@ -581,7 +581,7 @@ theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.Nonsingular (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) (W.addY' x₁ x₂ y₁ <| W.slope x₁ x₂ y₁ y₂) :=
   by
   by_cases hx₁ : W.add_X x₁ x₂ (W.slope x₁ x₂ y₁ y₂) = x₁
-  · rwa [add_Y', hx₁, sub_self, mul_zero, zero_add]
+  · rwa [add_Y', hx₁, sub_self, MulZeroClass.mul_zero, zero_add]
   · by_cases hx₂ : W.add_X x₁ x₂ (W.slope x₁ x₂ y₁ y₂) = x₂
     · by_cases hx : x₁ = x₂
       · subst hx
@@ -593,7 +593,7 @@ theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       rw [derivative_add_polynomial_slope h₁.left h₂.left hxy]
       run_tac
         eval_simp
-      simpa only [neg_ne_zero, sub_self, mul_zero, add_zero] using
+      simpa only [neg_ne_zero, sub_self, MulZeroClass.mul_zero, add_zero] using
         mul_ne_zero (sub_ne_zero_of_ne hx₁) (sub_ne_zero_of_ne hx₂)
 #align weierstrass_curve.nonsingular_add' WeierstrassCurve.nonsingular_add'
 
Diff
@@ -112,7 +112,7 @@ variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (A : Type v) [CommRi
 
 /-- The polynomial $-Y - a_1X - a_3$ associated to negation. -/
 noncomputable def negPolynomial : R[X][Y] :=
-  -Y - c (c W.a₁ * x + c W.a₃)
+  -Y - C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.neg_polynomial WeierstrassCurve.negPolynomial
 
 /-- The $Y$-coordinate of the negation of an affine point in `W`.
@@ -148,7 +148,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 @[simp]
-theorem eval_negPolynomial : (W.negPolynomial.eval <| c y₁).eval x₁ = W.negY x₁ y₁ :=
+theorem eval_negPolynomial : (W.negPolynomial.eval <| C y₁).eval x₁ = W.negY x₁ y₁ :=
   by
   rw [neg_Y, sub_sub, neg_polynomial]
   run_tac
@@ -160,7 +160,7 @@ with a slope of $L$ that passes through an affine point $(x_1, y_1)$.
 
 This does not depend on `W`, and has argument order: $x_1$, $y_1$, $L$. -/
 noncomputable def linePolynomial : R[X] :=
-  c L * (x - c x₁) + c y₁
+  C L * (X - C x₁) + C y₁
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 
 /-- The polynomial obtained by substituting the line $Y = L(X - x_1) + y_1$, with a slope of $L$
@@ -451,7 +451,7 @@ theorem slope_of_X_ne (hx : x₁ ≠ x₂) : W.slope x₁ x₂ y₁ y₂ = (y₁
 
 theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     W.slope x₁ x₂ y₁ y₂ =
-      -(W.polynomialX.eval <| c y₁).eval x₁ / (W.polynomialY.eval <| c y₁).eval x₁ :=
+      -(W.polynomialX.eval <| C y₁).eval x₁ / (W.polynomialY.eval <| C y₁).eval x₁ :=
   by
   rw [slope_of_Y_ne hx hy, eval_polynomial_X, neg_sub]
   congr 1
@@ -509,7 +509,7 @@ theorem Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁
 
 theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
-      -((x - c x₁) * (x - c x₂) * (x - c (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
+      -((X - C x₁) * (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
   by
   rw [add_polynomial_eq, neg_inj, Cubic.prod_x_sub_c_eq, Cubic.toPoly_injective]
   by_cases hx : x₁ = x₂
@@ -540,8 +540,8 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
-      -((x - c x₁) * (x - c x₂) + (x - c x₁) * (x - c (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
-          (x - c x₂) * (x - c (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
+      -((X - C x₁) * (X - C x₂) + (X - C x₁) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
+          (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂))) :=
   by
   rw [add_polynomial_slope h₁' h₂' hxy]
   run_tac
Diff
@@ -72,24 +72,24 @@ elliptic curve, rational point, group law
 -/
 
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 -- temporary import to enable point notation
 -- temporary import to enable point notation
 private unsafe def map_simp : tactic Unit :=
   sorry
 #align map_simp map_simp
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def eval_simp : tactic Unit :=
   sorry
 #align eval_simp eval_simp
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def C_simp : tactic Unit :=
   sorry
 #align C_simp C_simp
 
-/- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
+/- ./././Mathport/Syntax/Translate/Expr.lean:330:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def derivative_simp : tactic Unit :=
   sorry
 #align derivative_simp derivative_simp
@@ -129,7 +129,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
 theorem baseChange_negY :
     (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
       algebraMap R A (W.negY x₁ y₁) :=
@@ -146,7 +146,7 @@ theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
   by rw [← base_change_neg_Y, base_change_base_change]
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| c y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -173,8 +173,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.170323567.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.170323567.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -199,7 +199,7 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
 theorem baseChange_addX :
     (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
       algebraMap R A (W.addX x₁ x₂ L) :=
@@ -225,7 +225,7 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
 theorem baseChange_addY' :
     (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
         (algebraMap R A L) =
@@ -266,7 +266,7 @@ theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
   by rw [← base_change_add_Y, base_change_base_change]
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -276,10 +276,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -459,8 +459,8 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
 theorem baseChange_slope :
     (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
         (algebraMap F K y₂) =
@@ -537,7 +537,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((x - c x₁) * (x - c x₂) + (x - c x₁) * (x - c (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -552,7 +552,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -574,7 +574,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit 67f92b6f60865717e0811128b77d49ab4c07f7f1
+! leanprover-community/mathlib commit 03994e05d8bfc59a41d2ec99523d6553d21848ac
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -75,6 +75,11 @@ elliptic curve, rational point, group law
 /- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
 -- temporary import to enable point notation
 -- temporary import to enable point notation
+private unsafe def map_simp : tactic Unit :=
+  sorry
+#align map_simp map_simp
+
+/- ./././Mathport/Syntax/Translate/Expr.lean:334:4: warning: unsupported (TODO): `[tacs] -/
 private unsafe def eval_simp : tactic Unit :=
   sorry
 #align eval_simp eval_simp
@@ -89,7 +94,7 @@ private unsafe def derivative_simp : tactic Unit :=
   sorry
 #align derivative_simp derivative_simp
 
-universe u
+universe u v w
 
 namespace WeierstrassCurve
 
@@ -102,7 +107,8 @@ section Basic
 /-! ### Polynomials associated to nonsingular rational points on a Weierstrass curve -/
 
 
-variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (x₁ x₂ y₁ y₂ L : R)
+variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (A : Type v) [CommRing A] [Algebra R A]
+  (B : Type w) [CommRing B] [Algebra R B] [Algebra A B] [IsScalarTower R A B] (x₁ x₂ y₁ y₂ L : R)
 
 /-- The polynomial $-Y - a_1X - a_3$ associated to negation. -/
 noncomputable def negPolynomial : R[X][Y] :=
@@ -123,7 +129,24 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+theorem baseChange_negY :
+    (W.base_change A).negY (algebraMap R A x₁) (algebraMap R A y₁) =
+      algebraMap R A (W.negY x₁ y₁) :=
+  by
+  simp only [neg_Y]
+  run_tac
+    map_simp
+  rfl
+#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.baseChange_negY
+
+theorem baseChange_negY_of_baseChange (x₁ y₁ : A) :
+    (W.base_change B).negY (algebraMap A B x₁) (algebraMap A B y₁) =
+      algebraMap A B ((W.base_change A).negY x₁ y₁) :=
+  by rw [← base_change_neg_Y, base_change_base_change]
+#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.baseChange_negY_of_baseChange
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| c y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -132,7 +155,7 @@ theorem eval_negPolynomial : (W.negPolynomial.eval <| c y₁).eval x₁ = W.negY
     eval_simp
 #align weierstrass_curve.eval_neg_polynomial WeierstrassCurve.eval_negPolynomial
 
-/-- The polynomial $L*(X - x_1) + y_1$ associated to the line $Y = L*(X - x_1) + y_1$,
+/-- The polynomial $L(X - x_1) + y_1$ associated to the line $Y = L(X - x_1) + y_1$,
 with a slope of $L$ that passes through an affine point $(x_1, y_1)$.
 
 This does not depend on `W`, and has argument order: $x_1$, $y_1$, $L$. -/
@@ -140,7 +163,7 @@ noncomputable def linePolynomial : R[X] :=
   c L * (x - c x₁) + c y₁
 #align weierstrass_curve.line_polynomial WeierstrassCurve.linePolynomial
 
-/-- The polynomial obtained by substituting the line $Y = L*(X - x_1) + y_1$, with a slope of $L$
+/-- The polynomial obtained by substituting the line $Y = L(X - x_1) + y_1$, with a slope of $L$
 that passes through an affine point $(x_1, y_1)$, into the polynomial $W(X, Y)$ associated to `W`.
 If such a line intersects `W` at another point $(x_2, y_2)$, then the roots of this polynomial are
 precisely $x_1$, $x_2$, and the $X$-coordinate of the addition of $(x_1, y_1)$ and $(x_2, y_2)$.
@@ -150,8 +173,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.170323567.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -176,6 +199,23 @@ def addX : R :=
   L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂
 #align weierstrass_curve.add_X WeierstrassCurve.addX
 
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+theorem baseChange_addX :
+    (W.base_change A).addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
+      algebraMap R A (W.addX x₁ x₂ L) :=
+  by
+  simp only [add_X]
+  run_tac
+    map_simp
+  rfl
+#align weierstrass_curve.base_change_add_X WeierstrassCurve.baseChange_addX
+
+theorem baseChange_addX_of_baseChange (x₁ x₂ L : A) :
+    (W.base_change B).addX (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B L) =
+      algebraMap A B ((W.base_change A).addX x₁ x₂ L) :=
+  by rw [← base_change_add_X, base_change_base_change]
+#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.baseChange_addX_of_baseChange
+
 /-- The $Y$-coordinate, before applying the final negation, of the addition of two affine points
 $(x_1, y_1)$ and $(x_2, y_2)$, where the line through them is not vertical and has a slope of $L$.
 
@@ -185,6 +225,24 @@ def addY' : R :=
   L * (W.addX x₁ x₂ L - x₁) + y₁
 #align weierstrass_curve.add_Y' WeierstrassCurve.addY'
 
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+theorem baseChange_addY' :
+    (W.base_change A).addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
+        (algebraMap R A L) =
+      algebraMap R A (W.addY' x₁ x₂ y₁ L) :=
+  by
+  simp only [add_Y', base_change_add_X]
+  run_tac
+    map_simp
+#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.baseChange_addY'
+
+theorem baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
+    (W.base_change B).addY' (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
+        (algebraMap A B L) =
+      algebraMap A B ((W.base_change A).addY' x₁ x₂ y₁ L) :=
+  by rw [← base_change_add_Y', base_change_base_change]
+#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.baseChange_addY'_of_baseChange
+
 /-- The $Y$-coordinate of the addition of two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`,
 where the line through them is not vertical and has a slope of $L$.
 
@@ -194,7 +252,21 @@ def addY : R :=
   W.negY (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L)
 #align weierstrass_curve.add_Y WeierstrassCurve.addY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+theorem baseChange_addY :
+    (W.base_change A).addY (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
+        (algebraMap R A L) =
+      algebraMap R A (W.addY x₁ x₂ y₁ L) :=
+  by simp only [add_Y, base_change_add_Y', base_change_add_X, base_change_neg_Y]
+#align weierstrass_curve.base_change_add_Y WeierstrassCurve.baseChange_addY
+
+theorem baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
+    (W.base_change B).addY (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
+        (algebraMap A B L) =
+      algebraMap A B ((W.base_change A).addY x₁ x₂ y₁ L) :=
+  by rw [← base_change_add_Y, base_change_base_change]
+#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.baseChange_addY_of_baseChange
+
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -204,10 +276,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.170323567.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -340,7 +412,8 @@ section Addition
 
 open Classical
 
-variable {F : Type u} [Field F] (W : WeierstrassCurve F) (x₁ x₂ y₁ y₂ : F)
+variable {F : Type u} [Field F] (W : WeierstrassCurve F) (K : Type v) [Field K] [Algebra F K]
+  (x₁ x₂ y₁ y₂ : F)
 
 /-- The slope of the line through two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`.
 If $x_1 \ne x_2$, then this line is the secant of `W` through $(x_1, y_1)$ and $(x_2, y_2)$,
@@ -360,6 +433,11 @@ noncomputable def slope : F :=
 variable {W x₁ x₂ y₁ y₂} (h₁ : W.Nonsingular x₁ y₁) (h₂ : W.Nonsingular x₂ y₂)
   (h₁' : W.Equation x₁ y₁) (h₂' : W.Equation x₂ y₂)
 
+@[simp]
+theorem slope_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂) : W.slope x₁ x₂ y₁ y₂ = 0 := by
+  rw [slope, dif_pos hx, dif_pos hy]
+#align weierstrass_curve.slope_of_Y_eq WeierstrassCurve.slope_of_Y_eq
+
 @[simp]
 theorem slope_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     W.slope x₁ x₂ y₁ y₂ = (3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄ - W.a₁ * y₁) / (y₁ - W.negY x₁ y₁) :=
@@ -381,6 +459,41 @@ theorem slope_of_Y_ne_eq_eval (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
   ring1
 #align weierstrass_curve.slope_of_Y_ne_eq_eval WeierstrassCurve.slope_of_Y_ne_eq_eval
 
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.map_simp -/
+theorem baseChange_slope :
+    (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
+        (algebraMap F K y₂) =
+      algebraMap F K (W.slope x₁ x₂ y₁ y₂) :=
+  by
+  by_cases hx : x₁ = x₂
+  · by_cases hy : y₁ = W.neg_Y x₂ y₂
+    · rw [slope_of_Y_eq hx hy, slope_of_Y_eq <| congr_arg _ hx, map_zero]
+      · rw [hy, base_change_neg_Y]
+    · rw [slope_of_Y_ne hx hy, slope_of_Y_ne <| congr_arg _ hx]
+      · run_tac
+          map_simp
+        simpa only [base_change_neg_Y]
+      · rw [base_change_neg_Y]
+        contrapose! hy
+        exact NoZeroSMulDivisors.algebraMap_injective F K hy
+  · rw [slope_of_X_ne hx, slope_of_X_ne]
+    ·
+      run_tac
+        map_simp
+    · contrapose! hx
+      exact NoZeroSMulDivisors.algebraMap_injective F K hx
+#align weierstrass_curve.base_change_slope WeierstrassCurve.baseChange_slope
+
+theorem baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : WeierstrassCurve R)
+    (F : Type v) [Field F] [Algebra R F] (K : Type w) [Field K] [Algebra R K] [Algebra F K]
+    [IsScalarTower R F K] (x₁ x₂ y₁ y₂ : F) :
+    (W.base_change K).slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
+        (algebraMap F K y₂) =
+      algebraMap F K ((W.base_change F).slope x₁ x₂ y₁ y₂) :=
+  by rw [← base_change_slope, base_change_base_change]
+#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.baseChange_slope_of_baseChange
+
 include h₁' h₂'
 
 theorem Y_eq_of_X_eq (hx : x₁ = x₂) : y₁ = y₂ ∨ y₁ = W.negY x₂ y₂ :=
@@ -424,7 +537,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.170323567.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.150691367.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((x - c x₁) * (x - c x₂) + (x - c x₁) * (x - c (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -439,7 +552,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -461,7 +574,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -494,6 +607,8 @@ omit h₁ h₂
 
 namespace Point
 
+variable {h₁ h₂}
+
 /-- The addition of two nonsingular rational points.
 
 Given two nonsingular rational points `P` and `Q`, use `P + Q` instead of `add P Q`. -/
@@ -524,7 +639,7 @@ theorem some_add_some_of_Y_eq (hx : x₁ = x₂) (hy : y₁ = W.negY x₂ y₂)
 
 @[simp]
 theorem some_add_self_of_Y_eq (hy : y₁ = W.negY x₁ y₁) : some h₁ + some h₁ = 0 :=
-  some_add_some_of_Y_eq h₁ h₁ rfl hy
+  some_add_some_of_Y_eq rfl hy
 #align weierstrass_curve.point.some_add_self_of_Y_eq WeierstrassCurve.Point.some_add_self_of_Y_eq
 
 @[simp]
@@ -535,18 +650,18 @@ theorem some_add_some_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂
 
 theorem some_add_some_of_Y_ne' (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
     some h₁ + some h₂ = -some (nonsingular_add' h₁ h₂ fun _ => hy) :=
-  some_add_some_of_Y_ne h₁ h₂ hx hy
+  some_add_some_of_Y_ne hx hy
 #align weierstrass_curve.point.some_add_some_of_Y_ne' WeierstrassCurve.Point.some_add_some_of_Y_ne'
 
 @[simp]
 theorem some_add_self_of_Y_ne (hy : y₁ ≠ W.negY x₁ y₁) :
     some h₁ + some h₁ = some (nonsingular_add h₁ h₁ fun _ => hy) :=
-  some_add_some_of_Y_ne h₁ h₁ rfl hy
+  some_add_some_of_Y_ne rfl hy
 #align weierstrass_curve.point.some_add_self_of_Y_ne WeierstrassCurve.Point.some_add_self_of_Y_ne
 
 theorem some_add_self_of_Y_ne' (hy : y₁ ≠ W.negY x₁ y₁) :
     some h₁ + some h₁ = -some (nonsingular_add' h₁ h₁ fun _ => hy) :=
-  some_add_some_of_Y_ne h₁ h₁ rfl hy
+  some_add_some_of_Y_ne rfl hy
 #align weierstrass_curve.point.some_add_self_of_Y_ne' WeierstrassCurve.Point.some_add_self_of_Y_ne'
 
 @[simp]
@@ -557,7 +672,7 @@ theorem some_add_some_of_X_ne (hx : x₁ ≠ x₂) :
 
 theorem some_add_some_of_X_ne' (hx : x₁ ≠ x₂) :
     some h₁ + some h₂ = -some (nonsingular_add' h₁ h₂ fun h => (hx h).elim) :=
-  some_add_some_of_X_ne h₁ h₂ hx
+  some_add_some_of_X_ne hx
 #align weierstrass_curve.point.some_add_some_of_X_ne' WeierstrassCurve.Point.some_add_some_of_X_ne'
 
 end Point
@@ -576,7 +691,7 @@ namespace Point
 @[simp]
 theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
   by
-  rcases P, Q with ⟨_ | @⟨x₁, y₁, h₁⟩, _ | @⟨x₂, y₂, h₂⟩⟩
+  rcases P, Q with ⟨_ | @⟨x₁, y₁, _⟩, _ | @⟨x₂, y₂, _⟩⟩
   any_goals rfl
   · rw [zero_def, zero_add, eq_neg_iff_eq_neg, neg_zero]
   · simp only [neg_some]
@@ -585,11 +700,11 @@ theorem add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q :=
       by_cases hx : x₁ = x₂
       · by_cases hy : y₁ = W.neg_Y x₂ y₂
         · exact ⟨hx, hy⟩
-        · rw [some_add_some_of_Y_ne h₁ h₂ hx hy] at h
+        · rw [some_add_some_of_Y_ne hx hy] at h
           contradiction
-      · rw [some_add_some_of_X_ne h₁ h₂ hx] at h
+      · rw [some_add_some_of_X_ne hx] at h
         contradiction
-    · exact fun ⟨hx, hy⟩ => some_add_some_of_Y_eq h₁ h₂ hx hy
+    · exact fun ⟨hx, hy⟩ => some_add_some_of_Y_eq hx hy
 #align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Point.add_eq_zero
 
 @[simp]
@@ -604,6 +719,76 @@ end Point
 
 end Group
 
+section BaseChange
+
+/-! ### Nonsingular rational points on a base changed Weierstrass curve -/
+
+
+variable {R : Type u} [CommRing R] (W : WeierstrassCurve R) (F : Type v) [Field F] [Algebra R F]
+  (K : Type w) [Field K] [Algebra R K] [Algebra F K] [IsScalarTower R F K]
+
+namespace Point
+
+open WeierstrassCurve
+
+/- warning: weierstrass_curve.point.of_base_change_fun -> WeierstrassCurve.Point.ofBaseChangeFun is a dubious translation:
+lean 3 declaration is
+  forall {R : Type.{u1}} [_inst_1 : CommRing.{u1} R] (W : WeierstrassCurve.{u1} R) (F : Type.{u2}) [_inst_2 : Field.{u2} F] [_inst_3 : Algebra.{u1, u2} R F (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2)))] (K : Type.{u3}) [_inst_4 : Field.{u3} K] [_inst_5 : Algebra.{u1, u3} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))] [_inst_6 : Algebra.{u2, u3} F K (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2)) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))] [_inst_7 : IsScalarTower.{u1, u2, u3} R F K (SMulZeroClass.toHasSmul.{u1, u2} R F (AddZeroClass.toHasZero.{u2} F (AddMonoid.toAddZeroClass.{u2} F (AddCommMonoid.toAddMonoid.{u2} F (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))))))))) (SMulWithZero.toSmulZeroClass.{u1, u2} R F (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)))))) (AddZeroClass.toHasZero.{u2} F (AddMonoid.toAddZeroClass.{u2} F (AddCommMonoid.toAddMonoid.{u2} F (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))))))))) (MulActionWithZero.toSMulWithZero.{u1, u2} R F (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (AddZeroClass.toHasZero.{u2} F (AddMonoid.toAddZeroClass.{u2} F (AddCommMonoid.toAddMonoid.{u2} F (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))))))))) (Module.toMulActionWithZero.{u1, u2} R F (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} F (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} F (Semiring.toNonAssocSemiring.{u2} F (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2)))))) (Algebra.toModule.{u1, u2} R F (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u2} F (DivisionRing.toRing.{u2} F (Field.toDivisionRing.{u2} F _inst_2))) _inst_3))))) (SMulZeroClass.toHasSmul.{u2, u3} F K (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (SMulWithZero.toSmulZeroClass.{u2, u3} F K (MulZeroClass.toHasZero.{u2} F (MulZeroOneClass.toMulZeroClass.{u2} F (MonoidWithZero.toMulZeroOneClass.{u2} F (Semiring.toMonoidWithZero.{u2} F (CommSemiring.toSemiring.{u2} F (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2))))))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (MulActionWithZero.toSMulWithZero.{u2, u3} F K (Semiring.toMonoidWithZero.{u2} F (CommSemiring.toSemiring.{u2} F (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2)))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (Module.toMulActionWithZero.{u2, u3} F K (CommSemiring.toSemiring.{u2} F (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))))) (Algebra.toModule.{u2, u3} F K (Semifield.toCommSemiring.{u2} F (Field.toSemifield.{u2} F _inst_2)) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))) _inst_6))))) (SMulZeroClass.toHasSmul.{u1, u3} R K (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (SMulWithZero.toSmulZeroClass.{u1, u3} R K (MulZeroClass.toHasZero.{u1} R (MulZeroOneClass.toMulZeroClass.{u1} R (MonoidWithZero.toMulZeroOneClass.{u1} R (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)))))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (MulActionWithZero.toSMulWithZero.{u1, u3} R K (Semiring.toMonoidWithZero.{u1} R (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1))) (AddZeroClass.toHasZero.{u3} K (AddMonoid.toAddZeroClass.{u3} K (AddCommMonoid.toAddMonoid.{u3} K (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))))))))) (Module.toMulActionWithZero.{u1, u3} R K (CommSemiring.toSemiring.{u1} R (CommRing.toCommSemiring.{u1} R _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} K (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} K (Semiring.toNonAssocSemiring.{u3} K (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4)))))) (Algebra.toModule.{u1, u3} R K (CommRing.toCommSemiring.{u1} R _inst_1) (Ring.toSemiring.{u3} K (DivisionRing.toRing.{u3} K (Field.toDivisionRing.{u3} K _inst_4))) _inst_5)))))], (WeierstrassCurve.Point.{u2} F (EuclideanDomain.toCommRing.{u2} F (Field.toEuclideanDomain.{u2} F _inst_2)) (WeierstrassCurve.baseChange.{u1, u2} R _inst_1 W F (EuclideanDomain.toCommRing.{u2} F (Field.toEuclideanDomain.{u2} F _inst_2)) _inst_3)) -> (WeierstrassCurve.Point.{u3} K (EuclideanDomain.toCommRing.{u3} K (Field.toEuclideanDomain.{u3} K _inst_4)) (WeierstrassCurve.baseChange.{u1, u3} R _inst_1 W K (EuclideanDomain.toCommRing.{u3} K (Field.toEuclideanDomain.{u3} K _inst_4)) _inst_5))
+but is expected to have type
+  PUnit.{max (max (succ (succ u1)) (succ (succ u2))) (succ (succ u3))}
+Case conversion may be inaccurate. Consider using '#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Point.ofBaseChangeFunₓ'. -/
+/-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
+def ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
+  | 0 => 0
+  | some h => some <| (nonsingular_iff_baseChange_of_baseChange W F K _ _).mp h
+#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Point.ofBaseChangeFun
+
+/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
+@[simps]
+def ofBaseChange : W⟮F⟯ →+ W⟮K⟯
+    where
+  toFun := ofBaseChangeFun W F K
+  map_zero' := rfl
+  map_add' := by
+    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
+    any_goals rfl
+    by_cases hx : x₁ = x₂
+    · by_cases hy : y₁ = (W.base_change F).negY x₂ y₂
+      · simp only [some_add_some_of_Y_eq hx hy, of_base_change_fun]
+        rw [some_add_some_of_Y_eq <| congr_arg _ hx]
+        · rw [hy, base_change_neg_Y_of_base_change]
+      · simp only [some_add_some_of_Y_ne hx hy, of_base_change_fun]
+        rw [some_add_some_of_Y_ne <| congr_arg _ hx]
+        · simp only [base_change_add_X_of_base_change, base_change_add_Y_of_base_change,
+            base_change_slope_of_base_change]
+          exact ⟨rfl, rfl⟩
+        · rw [base_change_neg_Y_of_base_change]
+          contrapose! hy
+          exact NoZeroSMulDivisors.algebraMap_injective F K hy
+    · simp only [some_add_some_of_X_ne hx, of_base_change_fun]
+      rw [some_add_some_of_X_ne]
+      · simp only [base_change_add_X_of_base_change, base_change_add_Y_of_base_change,
+          base_change_slope_of_base_change]
+        exact ⟨rfl, rfl⟩
+      · contrapose! hx
+        exact NoZeroSMulDivisors.algebraMap_injective F K hx
+#align weierstrass_curve.point.of_base_change WeierstrassCurve.Point.ofBaseChange
+
+theorem ofBaseChange_injective : Function.Injective <| ofBaseChange W F K :=
+  by
+  rintro (_ | _) (_ | _) h
+  · rfl
+  any_goals contradiction
+  simp only
+  exact
+    ⟨NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).left,
+      NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).right⟩
+#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Point.ofBaseChange_injective
+
+end Point
+
+end BaseChange
+
 end WeierstrassCurve
 
 namespace EllipticCurve
Diff
@@ -123,7 +123,7 @@ theorem negY_negY : W.negY x₁ (W.negY x₁ y₁) = y₁ :=
   ring1
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.negY_negY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
 @[simp]
 theorem eval_negPolynomial : (W.negPolynomial.eval <| c y₁).eval x₁ = W.negY x₁ y₁ :=
   by
@@ -150,8 +150,8 @@ noncomputable def addPolynomial : R[X] :=
   W.Polynomial.eval <| linePolynomial x₁ y₁ L
 #align weierstrass_curve.add_polynomial WeierstrassCurve.addPolynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.495127061.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1038319287.C_simp -/
 theorem addPolynomial_eq :
     W.addPolynomial x₁ y₁ L =
       -Cubic.toPoly
@@ -194,7 +194,7 @@ def addY : R :=
   W.negY (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L)
 #align weierstrass_curve.add_Y WeierstrassCurve.addY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
 theorem equation_add_iff :
     W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L) ↔
       (W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) = 0 :=
@@ -204,10 +204,10 @@ theorem equation_add_iff :
     eval_simp
 #align weierstrass_curve.equation_add_iff WeierstrassCurve.equation_add_iff
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2092870093.derivative_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.170323567.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
 theorem nonsingular_add_of_eval_derivative_ne_zero
     (hx' : W.Equation (W.addX x₁ x₂ L) (W.addY' x₁ x₂ y₁ L))
     (hx : (derivative <| W.addPolynomial x₁ y₁ L).eval (W.addX x₁ x₂ L) ≠ 0) :
@@ -424,7 +424,7 @@ theorem addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
       linear_combination (norm := (field_simp [hx] ; ring1)) x₂ * h₁' - x₁ * h₂'
 #align weierstrass_curve.add_polynomial_slope WeierstrassCurve.addPolynomial_slope
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2092870093.derivative_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.170323567.derivative_simp -/
 theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     derivative (W.addPolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) =
       -((x - c x₁) * (x - c x₂) + (x - c x₁) * (x - c (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)) +
@@ -439,7 +439,7 @@ theorem derivative_addPolynomial_slope (hxy : x₁ = x₂ → y₁ ≠ W.negY x
 /-! ### The addition law on nonsingular rational points on a Weierstrass curve -/
 
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
 /-- The addition of two affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, lies in `W`. -/
 theorem equation_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
@@ -461,7 +461,7 @@ omit h₁' h₂'
 
 include h₁ h₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2375523933.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.2556673791.eval_simp -/
 /-- The addition of two nonsingular affine points in `W` on a sloped line,
 before applying the final negation that maps $Y$ to $-Y - a_1X - a_3$, is nonsingular. -/
 theorem nonsingular_add' (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :

Changes in mathlib4

mathlib3
mathlib4
feat: FastSubsingleton and FastIsEmpty to speed up congr!/convert (#12495)

This is a PR that's a temporary measure to improve performance of congr!/convert, and the implementation may change in a future PR with a new version of congr!.

Introduces two typeclasses that are meant to quickly evaluate in common cases of Subsingleton and IsEmpty. Makes congr! use these typeclasses rather than Subsingleton.

Local Subsingleton/IsEmpty instances are included as Fast instances. To get congr!/convert to reason about subsingleton types, you can add such instances to the local context. Or, you can apply Subsingleton.elim yourself.

Zulip discussion

Diff
@@ -972,6 +972,7 @@ variable {F K}
 
 lemma map_baseChange [Algebra F K] [IsScalarTower R F K] [Algebra F L] [IsScalarTower R F L]
     (χ : K →ₐ[F] L) (P : W⟮F⟯) : map W χ (baseChange W F K P) = baseChange W F L P := by
+  have : Subsingleton (F →ₐ[F] L) := inferInstance
   convert map_map W (Algebra.ofId F K) χ P
 
 end Point
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -613,7 +613,7 @@ lemma nonsingular_add' {x₁ x₂ y₁ y₂ : F} (h₁ : W.nonsingular x₁ y₁
       · subst hx
         contradiction
       · rwa [addY', ← neg_sub, mul_neg, hx₂, slope_of_Xne hx,
-          div_mul_cancel _ <| sub_ne_zero_of_ne hx, neg_sub, sub_add_cancel]
+          div_mul_cancel₀ _ <| sub_ne_zero_of_ne hx, neg_sub, sub_add_cancel]
     · apply nonsingular_add_of_eval_derivative_ne_zero <| equation_add' h₁.1 h₂.1 hxy
       rw [derivative_addPolynomial_slope h₁.left h₂.left hxy]
       eval_simp
chore: scope open Classical (#11199)

We remove all but one open Classicals, instead preferring to use open scoped Classical. The only real side-effect this led to is moving a couple declarations to use Exists.choose instead of Classical.choose.

The first few commits are explicitly labelled regex replaces for ease of review.

Diff
@@ -480,7 +480,7 @@ section Field
 
 /-! ### Group operation polynomials over a field -/
 
-open Classical
+open scoped Classical
 
 /-- The slope of the line through two affine points $(x_1, y_1)$ and $(x_2, y_2)$ in `W`.
 If $x_1 \ne x_2$, then this line is the secant of `W` through $(x_1, y_1)$ and $(x_2, y_2)$,
@@ -691,7 +691,7 @@ lemma neg_some {x y : R} (h : W.nonsingular x y) : -some h = some (nonsingular_n
 instance : InvolutiveNeg W.Point :=
   ⟨by rintro (_ | _) <;> simp [zero_def]; ring1⟩
 
-open Classical
+open scoped Classical
 
 variable {F : Type u} [Field F] {W : Affine F}
 
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -169,7 +169,7 @@ lemma irreducible_polynomial [IsDomain R] : Irreducible W.polynomial := by
   rw [Cubic.degree_of_a_ne_zero' <| neg_ne_zero.mpr <| one_ne_zero' R, degree_mul] at h0
   apply (h1.symm.le.trans Cubic.degree_of_b_eq_zero').not_lt
   rcases Nat.WithBot.add_eq_three_iff.mp h0.symm with h | h | h | h
-  -- porting note: replaced two `any_goals` proofs with two `iterate 2` proofs
+  -- Porting note: replaced two `any_goals` proofs with two `iterate 2` proofs
   iterate 2 rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
   iterate 2 rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.Affine.irreducible_polynomial
chore: classify avoid simpNF linter error porting notes (#10760)

Classifies by adding issue number (#10759) to porting notes claiming:

removed @[simp] to avoid a simpNF linter error.

Diff
@@ -174,7 +174,7 @@ lemma irreducible_polynomial [IsDomain R] : Irreducible W.polynomial := by
   iterate 2 rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.Affine.irreducible_polynomial
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma eval_polynomial (x y : R) : (W.polynomial.eval <| C y).eval x =
     y ^ 2 + W.a₁ * x * y + W.a₃ * y - (x ^ 3 + W.a₂ * x ^ 2 + W.a₄ * x + W.a₆) := by
   simp only [polynomial]
@@ -198,7 +198,7 @@ lemma equation_iff' (x y : R) : W.equation x y ↔
   rw [equation, eval_polynomial]
 #align weierstrass_curve.equation_iff' WeierstrassCurve.Affine.equation_iff'
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma equation_iff (x y : R) :
     W.equation x y ↔ y ^ 2 + W.a₁ * x * y + W.a₃ * y = x ^ 3 + W.a₂ * x ^ 2 + W.a₄ * x + W.a₆ := by
   rw [equation_iff', sub_eq_zero]
@@ -231,7 +231,7 @@ noncomputable def polynomialX : R[X][Y] :=
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.polynomial_X WeierstrassCurve.Affine.polynomialX
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) := by
   simp only [polynomialX]
@@ -254,7 +254,7 @@ noncomputable def polynomialY : R[X][Y] :=
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.Affine.polynomialY
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma eval_polynomialY (x y : R) :
     (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ := by
   simp only [polynomialY]
@@ -281,7 +281,7 @@ lemma nonsingular_iff' (x y : R) : W.nonsingular x y ↔ W.equation x y ∧
   rw [nonsingular, equation_iff', eval_polynomialX, eval_polynomialY]
 #align weierstrass_curve.nonsingular_iff' WeierstrassCurve.Affine.nonsingular_iff'
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma nonsingular_iff (x y : R) : W.nonsingular x y ↔
     W.equation x y ∧ (W.a₁ * y ≠ 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄ ∨ y ≠ -y - W.a₁ * x - W.a₃) := by
   rw [nonsingular_iff', sub_ne_zero, ← sub_ne_zero (a := y)]
@@ -344,7 +344,7 @@ lemma negY_negY (x y : R) : W.negY x (W.negY x y) = y := by
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.Affine.negY_negY
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma eval_negPolynomial (x y : R) : (W.negPolynomial.eval <| C y).eval x = W.negY x y := by
   rw [negY, sub_sub, negPolynomial]
   eval_simp
@@ -656,7 +656,7 @@ instance : Inhabited W.Point :=
 instance : Zero W.Point :=
   ⟨zero⟩
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma zero_def : (zero : W.Point) = 0 :=
   rfl
 #align weierstrass_curve.point.zero_def WeierstrassCurve.Affine.Point.zero_def
@@ -673,7 +673,7 @@ def neg : W.Point → W.Point
 instance : Neg W.Point :=
   ⟨neg⟩
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma neg_def (P : W.Point) : P.neg = -P :=
   rfl
 #align weierstrass_curve.point.neg_def WeierstrassCurve.Affine.Point.neg_def
@@ -711,7 +711,7 @@ noncomputable def add : W.Point → W.Point → W.Point
 noncomputable instance instAddPoint : Add W.Point :=
   ⟨add⟩
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 lemma add_def (P Q : W.Point) : P.add Q = P + Q :=
   rfl
 #align weierstrass_curve.point.add_def WeierstrassCurve.Affine.Point.add_def
refactor(AlgebraicGeometry/EllipticCurve/*): rename baseChange to map (#9744)

This is in accordance with other similar definitions e.g. Polynomial.map. It turns out that rewrite lemmas of the form (W.map (φ.comp ψ)).negY/addX/addY = ψ ((W.map φ).negY/addX/addY) are rather annoying to use, so they are replaced with the original baseChange functionality that says (W.baseChange B).negY/addX/addY = ψ ((W.baseChange A).negY/addX/addY). This addresses the issue in #9596 pointed out by @riccardobrasca, but for the Weierstrass curve W rather than its points.

Diff
@@ -99,13 +99,13 @@ local macro "derivative_simp" : tactic =>
 local macro "eval_simp" : tactic =>
   `(tactic| simp only [eval_C, eval_X, eval_neg, eval_add, eval_sub, eval_mul, eval_pow])
 
-universe t u v w
+universe r s u v w
 
 /-! ## Weierstrass curves -/
 
 /-- An abbreviation for a Weierstrass curve in affine coordinates. -/
-abbrev WeierstrassCurve.Affine :=
-  WeierstrassCurve
+abbrev WeierstrassCurve.Affine (R : Type u) : Type u :=
+  WeierstrassCurve R
 
 /-- The coercion to a Weierstrass curve in affine coordinates. -/
 @[pp_dot]
@@ -644,7 +644,7 @@ inductive Point
 #align weierstrass_curve.point WeierstrassCurve.Affine.Point
 
 /-- For an algebraic extension `S` of `R`, the type of nonsingular `S`-rational points on `W`. -/
-scoped[WeierstrassCurve] notation W "⟮" S "⟯" => Affine.Point <| baseChange W <| algebraMap _ S
+scoped[WeierstrassCurve] notation3 W "⟮" S "⟯" => Affine.Point <| baseChange W S
 
 namespace Point
 
@@ -780,170 +780,199 @@ end Group
 
 section BaseChange
 
-/-! ### Base changes -/
+/-! ### Maps and base changes -/
 
-variable {A : Type v} [CommRing A] (φ : R →+* A) {B : Type w} [CommRing B] (ψ : A →+* B)
+variable {A : Type v} [CommRing A] (φ : R →+* A)
 
-lemma equation_iff_baseChange {φ : R →+* A} (hφ : Function.Injective φ) (x y : R) :
-    W.equation x y ↔ (W.baseChange φ).toAffine.equation (φ x) (φ y) := by
+lemma map_equation {φ : R →+* A} (hφ : Function.Injective φ) (x y : R) :
+    (W.map φ).toAffine.equation (φ x) (φ y) ↔ W.equation x y := by
   simpa only [equation_iff] using
-    ⟨fun h => by convert congr_arg φ h <;> map_simp <;> rfl, fun h => hφ <| by map_simp; exact h⟩
-#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.Affine.equation_iff_baseChange
-
-lemma equation_iff_baseChange_of_baseChange {ψ : A →+* B} (hψ : Function.Injective ψ) (x y : A) :
-    (W.baseChange φ).toAffine.equation x y ↔
-      (W.baseChange <| ψ.comp φ).toAffine.equation (ψ x) (ψ y) := by
-  rw [(W.baseChange φ).toAffine.equation_iff_baseChange hψ, baseChange_baseChange]
-#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange
-
-lemma nonsingular_iff_baseChange {φ : R →+* A} (hφ : Function.Injective φ) (x y : R) :
-    W.nonsingular x y ↔ (W.baseChange φ).toAffine.nonsingular (φ x) (φ y) := by
-  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange hφ x y]
+    ⟨fun h => hφ <| by map_simp; exact h, fun h => by convert congr_arg φ h <;> map_simp <;> rfl⟩
+#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.Affine.map_equation
+
+lemma map_nonsingular {φ : R →+* A} (hφ : Function.Injective φ) (x y : R) :
+    (W.map φ).toAffine.nonsingular (φ x) (φ y) ↔ W.nonsingular x y := by
+  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.map_equation hφ x y]
   refine ⟨Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_),
     Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_)⟩
   any_goals apply hφ; map_simp; exact h
   any_goals convert congr_arg φ h <;> map_simp <;> rfl
-#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange
-
-lemma nonsingular_iff_baseChange_of_baseChange {ψ : A →+* B} (hψ : Function.Injective ψ) (x y : A) :
-    (W.baseChange φ).toAffine.nonsingular x y ↔
-      (W.baseChange <| ψ.comp φ).toAffine.nonsingular (ψ x) (ψ y) := by
-  rw [(W.baseChange φ).toAffine.nonsingular_iff_baseChange hψ, baseChange_baseChange]
-#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange
+#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.Affine.map_nonsingular
 
-lemma baseChange_negY (x y : R) : (W.baseChange φ).toAffine.negY (φ x) (φ y) = φ (W.negY x y) := by
+lemma map_negY (x y : R) : (W.map φ).toAffine.negY (φ x) (φ y) = φ (W.negY x y) := by
   simp only [negY]
   map_simp
   rfl
 set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.Affine.baseChange_negY
-
-lemma baseChange_negY_of_baseChange (x y : A) :
-    (W.baseChange <| ψ.comp φ).toAffine.negY (ψ x) (ψ y) =
-      ψ ((W.baseChange φ).toAffine.negY x y) := by
-  rw [← baseChange_negY, baseChange_baseChange]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.Affine.baseChange_negY_of_baseChange
+#align weierstrass_curve.base_change_neg_Y WeierstrassCurve.Affine.map_negY
 
-lemma baseChange_addX (x₁ x₂ L : R) :
-    (W.baseChange φ).toAffine.addX (φ x₁) (φ x₂) (φ L) = φ (W.addX x₁ x₂ L) := by
+lemma map_addX (x₁ x₂ L : R) :
+    (W.map φ).toAffine.addX (φ x₁) (φ x₂) (φ L) = φ (W.addX x₁ x₂ L) := by
   simp only [addX]
   map_simp
   rfl
 set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_add_X WeierstrassCurve.Affine.baseChange_addX
-
-lemma baseChange_addX_of_baseChange (x₁ x₂ L : A) :
-    (W.baseChange <| ψ.comp φ).toAffine.addX (ψ x₁) (ψ x₂) (ψ L) =
-      ψ ((W.baseChange φ).toAffine.addX x₁ x₂ L) := by
-  rw [← baseChange_addX, baseChange_baseChange]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.Affine.baseChange_addX_of_baseChange
+#align weierstrass_curve.base_change_add_X WeierstrassCurve.Affine.map_addX
 
-lemma baseChange_addY' (x₁ x₂ y₁ L : R) :
-    (W.baseChange φ).toAffine.addY' (φ x₁) (φ x₂) (φ y₁) (φ L) = φ (W.addY' x₁ x₂ y₁ L) := by
-  simp only [addY', baseChange_addX]
+lemma map_addY' (x₁ x₂ y₁ L : R) :
+    (W.map φ).toAffine.addY' (φ x₁) (φ x₂) (φ y₁) (φ L) = φ (W.addY' x₁ x₂ y₁ L) := by
+  simp only [addY', map_addX]
   map_simp
 set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.Affine.baseChange_addY'
+#align weierstrass_curve.base_change_add_Y' WeierstrassCurve.Affine.map_addY'
 
-lemma baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
-    (W.baseChange <| ψ.comp φ).toAffine.addY' (ψ x₁) (ψ x₂) (ψ y₁) (ψ L) =
-      ψ ((W.baseChange φ).toAffine.addY' x₁ x₂ y₁ L) := by
-  rw [← baseChange_addY', baseChange_baseChange]
+lemma map_addY (x₁ x₂ y₁ L : R) :
+    (W.map φ).toAffine.addY (φ x₁) (φ x₂) (φ y₁) (φ L) = φ (W.toAffine.addY x₁ x₂ y₁ L) := by
+  simp only [addY, map_addY', map_addX, map_negY]
 set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.Affine.baseChange_addY'_of_baseChange
+#align weierstrass_curve.base_change_add_Y WeierstrassCurve.Affine.map_addY
 
-lemma baseChange_addY (x₁ x₂ y₁ L : R) :
-    (W.baseChange φ).toAffine.addY (φ x₁) (φ x₂) (φ y₁) (φ L) = φ (W.toAffine.addY x₁ x₂ y₁ L) := by
-  simp only [addY, baseChange_addY', baseChange_addX, baseChange_negY]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_add_Y WeierstrassCurve.Affine.baseChange_addY
-
-lemma baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
-    (W.baseChange <| ψ.comp φ).toAffine.addY (ψ x₁) (ψ x₂) (ψ y₁) (ψ L) =
-      ψ ((W.baseChange φ).toAffine.addY x₁ x₂ y₁ L) := by
-  rw [← baseChange_addY, baseChange_baseChange]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.Affine.baseChange_addY_of_baseChange
-
-lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) {K : Type v} [Field K] (φ : F →+* K)
-    (x₁ x₂ y₁ y₂ : F) : (W.baseChange φ).toAffine.slope (φ x₁) (φ x₂) (φ y₁) (φ y₂) =
+lemma map_slope {F : Type u} [Field F] (W : Affine F) {K : Type v} [Field K] (φ : F →+* K)
+    (x₁ x₂ y₁ y₂ : F) : (W.map φ).toAffine.slope (φ x₁) (φ x₂) (φ y₁) (φ y₂) =
       φ (W.slope x₁ x₂ y₁ y₂) := by
   by_cases hx : x₁ = x₂
   · by_cases hy : y₁ = W.negY x₂ y₂
     · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
-      · rw [hy, baseChange_negY]
+      · rw [hy, map_negY]
     · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
       · map_simp
-        simp only [baseChange_negY]
+        simp only [map_negY]
         rfl
-      · rw [baseChange_negY]
+      · rw [map_negY]
         contrapose! hy
         exact φ.injective hy
   · rw [slope_of_Xne hx, slope_of_Xne]
     · map_simp
     · contrapose! hx
       exact φ.injective hx
-#align weierstrass_curve.base_change_slope WeierstrassCurve.Affine.baseChange_slope
+#align weierstrass_curve.base_change_slope WeierstrassCurve.Affine.map_slope
 
-lemma baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : Affine R) {F : Type v} [Field F]
-    {K : Type w} [Field K] (φ : R →+* F) (ψ : F →+* K) (x₁ x₂ y₁ y₂ : F) :
-    (W.baseChange <| ψ.comp φ).toAffine.slope (ψ x₁) (ψ x₂) (ψ y₁) (ψ y₂) =
-      ψ ((W.baseChange φ).toAffine.slope x₁ x₂ y₁ y₂) := by
-  rw [← baseChange_slope, baseChange_baseChange]
-#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.Affine.baseChange_slope_of_baseChange
+variable {R : Type r} [CommRing R] (W : Affine R) {S : Type s} [CommRing S] [Algebra R S]
+  {A : Type u} [CommRing A] [Algebra R A] [Algebra S A] [IsScalarTower R S A]
+  {B : Type v} [CommRing B] [Algebra R B] [Algebra S B] [IsScalarTower R S B] (ψ : A →ₐ[S] B)
 
-namespace Point
+lemma baseChange_equation {ψ : A →ₐ[S] B} (hψ : Function.Injective ψ) (x y : A) :
+    (W.baseChange B).toAffine.equation (ψ x) (ψ y) ↔ (W.baseChange A).toAffine.equation x y := by
+  erw [← map_equation _ hψ, map_baseChange]
+  rfl
+#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.Affine.baseChange_equation
+
+lemma baseChange_nonsingular {ψ : A →ₐ[S] B} (hψ : Function.Injective ψ) (x y : A) :
+    (W.baseChange B).toAffine.nonsingular (ψ x) (ψ y) ↔
+      (W.baseChange A).toAffine.nonsingular x y := by
+  erw [← map_nonsingular _ hψ, map_baseChange]
+  rfl
+#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.Affine.baseChange_nonsingular
+
+lemma baseChange_negY (x y : A) :
+    (W.baseChange B).toAffine.negY (ψ x) (ψ y) = ψ ((W.baseChange A).toAffine.negY x y) := by
+  erw [← map_negY, map_baseChange]
+  rfl
+set_option linter.uppercaseLean3 false in
+#align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.Affine.baseChange_negY
 
-variable [Algebra R A] {K : Type w} [Field K] [Algebra R K] [Algebra A K] [IsScalarTower R A K]
-  {L : Type t} [Field L] [Algebra R L] [Algebra A L] [IsScalarTower R A L] (φ : K →ₐ[A] L)
+lemma baseChange_addX (x₁ x₂ L : A) :
+    (W.baseChange B).toAffine.addX (ψ x₁) (ψ x₂) (ψ L) =
+      ψ ((W.baseChange A).toAffine.addX x₁ x₂ L) := by
+  erw [← map_addX, map_baseChange]
+  rfl
+set_option linter.uppercaseLean3 false in
+#align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.Affine.baseChange_addX
 
-/-- The function from `W⟮K⟯` to `W⟮L⟯` induced by an algebra homomorphism `φ : K →ₐ[A] L`,
-where `W` is defined over a subring of a ring `A`, and `K` and `L` are field extensions of `A`. -/
-def ofBaseChangeFun : W⟮K⟯ → W⟮L⟯
+lemma baseChange_addY' (x₁ x₂ y₁ L : A) :
+    (W.baseChange B).toAffine.addY' (ψ x₁) (ψ x₂) (ψ y₁) (ψ L) =
+      ψ ((W.baseChange A).toAffine.addY' x₁ x₂ y₁ L) := by
+  erw [← map_addY', map_baseChange]
+  rfl
+set_option linter.uppercaseLean3 false in
+#align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.Affine.baseChange_addY'
+
+lemma baseChange_addY (x₁ x₂ y₁ L : A) :
+    (W.baseChange B).toAffine.addY (ψ x₁) (ψ x₂) (ψ y₁) (ψ L) =
+      ψ ((W.baseChange A).toAffine.addY x₁ x₂ y₁ L) := by
+  erw [← map_addY, map_baseChange]
+  rfl
+set_option linter.uppercaseLean3 false in
+#align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.Affine.baseChange_addY
+
+variable {F : Type u} [Field F] [Algebra R F] [Algebra S F] [IsScalarTower R S F]
+  {K : Type v} [Field K] [Algebra R K] [Algebra S K] [IsScalarTower R S K] (ψ : F →ₐ[S] K)
+  {L : Type w} [Field L] [Algebra R L] [Algebra S L] [IsScalarTower R S L] (χ : K →ₐ[S] L)
+
+lemma baseChange_slope (x₁ x₂ y₁ y₂ : F) :
+    (W.baseChange K).toAffine.slope (ψ x₁) (ψ x₂) (ψ y₁) (ψ y₂) =
+      ψ ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂) := by
+  erw [← map_slope, map_baseChange]
+  rfl
+#align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.Affine.baseChange_slope
+
+namespace Point
+
+/-- The function from `W⟮F⟯` to `W⟮K⟯` induced by an algebra homomorphism `ψ : F →ₐ[S] K`,
+where `W` is defined over a subring of a ring `S`, and `F` and `K` are field extensions of `S`. -/
+def mapFun : W⟮F⟯ → W⟮K⟯
   | 0 => 0
-  | Point.some h => Point.some <| by
-    convert (W.nonsingular_iff_baseChange_of_baseChange (algebraMap R K) φ.injective _ _).mp h
-    exact (φ.restrictScalars R).comp_algebraMap.symm
-#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Affine.Point.ofBaseChangeFun
-
-/-- The group homomorphism from `W⟮K⟯` to `W⟮L⟯` induced by an algebra homomorphism `φ : K →ₐ[A] L`,
-where `W` is defined over a subring of a ring `A`, and `K` and `L` are field extensions of `A`. -/
-@[simps]
-def ofBaseChange : W⟮K⟯ →+ W⟮L⟯ where
-  toFun := ofBaseChangeFun W φ
+  | some h => some <| (W.baseChange_nonsingular ψ.injective ..).mpr h
+#align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Affine.Point.mapFun
+
+/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by an algebra homomorphism `ψ : F →ₐ[S] K`,
+where `W` is defined over a subring of a ring `S`, and `F` and `K` are field extensions of `S`. -/
+def map : W⟮F⟯ →+ W⟮K⟯ where
+  toFun := mapFun W ψ
   map_zero' := rfl
   map_add' := by
     rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
     any_goals rfl
     by_cases hx : x₁ = x₂
-    · by_cases hy : y₁ = (W.baseChange <| algebraMap R K).toAffine.negY x₂ y₂
-      · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
+    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
+      · simp only [some_add_some_of_Yeq hx hy, mapFun]
         rw [some_add_some_of_Yeq <| congr_arg _ hx]
-        · erw [hy, ← φ.comp_algebraMap_of_tower R, baseChange_negY_of_baseChange]
-          rfl
-      · simp only [some_add_some_of_Yne hx hy, ofBaseChangeFun]
+        · rw [hy, baseChange_negY]
+      · simp only [some_add_some_of_Yne hx hy, mapFun]
         rw [some_add_some_of_Yne <| congr_arg _ hx]
-        · simp only [← φ.comp_algebraMap_of_tower R, ← baseChange_addX_of_baseChange,
-            ← baseChange_addY_of_baseChange, ← baseChange_slope_of_baseChange]
-        · erw [← φ.comp_algebraMap_of_tower R, baseChange_negY_of_baseChange]
+        · simp only [some.injEq, ← baseChange_addX, ← baseChange_addY, ← baseChange_slope]
+        · rw [baseChange_negY]
           contrapose! hy
-          exact φ.injective hy
-    · simp only [some_add_some_of_Xne hx, ofBaseChangeFun]
+          exact ψ.injective hy
+    · simp only [some_add_some_of_Xne hx, mapFun]
       rw [some_add_some_of_Xne]
-      · simp only [← φ.comp_algebraMap_of_tower R, ← baseChange_addX_of_baseChange,
-          ← baseChange_addY_of_baseChange, ← baseChange_slope_of_baseChange]
+      · simp only [some.injEq, ← baseChange_addX, ← baseChange_addY, ← baseChange_slope]
       · contrapose! hx
-        exact φ.injective hx
-#align weierstrass_curve.point.of_base_change WeierstrassCurve.Affine.Point.ofBaseChange
+        exact ψ.injective hx
+#align weierstrass_curve.point.of_base_change WeierstrassCurve.Affine.Point.map
 
-lemma ofBaseChange_injective : Function.Injective <| ofBaseChange W φ := by
+lemma map_zero : map W ψ (0 : W⟮F⟯) = 0 :=
+  rfl
+
+lemma map_some {x y : F} (h : (W.baseChange F).toAffine.nonsingular x y) :
+    map W ψ (some h) = some ((W.baseChange_nonsingular ψ.injective ..).mpr h) :=
+  rfl
+
+lemma map_id (P : W⟮F⟯) : map W (Algebra.ofId F F) P = P := by
+  cases P <;> rfl
+
+lemma map_map (P : W⟮F⟯) : map W χ (map W ψ P) = map W (χ.comp ψ) P := by
+  cases P <;> rfl
+
+lemma map_injective : Function.Injective <| map W ψ := by
   rintro (_ | _) (_ | _) h
   any_goals contradiction
   · rfl
-  · simpa only [some.injEq] using ⟨φ.injective (some.inj h).left, φ.injective (some.inj h).right⟩
-#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Affine.Point.ofBaseChange_injective
+  · simpa only [some.injEq] using ⟨ψ.injective (some.inj h).left, ψ.injective (some.inj h).right⟩
+#align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Affine.Point.map_injective
+
+variable (F K)
+
+/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by the base change from `F` to `K`,
+where `W` is defined over a subring of a ring `S`, and `F` and `K` are field extensions of `S`. -/
+abbrev baseChange [Algebra F K] [IsScalarTower R F K] : W⟮F⟯ →+ W⟮K⟯ :=
+  map W <| Algebra.ofId F K
+
+variable {F K}
+
+lemma map_baseChange [Algebra F K] [IsScalarTower R F K] [Algebra F L] [IsScalarTower R F L]
+    (χ : K →ₐ[F] L) (P : W⟮F⟯) : map W χ (baseChange W F K P) = baseChange W F L P := by
+  convert map_map W (Algebra.ofId F K) χ P
 
 end Point
 
feat: The support of f ^ n (#9617)

This involves moving lemmas from Algebra.GroupPower.Ring to Algebra.GroupWithZero.Basic and changing some 0 < n assumptions to n ≠ 0.

From LeanAPAP

Diff
@@ -184,7 +184,7 @@ lemma eval_polynomial (x y : R) : (W.polynomial.eval <| C y).eval x =
 
 @[simp]
 lemma eval_polynomial_zero : (W.polynomial.eval 0).eval 0 = -W.a₆ := by
-  simp only [← C_0, eval_polynomial, zero_add, zero_sub, mul_zero, zero_pow <| Nat.zero_lt_succ _]
+  simp only [← C_0, eval_polynomial, zero_add, zero_sub, mul_zero, zero_pow <| Nat.succ_ne_zero _]
 #align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.Affine.eval_polynomial_zero
 
 /-- The proposition that an affine point $(x, y)$ lies in `W`. In other words, $W(x, y) = 0$. -/
@@ -241,7 +241,7 @@ set_option linter.uppercaseLean3 false in
 
 @[simp]
 lemma eval_polynomialX_zero : (W.polynomialX.eval 0).eval 0 = -W.a₄ := by
-  simp only [← C_0, eval_polynomialX, zero_add, zero_sub, mul_zero, zero_pow zero_lt_two]
+  simp only [← C_0, eval_polynomialX, zero_add, zero_sub, mul_zero, zero_pow two_ne_zero]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.Affine.eval_polynomialX_zero
 
refactor(AlgebraicGeometry/EllipticCurve/*): refactor base change for ring homomorphisms (#9596)

Refactor Weierstrass curves and nonsingular rational points to allow for base changes over an arbitrary ring homomorphism φ : K →+* L. This generalises the natural map algebraMap K L and removes the necessity for Algebra K L, but also gives an easy way to define DistribMulAction for the action of L ≃ₐ[K] L on the nonsingular rational points over L, since L ≃ₐ[K] L restricts to L →ₐ[K] L that restricts to L →+* L. The old notation W⟮L⟯ is preserved for base change over algebraMap K L.

Also remove some unnecessary coercions in the Weierstrass file.

Diff
@@ -99,7 +99,7 @@ local macro "derivative_simp" : tactic =>
 local macro "eval_simp" : tactic =>
   `(tactic| simp only [eval_C, eval_X, eval_neg, eval_add, eval_sub, eval_mul, eval_pow])
 
-universe u v w
+universe t u v w
 
 /-! ## Weierstrass curves -/
 
@@ -637,13 +637,14 @@ section Group
 /-- A nonsingular rational point on a Weierstrass curve `W` in affine coordinates. This is either
 the unique point at infinity `WeierstrassCurve.Affine.Point.zero` or the nonsingular affine points
 `WeierstrassCurve.Affine.Point.some` $(x, y)$ satisfying the Weierstrass equation of `W`. -/
+@[pp_dot]
 inductive Point
   | zero
   | some {x y : R} (h : W.nonsingular x y)
 #align weierstrass_curve.point WeierstrassCurve.Affine.Point
 
 /-- For an algebraic extension `S` of `R`, the type of nonsingular `S`-rational points on `W`. -/
-scoped[WeierstrassCurve] notation W "⟮" S "⟯" => Affine.Point (baseChange W S)
+scoped[WeierstrassCurve] notation W "⟮" S "⟯" => Affine.Point <| baseChange W <| algebraMap _ S
 
 namespace Point
 
@@ -781,41 +782,36 @@ section BaseChange
 
 /-! ### Base changes -/
 
-variable (A : Type v) [CommRing A] [Algebra R A] (B : Type w) [CommRing B] [Algebra R B]
-  [Algebra A B] [IsScalarTower R A B]
+variable {A : Type v} [CommRing A] (φ : R →+* A) {B : Type w} [CommRing B] (ψ : A →+* B)
 
-lemma equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.equation x y ↔ (W.baseChange A).toAffine.equation (algebraMap R A x) (algebraMap R A y) := by
-  simpa only [equation_iff]
-    using ⟨fun h => by convert congr_arg (algebraMap R A) h <;> map_simp <;> rfl,
-      fun h => by apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; exact h⟩
+lemma equation_iff_baseChange {φ : R →+* A} (hφ : Function.Injective φ) (x y : R) :
+    W.equation x y ↔ (W.baseChange φ).toAffine.equation (φ x) (φ y) := by
+  simpa only [equation_iff] using
+    ⟨fun h => by convert congr_arg φ h <;> map_simp <;> rfl, fun h => hφ <| by map_simp; exact h⟩
 #align weierstrass_curve.equation_iff_base_change WeierstrassCurve.Affine.equation_iff_baseChange
 
-lemma equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
-    (W.baseChange A).toAffine.equation x y ↔
-      (W.baseChange B).toAffine.equation (algebraMap A B x) (algebraMap A B y) := by
-  rw [(W.baseChange A).toAffine.equation_iff_baseChange B, baseChange_baseChange]
+lemma equation_iff_baseChange_of_baseChange {ψ : A →+* B} (hψ : Function.Injective ψ) (x y : A) :
+    (W.baseChange φ).toAffine.equation x y ↔
+      (W.baseChange <| ψ.comp φ).toAffine.equation (ψ x) (ψ y) := by
+  rw [(W.baseChange φ).toAffine.equation_iff_baseChange hψ, baseChange_baseChange]
 #align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange
 
-lemma nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.nonsingular x y ↔
-      (W.baseChange A).toAffine.nonsingular (algebraMap R A x) (algebraMap R A y) := by
-  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange A x y]
+lemma nonsingular_iff_baseChange {φ : R →+* A} (hφ : Function.Injective φ) (x y : R) :
+    W.nonsingular x y ↔ (W.baseChange φ).toAffine.nonsingular (φ x) (φ y) := by
+  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange hφ x y]
   refine ⟨Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_),
     Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_)⟩
-  any_goals apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; exact h
-  any_goals convert congr_arg (algebraMap R A) h <;> map_simp <;> rfl
+  any_goals apply hφ; map_simp; exact h
+  any_goals convert congr_arg φ h <;> map_simp <;> rfl
 #align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange
 
-lemma nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
-    (W.baseChange A).toAffine.nonsingular x y ↔
-      (W.baseChange B).toAffine.nonsingular (algebraMap A B x) (algebraMap A B y) := by
-  rw [(W.baseChange A).toAffine.nonsingular_iff_baseChange B, baseChange_baseChange]
+lemma nonsingular_iff_baseChange_of_baseChange {ψ : A →+* B} (hψ : Function.Injective ψ) (x y : A) :
+    (W.baseChange φ).toAffine.nonsingular x y ↔
+      (W.baseChange <| ψ.comp φ).toAffine.nonsingular (ψ x) (ψ y) := by
+  rw [(W.baseChange φ).toAffine.nonsingular_iff_baseChange hψ, baseChange_baseChange]
 #align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange
 
-lemma baseChange_negY (x y : R) :
-    (W.baseChange A).toAffine.negY (algebraMap R A x) (algebraMap R A y) =
-      algebraMap R A (W.negY x y) := by
+lemma baseChange_negY (x y : R) : (W.baseChange φ).toAffine.negY (φ x) (φ y) = φ (W.negY x y) := by
   simp only [negY]
   map_simp
   rfl
@@ -823,15 +819,14 @@ set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_neg_Y WeierstrassCurve.Affine.baseChange_negY
 
 lemma baseChange_negY_of_baseChange (x y : A) :
-    (W.baseChange B).toAffine.negY (algebraMap A B x) (algebraMap A B y) =
-      algebraMap A B ((W.baseChange A).toAffine.negY x y) := by
+    (W.baseChange <| ψ.comp φ).toAffine.negY (ψ x) (ψ y) =
+      ψ ((W.baseChange φ).toAffine.negY x y) := by
   rw [← baseChange_negY, baseChange_baseChange]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_neg_Y_of_base_change WeierstrassCurve.Affine.baseChange_negY_of_baseChange
 
 lemma baseChange_addX (x₁ x₂ L : R) :
-    (W.baseChange A).toAffine.addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
-      algebraMap R A (W.addX x₁ x₂ L) := by
+    (W.baseChange φ).toAffine.addX (φ x₁) (φ x₂) (φ L) = φ (W.addX x₁ x₂ L) := by
   simp only [addX]
   map_simp
   rfl
@@ -839,45 +834,42 @@ set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_add_X WeierstrassCurve.Affine.baseChange_addX
 
 lemma baseChange_addX_of_baseChange (x₁ x₂ L : A) :
-    (W.baseChange B).toAffine.addX (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B L) =
-      algebraMap A B ((W.baseChange A).toAffine.addX x₁ x₂ L) := by
+    (W.baseChange <| ψ.comp φ).toAffine.addX (ψ x₁) (ψ x₂) (ψ L) =
+      ψ ((W.baseChange φ).toAffine.addX x₁ x₂ L) := by
   rw [← baseChange_addX, baseChange_baseChange]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_add_X_of_base_change WeierstrassCurve.Affine.baseChange_addX_of_baseChange
 
 lemma baseChange_addY' (x₁ x₂ y₁ L : R) :
-    (W.baseChange A).toAffine.addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
-      (algebraMap R A L) = algebraMap R A (W.addY' x₁ x₂ y₁ L) := by
+    (W.baseChange φ).toAffine.addY' (φ x₁) (φ x₂) (φ y₁) (φ L) = φ (W.addY' x₁ x₂ y₁ L) := by
   simp only [addY', baseChange_addX]
   map_simp
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_add_Y' WeierstrassCurve.Affine.baseChange_addY'
 
 lemma baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
-    (W.baseChange B).toAffine.addY' (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
-      (algebraMap A B L) = algebraMap A B ((W.baseChange A).toAffine.addY' x₁ x₂ y₁ L) := by
+    (W.baseChange <| ψ.comp φ).toAffine.addY' (ψ x₁) (ψ x₂) (ψ y₁) (ψ L) =
+      ψ ((W.baseChange φ).toAffine.addY' x₁ x₂ y₁ L) := by
   rw [← baseChange_addY', baseChange_baseChange]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_add_Y'_of_base_change WeierstrassCurve.Affine.baseChange_addY'_of_baseChange
 
 lemma baseChange_addY (x₁ x₂ y₁ L : R) :
-    (W.baseChange A).toAffine.addY (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
-      (algebraMap R A L) = algebraMap R A (W.toAffine.addY x₁ x₂ y₁ L) := by
+    (W.baseChange φ).toAffine.addY (φ x₁) (φ x₂) (φ y₁) (φ L) = φ (W.toAffine.addY x₁ x₂ y₁ L) := by
   simp only [addY, baseChange_addY', baseChange_addX, baseChange_negY]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_add_Y WeierstrassCurve.Affine.baseChange_addY
 
 lemma baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
-    (W.baseChange B).toAffine.addY (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
-      (algebraMap A B L) = algebraMap A B ((W.baseChange A).toAffine.addY x₁ x₂ y₁ L) := by
+    (W.baseChange <| ψ.comp φ).toAffine.addY (ψ x₁) (ψ x₂) (ψ y₁) (ψ L) =
+      ψ ((W.baseChange φ).toAffine.addY x₁ x₂ y₁ L) := by
   rw [← baseChange_addY, baseChange_baseChange]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.base_change_add_Y_of_base_change WeierstrassCurve.Affine.baseChange_addY_of_baseChange
 
-lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
-    (x₁ x₂ y₁ y₂ : F) :
-    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
-      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
+lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) {K : Type v} [Field K] (φ : F →+* K)
+    (x₁ x₂ y₁ y₂ : F) : (W.baseChange φ).toAffine.slope (φ x₁) (φ x₂) (φ y₁) (φ y₂) =
+      φ (W.slope x₁ x₂ y₁ y₂) := by
   by_cases hx : x₁ = x₂
   · by_cases hy : y₁ = W.negY x₂ y₂
     · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
@@ -888,68 +880,69 @@ lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field
         rfl
       · rw [baseChange_negY]
         contrapose! hy
-        exact NoZeroSMulDivisors.algebraMap_injective F K hy
+        exact φ.injective hy
   · rw [slope_of_Xne hx, slope_of_Xne]
     · map_simp
     · contrapose! hx
-      exact NoZeroSMulDivisors.algebraMap_injective F K hx
+      exact φ.injective hx
 #align weierstrass_curve.base_change_slope WeierstrassCurve.Affine.baseChange_slope
 
-lemma baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : Affine R) (F : Type v) [Field F]
-    [Algebra R F] (K : Type w) [Field K] [Algebra R K] [Algebra F K] [IsScalarTower R F K]
-    (x₁ x₂ y₁ y₂ : F) :
-    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
-      (algebraMap F K y₂) = algebraMap F K ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂) := by
+lemma baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : Affine R) {F : Type v} [Field F]
+    {K : Type w} [Field K] (φ : R →+* F) (ψ : F →+* K) (x₁ x₂ y₁ y₂ : F) :
+    (W.baseChange <| ψ.comp φ).toAffine.slope (ψ x₁) (ψ x₂) (ψ y₁) (ψ y₂) =
+      ψ ((W.baseChange φ).toAffine.slope x₁ x₂ y₁ y₂) := by
   rw [← baseChange_slope, baseChange_baseChange]
 #align weierstrass_curve.base_change_slope_of_base_change WeierstrassCurve.Affine.baseChange_slope_of_baseChange
 
 namespace Point
 
-open WeierstrassCurve
-
-variable {R : Type u} [CommRing R] (W : Affine R) (F : Type v) [Field F] [Algebra R F]
-  (K : Type w) [Field K] [Algebra R K] [Algebra F K] [IsScalarTower R F K]
+variable [Algebra R A] {K : Type w} [Field K] [Algebra R K] [Algebra A K] [IsScalarTower R A K]
+  {L : Type t} [Field L] [Algebra R L] [Algebra A L] [IsScalarTower R A L] (φ : K →ₐ[A] L)
 
-/-- The function from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
-def ofBaseChangeFun : W⟮F⟯ → W⟮K⟯
+/-- The function from `W⟮K⟯` to `W⟮L⟯` induced by an algebra homomorphism `φ : K →ₐ[A] L`,
+where `W` is defined over a subring of a ring `A`, and `K` and `L` are field extensions of `A`. -/
+def ofBaseChangeFun : W⟮K⟯ → W⟮L⟯
   | 0 => 0
-  | Point.some h => Point.some <| (nonsingular_iff_baseChange_of_baseChange W F K ..).mp h
+  | Point.some h => Point.some <| by
+    convert (W.nonsingular_iff_baseChange_of_baseChange (algebraMap R K) φ.injective _ _).mp h
+    exact (φ.restrictScalars R).comp_algebraMap.symm
 #align weierstrass_curve.point.of_base_change_fun WeierstrassCurve.Affine.Point.ofBaseChangeFun
 
-/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
+/-- The group homomorphism from `W⟮K⟯` to `W⟮L⟯` induced by an algebra homomorphism `φ : K →ₐ[A] L`,
+where `W` is defined over a subring of a ring `A`, and `K` and `L` are field extensions of `A`. -/
 @[simps]
-def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
-  toFun := ofBaseChangeFun W F K
+def ofBaseChange : W⟮K⟯ →+ W⟮L⟯ where
+  toFun := ofBaseChangeFun W φ
   map_zero' := rfl
   map_add' := by
     rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
     any_goals rfl
     by_cases hx : x₁ = x₂
-    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
+    · by_cases hy : y₁ = (W.baseChange <| algebraMap R K).toAffine.negY x₂ y₂
       · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
         rw [some_add_some_of_Yeq <| congr_arg _ hx]
-        · rw [hy, baseChange_negY_of_baseChange]
+        · erw [hy, ← φ.comp_algebraMap_of_tower R, baseChange_negY_of_baseChange]
+          rfl
       · simp only [some_add_some_of_Yne hx hy, ofBaseChangeFun]
         rw [some_add_some_of_Yne <| congr_arg _ hx]
-        · simp only [baseChange_addX_of_baseChange, baseChange_addY_of_baseChange,
-            baseChange_slope_of_baseChange]
-        · rw [baseChange_negY_of_baseChange]
+        · simp only [← φ.comp_algebraMap_of_tower R, ← baseChange_addX_of_baseChange,
+            ← baseChange_addY_of_baseChange, ← baseChange_slope_of_baseChange]
+        · erw [← φ.comp_algebraMap_of_tower R, baseChange_negY_of_baseChange]
           contrapose! hy
-          exact NoZeroSMulDivisors.algebraMap_injective F K hy
+          exact φ.injective hy
     · simp only [some_add_some_of_Xne hx, ofBaseChangeFun]
       rw [some_add_some_of_Xne]
-      · simp only [baseChange_addX_of_baseChange, baseChange_addY_of_baseChange,
-          baseChange_slope_of_baseChange]
+      · simp only [← φ.comp_algebraMap_of_tower R, ← baseChange_addX_of_baseChange,
+          ← baseChange_addY_of_baseChange, ← baseChange_slope_of_baseChange]
       · contrapose! hx
-        exact NoZeroSMulDivisors.algebraMap_injective F K hx
+        exact φ.injective hx
 #align weierstrass_curve.point.of_base_change WeierstrassCurve.Affine.Point.ofBaseChange
 
-lemma ofBaseChange_injective : Function.Injective <| ofBaseChange W F K := by
+lemma ofBaseChange_injective : Function.Injective <| ofBaseChange W φ := by
   rintro (_ | _) (_ | _) h
   any_goals contradiction
   · rfl
-  · simpa only [some.injEq] using ⟨NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).left,
-      NoZeroSMulDivisors.algebraMap_injective F K (some.inj h).right⟩
+  · simpa only [some.injEq] using ⟨φ.injective (some.inj h).left, φ.injective (some.inj h).right⟩
 #align weierstrass_curve.point.of_base_change_injective WeierstrassCurve.Affine.Point.ofBaseChange_injective
 
 end Point
refactor(AlgebraicGeometry/EllipticCurve/*): split EllipticCurve.Point into two files (#8540)

Refactor the files in AlgebraicGeometry/EllipticCurve/* as follows:

  • Weierstrass.lean contains general definitions common to all Weierstrass and elliptic curves, namely quantities associated to their coefficients, variable and base changes, and models with prescribed j-invariants.
  • Affine.lean contains definitions specific to Weierstrass curves written in affine coordinates, including equation and nonsingular from the old Weierstrass.lean, but also the Point inductive and group operations from the old Point.lean.
  • Group.lean contains a standalone proof of the group law for Point, including instances for CoordinateRing in the old Weierstrass.lean, and ideal computations in its ClassGroup in the old Point.lean.

This refactor is done in preparation for the new Projective.lean in #8485 (and the upcoming Jacobian.lean), which shares all the general definitions in Weierstrass.lean, but none of those in Affine.lean and Group.lean except their proofs (analogous lemmas are proven by "reducing to the affine case"). Most of the definitions and lemmas for equation, nonsingular, CoordinateRing, and ClassGroup are specific to the affine representation of Weierstrass curves, so they are now in the WeierstrassCurve.Affine namespace, which is just an abbreviation for WeierstrassCurve. Further documentation is added to Group.lean to explain the argument for the group law, but otherwise few things are changed from the original files.

chore: removing unneeded maxHeartbeats (#7761)

Due to recent changes in core we can reduce or remove many set_option maxHeartbeats statements.

I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.

This reduces us from 96 maxHeartbeats statements to 44. (There are 10 false positives in meta or testing code.)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -511,8 +511,6 @@ lemma Y_eq_of_Y_ne (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) : y₁ =
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.Y_eq_of_Y_ne WeierstrassCurve.Y_eq_of_Y_ne
 
--- porting note: increased `maxHeartbeats` for `ring1`
-set_option synthInstance.maxHeartbeats 30000 in
 lemma XYIdeal_eq₂ (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XYIdeal W x₂ (C y₂) = XYIdeal W x₂ (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) := by
   -- porting note: removed assumption `h₂` explicitly
@@ -717,8 +715,6 @@ variable {F : Type u} [Field F] {W : WeierstrassCurve F} {x₁ x₂ y₁ y₂ :
   (h₁ : W.nonsingular x₁ y₁) (h₂ : W.nonsingular x₂ y₂) (h₁' : W.equation x₁ y₁)
   (h₂' : W.equation x₂ y₂)
 
--- porting note: increased `maxHeartbeats` for `ring1`
-set_option maxHeartbeats 800000 in
 lemma XYIdeal_neg_mul : XYIdeal W x₁ (C <| W.negY x₁ y₁) * XYIdeal W x₁ (C y₁) = XIdeal W x₁ := by
   have Y_rw :
     (Y - C (C y₁)) * (Y - C (C (W.negY x₁ y₁))) -
@@ -760,9 +756,6 @@ private lemma XYIdeal'_mul_inv :
   rw [← mul_assoc, ← FractionalIdeal.coeIdeal_mul, mul_comm <| XYIdeal W _ _, XYIdeal_neg_mul h₁,
     XIdeal, FractionalIdeal.coe_ideal_span_singleton_mul_inv W.FunctionField <| XClass_ne_zero W x₁]
 
--- porting note: increased `maxHeartbeats` for `ring1`
-set_option synthInstance.maxHeartbeats 60000 in
-set_option maxHeartbeats 600000 in
 lemma XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
     XIdeal W (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂) * (XYIdeal W x₁ (C y₁) * XYIdeal W x₂ (C y₂)) =
       YIdeal W (linePolynomial x₁ y₁ <| W.slope x₁ x₂ y₁ y₂) *
chore(RingTheory): golf, generalize, fix docs (#7500)

Co-authored-by: Junyan Xu <junyanxu.math@gmail.com>

Diff
@@ -785,8 +785,8 @@ lemma XYIdeal_mul_XYIdeal (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) :
   apply congr_arg (_ ∘ _)
   convert top_mul (_ : Ideal W.CoordinateRing)
   simp_rw [XClass, ← @Set.image_singleton _ _ <| CoordinateRing.mk W, ← map_span, ← Ideal.map_sup,
-    eq_top_iff_one, mem_map_iff_of_surjective _ <| AdjoinRoot.mk_surjective W.monic_polynomial,
-    ← span_insert, mem_span_insert', mem_span_singleton']
+    eq_top_iff_one, mem_map_iff_of_surjective _ AdjoinRoot.mk_surjective, ← span_insert,
+    mem_span_insert', mem_span_singleton']
   by_cases hx : x₁ = x₂
   · rcases hx, Y_eq_of_Y_ne h₁' h₂' hx (hxy hx) with ⟨rfl, rfl⟩
     let y := (y₁ - W.negY x₁ y₁) ^ 2
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2022 David Kurniadi Angdinata. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: David Kurniadi Angdinata
-
-! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.point
-! leanprover-community/mathlib commit e2e7f2ac359e7514e4d40061d7c08bb69487ba4e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.AlgebraicGeometry.EllipticCurve.Weierstrass
 import Mathlib.LinearAlgebra.FreeModule.Norm
 import Mathlib.RingTheory.ClassGroup
 
+#align_import algebraic_geometry.elliptic_curve.point from "leanprover-community/mathlib"@"e2e7f2ac359e7514e4d40061d7c08bb69487ba4e"
+
 /-!
 # Nonsingular rational points on Weierstrass curves
 
feat: port AlgebraicGeometry.EllipticCurve.Point (#5541)

Co-authored-by: David Kurniadi Angdinata <dka31@cantab.ac.uk>

Co-authored-by: David Kurniadi Angdinata <dka31@cantab.ac.uk>

Dependencies 11 + 780

781 files ported (98.6%)
324652 lines ported (98.4%)
Show graph

The unported dependencies are