algebraic_geometry.elliptic_curve.weierstrassMathlib.AlgebraicGeometry.EllipticCurve.Weierstrass

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
@@ -670,7 +670,7 @@ theorem WeierstrassCurve.Affine.nonsingular_iff (x y : R) :
 theorem WeierstrassCurve.Affine.nonsingular_zero :
     W.nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0) := by
   rw [nonsingular, equation_zero, C_0, eval_polynomial_X_zero, neg_ne_zero, eval_polynomial_Y_zero,
-    or_comm']
+    or_comm]
 #align weierstrass_curve.nonsingular_zero WeierstrassCurve.Affine.nonsingular_zero
 -/
 
@@ -678,7 +678,7 @@ theorem WeierstrassCurve.Affine.nonsingular_zero :
 theorem WeierstrassCurve.Affine.nonsingular_iff_variableChange (x y : R) :
     W.nonsingular x y ↔ (W.variableChange 1 x 0 y).nonsingular 0 0 :=
   by
-  rw [nonsingular_iff', equation_iff_variable_change, equation_zero, ← neg_ne_zero, or_comm',
+  rw [nonsingular_iff', equation_iff_variable_change, equation_zero, ← neg_ne_zero, or_comm,
     nonsingular_zero, variable_change_a₃, variable_change_a₄, inv_one, Units.val_one]
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.Affine.nonsingular_iff_variableChange
Diff
@@ -480,9 +480,9 @@ theorem WeierstrassCurve.Affine.irreducible_polynomial [IsDomain R] : Irreducibl
   rcases(W.monic_polynomial.not_irreducible_iff_exists_add_mul_eq_coeff W.nat_degree_polynomial).mp
       h with
     ⟨f, g, h0, h1⟩
-  simp only [polynomial_eq, Cubic.coeff_eq_c, Cubic.coeff_eq_d] at h0 h1 
-  apply_fun degree at h0 h1 
-  rw [Cubic.degree_of_a_ne_zero' <| neg_ne_zero.mpr <| one_ne_zero' R, degree_mul] at h0 
+  simp only [polynomial_eq, Cubic.coeff_eq_c, Cubic.coeff_eq_d] at h0 h1
+  apply_fun degree at h0 h1
+  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.with_bot.add_eq_three_iff.mp h0.symm with (h | h | h | h)
   any_goals rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
@@ -929,7 +929,7 @@ theorem WeierstrassCurve.Affine.CoordinateRing.smul_basis_eq_zero {p q : R[X]}
     (hpq : p • 1 + q • AdjoinRoot.mk W.Polynomial Y = 0) : p = 0 ∧ q = 0 :=
   by
   have h := fintype.linear_independent_iff.mp (coordinate_ring.basis W).LinearIndependent ![p, q]
-  erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h 
+  erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h
   exact ⟨h hpq 0, h hpq 1⟩
 #align weierstrass_curve.coordinate_ring.smul_basis_eq_zero WeierstrassCurve.Affine.CoordinateRing.smul_basis_eq_zero
 -/
@@ -939,7 +939,7 @@ theorem WeierstrassCurve.Affine.CoordinateRing.exists_smul_basis_eq (x : W.Coord
     ∃ p q : R[X], p • 1 + q • AdjoinRoot.mk W.Polynomial Y = x :=
   by
   have h := (coordinate_ring.basis W).sum_equivFun x
-  erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h 
+  erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h
   exact ⟨_, _, h⟩
 #align weierstrass_curve.coordinate_ring.exists_smul_basis_eq WeierstrassCurve.Affine.CoordinateRing.exists_smul_basis_eq
 -/
@@ -1019,7 +1019,7 @@ theorem WeierstrassCurve.Affine.CoordinateRing.degree_norm_smul_basis [IsDomain
   ·
     simpa only [hq, hdp, sub_zero, MulZeroClass.zero_mul, MulZeroClass.mul_zero,
       zero_pow zero_lt_two] using (max_bot_right _).symm
-  rw [← not_congr degree_eq_bot] at hp hq 
+  rw [← not_congr degree_eq_bot] at hp hq
   cases' p.degree with dp; · exact (hp rfl).elim
   cases' q.degree with dq; · exact (hq rfl).elim
   cases' le_or_lt dp (dq + 1) with hpq hpq
Diff
@@ -279,95 +279,95 @@ section BaseChange
 /-! ### Base changes -/
 
 
-#print WeierstrassCurve.baseChange /-
+#print WeierstrassCurve.map /-
 /-- The Weierstrass curve over `R` base changed to `A`. -/
 @[simps]
-def baseChange : WeierstrassCurve A :=
+def map : WeierstrassCurve A :=
   ⟨algebraMap R A W.a₁, algebraMap R A W.a₂, algebraMap R A W.a₃, algebraMap R A W.a₄,
     algebraMap R A W.a₆⟩
-#align weierstrass_curve.base_change WeierstrassCurve.baseChange
+#align weierstrass_curve.base_change WeierstrassCurve.map
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_b₂ /-
+#print WeierstrassCurve.map_b₂ /-
 @[simp]
-theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
+theorem map_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
   simp only [b₂, base_change_a₁, base_change_a₂];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
+#align weierstrass_curve.base_change_b₂ WeierstrassCurve.map_b₂
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_b₄ /-
+#print WeierstrassCurve.map_b₄ /-
 @[simp]
-theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
+theorem map_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
   simp only [b₄, base_change_a₁, base_change_a₃, base_change_a₄];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
+#align weierstrass_curve.base_change_b₄ WeierstrassCurve.map_b₄
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_b₆ /-
+#print WeierstrassCurve.map_b₆ /-
 @[simp]
-theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
+theorem map_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
   simp only [b₆, base_change_a₃, base_change_a₆];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
+#align weierstrass_curve.base_change_b₆ WeierstrassCurve.map_b₆
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_b₈ /-
+#print WeierstrassCurve.map_b₈ /-
 @[simp]
-theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
+theorem map_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
   simp only [b₈, base_change_a₁, base_change_a₂, base_change_a₃, base_change_a₄, base_change_a₆]
   run_tac
     map_simp
-#align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
+#align weierstrass_curve.base_change_b₈ WeierstrassCurve.map_b₈
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_c₄ /-
+#print WeierstrassCurve.map_c₄ /-
 @[simp]
-theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
+theorem map_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
   simp only [c₄, base_change_b₂, base_change_b₄];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
+#align weierstrass_curve.base_change_c₄ WeierstrassCurve.map_c₄
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_c₆ /-
+#print WeierstrassCurve.map_c₆ /-
 @[simp]
-theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
+theorem map_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
   simp only [c₆, base_change_b₂, base_change_b₄, base_change_b₆];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
+#align weierstrass_curve.base_change_c₆ WeierstrassCurve.map_c₆
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.baseChange_Δ /-
+#print WeierstrassCurve.map_Δ /-
 @[simp, nolint simp_nf]
-theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
+theorem map_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
   simp only [Δ, base_change_b₂, base_change_b₄, base_change_b₆, base_change_b₈];
   run_tac
     map_simp
-#align weierstrass_curve.base_change_Δ WeierstrassCurve.baseChange_Δ
+#align weierstrass_curve.base_change_Δ WeierstrassCurve.map_Δ
 -/
 
-#print WeierstrassCurve.baseChange_self /-
-theorem baseChange_self : W.base_change R = W := by ext <;> rfl
-#align weierstrass_curve.base_change_self WeierstrassCurve.baseChange_self
+#print WeierstrassCurve.map_id /-
+theorem map_id : W.base_change R = W := by ext <;> rfl
+#align weierstrass_curve.base_change_self WeierstrassCurve.map_id
 -/
 
-#print WeierstrassCurve.baseChange_baseChange /-
-theorem baseChange_baseChange : (W.base_change A).base_change B = W.base_change B := by
+#print WeierstrassCurve.map_baseChange /-
+theorem map_baseChange : (W.base_change A).base_change B = W.base_change B := by
   ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
-#align weierstrass_curve.base_change_base_change WeierstrassCurve.baseChange_baseChange
+#align weierstrass_curve.base_change_base_change WeierstrassCurve.map_baseChange
 -/
 
 end BaseChange
@@ -553,9 +553,9 @@ theorem WeierstrassCurve.Affine.equation_iff_variableChange (x y : R) :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.Affine.equation_iff_baseChange /-
-theorem WeierstrassCurve.Affine.equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A]
-    (x y : R) : W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
+#print WeierstrassCurve.Affine.map_equation /-
+theorem WeierstrassCurve.Affine.map_equation [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
+    W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
   by
   simp only [equation_iff]
   refine' ⟨fun h => _, fun h => _⟩
@@ -569,16 +569,16 @@ theorem WeierstrassCurve.Affine.equation_iff_baseChange [Nontrivial A] [NoZeroSM
     run_tac
       map_simp;
     exact h
-#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.Affine.equation_iff_baseChange
+#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.Affine.map_equation
 -/
 
-#print WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange /-
-theorem WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange [Nontrivial B]
-    [NoZeroSMulDivisors A B] (x y : A) :
+#print WeierstrassCurve.Affine.baseChange_equation /-
+theorem WeierstrassCurve.Affine.baseChange_equation [Nontrivial B] [NoZeroSMulDivisors A B]
+    (x y : A) :
     (W.base_change A).equation x y ↔
       (W.base_change B).equation (algebraMap A B x) (algebraMap A B y) :=
   by rw [equation_iff_base_change (W.base_change A) B, base_change_base_change]
-#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange
+#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.Affine.baseChange_equation
 -/
 
 /-! ### Nonsingularity of Weierstrass curves -/
@@ -686,9 +686,8 @@ theorem WeierstrassCurve.Affine.nonsingular_iff_variableChange (x y : R) :
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.Affine.nonsingular_iff_baseChange /-
-theorem WeierstrassCurve.Affine.nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A]
-    (x y : R) :
+#print WeierstrassCurve.Affine.map_nonsingular /-
+theorem WeierstrassCurve.Affine.map_nonsingular [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.nonsingular x y ↔ (W.base_change A).nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
   rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_base_change A x y]
@@ -705,16 +704,16 @@ theorem WeierstrassCurve.Affine.nonsingular_iff_baseChange [Nontrivial A] [NoZer
         run_tac
           map_simp;
         rfl
-#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange
+#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.Affine.map_nonsingular
 -/
 
-#print WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange /-
-theorem WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange [Nontrivial B]
-    [NoZeroSMulDivisors A B] (x y : A) :
+#print WeierstrassCurve.Affine.baseChange_nonsingular /-
+theorem WeierstrassCurve.Affine.baseChange_nonsingular [Nontrivial B] [NoZeroSMulDivisors A B]
+    (x y : A) :
     (W.base_change A).nonsingular x y ↔
       (W.base_change B).nonsingular (algebraMap A B x) (algebraMap A B y) :=
   by rw [nonsingular_iff_base_change (W.base_change A) B, base_change_base_change]
-#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange
+#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.Affine.baseChange_nonsingular
 -/
 
 #print WeierstrassCurve.Affine.nonsingular_zero_of_Δ_ne_zero /-
@@ -1162,36 +1161,36 @@ section BaseChange
 
 variable (A : Type v) [CommRing A] [Algebra R A]
 
-#print EllipticCurve.baseChange /-
+#print EllipticCurve.map /-
 /-- The elliptic curve over `R` base changed to `A`. -/
 @[simps]
-def baseChange : EllipticCurve A :=
+def map : EllipticCurve A :=
   ⟨E.base_change A, Units.map (↑(algebraMap R A)) E.Δ', by
     rw [Units.coe_map, RingHom.coe_monoidHom, coe_Δ', E.base_change_Δ]⟩
-#align elliptic_curve.base_change EllipticCurve.baseChange
+#align elliptic_curve.base_change EllipticCurve.map
 -/
 
-#print EllipticCurve.coeBaseChange_Δ' /-
-theorem coeBaseChange_Δ' : ↑(E.base_change A).Δ' = algebraMap R A E.Δ' :=
+#print EllipticCurve.coe_map_Δ' /-
+theorem coe_map_Δ' : ↑(E.base_change A).Δ' = algebraMap R A E.Δ' :=
   rfl
-#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBaseChange_Δ'
+#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coe_map_Δ'
 -/
 
-#print EllipticCurve.coe_inv_baseChange_Δ' /-
-theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A ↑E.Δ'⁻¹ :=
+#print EllipticCurve.coe_inv_map_Δ' /-
+theorem coe_inv_map_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A ↑E.Δ'⁻¹ :=
   rfl
-#align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
+#align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_map_Δ'
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print EllipticCurve.baseChange_j /-
+#print EllipticCurve.map_j /-
 @[simp]
-theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
+theorem map_j : (E.base_change A).j = algebraMap R A E.j :=
   by
   simp only [j, coe_inv_base_change_Δ', base_change_to_weierstrass_curve, E.base_change_c₄]
   run_tac
     map_simp
-#align elliptic_curve.base_change_j EllipticCurve.baseChange_j
+#align elliptic_curve.base_change_j EllipticCurve.map_j
 -/
 
 end BaseChange
Diff
@@ -769,7 +769,7 @@ open Ideal
 
 instance [IsDomain R] [NormalizedGCDMonoid R] : IsDomain W.CoordinateRing :=
   (Quotient.isDomain_iff_prime _).mpr <| by
-    simpa only [span_singleton_prime W.polynomial_ne_zero, ← GCDMonoid.irreducible_iff_prime] using
+    simpa only [span_singleton_prime W.polynomial_ne_zero, ← irreducible_iff_prime] using
       W.irreducible_polynomial
 
 #print WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field /-
Diff
@@ -774,7 +774,7 @@ instance [IsDomain R] [NormalizedGCDMonoid R] : IsDomain W.CoordinateRing :=
 
 #print WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field /-
 instance WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field {F : Type u}
-    [Field F] (W : WeierstrassCurve F) : IsDomain W.CoordinateRing := by classical
+    [Field F] (W : WeierstrassCurve F) : IsDomain W.CoordinateRing := by classical infer_instance
 #align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field
 -/
 
@@ -889,6 +889,9 @@ protected noncomputable def WeierstrassCurve.Affine.CoordinateRing.basis :
 theorem WeierstrassCurve.Affine.CoordinateRing.basis_apply (n : Fin 2) :
     W.CoordinateRing.Basis n = (AdjoinRoot.powerBasis' W.monic_polynomial).gen ^ (n : ℕ) := by
   classical
+  nontriviality R
+  simpa only [coordinate_ring.basis, Or.by_cases, dif_neg (not_subsingleton R), Basis.reindex_apply,
+    PowerBasis.basis_eq_pow]
 #align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.Affine.CoordinateRing.basis_apply
 -/
 
Diff
@@ -774,7 +774,7 @@ instance [IsDomain R] [NormalizedGCDMonoid R] : IsDomain W.CoordinateRing :=
 
 #print WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field /-
 instance WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field {F : Type u}
-    [Field F] (W : WeierstrassCurve F) : IsDomain W.CoordinateRing := by classical infer_instance
+    [Field F] (W : WeierstrassCurve F) : IsDomain W.CoordinateRing := by classical
 #align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field
 -/
 
@@ -889,9 +889,6 @@ protected noncomputable def WeierstrassCurve.Affine.CoordinateRing.basis :
 theorem WeierstrassCurve.Affine.CoordinateRing.basis_apply (n : Fin 2) :
     W.CoordinateRing.Basis n = (AdjoinRoot.powerBasis' W.monic_polynomial).gen ^ (n : ℕ) := by
   classical
-  nontriviality R
-  simpa only [coordinate_ring.basis, Or.by_cases, dif_neg (not_subsingleton R), Basis.reindex_apply,
-    PowerBasis.basis_eq_pow]
 #align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.Affine.CoordinateRing.basis_apply
 -/
 
Diff
@@ -423,58 +423,58 @@ open Polynomial
 
 open scoped Polynomial PolynomialPolynomial
 
-#print WeierstrassCurve.polynomial /-
+#print WeierstrassCurve.Affine.polynomial /-
 /-- The polynomial $W(X, Y) := Y^2 + a_1XY + a_3Y - (X^3 + a_2X^2 + a_4X + a_6)$ associated to a
 Weierstrass curve `W` over `R`. For ease of polynomial manipulation, this is represented as a term
 of type `R[X][X]`, where the inner variable represents $X$ and the outer variable represents $Y$.
 For clarity, the alternative notations `Y` and `R[X][Y]` are provided in the `polynomial_polynomial`
 locale to represent the outer variable and the bivariate polynomial ring `R[X][X]` respectively. -/
-protected noncomputable def polynomial : R[X][Y] :=
+protected noncomputable def WeierstrassCurve.Affine.polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
-#align weierstrass_curve.polynomial WeierstrassCurve.polynomial
+#align weierstrass_curve.polynomial WeierstrassCurve.Affine.polynomial
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4150285101.C_simp -/
-#print WeierstrassCurve.polynomial_eq /-
-theorem polynomial_eq :
+#print WeierstrassCurve.Affine.polynomial_eq /-
+theorem WeierstrassCurve.Affine.polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
         ⟨0, 1, Cubic.toPoly ⟨0, 0, W.a₁, W.a₃⟩, Cubic.toPoly ⟨-1, -W.a₂, -W.a₄, -W.a₆⟩⟩ :=
-  by simp only [WeierstrassCurve.polynomial, Cubic.toPoly];
+  by simp only [WeierstrassCurve.Affine.polynomial, Cubic.toPoly];
   run_tac
     C_simp;
   ring1
-#align weierstrass_curve.polynomial_eq WeierstrassCurve.polynomial_eq
+#align weierstrass_curve.polynomial_eq WeierstrassCurve.Affine.polynomial_eq
 -/
 
-#print WeierstrassCurve.polynomial_ne_zero /-
-theorem polynomial_ne_zero [Nontrivial R] : W.Polynomial ≠ 0 := by rw [polynomial_eq];
-  exact Cubic.ne_zero_of_b_ne_zero one_ne_zero
-#align weierstrass_curve.polynomial_ne_zero WeierstrassCurve.polynomial_ne_zero
+#print WeierstrassCurve.Affine.polynomial_ne_zero /-
+theorem WeierstrassCurve.Affine.polynomial_ne_zero [Nontrivial R] : W.Polynomial ≠ 0 := by
+  rw [polynomial_eq]; exact Cubic.ne_zero_of_b_ne_zero one_ne_zero
+#align weierstrass_curve.polynomial_ne_zero WeierstrassCurve.Affine.polynomial_ne_zero
 -/
 
-#print WeierstrassCurve.degree_polynomial /-
+#print WeierstrassCurve.Affine.degree_polynomial /-
 @[simp]
-theorem degree_polynomial [Nontrivial R] : W.Polynomial.degree = 2 := by rw [polynomial_eq];
-  exact Cubic.degree_of_b_ne_zero' one_ne_zero
-#align weierstrass_curve.degree_polynomial WeierstrassCurve.degree_polynomial
+theorem WeierstrassCurve.Affine.degree_polynomial [Nontrivial R] : W.Polynomial.degree = 2 := by
+  rw [polynomial_eq]; exact Cubic.degree_of_b_ne_zero' one_ne_zero
+#align weierstrass_curve.degree_polynomial WeierstrassCurve.Affine.degree_polynomial
 -/
 
-#print WeierstrassCurve.natDegree_polynomial /-
+#print WeierstrassCurve.Affine.natDegree_polynomial /-
 @[simp]
-theorem natDegree_polynomial [Nontrivial R] : W.Polynomial.natDegree = 2 := by rw [polynomial_eq];
-  exact Cubic.natDegree_of_b_ne_zero' one_ne_zero
-#align weierstrass_curve.nat_degree_polynomial WeierstrassCurve.natDegree_polynomial
+theorem WeierstrassCurve.Affine.natDegree_polynomial [Nontrivial R] : W.Polynomial.natDegree = 2 :=
+  by rw [polynomial_eq]; exact Cubic.natDegree_of_b_ne_zero' one_ne_zero
+#align weierstrass_curve.nat_degree_polynomial WeierstrassCurve.Affine.natDegree_polynomial
 -/
 
-#print WeierstrassCurve.monic_polynomial /-
-theorem monic_polynomial : W.Polynomial.Monic := by nontriviality R;
+#print WeierstrassCurve.Affine.monic_polynomial /-
+theorem WeierstrassCurve.Affine.monic_polynomial : W.Polynomial.Monic := by nontriviality R;
   simpa only [polynomial_eq] using Cubic.monic_of_b_eq_one'
-#align weierstrass_curve.monic_polynomial WeierstrassCurve.monic_polynomial
+#align weierstrass_curve.monic_polynomial WeierstrassCurve.Affine.monic_polynomial
 -/
 
-#print WeierstrassCurve.irreducible_polynomial /-
-theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
+#print WeierstrassCurve.Affine.irreducible_polynomial /-
+theorem WeierstrassCurve.Affine.irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   by
   by_contra h
   rcases(W.monic_polynomial.not_irreducible_iff_exists_add_mul_eq_coeff W.nat_degree_polynomial).mp
@@ -487,75 +487,75 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   rcases nat.with_bot.add_eq_three_iff.mp h0.symm with (h | h | h | h)
   any_goals rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
-#align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
+#align weierstrass_curve.irreducible_polynomial WeierstrassCurve.Affine.irreducible_polynomial
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3243647861.eval_simp -/
-#print WeierstrassCurve.eval_polynomial /-
+#print WeierstrassCurve.Affine.eval_polynomial /-
 @[simp]
-theorem eval_polynomial (x y : R) :
+theorem WeierstrassCurve.Affine.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 [WeierstrassCurve.polynomial];
+  by simp only [WeierstrassCurve.Affine.polynomial];
   run_tac
     eval_simp;
   rw [add_mul, ← add_assoc]
-#align weierstrass_curve.eval_polynomial WeierstrassCurve.eval_polynomial
+#align weierstrass_curve.eval_polynomial WeierstrassCurve.Affine.eval_polynomial
 -/
 
-#print WeierstrassCurve.eval_polynomial_zero /-
+#print WeierstrassCurve.Affine.eval_polynomial_zero /-
 @[simp]
-theorem eval_polynomial_zero : (W.Polynomial.eval 0).eval 0 = -W.a₆ := by
+theorem WeierstrassCurve.Affine.eval_polynomial_zero : (W.Polynomial.eval 0).eval 0 = -W.a₆ := by
   simp only [← C_0, eval_polynomial, zero_add, zero_sub, MulZeroClass.mul_zero,
     zero_pow (Nat.zero_lt_succ _)]
-#align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.eval_polynomial_zero
+#align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.Affine.eval_polynomial_zero
 -/
 
-#print WeierstrassCurve.equation /-
+#print WeierstrassCurve.Affine.equation /-
 /-- The proposition that an affine point $(x, y)$ lies in `W`. In other words, $W(x, y) = 0$. -/
-def equation (x y : R) : Prop :=
+def WeierstrassCurve.Affine.equation (x y : R) : Prop :=
   (W.Polynomial.eval <| C y).eval x = 0
-#align weierstrass_curve.equation WeierstrassCurve.equation
+#align weierstrass_curve.equation WeierstrassCurve.Affine.equation
 -/
 
-#print WeierstrassCurve.equation_iff' /-
-theorem equation_iff' (x y : R) :
+#print WeierstrassCurve.Affine.equation_iff' /-
+theorem WeierstrassCurve.Affine.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₆) = 0 :=
   by rw [equation, eval_polynomial]
-#align weierstrass_curve.equation_iff' WeierstrassCurve.equation_iff'
+#align weierstrass_curve.equation_iff' WeierstrassCurve.Affine.equation_iff'
 -/
 
-#print WeierstrassCurve.equation_iff /-
+#print WeierstrassCurve.Affine.equation_iff /-
 @[simp]
-theorem equation_iff (x y : R) :
+theorem WeierstrassCurve.Affine.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]
-#align weierstrass_curve.equation_iff WeierstrassCurve.equation_iff
+#align weierstrass_curve.equation_iff WeierstrassCurve.Affine.equation_iff
 -/
 
-#print WeierstrassCurve.equation_zero /-
+#print WeierstrassCurve.Affine.equation_zero /-
 @[simp]
-theorem equation_zero : W.equation 0 0 ↔ W.a₆ = 0 := by
+theorem WeierstrassCurve.Affine.equation_zero : W.equation 0 0 ↔ W.a₆ = 0 := by
   rw [equation, C_0, eval_polynomial_zero, neg_eq_zero]
-#align weierstrass_curve.equation_zero WeierstrassCurve.equation_zero
+#align weierstrass_curve.equation_zero WeierstrassCurve.Affine.equation_zero
 -/
 
-#print WeierstrassCurve.equation_iff_variableChange /-
-theorem equation_iff_variableChange (x y : R) :
+#print WeierstrassCurve.Affine.equation_iff_variableChange /-
+theorem WeierstrassCurve.Affine.equation_iff_variableChange (x y : R) :
     W.equation x y ↔ (W.variableChange 1 x 0 y).equation 0 0 :=
   by
   rw [equation_iff', ← neg_eq_zero, equation_zero, variable_change_a₆, inv_one, Units.val_one]
   congr 2
   ring1
-#align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
+#align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.Affine.equation_iff_variableChange
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.equation_iff_baseChange /-
-theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
+#print WeierstrassCurve.Affine.equation_iff_baseChange /-
+theorem WeierstrassCurve.Affine.equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A]
+    (x y : R) : W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
   by
   simp only [equation_iff]
   refine' ⟨fun h => _, fun h => _⟩
@@ -569,123 +569,126 @@ theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R
     run_tac
       map_simp;
     exact h
-#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.equation_iff_baseChange
+#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.Affine.equation_iff_baseChange
 -/
 
-#print WeierstrassCurve.equation_iff_baseChange_of_baseChange /-
-theorem equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
+#print WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange /-
+theorem WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange [Nontrivial B]
+    [NoZeroSMulDivisors A B] (x y : A) :
     (W.base_change A).equation x y ↔
       (W.base_change B).equation (algebraMap A B x) (algebraMap A B y) :=
   by rw [equation_iff_base_change (W.base_change A) B, base_change_base_change]
-#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.equation_iff_baseChange_of_baseChange
+#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.Affine.equation_iff_baseChange_of_baseChange
 -/
 
 /-! ### Nonsingularity of Weierstrass curves -/
 
 
-#print WeierstrassCurve.polynomialX /-
+#print WeierstrassCurve.Affine.polynomialX /-
 /-- The partial derivative $W_X(X, Y)$ of $W(X, Y)$ with respect to $X$.
 
 TODO: define this in terms of `polynomial.derivative`. -/
-noncomputable def polynomialX : R[X][Y] :=
+noncomputable def WeierstrassCurve.Affine.polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
-#align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
+#align weierstrass_curve.polynomial_X WeierstrassCurve.Affine.polynomialX
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3243647861.eval_simp -/
-#print WeierstrassCurve.eval_polynomialX /-
+#print WeierstrassCurve.Affine.eval_polynomialX /-
 @[simp]
-theorem eval_polynomialX (x y : R) :
+theorem WeierstrassCurve.Affine.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 [polynomial_X];
   run_tac
     eval_simp
-#align weierstrass_curve.eval_polynomial_X WeierstrassCurve.eval_polynomialX
+#align weierstrass_curve.eval_polynomial_X WeierstrassCurve.Affine.eval_polynomialX
 -/
 
-#print WeierstrassCurve.eval_polynomialX_zero /-
+#print WeierstrassCurve.Affine.eval_polynomialX_zero /-
 @[simp]
-theorem eval_polynomialX_zero : (W.polynomialX.eval 0).eval 0 = -W.a₄ := by
+theorem WeierstrassCurve.Affine.eval_polynomialX_zero : (W.polynomialX.eval 0).eval 0 = -W.a₄ := by
   simp only [← C_0, eval_polynomial_X, zero_add, zero_sub, MulZeroClass.mul_zero,
     zero_pow zero_lt_two]
-#align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.eval_polynomialX_zero
+#align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.Affine.eval_polynomialX_zero
 -/
 
-#print WeierstrassCurve.polynomialY /-
+#print WeierstrassCurve.Affine.polynomialY /-
 /-- The partial derivative $W_Y(X, Y)$ of $W(X, Y)$ with respect to $Y$.
 
 TODO: define this in terms of `polynomial.derivative`. -/
-noncomputable def polynomialY : R[X][Y] :=
+noncomputable def WeierstrassCurve.Affine.polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
-#align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
+#align weierstrass_curve.polynomial_Y WeierstrassCurve.Affine.polynomialY
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3243647861.eval_simp -/
-#print WeierstrassCurve.eval_polynomialY /-
+#print WeierstrassCurve.Affine.eval_polynomialY /-
 @[simp]
-theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
-  by simp only [polynomial_Y];
+theorem WeierstrassCurve.Affine.eval_polynomialY (x y : R) :
+    (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ := by simp only [polynomial_Y];
   run_tac
     eval_simp;
   rw [← add_assoc]
-#align weierstrass_curve.eval_polynomial_Y WeierstrassCurve.eval_polynomialY
+#align weierstrass_curve.eval_polynomial_Y WeierstrassCurve.Affine.eval_polynomialY
 -/
 
-#print WeierstrassCurve.eval_polynomialY_zero /-
+#print WeierstrassCurve.Affine.eval_polynomialY_zero /-
 @[simp]
-theorem eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
+theorem WeierstrassCurve.Affine.eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
   simp only [← C_0, eval_polynomial_Y, zero_add, MulZeroClass.mul_zero]
-#align weierstrass_curve.eval_polynomial_Y_zero WeierstrassCurve.eval_polynomialY_zero
+#align weierstrass_curve.eval_polynomial_Y_zero WeierstrassCurve.Affine.eval_polynomialY_zero
 -/
 
-#print WeierstrassCurve.nonsingular /-
+#print WeierstrassCurve.Affine.nonsingular /-
 /-- The proposition that an affine point $(x, y)$ on `W` is nonsingular.
 In other words, either $W_X(x, y) \ne 0$ or $W_Y(x, y) \ne 0$. -/
-def nonsingular (x y : R) : Prop :=
+def WeierstrassCurve.Affine.nonsingular (x y : R) : Prop :=
   W.equation x y ∧ ((W.polynomialX.eval <| C y).eval x ≠ 0 ∨ (W.polynomialY.eval <| C y).eval x ≠ 0)
-#align weierstrass_curve.nonsingular WeierstrassCurve.nonsingular
+#align weierstrass_curve.nonsingular WeierstrassCurve.Affine.nonsingular
 -/
 
-#print WeierstrassCurve.nonsingular_iff' /-
-theorem nonsingular_iff' (x y : R) :
+#print WeierstrassCurve.Affine.nonsingular_iff' /-
+theorem WeierstrassCurve.Affine.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₄) ≠ 0 ∨ 2 * y + W.a₁ * x + W.a₃ ≠ 0) :=
   by rw [nonsingular, equation_iff', eval_polynomial_X, eval_polynomial_Y]
-#align weierstrass_curve.nonsingular_iff' WeierstrassCurve.nonsingular_iff'
+#align weierstrass_curve.nonsingular_iff' WeierstrassCurve.Affine.nonsingular_iff'
 -/
 
-#print WeierstrassCurve.nonsingular_iff /-
+#print WeierstrassCurve.Affine.nonsingular_iff /-
 @[simp]
-theorem nonsingular_iff (x y : R) :
+theorem WeierstrassCurve.Affine.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 _ _ y]; congr 4 <;> ring1
-#align weierstrass_curve.nonsingular_iff WeierstrassCurve.nonsingular_iff
+#align weierstrass_curve.nonsingular_iff WeierstrassCurve.Affine.nonsingular_iff
 -/
 
-#print WeierstrassCurve.nonsingular_zero /-
+#print WeierstrassCurve.Affine.nonsingular_zero /-
 @[simp]
-theorem nonsingular_zero : W.nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0) := by
+theorem WeierstrassCurve.Affine.nonsingular_zero :
+    W.nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0) := by
   rw [nonsingular, equation_zero, C_0, eval_polynomial_X_zero, neg_ne_zero, eval_polynomial_Y_zero,
     or_comm']
-#align weierstrass_curve.nonsingular_zero WeierstrassCurve.nonsingular_zero
+#align weierstrass_curve.nonsingular_zero WeierstrassCurve.Affine.nonsingular_zero
 -/
 
-#print WeierstrassCurve.nonsingular_iff_variableChange /-
-theorem nonsingular_iff_variableChange (x y : R) :
+#print WeierstrassCurve.Affine.nonsingular_iff_variableChange /-
+theorem WeierstrassCurve.Affine.nonsingular_iff_variableChange (x y : R) :
     W.nonsingular x y ↔ (W.variableChange 1 x 0 y).nonsingular 0 0 :=
   by
   rw [nonsingular_iff', equation_iff_variable_change, equation_zero, ← neg_ne_zero, or_comm',
     nonsingular_zero, variable_change_a₃, variable_change_a₄, inv_one, Units.val_one]
   congr 4 <;> ring1
-#align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
+#align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.Affine.nonsingular_iff_variableChange
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
-#print WeierstrassCurve.nonsingular_iff_baseChange /-
-theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
+#print WeierstrassCurve.Affine.nonsingular_iff_baseChange /-
+theorem WeierstrassCurve.Affine.nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A]
+    (x y : R) :
     W.nonsingular x y ↔ (W.base_change A).nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
   rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_base_change A x y]
@@ -702,37 +705,40 @@ theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y
         run_tac
           map_simp;
         rfl
-#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.nonsingular_iff_baseChange
+#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange
 -/
 
-#print WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange /-
-theorem nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
+#print WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange /-
+theorem WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange [Nontrivial B]
+    [NoZeroSMulDivisors A B] (x y : A) :
     (W.base_change A).nonsingular x y ↔
       (W.base_change B).nonsingular (algebraMap A B x) (algebraMap A B y) :=
   by rw [nonsingular_iff_base_change (W.base_change A) B, base_change_base_change]
-#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange
+#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.Affine.nonsingular_iff_baseChange_of_baseChange
 -/
 
-#print WeierstrassCurve.nonsingular_zero_of_Δ_ne_zero /-
-theorem nonsingular_zero_of_Δ_ne_zero (h : W.equation 0 0) (hΔ : W.Δ ≠ 0) : W.nonsingular 0 0 := by
-  simp only [equation_zero, nonsingular_zero] at *; contrapose! hΔ; simp [h, hΔ]
-#align weierstrass_curve.nonsingular_zero_of_Δ_ne_zero WeierstrassCurve.nonsingular_zero_of_Δ_ne_zero
+#print WeierstrassCurve.Affine.nonsingular_zero_of_Δ_ne_zero /-
+theorem WeierstrassCurve.Affine.nonsingular_zero_of_Δ_ne_zero (h : W.equation 0 0) (hΔ : W.Δ ≠ 0) :
+    W.nonsingular 0 0 := by simp only [equation_zero, nonsingular_zero] at *; contrapose! hΔ;
+  simp [h, hΔ]
+#align weierstrass_curve.nonsingular_zero_of_Δ_ne_zero WeierstrassCurve.Affine.nonsingular_zero_of_Δ_ne_zero
 -/
 
-#print WeierstrassCurve.nonsingular_of_Δ_ne_zero /-
+#print WeierstrassCurve.Affine.nonsingular_of_Δ_ne_zero /-
 /-- A Weierstrass curve is nonsingular at every point if its discriminant is non-zero. -/
-theorem nonsingular_of_Δ_ne_zero {x y : R} (h : W.equation x y) (hΔ : W.Δ ≠ 0) :
-    W.nonsingular x y :=
+theorem WeierstrassCurve.Affine.nonsingular_of_Δ_ne_zero {x y : R} (h : W.equation x y)
+    (hΔ : W.Δ ≠ 0) : W.nonsingular x y :=
   (W.nonsingular_iff_variableChange x y).mpr <|
-    nonsingular_zero_of_Δ_ne_zero _ ((W.equation_iff_variableChange x y).mp h) <| by
-      rwa [variable_change_Δ, inv_one, Units.val_one, one_pow, one_mul]
-#align weierstrass_curve.nonsingular_of_Δ_ne_zero WeierstrassCurve.nonsingular_of_Δ_ne_zero
+    WeierstrassCurve.Affine.nonsingular_zero_of_Δ_ne_zero _
+        ((W.equation_iff_variableChange x y).mp h) <|
+      by rwa [variable_change_Δ, inv_one, Units.val_one, one_pow, one_mul]
+#align weierstrass_curve.nonsingular_of_Δ_ne_zero WeierstrassCurve.Affine.nonsingular_of_Δ_ne_zero
 -/
 
 /-! ### Ideals in the coordinate ring -/
 
 
-#print WeierstrassCurve.CoordinateRing /-
+#print WeierstrassCurve.Affine.CoordinateRing /-
 /-- The coordinate ring $R[W] := R[X, Y] / \langle W(X, Y) \rangle$ of `W`.
 
 Note that `derive comm_ring` generates a reducible instance of `comm_ring` for `coordinate_ring`.
@@ -744,17 +750,17 @@ TODO Lean 4: verify if the new def-eq cache (lean4#1102) fixed this issue.
 
 See Zulip thread:
 https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.E2.9C.94.20class_group.2Emk -/
-def CoordinateRing : Type u :=
+def WeierstrassCurve.Affine.CoordinateRing : Type u :=
   AdjoinRoot W.Polynomial
 deriving Inhabited, CommRing
-#align weierstrass_curve.coordinate_ring WeierstrassCurve.CoordinateRing
+#align weierstrass_curve.coordinate_ring WeierstrassCurve.Affine.CoordinateRing
 -/
 
-#print WeierstrassCurve.FunctionField /-
+#print WeierstrassCurve.Affine.FunctionField /-
 /-- The function field $R(W) := \mathrm{Frac}(R[W])$ of `W`. -/
-abbrev FunctionField : Type u :=
+abbrev WeierstrassCurve.Affine.FunctionField : Type u :=
   FractionRing W.CoordinateRing
-#align weierstrass_curve.function_field WeierstrassCurve.FunctionField
+#align weierstrass_curve.function_field WeierstrassCurve.Affine.FunctionField
 -/
 
 namespace CoordinateRing
@@ -766,66 +772,71 @@ instance [IsDomain R] [NormalizedGCDMonoid R] : IsDomain W.CoordinateRing :=
     simpa only [span_singleton_prime W.polynomial_ne_zero, ← GCDMonoid.irreducible_iff_prime] using
       W.irreducible_polynomial
 
-#print WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing_of_Field /-
-instance instIsDomainCoordinateRing_of_Field {F : Type u} [Field F] (W : WeierstrassCurve F) :
-    IsDomain W.CoordinateRing := by classical infer_instance
-#align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing_of_Field
+#print WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field /-
+instance WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field {F : Type u}
+    [Field F] (W : WeierstrassCurve F) : IsDomain W.CoordinateRing := by classical infer_instance
+#align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.Affine.CoordinateRing.instIsDomainCoordinateRing_of_Field
 -/
 
 variable (x : R) (y : R[X])
 
-#print WeierstrassCurve.CoordinateRing.XClass /-
+#print WeierstrassCurve.Affine.CoordinateRing.XClass /-
 /-- The class of the element $X - x$ in $R[W]$ for some $x \in R$. -/
 @[simp]
-noncomputable def XClass : W.CoordinateRing :=
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.XClass : W.CoordinateRing :=
   AdjoinRoot.mk W.Polynomial <| C <| X - C x
-#align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.CoordinateRing.XClass
+#align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.Affine.CoordinateRing.XClass
 -/
 
-#print WeierstrassCurve.CoordinateRing.XClass_ne_zero /-
-theorem XClass_ne_zero [Nontrivial R] : XClass W x ≠ 0 :=
+#print WeierstrassCurve.Affine.CoordinateRing.XClass_ne_zero /-
+theorem WeierstrassCurve.Affine.CoordinateRing.XClass_ne_zero [Nontrivial R] :
+    WeierstrassCurve.Affine.CoordinateRing.XClass W x ≠ 0 :=
   AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| X_sub_C_ne_zero x) <|
     by rw [nat_degree_polynomial, nat_degree_C]; norm_num1
-#align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.CoordinateRing.XClass_ne_zero
+#align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.Affine.CoordinateRing.XClass_ne_zero
 -/
 
-#print WeierstrassCurve.CoordinateRing.YClass /-
+#print WeierstrassCurve.Affine.CoordinateRing.YClass /-
 /-- The class of the element $Y - y(X)$ in $R[W]$ for some $y(X) \in R[X]$. -/
 @[simp]
-noncomputable def YClass : W.CoordinateRing :=
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.YClass : W.CoordinateRing :=
   AdjoinRoot.mk W.Polynomial <| Y - C y
-#align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.YClass
+#align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.Affine.CoordinateRing.YClass
 -/
 
-#print WeierstrassCurve.CoordinateRing.YClass_ne_zero /-
-theorem YClass_ne_zero [Nontrivial R] : YClass W y ≠ 0 :=
+#print WeierstrassCurve.Affine.CoordinateRing.YClass_ne_zero /-
+theorem WeierstrassCurve.Affine.CoordinateRing.YClass_ne_zero [Nontrivial R] :
+    WeierstrassCurve.Affine.CoordinateRing.YClass W y ≠ 0 :=
   AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (X_sub_C_ne_zero y) <| by
     rw [nat_degree_polynomial, nat_degree_X_sub_C]; norm_num1
-#align weierstrass_curve.coordinate_ring.Y_class_ne_zero WeierstrassCurve.CoordinateRing.YClass_ne_zero
+#align weierstrass_curve.coordinate_ring.Y_class_ne_zero WeierstrassCurve.Affine.CoordinateRing.YClass_ne_zero
 -/
 
-#print WeierstrassCurve.CoordinateRing.XIdeal /-
+#print WeierstrassCurve.Affine.CoordinateRing.XIdeal /-
 /-- The ideal $\langle X - x \rangle$ of $R[W]$ for some $x \in R$. -/
 @[simp]
-noncomputable def XIdeal : Ideal W.CoordinateRing :=
-  span {XClass W x}
-#align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.CoordinateRing.XIdeal
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.XIdeal : Ideal W.CoordinateRing :=
+  span {WeierstrassCurve.Affine.CoordinateRing.XClass W x}
+#align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.Affine.CoordinateRing.XIdeal
 -/
 
-#print WeierstrassCurve.CoordinateRing.YIdeal /-
+#print WeierstrassCurve.Affine.CoordinateRing.YIdeal /-
 /-- The ideal $\langle Y - y(X) \rangle$ of $R[W]$ for some $y(X) \in R[X]$. -/
 @[simp]
-noncomputable def YIdeal : Ideal W.CoordinateRing :=
-  span {YClass W y}
-#align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.CoordinateRing.YIdeal
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.YIdeal : Ideal W.CoordinateRing :=
+  span {WeierstrassCurve.Affine.CoordinateRing.YClass W y}
+#align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.Affine.CoordinateRing.YIdeal
 -/
 
-#print WeierstrassCurve.CoordinateRing.XYIdeal /-
+#print WeierstrassCurve.Affine.CoordinateRing.XYIdeal /-
 /-- The ideal $\langle X - x, Y - y(X) \rangle$ of $R[W]$ for some $x \in R$ and $y(X) \in R[X]$. -/
 @[simp]
-noncomputable def XYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
-  span {XClass W x, YClass W y}
-#align weierstrass_curve.coordinate_ring.XY_ideal WeierstrassCurve.CoordinateRing.XYIdeal
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.XYIdeal (x : R) (y : R[X]) :
+    Ideal W.CoordinateRing :=
+  span
+    {WeierstrassCurve.Affine.CoordinateRing.XClass W x,
+      WeierstrassCurve.Affine.CoordinateRing.YClass W y}
+#align weierstrass_curve.coordinate_ring.XY_ideal WeierstrassCurve.Affine.CoordinateRing.XYIdeal
 -/
 
 /-! ### The coordinate ring as an `R[X]`-algebra -/
@@ -834,10 +845,11 @@ noncomputable def XYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
 noncomputable instance : Algebra R[X] W.CoordinateRing :=
   Quotient.algebra R[X]
 
-#print WeierstrassCurve.CoordinateRing.instAlgebraCoordinateRing' /-
-noncomputable instance instAlgebraCoordinateRing' : Algebra R W.CoordinateRing :=
+#print WeierstrassCurve.Affine.CoordinateRing.instAlgebraCoordinateRing' /-
+noncomputable instance WeierstrassCurve.Affine.CoordinateRing.instAlgebraCoordinateRing' :
+    Algebra R W.CoordinateRing :=
   Quotient.algebra R
-#align weierstrass_curve.coordinate_ring.algebra' WeierstrassCurve.CoordinateRing.instAlgebraCoordinateRing'
+#align weierstrass_curve.coordinate_ring.algebra' WeierstrassCurve.Affine.CoordinateRing.instAlgebraCoordinateRing'
 -/
 
 instance : IsScalarTower R R[X] W.CoordinateRing :=
@@ -846,11 +858,12 @@ instance : IsScalarTower R R[X] W.CoordinateRing :=
 instance [Subsingleton R] : Subsingleton W.CoordinateRing :=
   Module.subsingleton R[X] _
 
-#print WeierstrassCurve.CoordinateRing.quotientXYIdealEquiv /-
+#print WeierstrassCurve.Affine.CoordinateRing.quotientXYIdealEquiv /-
 /-- The $R$-algebra isomorphism from $R[W] / \langle X - x, Y - y(X) \rangle$ to $R$ obtained by
 evaluation at $y(X)$ and at $x$ provided that $W(x, y(x)) = 0$. -/
-noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W.Polynomial.eval y).eval x = 0) :
-    (W.CoordinateRing ⧸ XYIdeal W x y) ≃ₐ[R] R :=
+noncomputable def WeierstrassCurve.Affine.CoordinateRing.quotientXYIdealEquiv {x : R} {y : R[X]}
+    (h : (W.Polynomial.eval y).eval x = 0) :
+    (W.CoordinateRing ⧸ WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x y) ≃ₐ[R] R :=
   (quotientEquivAlgOfEq R <| by
         simpa only [XY_ideal, X_class, Y_class, ← Set.image_pair, ← map_span]).trans <|
     (DoubleQuot.quotQuotEquivQuotOfLEₐ R <|
@@ -858,88 +871,92 @@ noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W.Polynomial.eva
             mem_span_C_X_sub_C_X_sub_C_iff_eval_eval_eq_zero.mpr h).trans <|
       ((quotientSpanCXSubCAlgEquiv (X - C x) y).restrictScalars R).trans <|
         quotientSpanXSubCAlgEquiv x
-#align weierstrass_curve.coordinate_ring.quotient_XY_ideal_equiv WeierstrassCurve.CoordinateRing.quotientXYIdealEquiv
+#align weierstrass_curve.coordinate_ring.quotient_XY_ideal_equiv WeierstrassCurve.Affine.CoordinateRing.quotientXYIdealEquiv
 -/
 
-#print WeierstrassCurve.CoordinateRing.basis /-
+#print WeierstrassCurve.Affine.CoordinateRing.basis /-
 /-- The basis $\{1, Y\}$ for the coordinate ring $R[W]$ over the polynomial ring $R[X]$.
 
 Given a Weierstrass curve `W`, write `W^.coordinate_ring.basis` for this basis. -/
-protected noncomputable def basis : Basis (Fin 2) R[X] W.CoordinateRing :=
+protected noncomputable def WeierstrassCurve.Affine.CoordinateRing.basis :
+    Basis (Fin 2) R[X] W.CoordinateRing :=
   (subsingleton_or_nontrivial R).byCases (fun _ => default) fun _ =>
     (AdjoinRoot.powerBasis' W.monic_polynomial).Basis.reindex <| finCongr W.nat_degree_polynomial
-#align weierstrass_curve.coordinate_ring.basis WeierstrassCurve.CoordinateRing.basis
+#align weierstrass_curve.coordinate_ring.basis WeierstrassCurve.Affine.CoordinateRing.basis
 -/
 
-#print WeierstrassCurve.CoordinateRing.basis_apply /-
-theorem basis_apply (n : Fin 2) :
+#print WeierstrassCurve.Affine.CoordinateRing.basis_apply /-
+theorem WeierstrassCurve.Affine.CoordinateRing.basis_apply (n : Fin 2) :
     W.CoordinateRing.Basis n = (AdjoinRoot.powerBasis' W.monic_polynomial).gen ^ (n : ℕ) := by
   classical
   nontriviality R
   simpa only [coordinate_ring.basis, Or.by_cases, dif_neg (not_subsingleton R), Basis.reindex_apply,
     PowerBasis.basis_eq_pow]
-#align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.CoordinateRing.basis_apply
+#align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.Affine.CoordinateRing.basis_apply
 -/
 
-#print WeierstrassCurve.CoordinateRing.basis_zero /-
-theorem basis_zero : W.CoordinateRing.Basis 0 = 1 := by simpa only [basis_apply] using pow_zero _
-#align weierstrass_curve.coordinate_ring.basis_zero WeierstrassCurve.CoordinateRing.basis_zero
+#print WeierstrassCurve.Affine.CoordinateRing.basis_zero /-
+theorem WeierstrassCurve.Affine.CoordinateRing.basis_zero : W.CoordinateRing.Basis 0 = 1 := by
+  simpa only [basis_apply] using pow_zero _
+#align weierstrass_curve.coordinate_ring.basis_zero WeierstrassCurve.Affine.CoordinateRing.basis_zero
 -/
 
-#print WeierstrassCurve.CoordinateRing.basis_one /-
-theorem basis_one : W.CoordinateRing.Basis 1 = AdjoinRoot.mk W.Polynomial Y := by
+#print WeierstrassCurve.Affine.CoordinateRing.basis_one /-
+theorem WeierstrassCurve.Affine.CoordinateRing.basis_one :
+    W.CoordinateRing.Basis 1 = AdjoinRoot.mk W.Polynomial Y := by
   simpa only [basis_apply] using pow_one _
-#align weierstrass_curve.coordinate_ring.basis_one WeierstrassCurve.CoordinateRing.basis_one
+#align weierstrass_curve.coordinate_ring.basis_one WeierstrassCurve.Affine.CoordinateRing.basis_one
 -/
 
-#print WeierstrassCurve.CoordinateRing.coe_basis /-
+#print WeierstrassCurve.Affine.CoordinateRing.coe_basis /-
 @[simp]
-theorem coe_basis :
+theorem WeierstrassCurve.Affine.CoordinateRing.coe_basis :
     (W.CoordinateRing.Basis : Fin 2 → W.CoordinateRing) = ![1, AdjoinRoot.mk W.Polynomial Y] := by
   ext n; fin_cases n; exacts [basis_zero W, basis_one W]
-#align weierstrass_curve.coordinate_ring.coe_basis WeierstrassCurve.CoordinateRing.coe_basis
+#align weierstrass_curve.coordinate_ring.coe_basis WeierstrassCurve.Affine.CoordinateRing.coe_basis
 -/
 
 variable {W}
 
-#print WeierstrassCurve.CoordinateRing.smul /-
-theorem smul (x : R[X]) (y : W.CoordinateRing) : x • y = AdjoinRoot.mk W.Polynomial (C x) * y :=
+#print WeierstrassCurve.Affine.CoordinateRing.smul /-
+theorem WeierstrassCurve.Affine.CoordinateRing.smul (x : R[X]) (y : W.CoordinateRing) :
+    x • y = AdjoinRoot.mk W.Polynomial (C x) * y :=
   (algebraMap_smul W.CoordinateRing x y).symm
-#align weierstrass_curve.coordinate_ring.smul WeierstrassCurve.CoordinateRing.smul
+#align weierstrass_curve.coordinate_ring.smul WeierstrassCurve.Affine.CoordinateRing.smul
 -/
 
-#print WeierstrassCurve.CoordinateRing.smul_basis_eq_zero /-
-theorem smul_basis_eq_zero {p q : R[X]} (hpq : p • 1 + q • AdjoinRoot.mk W.Polynomial Y = 0) :
-    p = 0 ∧ q = 0 :=
+#print WeierstrassCurve.Affine.CoordinateRing.smul_basis_eq_zero /-
+theorem WeierstrassCurve.Affine.CoordinateRing.smul_basis_eq_zero {p q : R[X]}
+    (hpq : p • 1 + q • AdjoinRoot.mk W.Polynomial Y = 0) : p = 0 ∧ q = 0 :=
   by
   have h := fintype.linear_independent_iff.mp (coordinate_ring.basis W).LinearIndependent ![p, q]
   erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h 
   exact ⟨h hpq 0, h hpq 1⟩
-#align weierstrass_curve.coordinate_ring.smul_basis_eq_zero WeierstrassCurve.CoordinateRing.smul_basis_eq_zero
+#align weierstrass_curve.coordinate_ring.smul_basis_eq_zero WeierstrassCurve.Affine.CoordinateRing.smul_basis_eq_zero
 -/
 
-#print WeierstrassCurve.CoordinateRing.exists_smul_basis_eq /-
-theorem exists_smul_basis_eq (x : W.CoordinateRing) :
+#print WeierstrassCurve.Affine.CoordinateRing.exists_smul_basis_eq /-
+theorem WeierstrassCurve.Affine.CoordinateRing.exists_smul_basis_eq (x : W.CoordinateRing) :
     ∃ p q : R[X], p • 1 + q • AdjoinRoot.mk W.Polynomial Y = x :=
   by
   have h := (coordinate_ring.basis W).sum_equivFun x
   erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h 
   exact ⟨_, _, h⟩
-#align weierstrass_curve.coordinate_ring.exists_smul_basis_eq WeierstrassCurve.CoordinateRing.exists_smul_basis_eq
+#align weierstrass_curve.coordinate_ring.exists_smul_basis_eq WeierstrassCurve.Affine.CoordinateRing.exists_smul_basis_eq
 -/
 
 variable (W)
 
-#print WeierstrassCurve.CoordinateRing.smul_basis_mul_C /-
-theorem smul_basis_mul_C (p q : R[X]) :
+#print WeierstrassCurve.Affine.CoordinateRing.smul_basis_mul_C /-
+theorem WeierstrassCurve.Affine.CoordinateRing.smul_basis_mul_C (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial (C y) =
       (p * y) • 1 + (q * y) • AdjoinRoot.mk W.Polynomial Y :=
   by simp only [smul, _root_.map_mul]; ring1
-#align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.CoordinateRing.smul_basis_mul_C
+#align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.Affine.CoordinateRing.smul_basis_mul_C
 -/
 
-#print WeierstrassCurve.CoordinateRing.smul_basis_mul_Y /-
-theorem smul_basis_mul_Y (p q : R[X]) :
+#print WeierstrassCurve.Affine.CoordinateRing.smul_basis_mul_Y /-
+theorem WeierstrassCurve.Affine.CoordinateRing.smul_basis_mul_Y (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial Y =
       (q * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)) • 1 +
         (p - q * (C W.a₁ * X + C W.a₃)) • AdjoinRoot.mk W.Polynomial Y :=
@@ -948,17 +965,17 @@ theorem smul_basis_mul_Y (p q : R[X]) :
     AdjoinRoot.mk W.polynomial Y ^ 2 =
       AdjoinRoot.mk W.polynomial
         (C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) - C (C W.a₁ * X + C W.a₃) * Y) :=
-    adjoin_root.mk_eq_mk.mpr ⟨1, by simp only [WeierstrassCurve.polynomial]; ring1⟩
+    adjoin_root.mk_eq_mk.mpr ⟨1, by simp only [WeierstrassCurve.Affine.polynomial]; ring1⟩
   simp only [smul, add_mul, mul_assoc, ← sq, Y_sq, map_sub, _root_.map_mul]
   ring1
-#align weierstrass_curve.coordinate_ring.smul_basis_mul_Y WeierstrassCurve.CoordinateRing.smul_basis_mul_Y
+#align weierstrass_curve.coordinate_ring.smul_basis_mul_Y WeierstrassCurve.Affine.CoordinateRing.smul_basis_mul_Y
 -/
 
 /-! ### Norms on the coordinate ring -/
 
 
-#print WeierstrassCurve.CoordinateRing.norm_smul_basis /-
-theorem norm_smul_basis (p q : R[X]) :
+#print WeierstrassCurve.Affine.CoordinateRing.norm_smul_basis /-
+theorem WeierstrassCurve.Affine.CoordinateRing.norm_smul_basis (p q : R[X]) :
     Algebra.norm R[X] (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       p ^ 2 - p * q * (C W.a₁ * X + C W.a₃) -
         q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) :=
@@ -968,24 +985,24 @@ theorem norm_smul_basis (p q : R[X]) :
     Finsupp.add_apply, map_smul, Finsupp.smul_apply, ← basis_zero, ← basis_one,
     Basis.repr_self_apply, if_pos, if_neg one_ne_zero, if_neg zero_ne_one, smul_eq_mul]
   ring1
-#align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
+#align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.Affine.CoordinateRing.norm_smul_basis
 -/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4150285101.C_simp -/
-#print WeierstrassCurve.CoordinateRing.coe_norm_smul_basis /-
-theorem coe_norm_smul_basis (p q : R[X]) :
+#print WeierstrassCurve.Affine.CoordinateRing.coe_norm_smul_basis /-
+theorem WeierstrassCurve.Affine.CoordinateRing.coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-Y - C (C W.a₁ * X + C W.a₃)))) :=
   AdjoinRoot.mk_eq_mk.mpr
-    ⟨C q ^ 2, by rw [norm_smul_basis, WeierstrassCurve.polynomial];
+    ⟨C q ^ 2, by rw [norm_smul_basis, WeierstrassCurve.Affine.polynomial];
       run_tac
         C_simp;
       ring1⟩
-#align weierstrass_curve.coordinate_ring.coe_norm_smul_basis WeierstrassCurve.CoordinateRing.coe_norm_smul_basis
+#align weierstrass_curve.coordinate_ring.coe_norm_smul_basis WeierstrassCurve.Affine.CoordinateRing.coe_norm_smul_basis
 -/
 
-#print WeierstrassCurve.CoordinateRing.degree_norm_smul_basis /-
-theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
+#print WeierstrassCurve.Affine.CoordinateRing.degree_norm_smul_basis /-
+theorem WeierstrassCurve.Affine.CoordinateRing.degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
     (Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y).degree =
       max (2 • p.degree) (2 • q.degree + 3) :=
   by
@@ -1023,27 +1040,29 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
             (max_eq_left_of_lt _).symm <;>
         rw [hdp] <;>
       exact with_bot.coe_lt_coe.mpr (by linarith only [hpq])
-#align weierstrass_curve.coordinate_ring.degree_norm_smul_basis WeierstrassCurve.CoordinateRing.degree_norm_smul_basis
+#align weierstrass_curve.coordinate_ring.degree_norm_smul_basis WeierstrassCurve.Affine.CoordinateRing.degree_norm_smul_basis
 -/
 
 variable {W}
 
-#print WeierstrassCurve.CoordinateRing.degree_norm_ne_one /-
-theorem degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) : (Algebra.norm R[X] x).degree ≠ 1 :=
+#print WeierstrassCurve.Affine.CoordinateRing.degree_norm_ne_one /-
+theorem WeierstrassCurve.Affine.CoordinateRing.degree_norm_ne_one [IsDomain R]
+    (x : W.CoordinateRing) : (Algebra.norm R[X] x).degree ≠ 1 :=
   by
   rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
   rw [degree_norm_smul_basis]
   rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
   any_goals rintro (_ | _)
   exact (lt_max_of_lt_right (by decide)).ne'
-#align weierstrass_curve.coordinate_ring.degree_norm_ne_one WeierstrassCurve.CoordinateRing.degree_norm_ne_one
+#align weierstrass_curve.coordinate_ring.degree_norm_ne_one WeierstrassCurve.Affine.CoordinateRing.degree_norm_ne_one
 -/
 
-#print WeierstrassCurve.CoordinateRing.natDegree_norm_ne_one /-
-theorem natDegree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
-    (Algebra.norm R[X] x).natDegree ≠ 1 :=
-  mt (degree_eq_iff_natDegree_eq_of_pos zero_lt_one).mpr <| degree_norm_ne_one x
-#align weierstrass_curve.coordinate_ring.nat_degree_norm_ne_one WeierstrassCurve.CoordinateRing.natDegree_norm_ne_one
+#print WeierstrassCurve.Affine.CoordinateRing.natDegree_norm_ne_one /-
+theorem WeierstrassCurve.Affine.CoordinateRing.natDegree_norm_ne_one [IsDomain R]
+    (x : W.CoordinateRing) : (Algebra.norm R[X] x).natDegree ≠ 1 :=
+  mt (degree_eq_iff_natDegree_eq_of_pos zero_lt_one).mpr <|
+    WeierstrassCurve.Affine.CoordinateRing.degree_norm_ne_one x
+#align weierstrass_curve.coordinate_ring.nat_degree_norm_ne_one WeierstrassCurve.Affine.CoordinateRing.natDegree_norm_ne_one
 -/
 
 end CoordinateRing
@@ -1087,10 +1106,11 @@ theorem twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] :
 #align elliptic_curve.two_torsion_polynomial_disc_ne_zero EllipticCurve.twoTorsionPolynomial_disc_ne_zero
 -/
 
-#print EllipticCurve.nonsingular /-
-theorem nonsingular [Nontrivial R] {x y : R} (h : E.equation x y) : E.nonsingular x y :=
+#print EllipticCurve.Affine.nonsingular /-
+theorem EllipticCurve.Affine.nonsingular [Nontrivial R] {x y : R} (h : E.equation x y) :
+    E.nonsingular x y :=
   E.nonsingular_of_Δ_ne_zero h <| E.coe_Δ' ▸ E.Δ'.NeZero
-#align elliptic_curve.nonsingular EllipticCurve.nonsingular
+#align elliptic_curve.nonsingular EllipticCurve.Affine.nonsingular
 -/
 
 section VariableChange
Diff
@@ -3,9 +3,9 @@ Copyright (c) 2021 Kevin Buzzard. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
 -/
-import Mathbin.Algebra.CubicDiscriminant
-import Mathbin.RingTheory.Norm
-import Mathbin.Tactic.LinearCombination
+import Algebra.CubicDiscriminant
+import RingTheory.Norm
+import Tactic.LinearCombination
 
 #align_import algebraic_geometry.elliptic_curve.weierstrass from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
 
@@ -82,15 +82,15 @@ elliptic curve, weierstrass equation, j invariant
 -/
 
 
-/- ./././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
 
Diff
@@ -288,7 +288,7 @@ def baseChange : WeierstrassCurve A :=
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_b₂ /-
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
@@ -298,7 +298,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_b₄ /-
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
@@ -308,7 +308,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_b₆ /-
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
@@ -318,7 +318,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_b₈ /-
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
@@ -329,7 +329,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_c₄ /-
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
@@ -339,7 +339,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_c₆ /-
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
@@ -349,7 +349,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.baseChange_Δ /-
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
@@ -434,7 +434,7 @@ protected noncomputable def polynomial : R[X][Y] :=
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2499254439.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4150285101.C_simp -/
 #print WeierstrassCurve.polynomial_eq /-
 theorem polynomial_eq :
     W.Polynomial =
@@ -490,7 +490,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3689701615.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3243647861.eval_simp -/
 #print WeierstrassCurve.eval_polynomial /-
 @[simp]
 theorem eval_polynomial (x y : R) :
@@ -551,8 +551,8 @@ theorem equation_iff_variableChange (x y : R) :
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.equation_iff_baseChange /-
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
@@ -592,7 +592,7 @@ noncomputable def polynomialX : R[X][Y] :=
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3689701615.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3243647861.eval_simp -/
 #print WeierstrassCurve.eval_polynomialX /-
 @[simp]
 theorem eval_polynomialX (x y : R) :
@@ -620,7 +620,7 @@ noncomputable def polynomialY : R[X][Y] :=
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3689701615.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3243647861.eval_simp -/
 #print WeierstrassCurve.eval_polynomialY /-
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
@@ -682,8 +682,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print WeierstrassCurve.nonsingular_iff_baseChange /-
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.nonsingular x y ↔ (W.base_change A).nonsingular (algebraMap R A x) (algebraMap R A y) :=
@@ -971,7 +971,7 @@ theorem norm_smul_basis (p q : R[X]) :
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2499254439.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4150285101.C_simp -/
 #print WeierstrassCurve.CoordinateRing.coe_norm_smul_basis /-
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
@@ -1163,7 +1163,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1062024125.map_simp -/
 #print EllipticCurve.baseChange_j /-
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Kevin Buzzard. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
-
-! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.weierstrass
-! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.CubicDiscriminant
 import Mathbin.RingTheory.Norm
 import Mathbin.Tactic.LinearCombination
 
+#align_import algebraic_geometry.elliptic_curve.weierstrass from "leanprover-community/mathlib"@"9240e8be927a0955b9a82c6c85ef499ee3a626b8"
+
 /-!
 # Weierstrass equations of elliptic curves
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.weierstrass
-! leanprover-community/mathlib commit e2e7f2ac359e7514e4d40061d7c08bb69487ba4e
+! leanprover-community/mathlib commit 9240e8be927a0955b9a82c6c85ef499ee3a626b8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,6 +15,9 @@ import Mathbin.Tactic.LinearCombination
 /-!
 # Weierstrass equations of elliptic curves
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the structure of an elliptic curve as a nonsingular Weierstrass curve given by a
 Weierstrass equation, which is mathematically accurate in many cases but also good for computation.
 
@@ -288,7 +291,7 @@ def baseChange : WeierstrassCurve A :=
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_b₂ /-
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
@@ -298,7 +301,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_b₄ /-
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
@@ -308,7 +311,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_b₆ /-
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
@@ -318,7 +321,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_b₈ /-
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
@@ -329,7 +332,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_c₄ /-
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
@@ -339,7 +342,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_c₆ /-
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
@@ -349,7 +352,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.baseChange_Δ /-
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
@@ -434,7 +437,7 @@ protected noncomputable def polynomial : R[X][Y] :=
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2499254439.C_simp -/
 #print WeierstrassCurve.polynomial_eq /-
 theorem polynomial_eq :
     W.Polynomial =
@@ -490,7 +493,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3689701615.eval_simp -/
 #print WeierstrassCurve.eval_polynomial /-
 @[simp]
 theorem eval_polynomial (x y : R) :
@@ -551,8 +554,8 @@ theorem equation_iff_variableChange (x y : R) :
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.equation_iff_baseChange /-
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
@@ -592,7 +595,7 @@ noncomputable def polynomialX : R[X][Y] :=
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3689701615.eval_simp -/
 #print WeierstrassCurve.eval_polynomialX /-
 @[simp]
 theorem eval_polynomialX (x y : R) :
@@ -620,7 +623,7 @@ noncomputable def polynomialY : R[X][Y] :=
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3689701615.eval_simp -/
 #print WeierstrassCurve.eval_polynomialY /-
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
@@ -682,8 +685,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print WeierstrassCurve.nonsingular_iff_baseChange /-
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.nonsingular x y ↔ (W.base_change A).nonsingular (algebraMap R A x) (algebraMap R A y) :=
@@ -971,7 +974,7 @@ theorem norm_smul_basis (p q : R[X]) :
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2499254439.C_simp -/
 #print WeierstrassCurve.CoordinateRing.coe_norm_smul_basis /-
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
@@ -1163,7 +1166,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 -/
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1810491703.map_simp -/
 #print EllipticCurve.baseChange_j /-
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
Diff
@@ -101,11 +101,13 @@ variable {R : Type u}
 /-! ## Weierstrass curves -/
 
 
+#print WeierstrassCurve /-
 /-- A Weierstrass curve $Y^2 + a_1XY + a_3Y = X^3 + a_2X^2 + a_4X + a_6$ with parameters $a_i$. -/
 @[ext]
 structure WeierstrassCurve (R : Type u) where
   (a₁ a₂ a₃ a₄ a₆ : R)
 #align weierstrass_curve WeierstrassCurve
+-/
 
 instance [Inhabited R] : Inhabited <| WeierstrassCurve R :=
   ⟨⟨default, default, default, default, default⟩⟩
@@ -119,45 +121,60 @@ section Quantity
 /-! ### Standard quantities -/
 
 
+#print WeierstrassCurve.b₂ /-
 /-- The `b₂` coefficient of a Weierstrass curve. -/
 @[simp]
 def b₂ : R :=
   W.a₁ ^ 2 + 4 * W.a₂
 #align weierstrass_curve.b₂ WeierstrassCurve.b₂
+-/
 
+#print WeierstrassCurve.b₄ /-
 /-- The `b₄` coefficient of a Weierstrass curve. -/
 @[simp]
 def b₄ : R :=
   2 * W.a₄ + W.a₁ * W.a₃
 #align weierstrass_curve.b₄ WeierstrassCurve.b₄
+-/
 
+#print WeierstrassCurve.b₆ /-
 /-- The `b₆` coefficient of a Weierstrass curve. -/
 @[simp]
 def b₆ : R :=
   W.a₃ ^ 2 + 4 * W.a₆
 #align weierstrass_curve.b₆ WeierstrassCurve.b₆
+-/
 
+#print WeierstrassCurve.b₈ /-
 /-- The `b₈` coefficient of a Weierstrass curve. -/
 @[simp]
 def b₈ : R :=
   W.a₁ ^ 2 * W.a₆ + 4 * W.a₂ * W.a₆ - W.a₁ * W.a₃ * W.a₄ + W.a₂ * W.a₃ ^ 2 - W.a₄ ^ 2
 #align weierstrass_curve.b₈ WeierstrassCurve.b₈
+-/
 
+#print WeierstrassCurve.b_relation /-
 theorem b_relation : 4 * W.b₈ = W.b₂ * W.b₆ - W.b₄ ^ 2 := by simp only [b₂, b₄, b₆, b₈]; ring1
 #align weierstrass_curve.b_relation WeierstrassCurve.b_relation
+-/
 
+#print WeierstrassCurve.c₄ /-
 /-- The `c₄` coefficient of a Weierstrass curve. -/
 @[simp]
 def c₄ : R :=
   W.b₂ ^ 2 - 24 * W.b₄
 #align weierstrass_curve.c₄ WeierstrassCurve.c₄
+-/
 
+#print WeierstrassCurve.c₆ /-
 /-- The `c₆` coefficient of a Weierstrass curve. -/
 @[simp]
 def c₆ : R :=
   -W.b₂ ^ 3 + 36 * W.b₂ * W.b₄ - 216 * W.b₆
 #align weierstrass_curve.c₆ WeierstrassCurve.c₆
+-/
 
+#print WeierstrassCurve.Δ /-
 /-- The discriminant `Δ` of a Weierstrass curve. If `R` is a field, then this polynomial vanishes
 if and only if the cubic curve cut out by this equation is singular. Sometimes only defined up to
 sign in the literature; we choose the sign used by the LMFDB. For more discussion, see
@@ -166,10 +183,13 @@ sign in the literature; we choose the sign used by the LMFDB. For more discussio
 def Δ : R :=
   -W.b₂ ^ 2 * W.b₈ - 8 * W.b₄ ^ 3 - 27 * W.b₆ ^ 2 + 9 * W.b₂ * W.b₄ * W.b₆
 #align weierstrass_curve.Δ WeierstrassCurve.Δ
+-/
 
+#print WeierstrassCurve.c_relation /-
 theorem c_relation : 1728 * W.Δ = W.c₄ ^ 3 - W.c₆ ^ 2 := by simp only [b₂, b₄, b₆, b₈, c₄, c₆, Δ];
   ring1
 #align weierstrass_curve.c_relation WeierstrassCurve.c_relation
+-/
 
 end Quantity
 
@@ -180,6 +200,7 @@ section VariableChange
 
 variable (u : Rˣ) (r s t : R)
 
+#print WeierstrassCurve.variableChange /-
 /-- The Weierstrass curve over `R` induced by an admissible linear change of variables
 $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
 @[simps]
@@ -191,24 +212,32 @@ def variableChange : WeierstrassCurve R
   a₄ := ↑u⁻¹ ^ 4 * (W.a₄ - s * W.a₃ + 2 * r * W.a₂ - (t + r * s) * W.a₁ + 3 * r ^ 2 - 2 * s * t)
   a₆ := ↑u⁻¹ ^ 6 * (W.a₆ + r * W.a₄ + r ^ 2 * W.a₂ + r ^ 3 - t * W.a₃ - t ^ 2 - r * t * W.a₁)
 #align weierstrass_curve.variable_change WeierstrassCurve.variableChange
+-/
 
+#print WeierstrassCurve.variableChange_b₂ /-
 @[simp]
 theorem variableChange_b₂ : (W.variableChange u r s t).b₂ = ↑u⁻¹ ^ 2 * (W.b₂ + 12 * r) := by
   simp only [b₂, variable_change_a₁, variable_change_a₂]; ring1
 #align weierstrass_curve.variable_change_b₂ WeierstrassCurve.variableChange_b₂
+-/
 
+#print WeierstrassCurve.variableChange_b₄ /-
 @[simp]
 theorem variableChange_b₄ :
     (W.variableChange u r s t).b₄ = ↑u⁻¹ ^ 4 * (W.b₄ + r * W.b₂ + 6 * r ^ 2) := by
   simp only [b₂, b₄, variable_change_a₁, variable_change_a₃, variable_change_a₄]; ring1
 #align weierstrass_curve.variable_change_b₄ WeierstrassCurve.variableChange_b₄
+-/
 
+#print WeierstrassCurve.variableChange_b₆ /-
 @[simp]
 theorem variableChange_b₆ :
     (W.variableChange u r s t).b₆ = ↑u⁻¹ ^ 6 * (W.b₆ + 2 * r * W.b₄ + r ^ 2 * W.b₂ + 4 * r ^ 3) :=
   by simp only [b₂, b₄, b₆, variable_change_a₃, variable_change_a₆]; ring1
 #align weierstrass_curve.variable_change_b₆ WeierstrassCurve.variableChange_b₆
+-/
 
+#print WeierstrassCurve.variableChange_b₈ /-
 @[simp]
 theorem variableChange_b₈ :
     (W.variableChange u r s t).b₈ =
@@ -218,20 +247,27 @@ theorem variableChange_b₈ :
     variable_change_a₄, variable_change_a₆]
   ring1
 #align weierstrass_curve.variable_change_b₈ WeierstrassCurve.variableChange_b₈
+-/
 
+#print WeierstrassCurve.variableChange_c₄ /-
 @[simp]
 theorem variableChange_c₄ : (W.variableChange u r s t).c₄ = ↑u⁻¹ ^ 4 * W.c₄ := by
   simp only [c₄, variable_change_b₂, variable_change_b₄]; ring1
 #align weierstrass_curve.variable_change_c₄ WeierstrassCurve.variableChange_c₄
+-/
 
+#print WeierstrassCurve.variableChange_c₆ /-
 @[simp]
 theorem variableChange_c₆ : (W.variableChange u r s t).c₆ = ↑u⁻¹ ^ 6 * W.c₆ := by
   simp only [c₆, variable_change_b₂, variable_change_b₄, variable_change_b₆]; ring1
 #align weierstrass_curve.variable_change_c₆ WeierstrassCurve.variableChange_c₆
+-/
 
+#print WeierstrassCurve.variableChange_Δ /-
 @[simp]
 theorem variableChange_Δ : (W.variableChange u r s t).Δ = ↑u⁻¹ ^ 12 * W.Δ := by dsimp; ring1
 #align weierstrass_curve.variable_change_Δ WeierstrassCurve.variableChange_Δ
+-/
 
 end VariableChange
 
@@ -243,38 +279,47 @@ section BaseChange
 /-! ### Base changes -/
 
 
+#print WeierstrassCurve.baseChange /-
 /-- The Weierstrass curve over `R` base changed to `A`. -/
 @[simps]
 def baseChange : WeierstrassCurve A :=
   ⟨algebraMap R A W.a₁, algebraMap R A W.a₂, algebraMap R A W.a₃, algebraMap R A W.a₄,
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_b₂ /-
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
   simp only [b₂, base_change_a₁, base_change_a₂];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_b₄ /-
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
   simp only [b₄, base_change_a₁, base_change_a₃, base_change_a₄];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_b₆ /-
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
   simp only [b₆, base_change_a₃, base_change_a₆];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_b₈ /-
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -282,37 +327,48 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_c₄ /-
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
   simp only [c₄, base_change_b₂, base_change_b₄];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_c₆ /-
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
   simp only [c₆, base_change_b₂, base_change_b₄, base_change_b₆];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.baseChange_Δ /-
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
   simp only [Δ, base_change_b₂, base_change_b₄, base_change_b₆, base_change_b₈];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_Δ WeierstrassCurve.baseChange_Δ
+-/
 
+#print WeierstrassCurve.baseChange_self /-
 theorem baseChange_self : W.base_change R = W := by ext <;> rfl
 #align weierstrass_curve.base_change_self WeierstrassCurve.baseChange_self
+-/
 
+#print WeierstrassCurve.baseChange_baseChange /-
 theorem baseChange_baseChange : (W.base_change A).base_change B = W.base_change B := by
   ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
 #align weierstrass_curve.base_change_base_change WeierstrassCurve.baseChange_baseChange
+-/
 
 end BaseChange
 
@@ -321,28 +377,36 @@ section TorsionPolynomial
 /-! ### 2-torsion polynomials -/
 
 
+#print WeierstrassCurve.twoTorsionPolynomial /-
 /-- A cubic polynomial whose discriminant is a multiple of the Weierstrass curve discriminant. If
 `W` is an elliptic curve over a field `R` of characteristic different from 2, then its roots over a
 splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsion points of `W`. -/
 def twoTorsionPolynomial : Cubic R :=
   ⟨4, W.b₂, 2 * W.b₄, W.b₆⟩
 #align weierstrass_curve.two_torsion_polynomial WeierstrassCurve.twoTorsionPolynomial
+-/
 
+#print WeierstrassCurve.twoTorsionPolynomial_disc /-
 theorem twoTorsionPolynomial_disc : W.twoTorsionPolynomial.disc = 16 * W.Δ := by
   dsimp [two_torsion_polynomial, Cubic.disc]; ring1
 #align weierstrass_curve.two_torsion_polynomial_disc WeierstrassCurve.twoTorsionPolynomial_disc
+-/
 
+#print WeierstrassCurve.twoTorsionPolynomial_disc_isUnit /-
 theorem twoTorsionPolynomial_disc_isUnit [Invertible (2 : R)] :
     IsUnit W.twoTorsionPolynomial.disc ↔ IsUnit W.Δ :=
   by
   rw [two_torsion_polynomial_disc, IsUnit.mul_iff, show (16 : R) = 2 ^ 4 by norm_num1]
   exact and_iff_right (isUnit_of_invertible <| 2 ^ 4)
 #align weierstrass_curve.two_torsion_polynomial_disc_is_unit WeierstrassCurve.twoTorsionPolynomial_disc_isUnit
+-/
 
+#print WeierstrassCurve.twoTorsionPolynomial_disc_ne_zero /-
 theorem twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] (hΔ : IsUnit W.Δ) :
     W.twoTorsionPolynomial.disc ≠ 0 :=
   (W.twoTorsionPolynomial_disc_isUnit.mpr hΔ).NeZero
 #align weierstrass_curve.two_torsion_polynomial_disc_ne_zero WeierstrassCurve.twoTorsionPolynomial_disc_ne_zero
+-/
 
 end TorsionPolynomial
 
@@ -359,6 +423,7 @@ open Polynomial
 
 open scoped Polynomial PolynomialPolynomial
 
+#print WeierstrassCurve.polynomial /-
 /-- The polynomial $W(X, Y) := Y^2 + a_1XY + a_3Y - (X^3 + a_2X^2 + a_4X + a_6)$ associated to a
 Weierstrass curve `W` over `R`. For ease of polynomial manipulation, this is represented as a term
 of type `R[X][X]`, where the inner variable represents $X$ and the outer variable represents $Y$.
@@ -367,8 +432,10 @@ locale to represent the outer variable and the bivariate polynomial ring `R[X][X
 protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
+#print WeierstrassCurve.polynomial_eq /-
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -378,25 +445,35 @@ theorem polynomial_eq :
     C_simp;
   ring1
 #align weierstrass_curve.polynomial_eq WeierstrassCurve.polynomial_eq
+-/
 
+#print WeierstrassCurve.polynomial_ne_zero /-
 theorem polynomial_ne_zero [Nontrivial R] : W.Polynomial ≠ 0 := by rw [polynomial_eq];
   exact Cubic.ne_zero_of_b_ne_zero one_ne_zero
 #align weierstrass_curve.polynomial_ne_zero WeierstrassCurve.polynomial_ne_zero
+-/
 
+#print WeierstrassCurve.degree_polynomial /-
 @[simp]
 theorem degree_polynomial [Nontrivial R] : W.Polynomial.degree = 2 := by rw [polynomial_eq];
   exact Cubic.degree_of_b_ne_zero' one_ne_zero
 #align weierstrass_curve.degree_polynomial WeierstrassCurve.degree_polynomial
+-/
 
+#print WeierstrassCurve.natDegree_polynomial /-
 @[simp]
 theorem natDegree_polynomial [Nontrivial R] : W.Polynomial.natDegree = 2 := by rw [polynomial_eq];
   exact Cubic.natDegree_of_b_ne_zero' one_ne_zero
 #align weierstrass_curve.nat_degree_polynomial WeierstrassCurve.natDegree_polynomial
+-/
 
+#print WeierstrassCurve.monic_polynomial /-
 theorem monic_polynomial : W.Polynomial.Monic := by nontriviality R;
   simpa only [polynomial_eq] using Cubic.monic_of_b_eq_one'
 #align weierstrass_curve.monic_polynomial WeierstrassCurve.monic_polynomial
+-/
 
+#print WeierstrassCurve.irreducible_polynomial /-
 theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   by
   by_contra h
@@ -411,8 +488,10 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+#print WeierstrassCurve.eval_polynomial /-
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| C y).eval x =
@@ -422,47 +501,61 @@ theorem eval_polynomial (x y : R) :
     eval_simp;
   rw [add_mul, ← add_assoc]
 #align weierstrass_curve.eval_polynomial WeierstrassCurve.eval_polynomial
+-/
 
+#print WeierstrassCurve.eval_polynomial_zero /-
 @[simp]
 theorem eval_polynomial_zero : (W.Polynomial.eval 0).eval 0 = -W.a₆ := by
   simp only [← C_0, eval_polynomial, zero_add, zero_sub, MulZeroClass.mul_zero,
     zero_pow (Nat.zero_lt_succ _)]
 #align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.eval_polynomial_zero
+-/
 
+#print WeierstrassCurve.equation /-
 /-- The proposition that an affine point $(x, y)$ lies in `W`. In other words, $W(x, y) = 0$. -/
-def Equation (x y : R) : Prop :=
+def equation (x y : R) : Prop :=
   (W.Polynomial.eval <| C y).eval x = 0
-#align weierstrass_curve.equation WeierstrassCurve.Equation
+#align weierstrass_curve.equation WeierstrassCurve.equation
+-/
 
+#print WeierstrassCurve.equation_iff' /-
 theorem equation_iff' (x y : R) :
-    W.Equation x y ↔
+    W.equation x y ↔
       y ^ 2 + W.a₁ * x * y + W.a₃ * y - (x ^ 3 + W.a₂ * x ^ 2 + W.a₄ * x + W.a₆) = 0 :=
   by rw [equation, eval_polynomial]
 #align weierstrass_curve.equation_iff' WeierstrassCurve.equation_iff'
+-/
 
+#print WeierstrassCurve.equation_iff /-
 @[simp]
 theorem 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
+    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]
 #align weierstrass_curve.equation_iff WeierstrassCurve.equation_iff
+-/
 
+#print WeierstrassCurve.equation_zero /-
 @[simp]
-theorem equation_zero : W.Equation 0 0 ↔ W.a₆ = 0 := by
+theorem equation_zero : W.equation 0 0 ↔ W.a₆ = 0 := by
   rw [equation, C_0, eval_polynomial_zero, neg_eq_zero]
 #align weierstrass_curve.equation_zero WeierstrassCurve.equation_zero
+-/
 
+#print WeierstrassCurve.equation_iff_variableChange /-
 theorem equation_iff_variableChange (x y : R) :
-    W.Equation x y ↔ (W.variableChange 1 x 0 y).Equation 0 0 :=
+    W.equation x y ↔ (W.variableChange 1 x 0 y).equation 0 0 :=
   by
   rw [equation_iff', ← neg_eq_zero, equation_zero, variable_change_a₆, inv_one, Units.val_one]
   congr 2
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.equation_iff_baseChange /-
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
+    W.equation x y ↔ (W.base_change A).equation (algebraMap R A x) (algebraMap R A y) :=
   by
   simp only [equation_iff]
   refine' ⟨fun h => _, fun h => _⟩
@@ -477,24 +570,30 @@ theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R
       map_simp;
     exact h
 #align weierstrass_curve.equation_iff_base_change WeierstrassCurve.equation_iff_baseChange
+-/
 
+#print WeierstrassCurve.equation_iff_baseChange_of_baseChange /-
 theorem equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
-    (W.base_change A).Equation x y ↔
-      (W.base_change B).Equation (algebraMap A B x) (algebraMap A B y) :=
+    (W.base_change A).equation x y ↔
+      (W.base_change B).equation (algebraMap A B x) (algebraMap A B y) :=
   by rw [equation_iff_base_change (W.base_change A) B, base_change_base_change]
 #align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.equation_iff_baseChange_of_baseChange
+-/
 
 /-! ### Nonsingularity of Weierstrass curves -/
 
 
+#print WeierstrassCurve.polynomialX /-
 /-- The partial derivative $W_X(X, Y)$ of $W(X, Y)$ with respect to $X$.
 
 TODO: define this in terms of `polynomial.derivative`. -/
 noncomputable def polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+#print WeierstrassCurve.eval_polynomialX /-
 @[simp]
 theorem 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
@@ -502,21 +601,27 @@ theorem eval_polynomialX (x y : R) :
   run_tac
     eval_simp
 #align weierstrass_curve.eval_polynomial_X WeierstrassCurve.eval_polynomialX
+-/
 
+#print WeierstrassCurve.eval_polynomialX_zero /-
 @[simp]
 theorem eval_polynomialX_zero : (W.polynomialX.eval 0).eval 0 = -W.a₄ := by
   simp only [← C_0, eval_polynomial_X, zero_add, zero_sub, MulZeroClass.mul_zero,
     zero_pow zero_lt_two]
 #align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.eval_polynomialX_zero
+-/
 
+#print WeierstrassCurve.polynomialY /-
 /-- The partial derivative $W_Y(X, Y)$ of $W(X, Y)$ with respect to $Y$.
 
 TODO: define this in terms of `polynomial.derivative`. -/
 noncomputable def polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+#print WeierstrassCurve.eval_polynomialY /-
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by simp only [polynomial_Y];
@@ -524,50 +629,64 @@ theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y
     eval_simp;
   rw [← add_assoc]
 #align weierstrass_curve.eval_polynomial_Y WeierstrassCurve.eval_polynomialY
+-/
 
+#print WeierstrassCurve.eval_polynomialY_zero /-
 @[simp]
 theorem eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
   simp only [← C_0, eval_polynomial_Y, zero_add, MulZeroClass.mul_zero]
 #align weierstrass_curve.eval_polynomial_Y_zero WeierstrassCurve.eval_polynomialY_zero
+-/
 
+#print WeierstrassCurve.nonsingular /-
 /-- The proposition that an affine point $(x, y)$ on `W` is nonsingular.
 In other words, either $W_X(x, y) \ne 0$ or $W_Y(x, y) \ne 0$. -/
-def Nonsingular (x y : R) : Prop :=
-  W.Equation x y ∧ ((W.polynomialX.eval <| C y).eval x ≠ 0 ∨ (W.polynomialY.eval <| C y).eval x ≠ 0)
-#align weierstrass_curve.nonsingular WeierstrassCurve.Nonsingular
+def nonsingular (x y : R) : Prop :=
+  W.equation x y ∧ ((W.polynomialX.eval <| C y).eval x ≠ 0 ∨ (W.polynomialY.eval <| C y).eval x ≠ 0)
+#align weierstrass_curve.nonsingular WeierstrassCurve.nonsingular
+-/
 
+#print WeierstrassCurve.nonsingular_iff' /-
 theorem nonsingular_iff' (x y : R) :
-    W.Nonsingular x y ↔
-      W.Equation x y ∧
+    W.nonsingular x y ↔
+      W.equation x y ∧
         (W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) ≠ 0 ∨ 2 * y + W.a₁ * x + W.a₃ ≠ 0) :=
   by rw [nonsingular, equation_iff', eval_polynomial_X, eval_polynomial_Y]
 #align weierstrass_curve.nonsingular_iff' WeierstrassCurve.nonsingular_iff'
+-/
 
+#print WeierstrassCurve.nonsingular_iff /-
 @[simp]
 theorem 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₃) :=
+    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 _ _ y]; congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff WeierstrassCurve.nonsingular_iff
+-/
 
+#print WeierstrassCurve.nonsingular_zero /-
 @[simp]
-theorem nonsingular_zero : W.Nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0) := by
+theorem nonsingular_zero : W.nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0) := by
   rw [nonsingular, equation_zero, C_0, eval_polynomial_X_zero, neg_ne_zero, eval_polynomial_Y_zero,
     or_comm']
 #align weierstrass_curve.nonsingular_zero WeierstrassCurve.nonsingular_zero
+-/
 
+#print WeierstrassCurve.nonsingular_iff_variableChange /-
 theorem nonsingular_iff_variableChange (x y : R) :
-    W.Nonsingular x y ↔ (W.variableChange 1 x 0 y).Nonsingular 0 0 :=
+    W.nonsingular x y ↔ (W.variableChange 1 x 0 y).nonsingular 0 0 :=
   by
   rw [nonsingular_iff', equation_iff_variable_change, equation_zero, ← neg_ne_zero, or_comm',
     nonsingular_zero, variable_change_a₃, variable_change_a₄, inv_one, Units.val_one]
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print WeierstrassCurve.nonsingular_iff_baseChange /-
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
+    W.nonsingular x y ↔ (W.base_change A).nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
   rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_base_change A x y]
   refine'
@@ -584,28 +703,36 @@ theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y
           map_simp;
         rfl
 #align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.nonsingular_iff_baseChange
+-/
 
+#print WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange /-
 theorem nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
-    (W.base_change A).Nonsingular x y ↔
-      (W.base_change B).Nonsingular (algebraMap A B x) (algebraMap A B y) :=
+    (W.base_change A).nonsingular x y ↔
+      (W.base_change B).nonsingular (algebraMap A B x) (algebraMap A B y) :=
   by rw [nonsingular_iff_base_change (W.base_change A) B, base_change_base_change]
 #align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange
+-/
 
-theorem nonsingular_zero_of_Δ_ne_zero (h : W.Equation 0 0) (hΔ : W.Δ ≠ 0) : W.Nonsingular 0 0 := by
+#print WeierstrassCurve.nonsingular_zero_of_Δ_ne_zero /-
+theorem nonsingular_zero_of_Δ_ne_zero (h : W.equation 0 0) (hΔ : W.Δ ≠ 0) : W.nonsingular 0 0 := by
   simp only [equation_zero, nonsingular_zero] at *; contrapose! hΔ; simp [h, hΔ]
 #align weierstrass_curve.nonsingular_zero_of_Δ_ne_zero WeierstrassCurve.nonsingular_zero_of_Δ_ne_zero
+-/
 
+#print WeierstrassCurve.nonsingular_of_Δ_ne_zero /-
 /-- A Weierstrass curve is nonsingular at every point if its discriminant is non-zero. -/
-theorem nonsingular_of_Δ_ne_zero {x y : R} (h : W.Equation x y) (hΔ : W.Δ ≠ 0) :
-    W.Nonsingular x y :=
+theorem nonsingular_of_Δ_ne_zero {x y : R} (h : W.equation x y) (hΔ : W.Δ ≠ 0) :
+    W.nonsingular x y :=
   (W.nonsingular_iff_variableChange x y).mpr <|
     nonsingular_zero_of_Δ_ne_zero _ ((W.equation_iff_variableChange x y).mp h) <| by
       rwa [variable_change_Δ, inv_one, Units.val_one, one_pow, one_mul]
 #align weierstrass_curve.nonsingular_of_Δ_ne_zero WeierstrassCurve.nonsingular_of_Δ_ne_zero
+-/
 
 /-! ### Ideals in the coordinate ring -/
 
 
+#print WeierstrassCurve.CoordinateRing /-
 /-- The coordinate ring $R[W] := R[X, Y] / \langle W(X, Y) \rangle$ of `W`.
 
 Note that `derive comm_ring` generates a reducible instance of `comm_ring` for `coordinate_ring`.
@@ -621,11 +748,14 @@ def CoordinateRing : Type u :=
   AdjoinRoot W.Polynomial
 deriving Inhabited, CommRing
 #align weierstrass_curve.coordinate_ring WeierstrassCurve.CoordinateRing
+-/
 
+#print WeierstrassCurve.FunctionField /-
 /-- The function field $R(W) := \mathrm{Frac}(R[W])$ of `W`. -/
 abbrev FunctionField : Type u :=
   FractionRing W.CoordinateRing
 #align weierstrass_curve.function_field WeierstrassCurve.FunctionField
+-/
 
 namespace CoordinateRing
 
@@ -636,51 +766,67 @@ instance [IsDomain R] [NormalizedGCDMonoid R] : IsDomain W.CoordinateRing :=
     simpa only [span_singleton_prime W.polynomial_ne_zero, ← GCDMonoid.irreducible_iff_prime] using
       W.irreducible_polynomial
 
-instance isDomain_of_field {F : Type u} [Field F] (W : WeierstrassCurve F) :
+#print WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing_of_Field /-
+instance instIsDomainCoordinateRing_of_Field {F : Type u} [Field F] (W : WeierstrassCurve F) :
     IsDomain W.CoordinateRing := by classical infer_instance
-#align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.CoordinateRing.isDomain_of_field
+#align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing_of_Field
+-/
 
 variable (x : R) (y : R[X])
 
+#print WeierstrassCurve.CoordinateRing.XClass /-
 /-- The class of the element $X - x$ in $R[W]$ for some $x \in R$. -/
 @[simp]
-noncomputable def xClass : W.CoordinateRing :=
+noncomputable def XClass : W.CoordinateRing :=
   AdjoinRoot.mk W.Polynomial <| C <| X - C x
-#align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.CoordinateRing.xClass
+#align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.CoordinateRing.XClass
+-/
 
-theorem xClass_ne_zero [Nontrivial R] : xClass W x ≠ 0 :=
+#print WeierstrassCurve.CoordinateRing.XClass_ne_zero /-
+theorem XClass_ne_zero [Nontrivial R] : XClass W x ≠ 0 :=
   AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| X_sub_C_ne_zero x) <|
     by rw [nat_degree_polynomial, nat_degree_C]; norm_num1
-#align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.CoordinateRing.xClass_ne_zero
+#align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.CoordinateRing.XClass_ne_zero
+-/
 
+#print WeierstrassCurve.CoordinateRing.YClass /-
 /-- The class of the element $Y - y(X)$ in $R[W]$ for some $y(X) \in R[X]$. -/
 @[simp]
-noncomputable def yClass : W.CoordinateRing :=
+noncomputable def YClass : W.CoordinateRing :=
   AdjoinRoot.mk W.Polynomial <| Y - C y
-#align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.yClass
+#align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.YClass
+-/
 
-theorem yClass_ne_zero [Nontrivial R] : yClass W y ≠ 0 :=
+#print WeierstrassCurve.CoordinateRing.YClass_ne_zero /-
+theorem YClass_ne_zero [Nontrivial R] : YClass W y ≠ 0 :=
   AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (X_sub_C_ne_zero y) <| by
     rw [nat_degree_polynomial, nat_degree_X_sub_C]; norm_num1
-#align weierstrass_curve.coordinate_ring.Y_class_ne_zero WeierstrassCurve.CoordinateRing.yClass_ne_zero
+#align weierstrass_curve.coordinate_ring.Y_class_ne_zero WeierstrassCurve.CoordinateRing.YClass_ne_zero
+-/
 
+#print WeierstrassCurve.CoordinateRing.XIdeal /-
 /-- The ideal $\langle X - x \rangle$ of $R[W]$ for some $x \in R$. -/
 @[simp]
-noncomputable def xIdeal : Ideal W.CoordinateRing :=
-  span {xClass W x}
-#align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.CoordinateRing.xIdeal
+noncomputable def XIdeal : Ideal W.CoordinateRing :=
+  span {XClass W x}
+#align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.CoordinateRing.XIdeal
+-/
 
+#print WeierstrassCurve.CoordinateRing.YIdeal /-
 /-- The ideal $\langle Y - y(X) \rangle$ of $R[W]$ for some $y(X) \in R[X]$. -/
 @[simp]
-noncomputable def yIdeal : Ideal W.CoordinateRing :=
-  span {yClass W y}
-#align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.CoordinateRing.yIdeal
+noncomputable def YIdeal : Ideal W.CoordinateRing :=
+  span {YClass W y}
+#align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.CoordinateRing.YIdeal
+-/
 
+#print WeierstrassCurve.CoordinateRing.XYIdeal /-
 /-- The ideal $\langle X - x, Y - y(X) \rangle$ of $R[W]$ for some $x \in R$ and $y(X) \in R[X]$. -/
 @[simp]
-noncomputable def xYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
-  span {xClass W x, yClass W y}
-#align weierstrass_curve.coordinate_ring.XY_ideal WeierstrassCurve.CoordinateRing.xYIdeal
+noncomputable def XYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
+  span {XClass W x, YClass W y}
+#align weierstrass_curve.coordinate_ring.XY_ideal WeierstrassCurve.CoordinateRing.XYIdeal
+-/
 
 /-! ### The coordinate ring as an `R[X]`-algebra -/
 
@@ -688,9 +834,11 @@ noncomputable def xYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
 noncomputable instance : Algebra R[X] W.CoordinateRing :=
   Quotient.algebra R[X]
 
-noncomputable instance algebra' : Algebra R W.CoordinateRing :=
+#print WeierstrassCurve.CoordinateRing.instAlgebraCoordinateRing' /-
+noncomputable instance instAlgebraCoordinateRing' : Algebra R W.CoordinateRing :=
   Quotient.algebra R
-#align weierstrass_curve.coordinate_ring.algebra' WeierstrassCurve.CoordinateRing.algebra'
+#align weierstrass_curve.coordinate_ring.algebra' WeierstrassCurve.CoordinateRing.instAlgebraCoordinateRing'
+-/
 
 instance : IsScalarTower R R[X] W.CoordinateRing :=
   Quotient.isScalarTower R R[X] _
@@ -698,10 +846,11 @@ instance : IsScalarTower R R[X] W.CoordinateRing :=
 instance [Subsingleton R] : Subsingleton W.CoordinateRing :=
   Module.subsingleton R[X] _
 
+#print WeierstrassCurve.CoordinateRing.quotientXYIdealEquiv /-
 /-- The $R$-algebra isomorphism from $R[W] / \langle X - x, Y - y(X) \rangle$ to $R$ obtained by
 evaluation at $y(X)$ and at $x$ provided that $W(x, y(x)) = 0$. -/
 noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W.Polynomial.eval y).eval x = 0) :
-    (W.CoordinateRing ⧸ xYIdeal W x y) ≃ₐ[R] R :=
+    (W.CoordinateRing ⧸ XYIdeal W x y) ≃ₐ[R] R :=
   (quotientEquivAlgOfEq R <| by
         simpa only [XY_ideal, X_class, Y_class, ← Set.image_pair, ← map_span]).trans <|
     (DoubleQuot.quotQuotEquivQuotOfLEₐ R <|
@@ -710,7 +859,9 @@ noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W.Polynomial.eva
       ((quotientSpanCXSubCAlgEquiv (X - C x) y).restrictScalars R).trans <|
         quotientSpanXSubCAlgEquiv x
 #align weierstrass_curve.coordinate_ring.quotient_XY_ideal_equiv WeierstrassCurve.CoordinateRing.quotientXYIdealEquiv
+-/
 
+#print WeierstrassCurve.CoordinateRing.basis /-
 /-- The basis $\{1, Y\}$ for the coordinate ring $R[W]$ over the polynomial ring $R[X]$.
 
 Given a Weierstrass curve `W`, write `W^.coordinate_ring.basis` for this basis. -/
@@ -718,7 +869,9 @@ protected noncomputable def basis : Basis (Fin 2) R[X] W.CoordinateRing :=
   (subsingleton_or_nontrivial R).byCases (fun _ => default) fun _ =>
     (AdjoinRoot.powerBasis' W.monic_polynomial).Basis.reindex <| finCongr W.nat_degree_polynomial
 #align weierstrass_curve.coordinate_ring.basis WeierstrassCurve.CoordinateRing.basis
+-/
 
+#print WeierstrassCurve.CoordinateRing.basis_apply /-
 theorem basis_apply (n : Fin 2) :
     W.CoordinateRing.Basis n = (AdjoinRoot.powerBasis' W.monic_polynomial).gen ^ (n : ℕ) := by
   classical
@@ -726,26 +879,36 @@ theorem basis_apply (n : Fin 2) :
   simpa only [coordinate_ring.basis, Or.by_cases, dif_neg (not_subsingleton R), Basis.reindex_apply,
     PowerBasis.basis_eq_pow]
 #align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.CoordinateRing.basis_apply
+-/
 
+#print WeierstrassCurve.CoordinateRing.basis_zero /-
 theorem basis_zero : W.CoordinateRing.Basis 0 = 1 := by simpa only [basis_apply] using pow_zero _
 #align weierstrass_curve.coordinate_ring.basis_zero WeierstrassCurve.CoordinateRing.basis_zero
+-/
 
+#print WeierstrassCurve.CoordinateRing.basis_one /-
 theorem basis_one : W.CoordinateRing.Basis 1 = AdjoinRoot.mk W.Polynomial Y := by
   simpa only [basis_apply] using pow_one _
 #align weierstrass_curve.coordinate_ring.basis_one WeierstrassCurve.CoordinateRing.basis_one
+-/
 
+#print WeierstrassCurve.CoordinateRing.coe_basis /-
 @[simp]
 theorem coe_basis :
     (W.CoordinateRing.Basis : Fin 2 → W.CoordinateRing) = ![1, AdjoinRoot.mk W.Polynomial Y] := by
   ext n; fin_cases n; exacts [basis_zero W, basis_one W]
 #align weierstrass_curve.coordinate_ring.coe_basis WeierstrassCurve.CoordinateRing.coe_basis
+-/
 
 variable {W}
 
+#print WeierstrassCurve.CoordinateRing.smul /-
 theorem smul (x : R[X]) (y : W.CoordinateRing) : x • y = AdjoinRoot.mk W.Polynomial (C x) * y :=
   (algebraMap_smul W.CoordinateRing x y).symm
 #align weierstrass_curve.coordinate_ring.smul WeierstrassCurve.CoordinateRing.smul
+-/
 
+#print WeierstrassCurve.CoordinateRing.smul_basis_eq_zero /-
 theorem smul_basis_eq_zero {p q : R[X]} (hpq : p • 1 + q • AdjoinRoot.mk W.Polynomial Y = 0) :
     p = 0 ∧ q = 0 :=
   by
@@ -753,7 +916,9 @@ theorem smul_basis_eq_zero {p q : R[X]} (hpq : p • 1 + q • AdjoinRoot.mk W.P
   erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h 
   exact ⟨h hpq 0, h hpq 1⟩
 #align weierstrass_curve.coordinate_ring.smul_basis_eq_zero WeierstrassCurve.CoordinateRing.smul_basis_eq_zero
+-/
 
+#print WeierstrassCurve.CoordinateRing.exists_smul_basis_eq /-
 theorem exists_smul_basis_eq (x : W.CoordinateRing) :
     ∃ p q : R[X], p • 1 + q • AdjoinRoot.mk W.Polynomial Y = x :=
   by
@@ -761,15 +926,19 @@ theorem exists_smul_basis_eq (x : W.CoordinateRing) :
   erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h 
   exact ⟨_, _, h⟩
 #align weierstrass_curve.coordinate_ring.exists_smul_basis_eq WeierstrassCurve.CoordinateRing.exists_smul_basis_eq
+-/
 
 variable (W)
 
-theorem smul_basis_mul_c (p q : R[X]) :
+#print WeierstrassCurve.CoordinateRing.smul_basis_mul_C /-
+theorem smul_basis_mul_C (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial (C y) =
       (p * y) • 1 + (q * y) • AdjoinRoot.mk W.Polynomial Y :=
   by simp only [smul, _root_.map_mul]; ring1
-#align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.CoordinateRing.smul_basis_mul_c
+#align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.CoordinateRing.smul_basis_mul_C
+-/
 
+#print WeierstrassCurve.CoordinateRing.smul_basis_mul_Y /-
 theorem smul_basis_mul_Y (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial Y =
       (q * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)) • 1 +
@@ -783,10 +952,12 @@ theorem smul_basis_mul_Y (p q : R[X]) :
   simp only [smul, add_mul, mul_assoc, ← sq, Y_sq, map_sub, _root_.map_mul]
   ring1
 #align weierstrass_curve.coordinate_ring.smul_basis_mul_Y WeierstrassCurve.CoordinateRing.smul_basis_mul_Y
+-/
 
 /-! ### Norms on the coordinate ring -/
 
 
+#print WeierstrassCurve.CoordinateRing.norm_smul_basis /-
 theorem norm_smul_basis (p q : R[X]) :
     Algebra.norm R[X] (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       p ^ 2 - p * q * (C W.a₁ * X + C W.a₃) -
@@ -798,8 +969,10 @@ theorem norm_smul_basis (p q : R[X]) :
     Basis.repr_self_apply, if_pos, if_neg one_ne_zero, if_neg zero_ne_one, smul_eq_mul]
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
+#print WeierstrassCurve.CoordinateRing.coe_norm_smul_basis /-
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-Y - C (C W.a₁ * X + C W.a₃)))) :=
@@ -809,7 +982,9 @@ theorem coe_norm_smul_basis (p q : R[X]) :
         C_simp;
       ring1⟩
 #align weierstrass_curve.coordinate_ring.coe_norm_smul_basis WeierstrassCurve.CoordinateRing.coe_norm_smul_basis
+-/
 
+#print WeierstrassCurve.CoordinateRing.degree_norm_smul_basis /-
 theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
     (Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y).degree =
       max (2 • p.degree) (2 • q.degree + 3) :=
@@ -849,9 +1024,11 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
         rw [hdp] <;>
       exact with_bot.coe_lt_coe.mpr (by linarith only [hpq])
 #align weierstrass_curve.coordinate_ring.degree_norm_smul_basis WeierstrassCurve.CoordinateRing.degree_norm_smul_basis
+-/
 
 variable {W}
 
+#print WeierstrassCurve.CoordinateRing.degree_norm_ne_one /-
 theorem degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) : (Algebra.norm R[X] x).degree ≠ 1 :=
   by
   rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
@@ -860,11 +1037,14 @@ theorem degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) : (Algebra.norm R
   any_goals rintro (_ | _)
   exact (lt_max_of_lt_right (by decide)).ne'
 #align weierstrass_curve.coordinate_ring.degree_norm_ne_one WeierstrassCurve.CoordinateRing.degree_norm_ne_one
+-/
 
+#print WeierstrassCurve.CoordinateRing.natDegree_norm_ne_one /-
 theorem natDegree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
     (Algebra.norm R[X] x).natDegree ≠ 1 :=
   mt (degree_eq_iff_natDegree_eq_of_pos zero_lt_one).mpr <| degree_norm_ne_one x
 #align weierstrass_curve.coordinate_ring.nat_degree_norm_ne_one WeierstrassCurve.CoordinateRing.natDegree_norm_ne_one
+-/
 
 end CoordinateRing
 
@@ -875,6 +1055,7 @@ end WeierstrassCurve
 /-! ## Elliptic curves -/
 
 
+#print EllipticCurve /-
 /-- An elliptic curve over a commutative ring. Note that this definition is only mathematically
 accurate for certain rings whose Picard group has trivial 12-torsion, such as a field or a PID. -/
 @[ext]
@@ -882,6 +1063,7 @@ structure EllipticCurve (R : Type u) [CommRing R] extends WeierstrassCurve R whe
   Δ' : Rˣ
   coe_Δ' : ↑Δ' = to_weierstrass_curve.Δ
 #align elliptic_curve EllipticCurve
+-/
 
 instance : Inhabited <| EllipticCurve ℚ :=
   ⟨⟨⟨0, 0, 1, -1, 0⟩, ⟨37, 37⁻¹, by norm_num1, by norm_num1⟩, by dsimp; ring1⟩⟩
@@ -890,20 +1072,26 @@ namespace EllipticCurve
 
 variable [CommRing R] (E : EllipticCurve R)
 
+#print EllipticCurve.j /-
 /-- The j-invariant `j` of an elliptic curve, which is invariant under isomorphisms over `R`. -/
 @[simp]
 def j : R :=
   ↑E.Δ'⁻¹ * E.c₄ ^ 3
 #align elliptic_curve.j EllipticCurve.j
+-/
 
+#print EllipticCurve.twoTorsionPolynomial_disc_ne_zero /-
 theorem twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] :
     E.twoTorsionPolynomial.disc ≠ 0 :=
   E.twoTorsionPolynomial_disc_ne_zero <| E.coe_Δ' ▸ E.Δ'.IsUnit
 #align elliptic_curve.two_torsion_polynomial_disc_ne_zero EllipticCurve.twoTorsionPolynomial_disc_ne_zero
+-/
 
-theorem nonsingular [Nontrivial R] {x y : R} (h : E.Equation x y) : E.Nonsingular x y :=
+#print EllipticCurve.nonsingular /-
+theorem nonsingular [Nontrivial R] {x y : R} (h : E.equation x y) : E.nonsingular x y :=
   E.nonsingular_of_Δ_ne_zero h <| E.coe_Δ' ▸ E.Δ'.NeZero
 #align elliptic_curve.nonsingular EllipticCurve.nonsingular
+-/
 
 section VariableChange
 
@@ -912,6 +1100,7 @@ section VariableChange
 
 variable (u : Rˣ) (r s t : R)
 
+#print EllipticCurve.variableChange /-
 /-- The elliptic curve over `R` induced by an admissible linear change of variables
 $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
 When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
@@ -920,15 +1109,21 @@ def variableChange : EllipticCurve R :=
   ⟨E.variableChange u r s t, u⁻¹ ^ 12 * E.Δ', by
     rw [Units.val_mul, Units.val_pow_eq_pow_val, coe_Δ', E.variable_change_Δ]⟩
 #align elliptic_curve.variable_change EllipticCurve.variableChange
+-/
 
+#print EllipticCurve.coe_variableChange_Δ' /-
 theorem coe_variableChange_Δ' : (↑(E.variableChange u r s t).Δ' : R) = ↑u⁻¹ ^ 12 * E.Δ' := by
   rw [variable_change_Δ', Units.val_mul, Units.val_pow_eq_pow_val]
 #align elliptic_curve.coe_variable_change_Δ' EllipticCurve.coe_variableChange_Δ'
+-/
 
+#print EllipticCurve.coe_inv_variableChange_Δ' /-
 theorem coe_inv_variableChange_Δ' : (↑(E.variableChange u r s t).Δ'⁻¹ : R) = u ^ 12 * ↑E.Δ'⁻¹ := by
   rw [variable_change_Δ', mul_inv, inv_pow, inv_inv, Units.val_mul, Units.val_pow_eq_pow_val]
 #align elliptic_curve.coe_inv_variable_change_Δ' EllipticCurve.coe_inv_variableChange_Δ'
+-/
 
+#print EllipticCurve.variableChange_j /-
 @[simp]
 theorem variableChange_j : (E.variableChange u r s t).j = E.j :=
   by
@@ -936,6 +1131,7 @@ theorem variableChange_j : (E.variableChange u r s t).j = E.j :=
   have hu : (u * ↑u⁻¹ : R) ^ 12 = 1 := by rw [u.mul_inv, one_pow]
   linear_combination (norm := (dsimp; ring1)) E.j * hu
 #align elliptic_curve.variable_change_j EllipticCurve.variableChange_j
+-/
 
 end VariableChange
 
@@ -946,22 +1142,29 @@ section BaseChange
 
 variable (A : Type v) [CommRing A] [Algebra R A]
 
+#print EllipticCurve.baseChange /-
 /-- The elliptic curve over `R` base changed to `A`. -/
 @[simps]
 def baseChange : EllipticCurve A :=
   ⟨E.base_change A, Units.map (↑(algebraMap R A)) E.Δ', by
     rw [Units.coe_map, RingHom.coe_monoidHom, coe_Δ', E.base_change_Δ]⟩
 #align elliptic_curve.base_change EllipticCurve.baseChange
+-/
 
-theorem coeBase_change_Δ' : ↑(E.base_change A).Δ' = algebraMap R A E.Δ' :=
+#print EllipticCurve.coeBaseChange_Δ' /-
+theorem coeBaseChange_Δ' : ↑(E.base_change A).Δ' = algebraMap R A E.Δ' :=
   rfl
-#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBase_change_Δ'
+#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBaseChange_Δ'
+-/
 
+#print EllipticCurve.coe_inv_baseChange_Δ' /-
 theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A ↑E.Δ'⁻¹ :=
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
+-/
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+#print EllipticCurve.baseChange_j /-
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
@@ -969,6 +1172,7 @@ theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   run_tac
     map_simp
 #align elliptic_curve.base_change_j EllipticCurve.baseChange_j
+-/
 
 end BaseChange
 
Diff
@@ -250,7 +250,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
   simp only [b₂, base_change_a₁, base_change_a₂];
@@ -258,7 +258,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
   simp only [b₄, base_change_a₁, base_change_a₃, base_change_a₄];
@@ -266,7 +266,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
   simp only [b₆, base_change_a₃, base_change_a₆];
@@ -274,7 +274,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -283,7 +283,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
   simp only [c₄, base_change_b₂, base_change_b₄];
@@ -291,7 +291,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
   simp only [c₆, base_change_b₂, base_change_b₄, base_change_b₆];
@@ -299,7 +299,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
   simp only [Δ, base_change_b₂, base_change_b₄, base_change_b₆, base_change_b₈];
@@ -368,7 +368,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4289455181.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -412,7 +412,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| C y).eval x =
@@ -459,8 +459,8 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -494,7 +494,7 @@ noncomputable def polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
 @[simp]
 theorem 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
@@ -516,7 +516,7 @@ noncomputable def polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by simp only [polynomial_Y];
@@ -564,8 +564,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -799,7 +799,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4289455181.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-Y - C (C W.a₁ * X + C W.a₃)))) :=
@@ -961,7 +961,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.weierstrass
-! leanprover-community/mathlib commit 03994e05d8bfc59a41d2ec99523d6553d21848ac
+! leanprover-community/mathlib commit e2e7f2ac359e7514e4d40061d7c08bb69487ba4e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -15,7 +15,7 @@ import Mathbin.Tactic.LinearCombination
 /-!
 # Weierstrass equations of elliptic curves
 
-We give a working definition of an elliptic curve as a nonsingular Weierstrass curve given by a
+This file defines the structure of an elliptic curve as a nonsingular Weierstrass curve given by a
 Weierstrass equation, which is mathematically accurate in many cases but also good for computation.
 
 ## Mathematical background
@@ -357,7 +357,7 @@ section Polynomial
 
 open Polynomial
 
-open scoped Polynomial
+open scoped Polynomial PolynomialPolynomial
 
 /-- The polynomial $W(X, Y) := Y^2 + a_1XY + a_3Y - (X^3 + a_2X^2 + a_4X + a_6)$ associated to a
 Weierstrass curve `W` over `R`. For ease of polynomial manipulation, this is represented as a term
@@ -629,10 +629,12 @@ abbrev FunctionField : Type u :=
 
 namespace CoordinateRing
 
+open Ideal
+
 instance [IsDomain R] [NormalizedGCDMonoid R] : IsDomain W.CoordinateRing :=
-  (Ideal.Quotient.isDomain_iff_prime _).mpr <| by
-    simpa only [Ideal.span_singleton_prime W.polynomial_ne_zero, ←
-      GCDMonoid.irreducible_iff_prime] using W.irreducible_polynomial
+  (Quotient.isDomain_iff_prime _).mpr <| by
+    simpa only [span_singleton_prime W.polynomial_ne_zero, ← GCDMonoid.irreducible_iff_prime] using
+      W.irreducible_polynomial
 
 instance isDomain_of_field {F : Type u} [Field F] (W : WeierstrassCurve F) :
     IsDomain W.CoordinateRing := by classical infer_instance
@@ -665,31 +667,50 @@ theorem yClass_ne_zero [Nontrivial R] : yClass W y ≠ 0 :=
 /-- The ideal $\langle X - x \rangle$ of $R[W]$ for some $x \in R$. -/
 @[simp]
 noncomputable def xIdeal : Ideal W.CoordinateRing :=
-  Ideal.span {xClass W x}
+  span {xClass W x}
 #align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.CoordinateRing.xIdeal
 
 /-- The ideal $\langle Y - y(X) \rangle$ of $R[W]$ for some $y(X) \in R[X]$. -/
 @[simp]
 noncomputable def yIdeal : Ideal W.CoordinateRing :=
-  Ideal.span {yClass W y}
+  span {yClass W y}
 #align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.CoordinateRing.yIdeal
 
+/-- The ideal $\langle X - x, Y - y(X) \rangle$ of $R[W]$ for some $x \in R$ and $y(X) \in R[X]$. -/
+@[simp]
+noncomputable def xYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
+  span {xClass W x, yClass W y}
+#align weierstrass_curve.coordinate_ring.XY_ideal WeierstrassCurve.CoordinateRing.xYIdeal
+
 /-! ### The coordinate ring as an `R[X]`-algebra -/
 
 
 noncomputable instance : Algebra R[X] W.CoordinateRing :=
-  Ideal.Quotient.algebra R[X]
+  Quotient.algebra R[X]
 
 noncomputable instance algebra' : Algebra R W.CoordinateRing :=
-  Ideal.Quotient.algebra R
+  Quotient.algebra R
 #align weierstrass_curve.coordinate_ring.algebra' WeierstrassCurve.CoordinateRing.algebra'
 
 instance : IsScalarTower R R[X] W.CoordinateRing :=
-  Ideal.Quotient.isScalarTower R R[X] _
+  Quotient.isScalarTower R R[X] _
 
 instance [Subsingleton R] : Subsingleton W.CoordinateRing :=
   Module.subsingleton R[X] _
 
+/-- The $R$-algebra isomorphism from $R[W] / \langle X - x, Y - y(X) \rangle$ to $R$ obtained by
+evaluation at $y(X)$ and at $x$ provided that $W(x, y(x)) = 0$. -/
+noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W.Polynomial.eval y).eval x = 0) :
+    (W.CoordinateRing ⧸ xYIdeal W x y) ≃ₐ[R] R :=
+  (quotientEquivAlgOfEq R <| by
+        simpa only [XY_ideal, X_class, Y_class, ← Set.image_pair, ← map_span]).trans <|
+    (DoubleQuot.quotQuotEquivQuotOfLEₐ R <|
+          (span_singleton_le_iff_mem _).mpr <|
+            mem_span_C_X_sub_C_X_sub_C_iff_eval_eval_eq_zero.mpr h).trans <|
+      ((quotientSpanCXSubCAlgEquiv (X - C x) y).restrictScalars R).trans <|
+        quotientSpanXSubCAlgEquiv x
+#align weierstrass_curve.coordinate_ring.quotient_XY_ideal_equiv WeierstrassCurve.CoordinateRing.quotientXYIdealEquiv
+
 /-- The basis $\{1, Y\}$ for the coordinate ring $R[W]$ over the polynomial ring $R[X]$.
 
 Given a Weierstrass curve `W`, write `W^.coordinate_ring.basis` for this basis. -/
@@ -746,7 +767,7 @@ variable (W)
 theorem smul_basis_mul_c (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial (C y) =
       (p * y) • 1 + (q * y) • AdjoinRoot.mk W.Polynomial Y :=
-  by simp only [smul, map_mul]; ring1
+  by simp only [smul, _root_.map_mul]; ring1
 #align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.CoordinateRing.smul_basis_mul_c
 
 theorem smul_basis_mul_Y (p q : R[X]) :
@@ -759,7 +780,7 @@ theorem smul_basis_mul_Y (p q : R[X]) :
       AdjoinRoot.mk W.polynomial
         (C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) - C (C W.a₁ * X + C W.a₃) * Y) :=
     adjoin_root.mk_eq_mk.mpr ⟨1, by simp only [WeierstrassCurve.polynomial]; ring1⟩
-  simp only [smul, add_mul, mul_assoc, ← sq, Y_sq, map_sub, map_mul]
+  simp only [smul, add_mul, mul_assoc, ← sq, Y_sq, map_sub, _root_.map_mul]
   ring1
 #align weierstrass_curve.coordinate_ring.smul_basis_mul_Y WeierstrassCurve.CoordinateRing.smul_basis_mul_Y
 
@@ -781,7 +802,7 @@ theorem norm_smul_basis (p q : R[X]) :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4289455181.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
-      AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
+      AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-Y - C (C W.a₁ * X + C W.a₃)))) :=
   AdjoinRoot.mk_eq_mk.mpr
     ⟨C q ^ 2, by rw [norm_smul_basis, WeierstrassCurve.polynomial];
       run_tac
Diff
@@ -346,10 +346,8 @@ theorem twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] (h
 
 end TorsionPolynomial
 
--- mathport name: outer_variable
 scoped[PolynomialPolynomial] notation "Y" => Polynomial.X
 
--- mathport name: polynomial_polynomial
 scoped[PolynomialPolynomial] notation R "[X][Y]" => Polynomial (Polynomial R)
 
 section Polynomial
Diff
@@ -82,15 +82,15 @@ elliptic curve, weierstrass equation, j invariant
 -/
 
 
-/- ./././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
 
Diff
@@ -406,7 +406,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
       h with
     ⟨f, g, h0, h1⟩
   simp only [polynomial_eq, Cubic.coeff_eq_c, Cubic.coeff_eq_d] at h0 h1 
-  apply_fun degree  at h0 h1 
+  apply_fun degree at h0 h1 
   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.with_bot.add_eq_three_iff.mp h0.symm with (h | h | h | h)
@@ -703,9 +703,9 @@ protected noncomputable def basis : Basis (Fin 2) R[X] W.CoordinateRing :=
 theorem basis_apply (n : Fin 2) :
     W.CoordinateRing.Basis n = (AdjoinRoot.powerBasis' W.monic_polynomial).gen ^ (n : ℕ) := by
   classical
-    nontriviality R
-    simpa only [coordinate_ring.basis, Or.by_cases, dif_neg (not_subsingleton R),
-      Basis.reindex_apply, PowerBasis.basis_eq_pow]
+  nontriviality R
+  simpa only [coordinate_ring.basis, Or.by_cases, dif_neg (not_subsingleton R), Basis.reindex_apply,
+    PowerBasis.basis_eq_pow]
 #align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.CoordinateRing.basis_apply
 
 theorem basis_zero : W.CoordinateRing.Basis 0 = 1 := by simpa only [basis_apply] using pow_zero _
@@ -814,14 +814,16 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
   cases' q.degree with dq; · exact (hq rfl).elim
   cases' le_or_lt dp (dq + 1) with hpq hpq
   ·
-    convert(degree_sub_eq_right_of_degree_lt <|
+    convert
+          (degree_sub_eq_right_of_degree_lt <|
                 (degree_sub_le _ _).trans_lt <|
                   max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
             (max_eq_right_of_lt _).symm <;>
         rw [hdq] <;>
       exact with_bot.coe_lt_coe.mpr (by linarith only [hpq])
   · rw [sub_sub]
-    convert(degree_sub_eq_left_of_degree_lt <|
+    convert
+          (degree_sub_eq_left_of_degree_lt <|
                 (degree_add_le _ _).trans_lt <|
                   max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
             (max_eq_left_of_lt _).symm <;>
Diff
@@ -405,9 +405,9 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   rcases(W.monic_polynomial.not_irreducible_iff_exists_add_mul_eq_coeff W.nat_degree_polynomial).mp
       h with
     ⟨f, g, h0, h1⟩
-  simp only [polynomial_eq, Cubic.coeff_eq_c, Cubic.coeff_eq_d] at h0 h1
-  apply_fun degree  at h0 h1
-  rw [Cubic.degree_of_a_ne_zero' <| neg_ne_zero.mpr <| one_ne_zero' R, degree_mul] at h0
+  simp only [polynomial_eq, Cubic.coeff_eq_c, Cubic.coeff_eq_d] at h0 h1 
+  apply_fun degree  at h0 h1 
+  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.with_bot.add_eq_three_iff.mp h0.symm with (h | h | h | h)
   any_goals rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
@@ -620,7 +620,8 @@ TODO Lean 4: verify if the new def-eq cache (lean4#1102) fixed this issue.
 See Zulip thread:
 https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.E2.9C.94.20class_group.2Emk -/
 def CoordinateRing : Type u :=
-  AdjoinRoot W.Polynomial deriving Inhabited, CommRing
+  AdjoinRoot W.Polynomial
+deriving Inhabited, CommRing
 #align weierstrass_curve.coordinate_ring WeierstrassCurve.CoordinateRing
 
 /-- The function field $R(W) := \mathrm{Frac}(R[W])$ of `W`. -/
@@ -717,7 +718,7 @@ theorem basis_one : W.CoordinateRing.Basis 1 = AdjoinRoot.mk W.Polynomial Y := b
 @[simp]
 theorem coe_basis :
     (W.CoordinateRing.Basis : Fin 2 → W.CoordinateRing) = ![1, AdjoinRoot.mk W.Polynomial Y] := by
-  ext n; fin_cases n; exacts[basis_zero W, basis_one W]
+  ext n; fin_cases n; exacts [basis_zero W, basis_one W]
 #align weierstrass_curve.coordinate_ring.coe_basis WeierstrassCurve.CoordinateRing.coe_basis
 
 variable {W}
@@ -730,7 +731,7 @@ theorem smul_basis_eq_zero {p q : R[X]} (hpq : p • 1 + q • AdjoinRoot.mk W.P
     p = 0 ∧ q = 0 :=
   by
   have h := fintype.linear_independent_iff.mp (coordinate_ring.basis W).LinearIndependent ![p, q]
-  erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h
+  erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h 
   exact ⟨h hpq 0, h hpq 1⟩
 #align weierstrass_curve.coordinate_ring.smul_basis_eq_zero WeierstrassCurve.CoordinateRing.smul_basis_eq_zero
 
@@ -738,7 +739,7 @@ theorem exists_smul_basis_eq (x : W.CoordinateRing) :
     ∃ p q : R[X], p • 1 + q • AdjoinRoot.mk W.Polynomial Y = x :=
   by
   have h := (coordinate_ring.basis W).sum_equivFun x
-  erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h
+  erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h 
   exact ⟨_, _, h⟩
 #align weierstrass_curve.coordinate_ring.exists_smul_basis_eq WeierstrassCurve.CoordinateRing.exists_smul_basis_eq
 
@@ -808,7 +809,7 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
   ·
     simpa only [hq, hdp, sub_zero, MulZeroClass.zero_mul, MulZeroClass.mul_zero,
       zero_pow zero_lt_two] using (max_bot_right _).symm
-  rw [← not_congr degree_eq_bot] at hp hq
+  rw [← not_congr degree_eq_bot] at hp hq 
   cases' p.degree with dp; · exact (hp rfl).elim
   cases' q.degree with dq; · exact (hq rfl).elim
   cases' le_or_lt dp (dq + 1) with hpq hpq
Diff
@@ -928,7 +928,7 @@ variable (A : Type v) [CommRing A] [Algebra R A]
 @[simps]
 def baseChange : EllipticCurve A :=
   ⟨E.base_change A, Units.map (↑(algebraMap R A)) E.Δ', by
-    rw [Units.coe_map, [anonymous], coe_Δ', E.base_change_Δ]⟩
+    rw [Units.coe_map, RingHom.coe_monoidHom, coe_Δ', E.base_change_Δ]⟩
 #align elliptic_curve.base_change EllipticCurve.baseChange
 
 theorem coeBase_change_Δ' : ↑(E.base_change A).Δ' = algebraMap R A E.Δ' :=
Diff
@@ -359,7 +359,7 @@ section Polynomial
 
 open Polynomial
 
-open Polynomial
+open scoped Polynomial
 
 /-- The polynomial $W(X, Y) := Y^2 + a_1XY + a_3Y - (X^3 + a_2X^2 + a_4X + a_6)$ associated to a
 Weierstrass curve `W` over `R`. For ease of polynomial manipulation, this is represented as a term
Diff
@@ -143,10 +143,7 @@ def b₈ : R :=
   W.a₁ ^ 2 * W.a₆ + 4 * W.a₂ * W.a₆ - W.a₁ * W.a₃ * W.a₄ + W.a₂ * W.a₃ ^ 2 - W.a₄ ^ 2
 #align weierstrass_curve.b₈ WeierstrassCurve.b₈
 
-theorem b_relation : 4 * W.b₈ = W.b₂ * W.b₆ - W.b₄ ^ 2 :=
-  by
-  simp only [b₂, b₄, b₆, b₈]
-  ring1
+theorem b_relation : 4 * W.b₈ = W.b₂ * W.b₆ - W.b₄ ^ 2 := by simp only [b₂, b₄, b₆, b₈]; ring1
 #align weierstrass_curve.b_relation WeierstrassCurve.b_relation
 
 /-- The `c₄` coefficient of a Weierstrass curve. -/
@@ -170,9 +167,7 @@ def Δ : R :=
   -W.b₂ ^ 2 * W.b₈ - 8 * W.b₄ ^ 3 - 27 * W.b₆ ^ 2 + 9 * W.b₂ * W.b₄ * W.b₆
 #align weierstrass_curve.Δ WeierstrassCurve.Δ
 
-theorem c_relation : 1728 * W.Δ = W.c₄ ^ 3 - W.c₆ ^ 2 :=
-  by
-  simp only [b₂, b₄, b₆, b₈, c₄, c₆, Δ]
+theorem c_relation : 1728 * W.Δ = W.c₄ ^ 3 - W.c₆ ^ 2 := by simp only [b₂, b₄, b₆, b₈, c₄, c₆, Δ];
   ring1
 #align weierstrass_curve.c_relation WeierstrassCurve.c_relation
 
@@ -198,26 +193,20 @@ def variableChange : WeierstrassCurve R
 #align weierstrass_curve.variable_change WeierstrassCurve.variableChange
 
 @[simp]
-theorem variableChange_b₂ : (W.variableChange u r s t).b₂ = ↑u⁻¹ ^ 2 * (W.b₂ + 12 * r) :=
-  by
-  simp only [b₂, variable_change_a₁, variable_change_a₂]
-  ring1
+theorem variableChange_b₂ : (W.variableChange u r s t).b₂ = ↑u⁻¹ ^ 2 * (W.b₂ + 12 * r) := by
+  simp only [b₂, variable_change_a₁, variable_change_a₂]; ring1
 #align weierstrass_curve.variable_change_b₂ WeierstrassCurve.variableChange_b₂
 
 @[simp]
 theorem variableChange_b₄ :
-    (W.variableChange u r s t).b₄ = ↑u⁻¹ ^ 4 * (W.b₄ + r * W.b₂ + 6 * r ^ 2) :=
-  by
-  simp only [b₂, b₄, variable_change_a₁, variable_change_a₃, variable_change_a₄]
-  ring1
+    (W.variableChange u r s t).b₄ = ↑u⁻¹ ^ 4 * (W.b₄ + r * W.b₂ + 6 * r ^ 2) := by
+  simp only [b₂, b₄, variable_change_a₁, variable_change_a₃, variable_change_a₄]; ring1
 #align weierstrass_curve.variable_change_b₄ WeierstrassCurve.variableChange_b₄
 
 @[simp]
 theorem variableChange_b₆ :
     (W.variableChange u r s t).b₆ = ↑u⁻¹ ^ 6 * (W.b₆ + 2 * r * W.b₄ + r ^ 2 * W.b₂ + 4 * r ^ 3) :=
-  by
-  simp only [b₂, b₄, b₆, variable_change_a₃, variable_change_a₆]
-  ring1
+  by simp only [b₂, b₄, b₆, variable_change_a₃, variable_change_a₆]; ring1
 #align weierstrass_curve.variable_change_b₆ WeierstrassCurve.variableChange_b₆
 
 @[simp]
@@ -231,24 +220,17 @@ theorem variableChange_b₈ :
 #align weierstrass_curve.variable_change_b₈ WeierstrassCurve.variableChange_b₈
 
 @[simp]
-theorem variableChange_c₄ : (W.variableChange u r s t).c₄ = ↑u⁻¹ ^ 4 * W.c₄ :=
-  by
-  simp only [c₄, variable_change_b₂, variable_change_b₄]
-  ring1
+theorem variableChange_c₄ : (W.variableChange u r s t).c₄ = ↑u⁻¹ ^ 4 * W.c₄ := by
+  simp only [c₄, variable_change_b₂, variable_change_b₄]; ring1
 #align weierstrass_curve.variable_change_c₄ WeierstrassCurve.variableChange_c₄
 
 @[simp]
-theorem variableChange_c₆ : (W.variableChange u r s t).c₆ = ↑u⁻¹ ^ 6 * W.c₆ :=
-  by
-  simp only [c₆, variable_change_b₂, variable_change_b₄, variable_change_b₆]
-  ring1
+theorem variableChange_c₆ : (W.variableChange u r s t).c₆ = ↑u⁻¹ ^ 6 * W.c₆ := by
+  simp only [c₆, variable_change_b₂, variable_change_b₄, variable_change_b₆]; ring1
 #align weierstrass_curve.variable_change_c₆ WeierstrassCurve.variableChange_c₆
 
 @[simp]
-theorem variableChange_Δ : (W.variableChange u r s t).Δ = ↑u⁻¹ ^ 12 * W.Δ :=
-  by
-  dsimp
-  ring1
+theorem variableChange_Δ : (W.variableChange u r s t).Δ = ↑u⁻¹ ^ 12 * W.Δ := by dsimp; ring1
 #align weierstrass_curve.variable_change_Δ WeierstrassCurve.variableChange_Δ
 
 end VariableChange
@@ -270,27 +252,24 @@ def baseChange : WeierstrassCurve A :=
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
-theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
-  by
-  simp only [b₂, base_change_a₁, base_change_a₂]
+theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ := by
+  simp only [b₂, base_change_a₁, base_change_a₂];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
-theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
-  by
-  simp only [b₄, base_change_a₁, base_change_a₃, base_change_a₄]
+theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ := by
+  simp only [b₄, base_change_a₁, base_change_a₃, base_change_a₄];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
-theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
-  by
-  simp only [b₆, base_change_a₃, base_change_a₆]
+theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ := by
+  simp only [b₆, base_change_a₃, base_change_a₆];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
@@ -306,27 +285,24 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
-theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
-  by
-  simp only [c₄, base_change_b₂, base_change_b₄]
+theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ := by
+  simp only [c₄, base_change_b₂, base_change_b₄];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
-theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
-  by
-  simp only [c₆, base_change_b₂, base_change_b₄, base_change_b₆]
+theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ := by
+  simp only [c₆, base_change_b₂, base_change_b₄, base_change_b₆];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp, nolint simp_nf]
-theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
-  by
-  simp only [Δ, base_change_b₂, base_change_b₄, base_change_b₆, base_change_b₈]
+theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ := by
+  simp only [Δ, base_change_b₂, base_change_b₄, base_change_b₆, base_change_b₈];
   run_tac
     map_simp
 #align weierstrass_curve.base_change_Δ WeierstrassCurve.baseChange_Δ
@@ -352,10 +328,8 @@ def twoTorsionPolynomial : Cubic R :=
   ⟨4, W.b₂, 2 * W.b₄, W.b₆⟩
 #align weierstrass_curve.two_torsion_polynomial WeierstrassCurve.twoTorsionPolynomial
 
-theorem twoTorsionPolynomial_disc : W.twoTorsionPolynomial.disc = 16 * W.Δ :=
-  by
-  dsimp [two_torsion_polynomial, Cubic.disc]
-  ring1
+theorem twoTorsionPolynomial_disc : W.twoTorsionPolynomial.disc = 16 * W.Δ := by
+  dsimp [two_torsion_polynomial, Cubic.disc]; ring1
 #align weierstrass_curve.two_torsion_polynomial_disc WeierstrassCurve.twoTorsionPolynomial_disc
 
 theorem twoTorsionPolynomial_disc_isUnit [Invertible (2 : R)] :
@@ -401,36 +375,27 @@ theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
         ⟨0, 1, Cubic.toPoly ⟨0, 0, W.a₁, W.a₃⟩, Cubic.toPoly ⟨-1, -W.a₂, -W.a₄, -W.a₆⟩⟩ :=
-  by
-  simp only [WeierstrassCurve.polynomial, Cubic.toPoly]
+  by simp only [WeierstrassCurve.polynomial, Cubic.toPoly];
   run_tac
-    C_simp
+    C_simp;
   ring1
 #align weierstrass_curve.polynomial_eq WeierstrassCurve.polynomial_eq
 
-theorem polynomial_ne_zero [Nontrivial R] : W.Polynomial ≠ 0 :=
-  by
-  rw [polynomial_eq]
+theorem polynomial_ne_zero [Nontrivial R] : W.Polynomial ≠ 0 := by rw [polynomial_eq];
   exact Cubic.ne_zero_of_b_ne_zero one_ne_zero
 #align weierstrass_curve.polynomial_ne_zero WeierstrassCurve.polynomial_ne_zero
 
 @[simp]
-theorem degree_polynomial [Nontrivial R] : W.Polynomial.degree = 2 :=
-  by
-  rw [polynomial_eq]
+theorem degree_polynomial [Nontrivial R] : W.Polynomial.degree = 2 := by rw [polynomial_eq];
   exact Cubic.degree_of_b_ne_zero' one_ne_zero
 #align weierstrass_curve.degree_polynomial WeierstrassCurve.degree_polynomial
 
 @[simp]
-theorem natDegree_polynomial [Nontrivial R] : W.Polynomial.natDegree = 2 :=
-  by
-  rw [polynomial_eq]
+theorem natDegree_polynomial [Nontrivial R] : W.Polynomial.natDegree = 2 := by rw [polynomial_eq];
   exact Cubic.natDegree_of_b_ne_zero' one_ne_zero
 #align weierstrass_curve.nat_degree_polynomial WeierstrassCurve.natDegree_polynomial
 
-theorem monic_polynomial : W.Polynomial.Monic :=
-  by
-  nontriviality R
+theorem monic_polynomial : W.Polynomial.Monic := by nontriviality R;
   simpa only [polynomial_eq] using Cubic.monic_of_b_eq_one'
 #align weierstrass_curve.monic_polynomial WeierstrassCurve.monic_polynomial
 
@@ -454,10 +419,9 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
 theorem 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 [WeierstrassCurve.polynomial]
+  by simp only [WeierstrassCurve.polynomial];
   run_tac
-    eval_simp
+    eval_simp;
   rw [add_mul, ← add_assoc]
 #align weierstrass_curve.eval_polynomial WeierstrassCurve.eval_polynomial
 
@@ -506,12 +470,13 @@ theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R
   refine' ⟨fun h => _, fun h => _⟩
   ·
     convert congr_arg (algebraMap R A) h <;>
-      · run_tac
-          map_simp
+      ·
+        run_tac
+          map_simp;
         rfl
-  · apply NoZeroSMulDivisors.algebraMap_injective R A
+  · apply NoZeroSMulDivisors.algebraMap_injective R A;
     run_tac
-      map_simp
+      map_simp;
     exact h
 #align weierstrass_curve.equation_iff_base_change WeierstrassCurve.equation_iff_baseChange
 
@@ -534,9 +499,8 @@ noncomputable def polynomialX : R[X][Y] :=
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
 @[simp]
 theorem 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 [polynomial_X]
+    (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) := by
+  simp only [polynomial_X];
   run_tac
     eval_simp
 #align weierstrass_curve.eval_polynomial_X WeierstrassCurve.eval_polynomialX
@@ -557,10 +521,9 @@ noncomputable def polynomialY : R[X][Y] :=
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
-  by
-  simp only [polynomial_Y]
+  by simp only [polynomial_Y];
   run_tac
-    eval_simp
+    eval_simp;
   rw [← add_assoc]
 #align weierstrass_curve.eval_polynomial_Y WeierstrassCurve.eval_polynomialY
 
@@ -586,9 +549,7 @@ theorem nonsingular_iff' (x y : R) :
 theorem 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 _ _ y]
-  congr 4 <;> ring1
+  by rw [nonsingular_iff', sub_ne_zero, ← @sub_ne_zero _ _ y]; congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff WeierstrassCurve.nonsingular_iff
 
 @[simp]
@@ -620,8 +581,9 @@ theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y
     exact h
   any_goals
     convert congr_arg (algebraMap R A) h <;>
-      · run_tac
-          map_simp
+      ·
+        run_tac
+          map_simp;
         rfl
 #align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.nonsingular_iff_baseChange
 
@@ -631,11 +593,8 @@ theorem nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivis
   by rw [nonsingular_iff_base_change (W.base_change A) B, base_change_base_change]
 #align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange
 
-theorem nonsingular_zero_of_Δ_ne_zero (h : W.Equation 0 0) (hΔ : W.Δ ≠ 0) : W.Nonsingular 0 0 :=
-  by
-  simp only [equation_zero, nonsingular_zero] at *
-  contrapose! hΔ
-  simp [h, hΔ]
+theorem nonsingular_zero_of_Δ_ne_zero (h : W.Equation 0 0) (hΔ : W.Δ ≠ 0) : W.Nonsingular 0 0 := by
+  simp only [equation_zero, nonsingular_zero] at *; contrapose! hΔ; simp [h, hΔ]
 #align weierstrass_curve.nonsingular_zero_of_Δ_ne_zero WeierstrassCurve.nonsingular_zero_of_Δ_ne_zero
 
 /-- A Weierstrass curve is nonsingular at every point if its discriminant is non-zero. -/
@@ -690,9 +649,7 @@ noncomputable def xClass : W.CoordinateRing :=
 
 theorem xClass_ne_zero [Nontrivial R] : xClass W x ≠ 0 :=
   AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| X_sub_C_ne_zero x) <|
-    by
-    rw [nat_degree_polynomial, nat_degree_C]
-    norm_num1
+    by rw [nat_degree_polynomial, nat_degree_C]; norm_num1
 #align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.CoordinateRing.xClass_ne_zero
 
 /-- The class of the element $Y - y(X)$ in $R[W]$ for some $y(X) \in R[X]$. -/
@@ -702,10 +659,8 @@ noncomputable def yClass : W.CoordinateRing :=
 #align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.yClass
 
 theorem yClass_ne_zero [Nontrivial R] : yClass W y ≠ 0 :=
-  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (X_sub_C_ne_zero y) <|
-    by
-    rw [nat_degree_polynomial, nat_degree_X_sub_C]
-    norm_num1
+  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (X_sub_C_ne_zero y) <| by
+    rw [nat_degree_polynomial, nat_degree_X_sub_C]; norm_num1
 #align weierstrass_curve.coordinate_ring.Y_class_ne_zero WeierstrassCurve.CoordinateRing.yClass_ne_zero
 
 /-- The ideal $\langle X - x \rangle$ of $R[W]$ for some $x \in R$. -/
@@ -761,11 +716,8 @@ theorem basis_one : W.CoordinateRing.Basis 1 = AdjoinRoot.mk W.Polynomial Y := b
 
 @[simp]
 theorem coe_basis :
-    (W.CoordinateRing.Basis : Fin 2 → W.CoordinateRing) = ![1, AdjoinRoot.mk W.Polynomial Y] :=
-  by
-  ext n
-  fin_cases n
-  exacts[basis_zero W, basis_one W]
+    (W.CoordinateRing.Basis : Fin 2 → W.CoordinateRing) = ![1, AdjoinRoot.mk W.Polynomial Y] := by
+  ext n; fin_cases n; exacts[basis_zero W, basis_one W]
 #align weierstrass_curve.coordinate_ring.coe_basis WeierstrassCurve.CoordinateRing.coe_basis
 
 variable {W}
@@ -795,9 +747,7 @@ variable (W)
 theorem smul_basis_mul_c (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial (C y) =
       (p * y) • 1 + (q * y) • AdjoinRoot.mk W.Polynomial Y :=
-  by
-  simp only [smul, map_mul]
-  ring1
+  by simp only [smul, map_mul]; ring1
 #align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.CoordinateRing.smul_basis_mul_c
 
 theorem smul_basis_mul_Y (p q : R[X]) :
@@ -809,10 +759,7 @@ theorem smul_basis_mul_Y (p q : R[X]) :
     AdjoinRoot.mk W.polynomial Y ^ 2 =
       AdjoinRoot.mk W.polynomial
         (C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) - C (C W.a₁ * X + C W.a₃) * Y) :=
-    adjoin_root.mk_eq_mk.mpr
-      ⟨1, by
-        simp only [WeierstrassCurve.polynomial]
-        ring1⟩
+    adjoin_root.mk_eq_mk.mpr ⟨1, by simp only [WeierstrassCurve.polynomial]; ring1⟩
   simp only [smul, add_mul, mul_assoc, ← sq, Y_sq, map_sub, map_mul]
   ring1
 #align weierstrass_curve.coordinate_ring.smul_basis_mul_Y WeierstrassCurve.CoordinateRing.smul_basis_mul_Y
@@ -837,10 +784,9 @@ theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
   AdjoinRoot.mk_eq_mk.mpr
-    ⟨C q ^ 2, by
-      rw [norm_smul_basis, WeierstrassCurve.polynomial]
+    ⟨C q ^ 2, by rw [norm_smul_basis, WeierstrassCurve.polynomial];
       run_tac
-        C_simp
+        C_simp;
       ring1⟩
 #align weierstrass_curve.coordinate_ring.coe_norm_smul_basis WeierstrassCurve.CoordinateRing.coe_norm_smul_basis
 
@@ -854,19 +800,17 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
   have hdq : (q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)).degree = 2 • q.degree + 3 :=
     by rw [degree_mul, degree_pow, ← one_mul <| X ^ 3, ← C_1, degree_cubic <| one_ne_zero' R]
   rw [norm_smul_basis]
-  by_cases hp : p = 0
+  by_cases hp : p = 0;
   ·
     simpa only [hp, hdq, neg_zero, zero_sub, MulZeroClass.zero_mul, zero_pow zero_lt_two,
       degree_neg] using (max_bot_left _).symm
-  by_cases hq : q = 0
+  by_cases hq : q = 0;
   ·
     simpa only [hq, hdp, sub_zero, MulZeroClass.zero_mul, MulZeroClass.mul_zero,
       zero_pow zero_lt_two] using (max_bot_right _).symm
   rw [← not_congr degree_eq_bot] at hp hq
-  cases' p.degree with dp
-  · exact (hp rfl).elim
-  cases' q.degree with dq
-  · exact (hq rfl).elim
+  cases' p.degree with dp; · exact (hp rfl).elim
+  cases' q.degree with dq; · exact (hq rfl).elim
   cases' le_or_lt dp (dq + 1) with hpq hpq
   ·
     convert(degree_sub_eq_right_of_degree_lt <|
@@ -918,10 +862,7 @@ structure EllipticCurve (R : Type u) [CommRing R] extends WeierstrassCurve R whe
 #align elliptic_curve EllipticCurve
 
 instance : Inhabited <| EllipticCurve ℚ :=
-  ⟨⟨⟨0, 0, 1, -1, 0⟩, ⟨37, 37⁻¹, by norm_num1, by norm_num1⟩,
-      by
-      dsimp
-      ring1⟩⟩
+  ⟨⟨⟨0, 0, 1, -1, 0⟩, ⟨37, 37⁻¹, by norm_num1, by norm_num1⟩, by dsimp; ring1⟩⟩
 
 namespace EllipticCurve
 
Diff
@@ -85,17 +85,14 @@ elliptic curve, weierstrass equation, j invariant
 /- ./././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
 
 universe u v w
 
Diff
@@ -271,7 +271,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
   by
@@ -280,7 +280,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
   by
@@ -289,7 +289,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
   by
@@ -298,7 +298,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -307,7 +307,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
   by
@@ -316,7 +316,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
   by
@@ -325,7 +325,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
   by
@@ -399,7 +399,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4289455181.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -452,7 +452,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| C y).eval x =
@@ -500,8 +500,8 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -534,7 +534,7 @@ noncomputable def polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
@@ -557,7 +557,7 @@ noncomputable def polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4205960341.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
@@ -608,8 +608,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -835,7 +835,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.4289455181.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
@@ -1001,7 +1001,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.736360669.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
Diff
@@ -271,7 +271,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
   by
@@ -280,7 +280,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
   by
@@ -289,7 +289,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
   by
@@ -298,7 +298,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -307,7 +307,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
   by
@@ -316,7 +316,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
   by
@@ -325,7 +325,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
   by
@@ -399,7 +399,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.124303653.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -452,7 +452,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3485030765.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| C y).eval x =
@@ -500,8 +500,8 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -534,7 +534,7 @@ noncomputable def polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3485030765.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
@@ -557,7 +557,7 @@ noncomputable def polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3485030765.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2480101633.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
@@ -608,8 +608,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -835,7 +835,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.124303653.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3948480697.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
@@ -1001,7 +1001,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2242074953.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
Diff
@@ -271,7 +271,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
   by
@@ -280,7 +280,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
   by
@@ -289,7 +289,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
   by
@@ -298,7 +298,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -307,7 +307,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
   by
@@ -316,7 +316,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
   by
@@ -325,7 +325,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
   by
@@ -399,7 +399,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2327590855.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.124303653.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -452,7 +452,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3687834639.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3485030765.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| C y).eval x =
@@ -500,8 +500,8 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -534,7 +534,7 @@ noncomputable def polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3687834639.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3485030765.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
@@ -557,7 +557,7 @@ noncomputable def polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3687834639.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3485030765.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
@@ -608,8 +608,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -835,7 +835,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2327590855.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.124303653.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
@@ -1001,7 +1001,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.1421506997.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
Diff
@@ -872,16 +872,14 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
   · exact (hq rfl).elim
   cases' le_or_lt dp (dq + 1) with hpq hpq
   ·
-    convert
-          (degree_sub_eq_right_of_degree_lt <|
+    convert(degree_sub_eq_right_of_degree_lt <|
                 (degree_sub_le _ _).trans_lt <|
                   max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
             (max_eq_right_of_lt _).symm <;>
         rw [hdq] <;>
       exact with_bot.coe_lt_coe.mpr (by linarith only [hpq])
   · rw [sub_sub]
-    convert
-          (degree_sub_eq_left_of_degree_lt <|
+    convert(degree_sub_eq_left_of_degree_lt <|
                 (degree_add_le _ _).trans_lt <|
                   max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
             (max_eq_left_of_lt _).symm <;>
Diff
@@ -271,7 +271,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
   by
@@ -280,7 +280,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
   by
@@ -289,7 +289,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
   by
@@ -298,7 +298,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -307,7 +307,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
   by
@@ -316,7 +316,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
   by
@@ -325,7 +325,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
   by
@@ -399,7 +399,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2327590855.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -452,7 +452,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3687834639.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| C y).eval x =
@@ -500,8 +500,8 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -534,7 +534,7 @@ noncomputable def polynomialX : R[X][Y] :=
   C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3687834639.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
@@ -557,7 +557,7 @@ noncomputable def polynomialY : R[X][Y] :=
   C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3687834639.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
@@ -608,8 +608,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -835,7 +835,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.2327590855.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
@@ -1003,7 +1003,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.367748183.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
Diff
@@ -466,7 +466,8 @@ theorem eval_polynomial (x y : R) :
 
 @[simp]
 theorem 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, MulZeroClass.mul_zero,
+    zero_pow (Nat.zero_lt_succ _)]
 #align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.eval_polynomial_zero
 
 /-- The proposition that an affine point $(x, y)$ lies in `W`. In other words, $W(x, y) = 0$. -/
@@ -545,7 +546,8 @@ theorem eval_polynomialX (x y : R) :
 
 @[simp]
 theorem eval_polynomialX_zero : (W.polynomialX.eval 0).eval 0 = -W.a₄ := by
-  simp only [← C_0, eval_polynomial_X, zero_add, zero_sub, mul_zero, zero_pow zero_lt_two]
+  simp only [← C_0, eval_polynomial_X, zero_add, zero_sub, MulZeroClass.mul_zero,
+    zero_pow zero_lt_two]
 #align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.eval_polynomialX_zero
 
 /-- The partial derivative $W_Y(X, Y)$ of $W(X, Y)$ with respect to $Y$.
@@ -567,7 +569,7 @@ theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y
 
 @[simp]
 theorem eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
-  simp only [← C_0, eval_polynomial_Y, zero_add, mul_zero]
+  simp only [← C_0, eval_polynomial_Y, zero_add, MulZeroClass.mul_zero]
 #align weierstrass_curve.eval_polynomial_Y_zero WeierstrassCurve.eval_polynomialY_zero
 
 /-- The proposition that an affine point $(x, y)$ on `W` is nonsingular.
@@ -857,12 +859,12 @@ theorem degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
   rw [norm_smul_basis]
   by_cases hp : p = 0
   ·
-    simpa only [hp, hdq, neg_zero, zero_sub, zero_mul, zero_pow zero_lt_two, degree_neg] using
-      (max_bot_left _).symm
+    simpa only [hp, hdq, neg_zero, zero_sub, MulZeroClass.zero_mul, zero_pow zero_lt_two,
+      degree_neg] using (max_bot_left _).symm
   by_cases hq : q = 0
   ·
-    simpa only [hq, hdp, sub_zero, zero_mul, mul_zero, zero_pow zero_lt_two] using
-      (max_bot_right _).symm
+    simpa only [hq, hdp, sub_zero, MulZeroClass.zero_mul, MulZeroClass.mul_zero,
+      zero_pow zero_lt_two] using (max_bot_right _).symm
   rw [← not_congr degree_eq_bot] at hp hq
   cases' p.degree with dp
   · exact (hp rfl).elim
Diff
@@ -690,7 +690,7 @@ noncomputable def xClass : W.CoordinateRing :=
 #align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.CoordinateRing.xClass
 
 theorem xClass_ne_zero [Nontrivial R] : xClass W x ≠ 0 :=
-  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| x_sub_c_ne_zero x) <|
+  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| X_sub_C_ne_zero x) <|
     by
     rw [nat_degree_polynomial, nat_degree_C]
     norm_num1
@@ -703,7 +703,7 @@ noncomputable def yClass : W.CoordinateRing :=
 #align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.yClass
 
 theorem yClass_ne_zero [Nontrivial R] : yClass W y ≠ 0 :=
-  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (x_sub_c_ne_zero y) <|
+  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (X_sub_C_ne_zero y) <|
     by
     rw [nat_degree_polynomial, nat_degree_X_sub_C]
     norm_num1
Diff
@@ -376,7 +376,7 @@ theorem twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] (h
 end TorsionPolynomial
 
 -- mathport name: outer_variable
-scoped[PolynomialPolynomial] notation "Y" => Polynomial.x
+scoped[PolynomialPolynomial] notation "Y" => Polynomial.X
 
 -- mathport name: polynomial_polynomial
 scoped[PolynomialPolynomial] notation R "[X][Y]" => Polynomial (Polynomial R)
@@ -396,7 +396,7 @@ of type `R[X][X]`, where the inner variable represents $X$ and the outer variabl
 For clarity, the alternative notations `Y` and `R[X][Y]` are provided in the `polynomial_polynomial`
 locale to represent the outer variable and the bivariate polynomial ring `R[X][X]` respectively. -/
 protected noncomputable def polynomial : R[X][Y] :=
-  Y ^ 2 + c (c W.a₁ * x + c W.a₃) * Y - c (x ^ 3 + c W.a₂ * x ^ 2 + c W.a₄ * x + c W.a₆)
+  Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
@@ -455,7 +455,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
-    (W.Polynomial.eval <| c y).eval x =
+    (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 [WeierstrassCurve.polynomial]
@@ -471,7 +471,7 @@ theorem eval_polynomial_zero : (W.Polynomial.eval 0).eval 0 = -W.a₆ := by
 
 /-- The proposition that an affine point $(x, y)$ lies in `W`. In other words, $W(x, y) = 0$. -/
 def Equation (x y : R) : Prop :=
-  (W.Polynomial.eval <| c y).eval x = 0
+  (W.Polynomial.eval <| C y).eval x = 0
 #align weierstrass_curve.equation WeierstrassCurve.Equation
 
 theorem equation_iff' (x y : R) :
@@ -530,13 +530,13 @@ theorem equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors
 
 TODO: define this in terms of `polynomial.derivative`. -/
 noncomputable def polynomialX : R[X][Y] :=
-  c (c W.a₁) * Y - c (c 3 * x ^ 2 + c (2 * W.a₂) * x + c W.a₄)
+  C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
-    (W.polynomialX.eval <| c y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
+    (W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
   by
   simp only [polynomial_X]
   run_tac
@@ -552,12 +552,12 @@ theorem eval_polynomialX_zero : (W.polynomialX.eval 0).eval 0 = -W.a₄ := by
 
 TODO: define this in terms of `polynomial.derivative`. -/
 noncomputable def polynomialY : R[X][Y] :=
-  c (c 2) * Y + c (c W.a₁ * x + c W.a₃)
+  C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
-theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| c y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
+theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
   simp only [polynomial_Y]
   run_tac
@@ -573,7 +573,7 @@ theorem eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
 /-- The proposition that an affine point $(x, y)$ on `W` is nonsingular.
 In other words, either $W_X(x, y) \ne 0$ or $W_Y(x, y) \ne 0$. -/
 def Nonsingular (x y : R) : Prop :=
-  W.Equation x y ∧ ((W.polynomialX.eval <| c y).eval x ≠ 0 ∨ (W.polynomialY.eval <| c y).eval x ≠ 0)
+  W.Equation x y ∧ ((W.polynomialX.eval <| C y).eval x ≠ 0 ∨ (W.polynomialY.eval <| C y).eval x ≠ 0)
 #align weierstrass_curve.nonsingular WeierstrassCurve.Nonsingular
 
 theorem nonsingular_iff' (x y : R) :
@@ -686,11 +686,11 @@ variable (x : R) (y : R[X])
 /-- The class of the element $X - x$ in $R[W]$ for some $x \in R$. -/
 @[simp]
 noncomputable def xClass : W.CoordinateRing :=
-  AdjoinRoot.mk W.Polynomial <| c <| x - c x
+  AdjoinRoot.mk W.Polynomial <| C <| X - C x
 #align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.CoordinateRing.xClass
 
 theorem xClass_ne_zero [Nontrivial R] : xClass W x ≠ 0 :=
-  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (c_ne_zero.mpr <| x_sub_c_ne_zero x) <|
+  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| x_sub_c_ne_zero x) <|
     by
     rw [nat_degree_polynomial, nat_degree_C]
     norm_num1
@@ -699,7 +699,7 @@ theorem xClass_ne_zero [Nontrivial R] : xClass W x ≠ 0 :=
 /-- The class of the element $Y - y(X)$ in $R[W]$ for some $y(X) \in R[X]$. -/
 @[simp]
 noncomputable def yClass : W.CoordinateRing :=
-  AdjoinRoot.mk W.Polynomial <| Y - c y
+  AdjoinRoot.mk W.Polynomial <| Y - C y
 #align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.yClass
 
 theorem yClass_ne_zero [Nontrivial R] : yClass W y ≠ 0 :=
@@ -771,7 +771,7 @@ theorem coe_basis :
 
 variable {W}
 
-theorem smul (x : R[X]) (y : W.CoordinateRing) : x • y = AdjoinRoot.mk W.Polynomial (c x) * y :=
+theorem smul (x : R[X]) (y : W.CoordinateRing) : x • y = AdjoinRoot.mk W.Polynomial (C x) * y :=
   (algebraMap_smul W.CoordinateRing x y).symm
 #align weierstrass_curve.coordinate_ring.smul WeierstrassCurve.CoordinateRing.smul
 
@@ -794,7 +794,7 @@ theorem exists_smul_basis_eq (x : W.CoordinateRing) :
 variable (W)
 
 theorem smul_basis_mul_c (p q : R[X]) :
-    (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial (c y) =
+    (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial (C y) =
       (p * y) • 1 + (q * y) • AdjoinRoot.mk W.Polynomial Y :=
   by
   simp only [smul, map_mul]
@@ -803,8 +803,8 @@ theorem smul_basis_mul_c (p q : R[X]) :
 
 theorem smul_basis_mul_Y (p q : R[X]) :
     (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) * AdjoinRoot.mk W.Polynomial Y =
-      (q * (x ^ 3 + c W.a₂ * x ^ 2 + c W.a₄ * x + c W.a₆)) • 1 +
-        (p - q * (c W.a₁ * x + c W.a₃)) • AdjoinRoot.mk W.Polynomial Y :=
+      (q * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)) • 1 +
+        (p - q * (C W.a₁ * X + C W.a₃)) • AdjoinRoot.mk W.Polynomial Y :=
   by
   have Y_sq :
     AdjoinRoot.mk W.polynomial Y ^ 2 =
@@ -823,8 +823,8 @@ theorem smul_basis_mul_Y (p q : R[X]) :
 
 theorem norm_smul_basis (p q : R[X]) :
     Algebra.norm R[X] (p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
-      p ^ 2 - p * q * (c W.a₁ * x + c W.a₃) -
-        q ^ 2 * (x ^ 3 + c W.a₂ * x ^ 2 + c W.a₄ * x + c W.a₆) :=
+      p ^ 2 - p * q * (C W.a₁ * X + C W.a₃) -
+        q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) :=
   by
   simp_rw [Algebra.norm_eq_matrix_det W.CoordinateRing.Basis, Matrix.det_fin_two,
     Algebra.leftMulMatrix_eq_repr_mul, basis_zero, mul_one, basis_one, smul_basis_mul_Y, map_add,
@@ -836,9 +836,9 @@ theorem norm_smul_basis (p q : R[X]) :
 /- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
-      AdjoinRoot.mk W.Polynomial ((c p + c q * x) * (c p + c q * (-x - c (c W.a₁ * x + c W.a₃)))) :=
+      AdjoinRoot.mk W.Polynomial ((C p + C q * X) * (C p + C q * (-X - C (C W.a₁ * X + C W.a₃)))) :=
   AdjoinRoot.mk_eq_mk.mpr
-    ⟨c q ^ 2, by
+    ⟨C q ^ 2, by
       rw [norm_smul_basis, WeierstrassCurve.polynomial]
       run_tac
         C_simp
Diff
@@ -82,17 +82,17 @@ elliptic curve, weierstrass equation, j invariant
 -/
 
 
-/- ./././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 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
@@ -271,7 +271,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
   by
@@ -280,7 +280,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
   by
@@ -289,7 +289,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
   by
@@ -298,7 +298,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -307,7 +307,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
   by
@@ -316,7 +316,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
   by
@@ -325,7 +325,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
   by
@@ -399,7 +399,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + c (c W.a₁ * x + c W.a₃) * Y - c (x ^ 3 + c W.a₂ * x ^ 2 + c W.a₄ * x + c W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -452,7 +452,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| c y).eval x =
@@ -499,8 +499,8 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -533,7 +533,7 @@ noncomputable def polynomialX : R[X][Y] :=
   c (c W.a₁) * Y - c (c 3 * x ^ 2 + c (2 * W.a₂) * x + c W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| c y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
@@ -555,7 +555,7 @@ noncomputable def polynomialY : R[X][Y] :=
   c (c 2) * Y + c (c W.a₁ * x + c W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| c y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
@@ -606,8 +606,8 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
   by
@@ -833,7 +833,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((c p + c q * x) * (c p + c q * (-x - c (c W.a₁ * x + c W.a₃)))) :=
@@ -1001,7 +1001,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:69:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
 
 ! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.weierstrass
-! 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.
 -/
@@ -97,7 +97,7 @@ private unsafe def C_simp : tactic Unit :=
   sorry
 #align C_simp C_simp
 
-universe u v
+universe u v w
 
 variable {R : Type u}
 
@@ -256,13 +256,14 @@ theorem variableChange_Δ : (W.variableChange u r s t).Δ = ↑u⁻¹ ^ 12 * W.
 
 end VariableChange
 
+variable (A : Type v) [CommRing A] [Algebra R A] (B : Type w) [CommRing B] [Algebra R B]
+  [Algebra A B] [IsScalarTower R A B]
+
 section BaseChange
 
 /-! ### Base changes -/
 
 
-variable (A : Type v) [CommRing A] [Algebra R A]
-
 /-- The Weierstrass curve over `R` base changed to `A`. -/
 @[simps]
 def baseChange : WeierstrassCurve A :=
@@ -333,6 +334,13 @@ theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
     map_simp
 #align weierstrass_curve.base_change_Δ WeierstrassCurve.baseChange_Δ
 
+theorem baseChange_self : W.base_change R = W := by ext <;> rfl
+#align weierstrass_curve.base_change_self WeierstrassCurve.baseChange_self
+
+theorem baseChange_baseChange : (W.base_change A).base_change B = W.base_change B := by
+  ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
+#align weierstrass_curve.base_change_base_change WeierstrassCurve.baseChange_baseChange
+
 end BaseChange
 
 section TorsionPolynomial
@@ -491,6 +499,30 @@ theorem equation_iff_variableChange (x y : R) :
   ring1
 #align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
 
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+theorem equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
+    W.Equation x y ↔ (W.base_change A).Equation (algebraMap R A x) (algebraMap R A y) :=
+  by
+  simp only [equation_iff]
+  refine' ⟨fun h => _, fun h => _⟩
+  ·
+    convert congr_arg (algebraMap R A) h <;>
+      · run_tac
+          map_simp
+        rfl
+  · apply NoZeroSMulDivisors.algebraMap_injective R A
+    run_tac
+      map_simp
+    exact h
+#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.equation_iff_baseChange
+
+theorem equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
+    (W.base_change A).Equation x y ↔
+      (W.base_change B).Equation (algebraMap A B x) (algebraMap A B y) :=
+  by rw [equation_iff_base_change (W.base_change A) B, base_change_base_change]
+#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.equation_iff_baseChange_of_baseChange
+
 /-! ### Nonsingularity of Weierstrass curves -/
 
 
@@ -574,6 +606,32 @@ theorem nonsingular_iff_variableChange (x y : R) :
   congr 4 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
+theorem nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
+    W.Nonsingular x y ↔ (W.base_change A).Nonsingular (algebraMap R A x) (algebraMap R A y) :=
+  by
+  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_base_change A 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;
+    run_tac
+      map_simp;
+    exact h
+  any_goals
+    convert congr_arg (algebraMap R A) h <;>
+      · run_tac
+          map_simp
+        rfl
+#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.nonsingular_iff_baseChange
+
+theorem nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
+    (W.base_change A).Nonsingular x y ↔
+      (W.base_change B).Nonsingular (algebraMap A B x) (algebraMap A B y) :=
+  by rw [nonsingular_iff_base_change (W.base_change A) B, base_change_base_change]
+#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange
+
 theorem nonsingular_zero_of_Δ_ne_zero (h : W.Equation 0 0) (hΔ : W.Δ ≠ 0) : W.Nonsingular 0 0 :=
   by
   simp only [equation_zero, nonsingular_zero] at *
Diff
@@ -270,7 +270,7 @@ def baseChange : WeierstrassCurve A :=
     algebraMap R A W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
   by
@@ -279,7 +279,7 @@ theorem baseChange_b₂ : (W.base_change A).b₂ = algebraMap R A W.b₂ :=
     map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
   by
@@ -288,7 +288,7 @@ theorem baseChange_b₄ : (W.base_change A).b₄ = algebraMap R A W.b₄ :=
     map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
   by
@@ -297,7 +297,7 @@ theorem baseChange_b₆ : (W.base_change A).b₆ = algebraMap R A W.b₆ :=
     map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
   by
@@ -306,7 +306,7 @@ theorem baseChange_b₈ : (W.base_change A).b₈ = algebraMap R A W.b₈ :=
     map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
   by
@@ -315,7 +315,7 @@ theorem baseChange_c₄ : (W.base_change A).c₄ = algebraMap R A W.c₄ :=
     map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
   by
@@ -324,7 +324,7 @@ theorem baseChange_c₆ : (W.base_change A).c₆ = algebraMap R A W.c₆ :=
     map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp, nolint simp_nf]
 theorem baseChange_Δ : (W.base_change A).Δ = algebraMap R A W.Δ :=
   by
@@ -391,7 +391,7 @@ protected noncomputable def polynomial : R[X][Y] :=
   Y ^ 2 + c (c W.a₁ * x + c W.a₃) * Y - c (x ^ 3 + c W.a₂ * x ^ 2 + c W.a₄ * x + c W.a₆)
 #align weierstrass_curve.polynomial WeierstrassCurve.polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.662198539.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
 theorem polynomial_eq :
     W.Polynomial =
       Cubic.toPoly
@@ -444,7 +444,7 @@ theorem irreducible_polynomial [IsDomain R] : Irreducible W.Polynomial :=
   any_goals rw [degree_add_eq_right_of_degree_lt] <;> simp only [h] <;> decide
 #align weierstrass_curve.irreducible_polynomial WeierstrassCurve.irreducible_polynomial
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.140611923.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomial (x y : R) :
     (W.Polynomial.eval <| c y).eval x =
@@ -501,7 +501,7 @@ noncomputable def polynomialX : R[X][Y] :=
   c (c W.a₁) * Y - c (c 3 * x ^ 2 + c (2 * W.a₂) * x + c W.a₄)
 #align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.140611923.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomialX (x y : R) :
     (W.polynomialX.eval <| c y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) :=
@@ -523,7 +523,7 @@ noncomputable def polynomialY : R[X][Y] :=
   c (c 2) * Y + c (c W.a₁ * x + c W.a₃)
 #align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.140611923.eval_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3143603269.eval_simp -/
 @[simp]
 theorem eval_polynomialY (x y : R) : (W.polynomialY.eval <| c y).eval x = 2 * y + W.a₁ * x + W.a₃ :=
   by
@@ -775,7 +775,7 @@ theorem norm_smul_basis (p q : R[X]) :
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.662198539.C_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.3266784253.C_simp -/
 theorem coe_norm_smul_basis (p q : R[X]) :
     ↑(Algebra.norm R[X] <| p • 1 + q • AdjoinRoot.mk W.Polynomial Y) =
       AdjoinRoot.mk W.Polynomial ((c p + c q * x) * (c p + c q * (-x - c (c W.a₁ * x + c W.a₃)))) :=
@@ -943,7 +943,7 @@ theorem coe_inv_baseChange_Δ' : ↑(E.base_change A).Δ'⁻¹ = algebraMap R A
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
-/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.1840236955.map_simp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Builtin.lean:72:18: unsupported non-interactive tactic _private.272596109.map_simp -/
 @[simp]
 theorem baseChange_j : (E.base_change A).j = algebraMap R A E.j :=
   by

Changes in mathlib4

mathlib3
mathlib4
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
@@ -74,7 +74,7 @@ algebraic geometry which are not globally defined by a cubic equation valid over
 elliptic curve, weierstrass equation, j invariant
 -/
 
--- porting note: replaced `map_one`, `map_bit0`, and `map_bit1` with `map_ofNat`
+-- Porting note: replaced `map_one`, `map_bit0`, and `map_bit1` with `map_ofNat`
 local macro "map_simp" : tactic =>
   `(tactic| simp only [map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow])
 
@@ -617,7 +617,7 @@ section VariableChange
 
 variable (C : WeierstrassCurve.VariableChange R)
 
--- porting note: was just `@[simps]`
+-- Porting note: was just `@[simps]`
 /-- The elliptic curve over `R` induced by an admissible linear change of variables
 $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
 When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
@@ -666,7 +666,7 @@ section BaseChange
 
 variable {A : Type v} [CommRing A] (φ : R →+* A)
 
--- porting note: was just `@[simps]`
+-- Porting note: was just `@[simps]`
 /-- The elliptic curve mapped over a ring homomorphism `φ : R →+* A`. -/
 @[pp_dot, simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
 def map : EllipticCurve A :=
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
@@ -116,28 +116,28 @@ section Quantity
 
 /-! ### Standard quantities -/
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₂` coefficient of a Weierstrass curve. -/
 @[pp_dot]
 def b₂ : R :=
   W.a₁ ^ 2 + 4 * W.a₂
 #align weierstrass_curve.b₂ WeierstrassCurve.b₂
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₄` coefficient of a Weierstrass curve. -/
 @[pp_dot]
 def b₄ : R :=
   2 * W.a₄ + W.a₁ * W.a₃
 #align weierstrass_curve.b₄ WeierstrassCurve.b₄
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₆` coefficient of a Weierstrass curve. -/
 @[pp_dot]
 def b₆ : R :=
   W.a₃ ^ 2 + 4 * W.a₆
 #align weierstrass_curve.b₆ WeierstrassCurve.b₆
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₈` coefficient of a Weierstrass curve. -/
 @[pp_dot]
 def b₈ : R :=
@@ -149,21 +149,21 @@ lemma b_relation : 4 * W.b₈ = W.b₂ * W.b₆ - W.b₄ ^ 2 := by
   ring1
 #align weierstrass_curve.b_relation WeierstrassCurve.b_relation
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `c₄` coefficient of a Weierstrass curve. -/
 @[pp_dot]
 def c₄ : R :=
   W.b₂ ^ 2 - 24 * W.b₄
 #align weierstrass_curve.c₄ WeierstrassCurve.c₄
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `c₆` coefficient of a Weierstrass curve. -/
 @[pp_dot]
 def c₆ : R :=
   -W.b₂ ^ 3 + 36 * W.b₂ * W.b₄ - 216 * W.b₆
 #align weierstrass_curve.c₆ WeierstrassCurve.c₆
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The discriminant `Δ` of a Weierstrass curve. If `R` is a field, then this polynomial vanishes
 if and only if the cubic curve cut out by this equation is singular. Sometimes only defined up to
 sign in the literature; we choose the sign used by the LMFDB. For more discussion, see
@@ -599,7 +599,7 @@ add_decl_doc coe_Δ'
 
 variable {R : Type u} [CommRing R] (E : EllipticCurve R)
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
+-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
 /-- The j-invariant `j` of an elliptic curve, which is invariant under isomorphisms over `R`. -/
 @[pp_dot]
 def j : R :=
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
@@ -37,7 +37,7 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
  * `WeierstrassCurve.ofJ`: a Weierstrass curve whose j-invariant is neither 0 nor 1728.
  * `WeierstrassCurve.VariableChange`: a change of variables of Weierstrass curves.
  * `WeierstrassCurve.variableChange`: the Weierstrass curve induced by a change of variables.
- * `WeierstrassCurve.baseChange`: the Weierstrass curve base changed over a ring homomorphism.
+ * `WeierstrassCurve.map`: the Weierstrass curve mapped over a ring homomorphism.
  * `WeierstrassCurve.twoTorsionPolynomial`: the 2-torsion polynomial of a Weierstrass curve.
  * `EllipticCurve`: an elliptic curve over a commutative ring.
  * `EllipticCurve.j`: the j-invariant of an elliptic curve.
@@ -78,7 +78,7 @@ elliptic curve, weierstrass equation, j invariant
 local macro "map_simp" : tactic =>
   `(tactic| simp only [map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow])
 
-universe u v w
+universe s u v w
 
 /-! ## Weierstrass curves -/
 
@@ -358,68 +358,84 @@ end VariableChange
 
 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)
 
-/-- The Weierstrass curve base changed over a ring homomorphism `φ : R →+* A`. -/
+/-- The Weierstrass curve mapped over a ring homomorphism `φ : R →+* A`. -/
 @[pp_dot, simps]
-def baseChange : WeierstrassCurve A :=
+def map : WeierstrassCurve A :=
   ⟨φ W.a₁, φ W.a₂, φ W.a₃, φ W.a₄, φ W.a₆⟩
-#align weierstrass_curve.base_change WeierstrassCurve.baseChange
+#align weierstrass_curve.base_change WeierstrassCurve.map
+
+variable (A)
+
+/-- The Weierstrass curve base changed to an algebra `A` over `R`. -/
+@[pp_dot]
+abbrev baseChange [Algebra R A] : WeierstrassCurve A :=
+  W.map <| algebraMap R A
+
+variable {A}
 
 @[simp]
-lemma baseChange_b₂ : (W.baseChange φ).b₂ = φ W.b₂ := by
-  simp only [b₂, baseChange_a₁, baseChange_a₂]
+lemma map_b₂ : (W.map φ).b₂ = φ W.b₂ := by
+  simp only [b₂, map_a₁, map_a₂]
   map_simp
-#align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
+#align weierstrass_curve.base_change_b₂ WeierstrassCurve.map_b₂
 
 @[simp]
-lemma baseChange_b₄ : (W.baseChange φ).b₄ = φ W.b₄ := by
-  simp only [b₄, baseChange_a₁, baseChange_a₃, baseChange_a₄]
+lemma map_b₄ : (W.map φ).b₄ = φ W.b₄ := by
+  simp only [b₄, map_a₁, map_a₃, map_a₄]
   map_simp
-#align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
+#align weierstrass_curve.base_change_b₄ WeierstrassCurve.map_b₄
 
 @[simp]
-lemma baseChange_b₆ : (W.baseChange φ).b₆ = φ W.b₆ := by
-  simp only [b₆, baseChange_a₃, baseChange_a₆]
+lemma map_b₆ : (W.map φ).b₆ = φ W.b₆ := by
+  simp only [b₆, map_a₃, map_a₆]
   map_simp
-#align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
+#align weierstrass_curve.base_change_b₆ WeierstrassCurve.map_b₆
 
 @[simp]
-lemma baseChange_b₈ : (W.baseChange φ).b₈ = φ W.b₈ := by
-  simp only [b₈, baseChange_a₁, baseChange_a₂, baseChange_a₃, baseChange_a₄, baseChange_a₆]
+lemma map_b₈ : (W.map φ).b₈ = φ W.b₈ := by
+  simp only [b₈, map_a₁, map_a₂, map_a₃, map_a₄, map_a₆]
   map_simp
-#align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
+#align weierstrass_curve.base_change_b₈ WeierstrassCurve.map_b₈
 
 @[simp]
-lemma baseChange_c₄ : (W.baseChange φ).c₄ = φ W.c₄ := by
-  simp only [c₄, baseChange_b₂, baseChange_b₄]
+lemma map_c₄ : (W.map φ).c₄ = φ W.c₄ := by
+  simp only [c₄, map_b₂, map_b₄]
   map_simp
-#align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
+#align weierstrass_curve.base_change_c₄ WeierstrassCurve.map_c₄
 
 @[simp]
-lemma baseChange_c₆ : (W.baseChange φ).c₆ = φ W.c₆ := by
-  simp only [c₆, baseChange_b₂, baseChange_b₄, baseChange_b₆]
+lemma map_c₆ : (W.map φ).c₆ = φ W.c₆ := by
+  simp only [c₆, map_b₂, map_b₄, map_b₆]
   map_simp
-#align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
+#align weierstrass_curve.base_change_c₆ WeierstrassCurve.map_c₆
 
 @[simp]
-lemma baseChange_Δ : (W.baseChange φ).Δ = φ W.Δ := by
-  simp only [Δ, baseChange_b₂, baseChange_b₄, baseChange_b₆, baseChange_b₈]
+lemma map_Δ : (W.map φ).Δ = φ W.Δ := by
+  simp only [Δ, map_b₂, map_b₄, map_b₆, map_b₈]
   map_simp
-#align weierstrass_curve.base_change_Δ WeierstrassCurve.baseChange_Δ
+#align weierstrass_curve.base_change_Δ WeierstrassCurve.map_Δ
 
-lemma baseChange_self : W.baseChange (RingHom.id R) = W :=
+@[simp]
+lemma map_id : W.map (RingHom.id R) = W :=
   rfl
-#align weierstrass_curve.base_change_self WeierstrassCurve.baseChange_self
+#align weierstrass_curve.base_change_self WeierstrassCurve.map_id
 
-lemma baseChange_baseChange : (W.baseChange φ).baseChange ψ = W.baseChange (ψ.comp φ) :=
+lemma map_map {B : Type w} [CommRing B] (ψ : A →+* B) : (W.map φ).map ψ = W.map (ψ.comp φ) :=
   rfl
-#align weierstrass_curve.base_change_base_change WeierstrassCurve.baseChange_baseChange
 
-lemma baseChange_injective {φ : R →+* A} (hφ : Function.Injective φ) :
-    Function.Injective <| baseChange (φ := φ) := fun _ _ h => by
+@[simp]
+lemma map_baseChange {S : Type s} [CommRing S] [Algebra R S] {A : Type v} [CommRing A] [Algebra R A]
+    [Algebra S A] [IsScalarTower R S A] {B : Type w} [CommRing B] [Algebra R B] [Algebra S B]
+    [IsScalarTower R S B] (ψ : A →ₐ[S] B) : (W.baseChange A).map ψ = W.baseChange B :=
+  congr_arg W.map <| ψ.comp_algebraMap_of_tower R
+#align weierstrass_curve.base_change_base_change WeierstrassCurve.map_baseChange
+
+lemma map_injective {φ : R →+* A} (hφ : Function.Injective φ) :
+    Function.Injective <| map (φ := φ) := fun _ _ h => by
   rcases mk.inj h with ⟨_, _, _, _, _⟩
   ext <;> apply_fun _ using hφ <;> assumption
 
@@ -427,43 +443,59 @@ namespace VariableChange
 
 variable (C : VariableChange R)
 
-/-- The change of variables base changed over a ring homomorphism `φ : R →+* A`. -/
-@[simps]
-def baseChange : VariableChange A :=
+/-- The change of variables mapped over a ring homomorphism `φ : R →+* A`. -/
+@[pp_dot, simps]
+def map : VariableChange A :=
   ⟨Units.map φ C.u, φ C.r, φ C.s, φ C.t⟩
 
-lemma baseChange_id : (id : VariableChange R).baseChange φ = id := by
-  simp only [id, baseChange]
-  ext <;> simp only [map_one, Units.val_one, map_zero]
+variable (A)
 
-lemma baseChange_comp (C' : VariableChange R) :
-    (C.comp C').baseChange φ = (C.baseChange φ).comp (C'.baseChange φ) := by
-  simp only [comp, baseChange]
-  ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
+/-- The change of variables base changed to an algebra `A` over `R`. -/
+@[pp_dot]
+abbrev baseChange [Algebra R A] : VariableChange A :=
+  C.map <| algebraMap R A
 
-/-- The base change of a change of variables over a ring homomorphism is a group homomorphism. -/
-def baseChangeMap : VariableChange R →* VariableChange A where
-  toFun := baseChange φ
-  map_one' := baseChange_id φ
-  map_mul' := baseChange_comp φ
+variable {A}
 
-lemma baseChange_self : C.baseChange (RingHom.id R) = C :=
+@[simp]
+lemma map_id : C.map (RingHom.id R) = C :=
   rfl
 
-lemma baseChange_baseChange : (C.baseChange φ).baseChange ψ = C.baseChange (ψ.comp φ) :=
+lemma map_map {A : Type v} [CommRing A] (φ : R →+* A) {B : Type w} [CommRing B] (ψ : A →+* B) :
+    (C.map φ).map ψ = C.map (ψ.comp φ) :=
   rfl
 
-lemma baseChange_injective {φ : R →+* A} (hφ : Function.Injective φ) :
-    Function.Injective <| baseChange (φ := φ) := fun _ _ h => by
+@[simp]
+lemma map_baseChange {S : Type s} [CommRing S] [Algebra R S] {A : Type v} [CommRing A] [Algebra R A]
+    [Algebra S A] [IsScalarTower R S A] {B : Type w} [CommRing B] [Algebra R B] [Algebra S B]
+    [IsScalarTower R S B] (ψ : A →ₐ[S] B) : (C.baseChange A).map ψ = C.baseChange B :=
+  congr_arg C.map <| ψ.comp_algebraMap_of_tower R
+
+lemma map_injective {φ : R →+* A} (hφ : Function.Injective φ) :
+    Function.Injective <| map (φ := φ) := fun _ _ h => by
   rcases mk.inj h with ⟨h, _, _, _⟩
   replace h := (Units.mk.inj h).left
   ext <;> apply_fun _ using hφ <;> assumption
 
+private lemma id_map : (id : VariableChange R).map φ = id := by
+  simp only [id, map]
+  ext <;> simp only [map_one, Units.val_one, map_zero]
+
+private lemma comp_map (C' : VariableChange R) : (C.comp C').map φ = (C.map φ).comp (C'.map φ) := by
+  simp only [comp, map]
+  ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
+
+/-- The map over a ring homomorphism of a change of variables is a group homomorphism. -/
+def mapHom : VariableChange R →* VariableChange A where
+  toFun := map φ
+  map_one' := id_map φ
+  map_mul' := comp_map φ
+
 end VariableChange
 
-lemma baseChange_variableChange (C : VariableChange R) :
-    (W.baseChange φ).variableChange (C.baseChange φ) = (W.variableChange C).baseChange φ := by
-  simp only [baseChange, variableChange, VariableChange.baseChange]
+lemma map_variableChange (C : VariableChange R) :
+    (W.map φ).variableChange (C.map φ) = (W.variableChange C).map φ := by
+  simp only [map, variableChange, VariableChange.map]
   ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
 
 end BaseChange
@@ -630,35 +662,43 @@ end VariableChange
 
 section BaseChange
 
-/-! ### Base changes -/
+/-! ### Maps and base changes -/
 
 variable {A : Type v} [CommRing A] (φ : R →+* A)
 
 -- porting note: was just `@[simps]`
-/-- The elliptic curve base changed over a ring homomorphism `φ : R →+* A`. -/
+/-- The elliptic curve mapped over a ring homomorphism `φ : R →+* A`. -/
 @[pp_dot, simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
-def baseChange : EllipticCurve A :=
-  ⟨E.toWeierstrassCurve.baseChange φ, Units.map φ E.Δ',
-    by simp only [Units.coe_map, coe_Δ', E.baseChange_Δ]; rfl⟩
-#align elliptic_curve.base_change EllipticCurve.baseChange
+def map : EllipticCurve A :=
+  ⟨E.toWeierstrassCurve.map φ, Units.map φ E.Δ', by simp only [Units.coe_map, coe_Δ', E.map_Δ]; rfl⟩
+#align elliptic_curve.base_change EllipticCurve.map
+
+variable (A)
+
+/-- The elliptic curve base changed to an algebra `A` over `R`. -/
+@[pp_dot]
+abbrev baseChange [Algebra R A] : EllipticCurve A :=
+  E.map <| algebraMap R A
+
+variable {A}
 
-lemma coeBaseChange_Δ' : (E.baseChange φ).Δ' = φ E.Δ' :=
+lemma coe_map_Δ' : (E.map φ).Δ' = φ E.Δ' :=
   rfl
-#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBaseChange_Δ'
+#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coe_map_Δ'
 
-lemma coe_inv_baseChange_Δ' : (E.baseChange φ).Δ'⁻¹ = φ ↑E.Δ'⁻¹ :=
+lemma coe_inv_map_Δ' : (E.map φ).Δ'⁻¹ = φ ↑E.Δ'⁻¹ :=
   rfl
-#align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
+#align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_map_Δ'
 
 @[simp]
-lemma baseChange_j : (E.baseChange φ).j = φ E.j := by
-  simp only [j, baseChange, E.baseChange_c₄]
+lemma map_j : (E.map φ).j = φ E.j := by
+  simp only [j, map, E.map_c₄]
   map_simp
   rfl
-#align elliptic_curve.base_change_j EllipticCurve.baseChange_j
+#align elliptic_curve.base_change_j EllipticCurve.map_j
 
-lemma baseChange_injective {φ : R →+* A} (hφ : Function.Injective φ) :
-    Function.Injective <| baseChange (φ := φ) := fun _ _ h => by
+lemma map_injective {φ : R →+* A} (hφ : Function.Injective φ) :
+    Function.Injective <| map (φ := φ) := fun _ _ h => by
   rcases mk.inj h with ⟨h1, h2⟩
   replace h2 := (Units.mk.inj h2).left
   rcases WeierstrassCurve.mk.inj h1 with ⟨_, _, _, _, _⟩
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
@@ -37,7 +37,7 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
  * `WeierstrassCurve.ofJ`: a Weierstrass curve whose j-invariant is neither 0 nor 1728.
  * `WeierstrassCurve.VariableChange`: a change of variables of Weierstrass curves.
  * `WeierstrassCurve.variableChange`: the Weierstrass curve induced by a change of variables.
- * `WeierstrassCurve.baseChange`: the Weierstrass curve base changed over an algebra.
+ * `WeierstrassCurve.baseChange`: the Weierstrass curve base changed over a ring homomorphism.
  * `WeierstrassCurve.twoTorsionPolynomial`: the 2-torsion polynomial of a Weierstrass curve.
  * `EllipticCurve`: an elliptic curve over a commutative ring.
  * `EllipticCurve.j`: the j-invariant of an elliptic curve.
@@ -215,16 +215,16 @@ def id : VariableChange R :=
 /-- The composition of two linear changes of variables given by matrix multiplication. -/
 def comp : VariableChange R where
   u := C.u * C'.u
-  r := C.r * ↑C'.u ^ 2 + C'.r
-  s := ↑C'.u * C.s + C'.s
-  t := C.t * ↑C'.u ^ 3 + C.r * C'.s * ↑C'.u ^ 2 + C'.t
+  r := C.r * C'.u ^ 2 + C'.r
+  s := C'.u * C.s + C'.s
+  t := C.t * C'.u ^ 3 + C.r * C'.s * C'.u ^ 2 + C'.t
 
 /-- The inverse of a linear change of variables given by matrix inversion. -/
 def inv : VariableChange R where
   u := C.u⁻¹
-  r := -C.r * ↑C.u⁻¹ ^ 2
-  s := -C.s * ↑C.u⁻¹
-  t := (C.r * C.s - C.t) * ↑C.u⁻¹ ^ 3
+  r := -C.r * C.u⁻¹ ^ 2
+  s := -C.s * C.u⁻¹
+  t := (C.r * C.s - C.t) * C.u⁻¹ ^ 3
 
 lemma id_comp (C : VariableChange R) : comp id C = C := by
   simp only [comp, id, zero_add, zero_mul, mul_zero, one_mul]
@@ -261,12 +261,12 @@ variable (C : VariableChange R)
 $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
 @[pp_dot, simps]
 def variableChange : WeierstrassCurve R where
-  a₁ := ↑C.u⁻¹ * (W.a₁ + 2 * C.s)
-  a₂ := ↑C.u⁻¹ ^ 2 * (W.a₂ - C.s * W.a₁ + 3 * C.r - C.s ^ 2)
-  a₃ := ↑C.u⁻¹ ^ 3 * (W.a₃ + C.r * W.a₁ + 2 * C.t)
-  a₄ := ↑C.u⁻¹ ^ 4 * (W.a₄ - C.s * W.a₃ + 2 * C.r * W.a₂ - (C.t + C.r * C.s) * W.a₁ + 3 * C.r ^ 2
+  a₁ := C.u⁻¹ * (W.a₁ + 2 * C.s)
+  a₂ := C.u⁻¹ ^ 2 * (W.a₂ - C.s * W.a₁ + 3 * C.r - C.s ^ 2)
+  a₃ := C.u⁻¹ ^ 3 * (W.a₃ + C.r * W.a₁ + 2 * C.t)
+  a₄ := C.u⁻¹ ^ 4 * (W.a₄ - C.s * W.a₃ + 2 * C.r * W.a₂ - (C.t + C.r * C.s) * W.a₁ + 3 * C.r ^ 2
     - 2 * C.s * C.t)
-  a₆ := ↑C.u⁻¹ ^ 6 * (W.a₆ + C.r * W.a₄ + C.r ^ 2 * W.a₂ + C.r ^ 3 - C.t * W.a₃ - C.t ^ 2
+  a₆ := C.u⁻¹ ^ 6 * (W.a₆ + C.r * W.a₄ + C.r ^ 2 * W.a₂ + C.r ^ 3 - C.t * W.a₃ - C.t ^ 2
     - C.r * C.t * W.a₁)
 #align weierstrass_curve.variable_change WeierstrassCurve.variableChange
 
@@ -278,33 +278,29 @@ lemma variableChange_comp (C C' : VariableChange R) (W : WeierstrassCurve R) :
     W.variableChange (C.comp C') = (W.variableChange C').variableChange C := by
   simp only [VariableChange.comp, variableChange]
   ext <;> simp only [mul_inv, Units.val_mul]
-  · linear_combination (norm := ring1) ↑C.u⁻¹ * C.s * 2 * C'.u.inv_mul
+  · linear_combination (norm := ring1) C.u⁻¹ * C.s * 2 * C'.u.inv_mul
   · linear_combination (norm := ring1)
-      C.s * (-C'.s * 2 - W.a₁) * (↑C.u⁻¹ : R) ^ 2 * ↑C'.u⁻¹ * C'.u.inv_mul
-        + (C.r * 3 - C.s ^ 2) * (↑C.u⁻¹ : R) ^ 2 * pow_mul_pow_eq_one 2 C'.u.inv_mul
+      C.s * (-C'.s * 2 - W.a₁) * C.u⁻¹ ^ 2 * C'.u⁻¹ * C'.u.inv_mul
+        + (C.r * 3 - C.s ^ 2) * C.u⁻¹ ^ 2 * pow_mul_pow_eq_one 2 C'.u.inv_mul
   · linear_combination (norm := ring1)
-      C.r * (C'.s * 2 + W.a₁) * (↑C.u⁻¹ : R) ^ 3 * ↑C'.u⁻¹ * pow_mul_pow_eq_one 2 C'.u.inv_mul
-        + C.t * 2 * (↑C.u⁻¹ : R) ^ 3 * pow_mul_pow_eq_one 3 C'.u.inv_mul
+      C.r * (C'.s * 2 + W.a₁) * C.u⁻¹ ^ 3 * C'.u⁻¹ * pow_mul_pow_eq_one 2 C'.u.inv_mul
+        + C.t * 2 * C.u⁻¹ ^ 3 * pow_mul_pow_eq_one 3 C'.u.inv_mul
   · linear_combination (norm := ring1)
-      C.s * (-W.a₃ - C'.r * W.a₁ - C'.t * 2) * (↑C.u⁻¹ : R) ^ 4 * (↑C'.u⁻¹ : R) ^ 3 * C'.u.inv_mul
-        + (↑C.u⁻¹ : R) ^ 4 * (↑C'.u⁻¹ : R) ^ 2
-          * (C.r * C'.r * 6 + C.r * W.a₂ * 2 - C'.s * C.r * W.a₁ * 2 - C'.s ^ 2 * C.r * 2)
-          * pow_mul_pow_eq_one 2 C'.u.inv_mul
-        + -(↑C.u⁻¹ : R) ^ 4
-          * ↑C'.u⁻¹ * (C.s * C'.s * C.r * 2 + C.s * C.r * W.a₁ + C'.s * C.t * 2 + C.t * W.a₁)
-          * pow_mul_pow_eq_one 3 C'.u.inv_mul
-        + (↑C.u⁻¹ : R) ^ 4 * (C.r ^ 2 * 3 - C.s * C.t * 2) * pow_mul_pow_eq_one 4 C'.u.inv_mul
+      C.s * (-W.a₃ - C'.r * W.a₁ - C'.t * 2) * C.u⁻¹ ^ 4 * C'.u⁻¹ ^ 3 * C'.u.inv_mul
+        + C.u⁻¹ ^ 4 * C'.u⁻¹ ^ 2 * (C.r * C'.r * 6 + C.r * W.a₂ * 2 - C'.s * C.r * W.a₁ * 2
+          - C'.s ^ 2 * C.r * 2) * pow_mul_pow_eq_one 2 C'.u.inv_mul
+        - C.u⁻¹ ^ 4 * C'.u⁻¹ * (C.s * C'.s * C.r * 2 + C.s * C.r * W.a₁ + C'.s * C.t * 2
+          + C.t * W.a₁) * pow_mul_pow_eq_one 3 C'.u.inv_mul
+        + C.u⁻¹ ^ 4 * (C.r ^ 2 * 3 - C.s * C.t * 2) * pow_mul_pow_eq_one 4 C'.u.inv_mul
   · linear_combination (norm := ring1)
-      C.r * (↑C.u⁻¹ : R) ^ 6 * (↑C'.u⁻¹ : R) ^ 4 * (C'.r * W.a₂ * 2 - C'.r * C'.s * W.a₁
-          + C'.r ^ 2 * 3 + W.a₄ - C'.s * C'.t * 2 - C'.s * W.a₃ - C'.t * W.a₁)
-          * pow_mul_pow_eq_one 2 C'.u.inv_mul
-        + -(↑C.u⁻¹ : R) ^ 6 * (↑C'.u⁻¹ : R) ^ 3 * C.t * (C'.r * W.a₁ + C'.t * 2 + W.a₃)
+      C.r * C.u⁻¹ ^ 6 * C'.u⁻¹ ^ 4 * (C'.r * W.a₂ * 2 - C'.r * C'.s * W.a₁ + C'.r ^ 2 * 3 + W.a₄
+          - C'.s * C'.t * 2 - C'.s * W.a₃ - C'.t * W.a₁) * pow_mul_pow_eq_one 2 C'.u.inv_mul
+        - C.u⁻¹ ^ 6 * C'.u⁻¹ ^ 3 * C.t * (C'.r * W.a₁ + C'.t * 2 + W.a₃)
           * pow_mul_pow_eq_one 3 C'.u.inv_mul
-        + C.r ^ 2 * (↑C.u⁻¹ : R) ^ 6 * (↑C'.u⁻¹ : R) ^ 2
-          * (C'.r * 3 + W.a₂ - C'.s * W.a₁ - C'.s ^ 2) * pow_mul_pow_eq_one 4 C'.u.inv_mul
-        + -C.r * C.t * (↑C.u⁻¹ : R) ^ 6 * ↑C'.u⁻¹ * (C'.s * 2 + W.a₁)
-          * pow_mul_pow_eq_one 5 C'.u.inv_mul
-        + (↑C.u⁻¹ : R) ^ 6 * (C.r ^ 3 - C.t ^ 2) * pow_mul_pow_eq_one 6 C'.u.inv_mul
+        + C.r ^ 2 * C.u⁻¹ ^ 6 * C'.u⁻¹ ^ 2 * (C'.r * 3 + W.a₂ - C'.s * W.a₁ - C'.s ^ 2)
+          * pow_mul_pow_eq_one 4 C'.u.inv_mul
+        - C.r * C.t * C.u⁻¹ ^ 6 * C'.u⁻¹ * (C'.s * 2 + W.a₁) * pow_mul_pow_eq_one 5 C'.u.inv_mul
+        + C.u⁻¹ ^ 6 * (C.r ^ 3 - C.t ^ 2) * pow_mul_pow_eq_one 6 C'.u.inv_mul
 
 instance instMulActionVariableChange : MulAction (VariableChange R) (WeierstrassCurve R) where
   smul := fun C W => W.variableChange C
@@ -312,27 +308,27 @@ instance instMulActionVariableChange : MulAction (VariableChange R) (Weierstrass
   mul_smul := variableChange_comp
 
 @[simp]
-lemma variableChange_b₂ : (W.variableChange C).b₂ = (↑C.u⁻¹ : R) ^ 2 * (W.b₂ + 12 * C.r) := by
+lemma variableChange_b₂ : (W.variableChange C).b₂ = C.u⁻¹ ^ 2 * (W.b₂ + 12 * C.r) := by
   simp only [b₂, variableChange_a₁, variableChange_a₂]
   ring1
 #align weierstrass_curve.variable_change_b₂ WeierstrassCurve.variableChange_b₂
 
 @[simp]
 lemma variableChange_b₄ :
-    (W.variableChange C).b₄ = (↑C.u⁻¹ : R) ^ 4 * (W.b₄ + C.r * W.b₂ + 6 * C.r ^ 2) := by
+    (W.variableChange C).b₄ = C.u⁻¹ ^ 4 * (W.b₄ + C.r * W.b₂ + 6 * C.r ^ 2) := by
   simp only [b₂, b₄, variableChange_a₁, variableChange_a₃, variableChange_a₄]
   ring1
 #align weierstrass_curve.variable_change_b₄ WeierstrassCurve.variableChange_b₄
 
 @[simp]
 lemma variableChange_b₆ : (W.variableChange C).b₆ =
-    (↑C.u⁻¹ : R) ^ 6 * (W.b₆ + 2 * C.r * W.b₄ + C.r ^ 2 * W.b₂ + 4 * C.r ^ 3) := by
+    C.u⁻¹ ^ 6 * (W.b₆ + 2 * C.r * W.b₄ + C.r ^ 2 * W.b₂ + 4 * C.r ^ 3) := by
   simp only [b₂, b₄, b₆, variableChange_a₃, variableChange_a₆]
   ring1
 #align weierstrass_curve.variable_change_b₆ WeierstrassCurve.variableChange_b₆
 
 @[simp]
-lemma variableChange_b₈ : (W.variableChange C).b₈ = (↑C.u⁻¹ : R) ^ 8 *
+lemma variableChange_b₈ : (W.variableChange C).b₈ = C.u⁻¹ ^ 8 *
     (W.b₈ + 3 * C.r * W.b₆ + 3 * C.r ^ 2 * W.b₄ + C.r ^ 3 * W.b₂ + 3 * C.r ^ 4) := by
   simp only [b₂, b₄, b₆, b₈, variableChange_a₁, variableChange_a₂, variableChange_a₃,
     variableChange_a₄, variableChange_a₆]
@@ -340,19 +336,19 @@ lemma variableChange_b₈ : (W.variableChange C).b₈ = (↑C.u⁻¹ : R) ^ 8 *
 #align weierstrass_curve.variable_change_b₈ WeierstrassCurve.variableChange_b₈
 
 @[simp]
-lemma variableChange_c₄ : (W.variableChange C).c₄ = (↑C.u⁻¹ : R) ^ 4 * W.c₄ := by
+lemma variableChange_c₄ : (W.variableChange C).c₄ = C.u⁻¹ ^ 4 * W.c₄ := by
   simp only [c₄, variableChange_b₂, variableChange_b₄]
   ring1
 #align weierstrass_curve.variable_change_c₄ WeierstrassCurve.variableChange_c₄
 
 @[simp]
-lemma variableChange_c₆ : (W.variableChange C).c₆ = (↑C.u⁻¹ : R) ^ 6 * W.c₆ := by
+lemma variableChange_c₆ : (W.variableChange C).c₆ = C.u⁻¹ ^ 6 * W.c₆ := by
   simp only [c₆, variableChange_b₂, variableChange_b₄, variableChange_b₆]
   ring1
 #align weierstrass_curve.variable_change_c₆ WeierstrassCurve.variableChange_c₆
 
 @[simp]
-lemma variableChange_Δ : (W.variableChange C).Δ = (↑C.u⁻¹ : R) ^ 12 * W.Δ := by
+lemma variableChange_Δ : (W.variableChange C).Δ = C.u⁻¹ ^ 12 * W.Δ := by
   simp only [b₂, b₄, b₆, b₈, Δ, variableChange_a₁, variableChange_a₂, variableChange_a₃,
     variableChange_a₄, variableChange_a₆]
   ring1
@@ -364,111 +360,109 @@ 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)
 
-/-- The Weierstrass curve over `R` base changed to `A`. -/
+/-- The Weierstrass curve base changed over a ring homomorphism `φ : R →+* A`. -/
 @[pp_dot, simps]
 def baseChange : WeierstrassCurve A :=
-  ⟨algebraMap R A W.a₁, algebraMap R A W.a₂, algebraMap R A W.a₃, algebraMap R A W.a₄,
-    algebraMap R A W.a₆⟩
+  ⟨φ W.a₁, φ W.a₂, φ W.a₃, φ W.a₄, φ W.a₆⟩
 #align weierstrass_curve.base_change WeierstrassCurve.baseChange
 
 @[simp]
-lemma baseChange_b₂ : (W.baseChange A).b₂ = algebraMap R A W.b₂ := by
+lemma baseChange_b₂ : (W.baseChange φ).b₂ = φ W.b₂ := by
   simp only [b₂, baseChange_a₁, baseChange_a₂]
   map_simp
 #align weierstrass_curve.base_change_b₂ WeierstrassCurve.baseChange_b₂
 
 @[simp]
-lemma baseChange_b₄ : (W.baseChange A).b₄ = algebraMap R A W.b₄ := by
+lemma baseChange_b₄ : (W.baseChange φ).b₄ = φ W.b₄ := by
   simp only [b₄, baseChange_a₁, baseChange_a₃, baseChange_a₄]
   map_simp
 #align weierstrass_curve.base_change_b₄ WeierstrassCurve.baseChange_b₄
 
 @[simp]
-lemma baseChange_b₆ : (W.baseChange A).b₆ = algebraMap R A W.b₆ := by
+lemma baseChange_b₆ : (W.baseChange φ).b₆ = φ W.b₆ := by
   simp only [b₆, baseChange_a₃, baseChange_a₆]
   map_simp
 #align weierstrass_curve.base_change_b₆ WeierstrassCurve.baseChange_b₆
 
 @[simp]
-lemma baseChange_b₈ : (W.baseChange A).b₈ = algebraMap R A W.b₈ := by
+lemma baseChange_b₈ : (W.baseChange φ).b₈ = φ W.b₈ := by
   simp only [b₈, baseChange_a₁, baseChange_a₂, baseChange_a₃, baseChange_a₄, baseChange_a₆]
   map_simp
 #align weierstrass_curve.base_change_b₈ WeierstrassCurve.baseChange_b₈
 
 @[simp]
-lemma baseChange_c₄ : (W.baseChange A).c₄ = algebraMap R A W.c₄ := by
+lemma baseChange_c₄ : (W.baseChange φ).c₄ = φ W.c₄ := by
   simp only [c₄, baseChange_b₂, baseChange_b₄]
   map_simp
 #align weierstrass_curve.base_change_c₄ WeierstrassCurve.baseChange_c₄
 
 @[simp]
-lemma baseChange_c₆ : (W.baseChange A).c₆ = algebraMap R A W.c₆ := by
+lemma baseChange_c₆ : (W.baseChange φ).c₆ = φ W.c₆ := by
   simp only [c₆, baseChange_b₂, baseChange_b₄, baseChange_b₆]
   map_simp
 #align weierstrass_curve.base_change_c₆ WeierstrassCurve.baseChange_c₆
 
 @[simp]
-lemma baseChange_Δ : (W.baseChange A).Δ = algebraMap R A W.Δ := by
+lemma baseChange_Δ : (W.baseChange φ).Δ = φ W.Δ := by
   simp only [Δ, baseChange_b₂, baseChange_b₄, baseChange_b₆, baseChange_b₈]
   map_simp
 #align weierstrass_curve.base_change_Δ WeierstrassCurve.baseChange_Δ
 
-lemma baseChange_self : W.baseChange R = W := by
-  ext <;> rfl
+lemma baseChange_self : W.baseChange (RingHom.id R) = W :=
+  rfl
 #align weierstrass_curve.base_change_self WeierstrassCurve.baseChange_self
 
-lemma baseChange_baseChange : (W.baseChange A).baseChange B = W.baseChange B := by
-  ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
+lemma baseChange_baseChange : (W.baseChange φ).baseChange ψ = W.baseChange (ψ.comp φ) :=
+  rfl
 #align weierstrass_curve.base_change_base_change WeierstrassCurve.baseChange_baseChange
 
-lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
-    Function.Injective <| baseChange (R := R) (A := A) := fun W W' h1 => by
-  rcases mk.inj h1 with ⟨_, _, _, _, _⟩
-  ext <;> apply_fun _ using h <;> assumption
+lemma baseChange_injective {φ : R →+* A} (hφ : Function.Injective φ) :
+    Function.Injective <| baseChange (φ := φ) := fun _ _ h => by
+  rcases mk.inj h with ⟨_, _, _, _, _⟩
+  ext <;> apply_fun _ using hφ <;> assumption
 
 namespace VariableChange
 
 variable (C : VariableChange R)
 
-/-- The change of variables over `R` base changed to `A`. -/
+/-- The change of variables base changed over a ring homomorphism `φ : R →+* A`. -/
 @[simps]
 def baseChange : VariableChange A :=
-  ⟨Units.map (algebraMap R A) C.u, algebraMap R A C.r, algebraMap R A C.s, algebraMap R A C.t⟩
+  ⟨Units.map φ C.u, φ C.r, φ C.s, φ C.t⟩
 
-lemma baseChange_id : baseChange A (id : VariableChange R) = id := by
+lemma baseChange_id : (id : VariableChange R).baseChange φ = id := by
   simp only [id, baseChange]
   ext <;> simp only [map_one, Units.val_one, map_zero]
 
 lemma baseChange_comp (C' : VariableChange R) :
-    baseChange A (C.comp C') = (baseChange A C).comp (baseChange A C') := by
+    (C.comp C').baseChange φ = (C.baseChange φ).comp (C'.baseChange φ) := by
   simp only [comp, baseChange]
   ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
 
-/-- The base change to `A` of a change of variables over `R` is a group homomorphism. -/
+/-- The base change of a change of variables over a ring homomorphism is a group homomorphism. -/
 def baseChangeMap : VariableChange R →* VariableChange A where
-  toFun := baseChange A
-  map_one' := baseChange_id A
-  map_mul' := baseChange_comp A
+  toFun := baseChange φ
+  map_one' := baseChange_id φ
+  map_mul' := baseChange_comp φ
 
-lemma baseChange_self : C.baseChange R = C :=
+lemma baseChange_self : C.baseChange (RingHom.id R) = C :=
   rfl
 
-lemma baseChange_baseChange : (C.baseChange A).baseChange B = C.baseChange B := by
-  ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
+lemma baseChange_baseChange : (C.baseChange φ).baseChange ψ = C.baseChange (ψ.comp φ) :=
+  rfl
 
-lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
-    Function.Injective <| baseChange (R := R) A := fun C C' h1 => by
-  rcases mk.inj h1 with ⟨h1, _, _, _⟩
-  replace h1 := (Units.mk.inj h1).left
-  ext <;> apply_fun _ using h <;> assumption
+lemma baseChange_injective {φ : R →+* A} (hφ : Function.Injective φ) :
+    Function.Injective <| baseChange (φ := φ) := fun _ _ h => by
+  rcases mk.inj h with ⟨h, _, _, _⟩
+  replace h := (Units.mk.inj h).left
+  ext <;> apply_fun _ using hφ <;> assumption
 
 end VariableChange
 
 lemma baseChange_variableChange (C : VariableChange R) :
-    (W.baseChange A).variableChange (C.baseChange A) = (W.variableChange C).baseChange A := by
+    (W.baseChange φ).variableChange (C.baseChange φ) = (W.variableChange C).baseChange φ := by
   simp only [baseChange, variableChange, VariableChange.baseChange]
   ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
 
@@ -560,7 +554,7 @@ accurate for certain rings whose Picard group has trivial 12-torsion, such as a
 @[ext]
 structure EllipticCurve (R : Type u) [CommRing R] extends WeierstrassCurve R where
   Δ' : Rˣ
-  coe_Δ' : ↑Δ' = toWeierstrassCurve.Δ
+  coe_Δ' : Δ' = toWeierstrassCurve.Δ
 #align elliptic_curve EllipticCurve
 
 namespace EllipticCurve
@@ -577,7 +571,7 @@ variable {R : Type u} [CommRing R] (E : EllipticCurve R)
 /-- The j-invariant `j` of an elliptic curve, which is invariant under isomorphisms over `R`. -/
 @[pp_dot]
 def j : R :=
-  ↑E.Δ'⁻¹ * E.c₄ ^ 3
+  E.Δ'⁻¹ * E.c₄ ^ 3
 #align elliptic_curve.j EllipticCurve.j
 
 lemma twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] :
@@ -616,21 +610,20 @@ instance instMulActionVariableChange :
   one_smul := variableChange_id
   mul_smul := variableChange_comp
 
-lemma coe_variableChange_Δ' : (↑(E.variableChange C).Δ' : R) = (↑C.u⁻¹ : R) ^ 12 * E.Δ' := by
-  rw [variableChange_Δ', Units.val_mul, Units.val_pow_eq_pow_val]
+lemma coe_variableChange_Δ' : (E.variableChange C).Δ' = C.u⁻¹ ^ 12 * E.Δ' :=
+  rfl
 #align elliptic_curve.coe_variable_change_Δ' EllipticCurve.coe_variableChange_Δ'
 
-lemma coe_inv_variableChange_Δ' :
-    (↑(E.variableChange C).Δ'⁻¹ : R) = (C.u : R) ^ 12 * ↑E.Δ'⁻¹ := by
-  rw [variableChange_Δ', mul_inv, inv_pow, inv_inv, Units.val_mul, Units.val_pow_eq_pow_val]
+lemma coe_inv_variableChange_Δ' : (E.variableChange C).Δ'⁻¹ = C.u ^ 12 * E.Δ'⁻¹ := by
+  rw [variableChange_Δ', mul_inv, inv_pow, inv_inv]
 #align elliptic_curve.coe_inv_variable_change_Δ' EllipticCurve.coe_inv_variableChange_Δ'
 
 @[simp]
 lemma variableChange_j : (E.variableChange C).j = E.j := by
-  rw [j, coe_inv_variableChange_Δ']
-  have hu : (C.u * ↑C.u⁻¹ : R) ^ 12 = 1 := by rw [C.u.mul_inv, one_pow]
-  linear_combination (norm := (rw [variableChange_toWeierstrassCurve,
-    WeierstrassCurve.variableChange_c₄, j]; ring1)) E.j * hu
+  rw [j, coe_inv_variableChange_Δ', Units.val_mul, Units.val_pow_eq_pow_val,
+    variableChange_toWeierstrassCurve, WeierstrassCurve.variableChange_c₄]
+  have hu : (C.u * C.u⁻¹ : R) ^ 12 = 1 := by rw [C.u.mul_inv, one_pow]
+  linear_combination (norm := (rw [j]; ring1)) E.j * hu
 #align elliptic_curve.variable_change_j EllipticCurve.variableChange_j
 
 end VariableChange
@@ -639,37 +632,37 @@ section BaseChange
 
 /-! ### Base changes -/
 
-variable (A : Type v) [CommRing A] [Algebra R A]
+variable {A : Type v} [CommRing A] (φ : R →+* A)
 
 -- porting note: was just `@[simps]`
-/-- The elliptic curve over `R` base changed to `A`. -/
+/-- The elliptic curve base changed over a ring homomorphism `φ : R →+* A`. -/
 @[pp_dot, simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
 def baseChange : EllipticCurve A :=
-  ⟨E.toWeierstrassCurve.baseChange A, Units.map (↑(algebraMap R A)) E.Δ',
+  ⟨E.toWeierstrassCurve.baseChange φ, Units.map φ E.Δ',
     by simp only [Units.coe_map, coe_Δ', E.baseChange_Δ]; rfl⟩
 #align elliptic_curve.base_change EllipticCurve.baseChange
 
-lemma coeBaseChange_Δ' : ↑(E.baseChange A).Δ' = algebraMap R A E.Δ' :=
+lemma coeBaseChange_Δ' : (E.baseChange φ).Δ' = φ E.Δ' :=
   rfl
 #align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBaseChange_Δ'
 
-lemma coe_inv_baseChange_Δ' : ↑(E.baseChange A).Δ'⁻¹ = algebraMap R A ↑E.Δ'⁻¹ :=
+lemma coe_inv_baseChange_Δ' : (E.baseChange φ).Δ'⁻¹ = φ ↑E.Δ'⁻¹ :=
   rfl
 #align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
 
 @[simp]
-lemma baseChange_j : (E.baseChange A).j = algebraMap R A E.j := by
+lemma baseChange_j : (E.baseChange φ).j = φ E.j := by
   simp only [j, baseChange, E.baseChange_c₄]
   map_simp
   rfl
 #align elliptic_curve.base_change_j EllipticCurve.baseChange_j
 
-lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
-    Function.Injective <| baseChange (R := R) (A := A) := fun E E' h1 => by
-  rcases mk.inj h1 with ⟨h1, h2⟩
+lemma baseChange_injective {φ : R →+* A} (hφ : Function.Injective φ) :
+    Function.Injective <| baseChange (φ := φ) := fun _ _ h => by
+  rcases mk.inj h with ⟨h1, h2⟩
   replace h2 := (Units.mk.inj h2).left
   rcases WeierstrassCurve.mk.inj h1 with ⟨_, _, _, _, _⟩
-  ext <;> apply_fun _ using h <;> assumption
+  ext <;> apply_fun _ using hφ <;> assumption
 
 end BaseChange
 
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.

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
 -/
 import Mathlib.Algebra.CubicDiscriminant
-import Mathlib.RingTheory.Norm
+import Mathlib.Tactic.FieldSimp
 import Mathlib.Tactic.LinearCombination
 
 #align_import algebraic_geometry.elliptic_curve.weierstrass from "leanprover-community/mathlib"@"e2e7f2ac359e7514e4d40061d7c08bb69487ba4e"
@@ -32,38 +32,27 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
 
  * `WeierstrassCurve`: a Weierstrass curve over a commutative ring.
  * `WeierstrassCurve.Δ`: the discriminant of a Weierstrass curve.
- * `WeierstrassCurve.ofJ0`, `WeierstrassCurve.ofJ1728`, `WeierstrassCurve.ofJ`:
-    Weierstrass curves whose $j$-invariants are $0$, $1728$ and $j\neq 0,1728$, respectively.
+ * `WeierstrassCurve.ofJ0`: a Weierstrass curve whose j-invariant is 0.
+ * `WeierstrassCurve.ofJ1728`: a Weierstrass curve whose j-invariant is 1728.
+ * `WeierstrassCurve.ofJ`: a Weierstrass curve whose j-invariant is neither 0 nor 1728.
  * `WeierstrassCurve.VariableChange`: a change of variables of Weierstrass curves.
  * `WeierstrassCurve.variableChange`: the Weierstrass curve induced by a change of variables.
  * `WeierstrassCurve.baseChange`: the Weierstrass curve base changed over an algebra.
  * `WeierstrassCurve.twoTorsionPolynomial`: the 2-torsion polynomial of a Weierstrass curve.
- * `WeierstrassCurve.polynomial`: the polynomial associated to a Weierstrass curve.
- * `WeierstrassCurve.equation`: the Weierstrass equation of a Weierstrass curve.
- * `WeierstrassCurve.nonsingular`: the nonsingular condition at a point on a Weierstrass curve.
- * `WeierstrassCurve.CoordinateRing`: the coordinate ring of a Weierstrass curve.
- * `WeierstrassCurve.FunctionField`: the function field of a Weierstrass curve.
- * `WeierstrassCurve.CoordinateRing.basis`: the power basis of the coordinate ring over `R[X]`.
  * `EllipticCurve`: an elliptic curve over a commutative ring.
  * `EllipticCurve.j`: the j-invariant of an elliptic curve.
- * `EllipticCurve.ofJ0`, `EllipticCurve.ofJ1728`, `EllipticCurve.ofJ'`: elliptic curves whose
-    $j$-invariants are $0$, $1728$ and $j\neq 0,1728$, respectively.
- * `EllipticCurve.ofJ`: an elliptic curve over a field $F$, whose $j$-invariant equal to $j$.
+ * `EllipticCurve.ofJ0`: an elliptic curve whose j-invariant is 0.
+ * `EllipticCurve.ofJ1728`: an elliptic curve whose j-invariant is 1728.
+ * `EllipticCurve.ofJ'`: an elliptic curve whose j-invariant is neither 0 nor 1728.
+ * `EllipticCurve.ofJ`: an elliptic curve whose j-invariant equal to j.
 
 ## Main statements
 
  * `WeierstrassCurve.twoTorsionPolynomial_disc`: the discriminant of a Weierstrass curve is a
     constant factor of the cubic discriminant of its 2-torsion polynomial.
- * `WeierstrassCurve.nonsingular_of_Δ_ne_zero`: a Weierstrass curve is nonsingular at every point
-    if its discriminant is non-zero.
- * `WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing`: the coordinate ring of a
-    Weierstrass curve is an integral domain.
- * `WeierstrassCurve.CoordinateRing.degree_norm_smul_basis`: the degree of the norm of an element
-    in the coordinate ring in terms of the power basis.
- * `EllipticCurve.nonsingular`: an elliptic curve is nonsingular at every point.
  * `EllipticCurve.variableChange_j`: the j-invariant of an elliptic curve is invariant under an
     admissible linear change of variables.
- * `EllipticCurve.ofJ_j`: the $j$-invariant of `EllipticCurve.ofJ` is equal to $j$.
+ * `EllipticCurve.ofJ_j`: the j-invariant of `EllipticCurve.ofJ` is equal to j.
 
 ## Implementation notes
 
@@ -91,8 +80,6 @@ local macro "map_simp" : tactic =>
 
 universe u v w
 
-variable {R : Type u}
-
 /-! ## Weierstrass curves -/
 
 /-- A Weierstrass curve $Y^2 + a_1XY + a_3Y = X^3 + a_2X^2 + a_4X + a_6$ with parameters $a_i$. -/
@@ -118,11 +105,12 @@ add_decl_doc a₄
 /-- The `a₆` coefficient of a Weierstrass curve. -/
 add_decl_doc a₆
 
-instance instInhabitedWeierstrassCurve [Inhabited R] : Inhabited <| WeierstrassCurve R :=
+instance instInhabitedWeierstrassCurve {R : Type u} [Inhabited R] :
+    Inhabited <| WeierstrassCurve R :=
   ⟨⟨default, default, default, default, default⟩⟩
 #align weierstrass_curve.inhabited WeierstrassCurve.instInhabitedWeierstrassCurve
 
-variable [CommRing R] (W : WeierstrassCurve R)
+variable {R : Type u} [CommRing R] (W : WeierstrassCurve R)
 
 section Quantity
 
@@ -130,24 +118,28 @@ section Quantity
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₂` coefficient of a Weierstrass curve. -/
+@[pp_dot]
 def b₂ : R :=
   W.a₁ ^ 2 + 4 * W.a₂
 #align weierstrass_curve.b₂ WeierstrassCurve.b₂
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₄` coefficient of a Weierstrass curve. -/
+@[pp_dot]
 def b₄ : R :=
   2 * W.a₄ + W.a₁ * W.a₃
 #align weierstrass_curve.b₄ WeierstrassCurve.b₄
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₆` coefficient of a Weierstrass curve. -/
+@[pp_dot]
 def b₆ : R :=
   W.a₃ ^ 2 + 4 * W.a₆
 #align weierstrass_curve.b₆ WeierstrassCurve.b₆
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `b₈` coefficient of a Weierstrass curve. -/
+@[pp_dot]
 def b₈ : R :=
   W.a₁ ^ 2 * W.a₆ + 4 * W.a₂ * W.a₆ - W.a₁ * W.a₃ * W.a₄ + W.a₂ * W.a₃ ^ 2 - W.a₄ ^ 2
 #align weierstrass_curve.b₈ WeierstrassCurve.b₈
@@ -159,12 +151,14 @@ lemma b_relation : 4 * W.b₈ = W.b₂ * W.b₆ - W.b₄ ^ 2 := by
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `c₄` coefficient of a Weierstrass curve. -/
+@[pp_dot]
 def c₄ : R :=
   W.b₂ ^ 2 - 24 * W.b₄
 #align weierstrass_curve.c₄ WeierstrassCurve.c₄
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The `c₆` coefficient of a Weierstrass curve. -/
+@[pp_dot]
 def c₆ : R :=
   -W.b₂ ^ 3 + 36 * W.b₂ * W.b₄ - 216 * W.b₆
 #align weierstrass_curve.c₆ WeierstrassCurve.c₆
@@ -174,6 +168,7 @@ def c₆ : R :=
 if and only if the cubic curve cut out by this equation is singular. Sometimes only defined up to
 sign in the literature; we choose the sign used by the LMFDB. For more discussion, see
 [the LMFDB page on discriminants](https://www.lmfdb.org/knowledge/show/ec.discriminant). -/
+@[pp_dot]
 def Δ : R :=
   -W.b₂ ^ 2 * W.b₈ - 8 * W.b₄ ^ 3 - 27 * W.b₆ ^ 2 + 9 * W.b₂ * W.b₄ * W.b₆
 #align weierstrass_curve.Δ WeierstrassCurve.Δ
@@ -185,64 +180,13 @@ lemma c_relation : 1728 * W.Δ = W.c₄ ^ 3 - W.c₆ ^ 2 := by
 
 end Quantity
 
-section ModelsWithJ
-
-variable (R)
-
-/-- The Weierstrass curve $Y^2 + Y = X^3$.
-It is of $j$-invariant $0$ if it is an elliptic curve. -/
-def ofJ0 : WeierstrassCurve R :=
-  ⟨0, 0, 1, 0, 0⟩
-
-lemma ofJ0_c₄ : (ofJ0 R).c₄ = 0 := by
-  rw [ofJ0, c₄, b₂, b₄]
-  norm_num1
-
-lemma ofJ0_Δ : (ofJ0 R).Δ = -27 := by
-  rw [ofJ0, Δ, b₂, b₄, b₆, b₈]
-  norm_num1
-
-/-- The Weierstrass curve $Y^2 = X^3 + X$.
-It is of $j$-invariant $1728$ if it is an elliptic curve. -/
-def ofJ1728 : WeierstrassCurve R :=
-  ⟨0, 0, 0, 1, 0⟩
-
-lemma ofJ1728_c₄ : (ofJ1728 R).c₄ = -48 := by
-  rw [ofJ1728, c₄, b₂, b₄]
-  norm_num1
-
-lemma ofJ1728_Δ : (ofJ1728 R).Δ = -64 := by
-  rw [ofJ1728, Δ, b₂, b₄, b₆, b₈]
-  norm_num1
-
-variable {R} (j : R)
-
-/-- The Weierstrass curve $Y^2 + (j - 1728)XY = X^3 - 36(j - 1728)^3X - (j - 1728)^5$.
-It is of $j$-invariant $j$ if it is an elliptic curve. -/
-def ofJ : WeierstrassCurve R :=
-  ⟨j - 1728, 0, 0, -36 * (j - 1728) ^ 3, -(j - 1728) ^ 5⟩
-
-lemma ofJ_c₄ : (ofJ j).c₄ = j * (j - 1728) ^ 3 := by
-  simp only [ofJ, c₄, b₂, b₄]
-  ring1
-
-lemma ofJ_Δ : (ofJ j).Δ = j ^ 2 * (j - 1728) ^ 9 := by
-  simp only [ofJ, Δ, b₂, b₄, b₆, b₈]
-  ring1
-
-end ModelsWithJ
-
 section VariableChange
 
 /-! ### Variable changes -/
 
-/-- An admissible linear change of variables of Weierstrass curves defined over a ring `R`.
-It consists of a tuple $(u,r,s,t)$ of elements in $R$, with $u$ invertible.
-As a matrix, it is $\begin{pmatrix}
-u^2 & 0 & r \cr
-u^2s & u^3 & t \cr
-0 & 0 & 1
-\end{pmatrix}$. -/
+/-- An admissible linear change of variables of Weierstrass curves defined over a ring `R` given by
+a tuple $(u, r, s, t)$ for some $u \in R^\times$ and some $r, s, t \in R$. As a matrix, it is
+$\begin{pmatrix} u^2 & 0 & r \cr u^2s & u^3 & t \cr 0 & 0 & 1 \end{pmatrix}$. -/
 @[ext]
 structure VariableChange (R : Type u) [CommRing R] where
   (u : Rˣ)
@@ -264,19 +208,18 @@ add_decl_doc t
 
 variable (C C' C'' : VariableChange R)
 
-/-- The identity linear change of variables. As a matrix, it is just identity matrix. -/
+/-- The identity linear change of variables given by the identity matrix. -/
 def id : VariableChange R :=
   ⟨1, 0, 0, 0⟩
 
-/-- The composition of two linear change of variables. As matrices, it is just matrix
-multiplcation. -/
+/-- The composition of two linear changes of variables given by matrix multiplication. -/
 def comp : VariableChange R where
   u := C.u * C'.u
   r := C.r * ↑C'.u ^ 2 + C'.r
   s := ↑C'.u * C.s + C'.s
   t := C.t * ↑C'.u ^ 3 + C.r * C'.s * ↑C'.u ^ 2 + C'.t
 
-/-- The inverse of a linear change of variables. As a matrix, it is just matrix inverse. -/
+/-- The inverse of a linear change of variables given by matrix inversion. -/
 def inv : VariableChange R where
   u := C.u⁻¹
   r := -C.r * ↑C.u⁻¹ ^ 2
@@ -295,9 +238,8 @@ lemma comp_left_inv (C : VariableChange R) : comp (inv C) C = id := by
   · exact C.u.inv_mul
   · linear_combination (norm := ring1) -C.r * pow_mul_pow_eq_one 2 C.u.inv_mul
   · linear_combination (norm := ring1) -C.s * C.u.inv_mul
-  · linear_combination (norm := ring1)
-      (C.r * C.s - C.t) * pow_mul_pow_eq_one 3 C.u.inv_mul
-        + -C.r * C.s * pow_mul_pow_eq_one 2 C.u.inv_mul
+  · linear_combination (norm := ring1) (C.r * C.s - C.t) * pow_mul_pow_eq_one 3 C.u.inv_mul
+      + -C.r * C.s * pow_mul_pow_eq_one 2 C.u.inv_mul
 
 lemma comp_assoc (C C' C'' : VariableChange R) : comp (comp C C') C'' = comp C (comp C' C'') := by
   ext <;> simp only [comp, Units.val_mul] <;> ring1
@@ -317,7 +259,7 @@ variable (C : VariableChange R)
 
 /-- The Weierstrass curve over `R` induced by an admissible linear change of variables
 $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
-@[simps]
+@[pp_dot, simps]
 def variableChange : WeierstrassCurve R where
   a₁ := ↑C.u⁻¹ * (W.a₁ + 2 * C.s)
   a₂ := ↑C.u⁻¹ ^ 2 * (W.a₂ - C.s * W.a₁ + 3 * C.r - C.s ^ 2)
@@ -383,18 +325,15 @@ lemma variableChange_b₄ :
 #align weierstrass_curve.variable_change_b₄ WeierstrassCurve.variableChange_b₄
 
 @[simp]
-lemma variableChange_b₆ :
-    (W.variableChange C).b₆ =
-      (↑C.u⁻¹ : R) ^ 6 * (W.b₆ + 2 * C.r * W.b₄ + C.r ^ 2 * W.b₂ + 4 * C.r ^ 3) := by
+lemma variableChange_b₆ : (W.variableChange C).b₆ =
+    (↑C.u⁻¹ : R) ^ 6 * (W.b₆ + 2 * C.r * W.b₄ + C.r ^ 2 * W.b₂ + 4 * C.r ^ 3) := by
   simp only [b₂, b₄, b₆, variableChange_a₃, variableChange_a₆]
   ring1
 #align weierstrass_curve.variable_change_b₆ WeierstrassCurve.variableChange_b₆
 
 @[simp]
-lemma variableChange_b₈ :
-    (W.variableChange C).b₈ =
-      (↑C.u⁻¹ : R) ^ 8 * (W.b₈ + 3 * C.r * W.b₆ + 3 * C.r ^ 2 * W.b₄ + C.r ^ 3 * W.b₂
-        + 3 * C.r ^ 4) := by
+lemma variableChange_b₈ : (W.variableChange C).b₈ = (↑C.u⁻¹ : R) ^ 8 *
+    (W.b₈ + 3 * C.r * W.b₆ + 3 * C.r ^ 2 * W.b₄ + C.r ^ 3 * W.b₂ + 3 * C.r ^ 4) := by
   simp only [b₂, b₄, b₆, b₈, variableChange_a₁, variableChange_a₂, variableChange_a₃,
     variableChange_a₄, variableChange_a₆]
   ring1
@@ -421,15 +360,15 @@ lemma variableChange_Δ : (W.variableChange C).Δ = (↑C.u⁻¹ : R) ^ 12 * W.
 
 end VariableChange
 
-variable (A : Type v) [CommRing A] [Algebra R A] (B : Type w) [CommRing B] [Algebra R B]
-  [Algebra A B] [IsScalarTower R A B]
-
 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]
+
 /-- The Weierstrass curve over `R` base changed to `A`. -/
-@[simps]
+@[pp_dot, simps]
 def baseChange : WeierstrassCurve A :=
   ⟨algebraMap R A W.a₁, algebraMap R A W.a₂, algebraMap R A W.a₃, algebraMap R A W.a₄,
     algebraMap R A W.a₆⟩
@@ -506,10 +445,9 @@ lemma baseChange_id : baseChange A (id : VariableChange R) = id := by
 lemma baseChange_comp (C' : VariableChange R) :
     baseChange A (C.comp C') = (baseChange A C).comp (baseChange A C') := by
   simp only [comp, baseChange]
-  ext <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe,
-    map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow]
+  ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
 
-/-- The base change of change of variables over `R` to `A` is a group homomorphism. -/
+/-- The base change to `A` of a change of variables over `R` is a group homomorphism. -/
 def baseChangeMap : VariableChange R →* VariableChange A where
   toFun := baseChange A
   map_one' := baseChange_id A
@@ -532,8 +470,7 @@ end VariableChange
 lemma baseChange_variableChange (C : VariableChange R) :
     (W.baseChange A).variableChange (C.baseChange A) = (W.variableChange C).baseChange A := by
   simp only [baseChange, variableChange, VariableChange.baseChange]
-  ext <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe,
-    map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow]
+  ext <;> map_simp <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe]
 
 end BaseChange
 
@@ -544,6 +481,7 @@ section TorsionPolynomial
 /-- A cubic polynomial whose discriminant is a multiple of the Weierstrass curve discriminant. If
 `W` is an elliptic curve over a field `R` of characteristic different from 2, then its roots over a
 splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsion points of `W`. -/
+@[pp_dot]
 def twoTorsionPolynomial : Cubic R :=
   ⟨4, W.b₂, 2 * W.b₄, W.b₆⟩
 #align weierstrass_curve.two_torsion_polynomial WeierstrassCurve.twoTorsionPolynomial
@@ -566,537 +504,52 @@ lemma twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] (hΔ
 
 end TorsionPolynomial
 
-/-- The notation `Y` for `X` in the `PolynomialPolynomial` scope. -/
-scoped[PolynomialPolynomial] notation "Y" => Polynomial.X
-
-/-- The notation `R[X][Y]` for `R[X][X]` in the `PolynomialPolynomial` scope. -/
-scoped[PolynomialPolynomial] notation R "[X][Y]" => Polynomial (Polynomial R)
-
-section Polynomial
-
-/-! ### Weierstrass equations -/
-
-open Polynomial
-
--- porting note: relocated into `Polynomial` section
-local macro "eval_simp" : tactic =>
-  `(tactic| simp only [eval_C, eval_X, eval_add, eval_sub, eval_mul, eval_pow])
-
--- porting note: relocated into `Polynomial` section
-local macro "C_simp" : tactic =>
-  `(tactic| simp only [C_0, C_1, C_neg, C_add, C_sub, C_mul, C_pow])
-
-open scoped Polynomial PolynomialPolynomial
-
-/-- The polynomial $W(X, Y) := Y^2 + a_1XY + a_3Y - (X^3 + a_2X^2 + a_4X + a_6)$ associated to a
-Weierstrass curve `W` over `R`. For ease of polynomial manipulation, this is represented as a term
-of type `R[X][X]`, where the inner variable represents $X$ and the outer variable represents $Y$.
-For clarity, the alternative notations `Y` and `R[X][Y]` are provided in the `PolynomialPolynomial`
-scope to represent the outer variable and the bivariate polynomial ring `R[X][X]` respectively. -/
-protected noncomputable def polynomial : R[X][Y] :=
-  Y ^ 2 + C (C W.a₁ * X + C W.a₃) * Y - C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)
-#align weierstrass_curve.polynomial WeierstrassCurve.polynomial
-
-lemma polynomial_eq :
-    W.polynomial =
-      Cubic.toPoly
-        ⟨0, 1, Cubic.toPoly ⟨0, 0, W.a₁, W.a₃⟩, Cubic.toPoly ⟨-1, -W.a₂, -W.a₄, -W.a₆⟩⟩ := by
-  simp only [WeierstrassCurve.polynomial, Cubic.toPoly]
-  C_simp
-  ring1
-#align weierstrass_curve.polynomial_eq WeierstrassCurve.polynomial_eq
-
-lemma polynomial_ne_zero [Nontrivial R] : W.polynomial ≠ 0 := by
-  rw [polynomial_eq]
-  exact Cubic.ne_zero_of_b_ne_zero one_ne_zero
-#align weierstrass_curve.polynomial_ne_zero WeierstrassCurve.polynomial_ne_zero
-
-@[simp]
-lemma degree_polynomial [Nontrivial R] : W.polynomial.degree = 2 := by
-  rw [polynomial_eq]
-  exact Cubic.degree_of_b_ne_zero' one_ne_zero
-#align weierstrass_curve.degree_polynomial WeierstrassCurve.degree_polynomial
-
-@[simp]
-lemma natDegree_polynomial [Nontrivial R] : W.polynomial.natDegree = 2 := by
-  rw [polynomial_eq]
-  exact Cubic.natDegree_of_b_ne_zero' one_ne_zero
-#align weierstrass_curve.nat_degree_polynomial WeierstrassCurve.natDegree_polynomial
-
-lemma monic_polynomial : W.polynomial.Monic := by
-  nontriviality R
-  simpa only [polynomial_eq] using Cubic.monic_of_b_eq_one'
-#align weierstrass_curve.monic_polynomial WeierstrassCurve.monic_polynomial
-
-lemma irreducible_polynomial [IsDomain R] : Irreducible W.polynomial := by
-  by_contra h
-  rcases (W.monic_polynomial.not_irreducible_iff_exists_add_mul_eq_coeff W.natDegree_polynomial).mp
-    h with ⟨f, g, h0, h1⟩
-  simp only [polynomial_eq, Cubic.coeff_eq_c, Cubic.coeff_eq_d] at h0 h1
-  apply_fun degree at h0 h1
-  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
-  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.irreducible_polynomial
-
--- porting note: 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 [WeierstrassCurve.polynomial]
-  eval_simp
-  rw [add_mul, ← add_assoc]
-#align weierstrass_curve.eval_polynomial WeierstrassCurve.eval_polynomial
-
-@[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 _]
-#align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.eval_polynomial_zero
-
--- porting note: added `protected` for consistency with `WeierstrassCurve.polynomial`
-/-- The proposition that an affine point $(x, y)$ lies in `W`. In other words, $W(x, y) = 0$. -/
-protected def equation (x y : R) : Prop :=
-  (W.polynomial.eval <| C y).eval x = 0
-#align weierstrass_curve.equation WeierstrassCurve.equation
-
-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₆) = 0 := by
-  rw [WeierstrassCurve.equation, eval_polynomial]
-#align weierstrass_curve.equation_iff' WeierstrassCurve.equation_iff'
-
--- porting note: 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]
-#align weierstrass_curve.equation_iff WeierstrassCurve.equation_iff
-
-@[simp]
-lemma equation_zero : W.equation 0 0 ↔ W.a₆ = 0 := by
-  rw [WeierstrassCurve.equation, C_0, eval_polynomial_zero, neg_eq_zero]
-#align weierstrass_curve.equation_zero WeierstrassCurve.equation_zero
-
-lemma equation_iff_variableChange (x y : R) :
-    W.equation x y ↔ (W.variableChange ⟨1, x, 0, y⟩).equation 0 0 := by
-  rw [equation_iff', ← neg_eq_zero, equation_zero, variableChange_a₆, inv_one, Units.val_one]
-  congr! 1
-  ring1
-#align weierstrass_curve.equation_iff_variable_change WeierstrassCurve.equation_iff_variableChange
-
-lemma equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.equation x y ↔ (W.baseChange A).equation (algebraMap R A x) (algebraMap R A y) := by
-  simp only [equation_iff]
-  exact
-    ⟨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⟩
-#align weierstrass_curve.equation_iff_base_change WeierstrassCurve.equation_iff_baseChange
+section ModelsWithJ
 
-lemma equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
-    (W.baseChange A).equation x y ↔
-      (W.baseChange B).equation (algebraMap A B x) (algebraMap A B y) := by
-  rw [equation_iff_baseChange (W.baseChange A) B, baseChange_baseChange]
-#align weierstrass_curve.equation_iff_base_change_of_base_change WeierstrassCurve.equation_iff_baseChange_of_baseChange
+/-! ### Models with prescribed j-invariant -/
 
-/-! ### Nonsingularity of Weierstrass curves -/
+variable (R)
 
--- porting note: added `protected` for consistency with `WeierstrassCurve.polynomial`
-/-- The partial derivative $W_X(X, Y)$ of $W(X, Y)$ with respect to $X$.
+/-- The Weierstrass curve $Y^2 + Y = X^3$. It is of j-invariant 0 if it is an elliptic curve. -/
+def ofJ0 : WeierstrassCurve R :=
+  ⟨0, 0, 1, 0, 0⟩
 
-TODO: define this in terms of `Polynomial.derivative`. -/
-protected noncomputable def polynomialX : R[X][Y] :=
-  C (C W.a₁) * Y - C (C 3 * X ^ 2 + C (2 * W.a₂) * X + C W.a₄)
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.polynomial_X WeierstrassCurve.polynomialX
+lemma ofJ0_c₄ : (ofJ0 R).c₄ = 0 := by
+  rw [ofJ0, c₄, b₂, b₄]
+  norm_num1
 
--- porting note: 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 [WeierstrassCurve.polynomialX]
-  eval_simp
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.eval_polynomial_X WeierstrassCurve.eval_polynomialX
+lemma ofJ0_Δ : (ofJ0 R).Δ = -27 := by
+  rw [ofJ0, Δ, b₂, b₄, b₆, b₈]
+  norm_num1
 
-@[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]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.eval_polynomialX_zero
+/-- The Weierstrass curve $Y^2 = X^3 + X$. It is of j-invariant 1728 if it is an elliptic curve. -/
+def ofJ1728 : WeierstrassCurve R :=
+  ⟨0, 0, 0, 1, 0⟩
 
--- porting note: added `protected` for consistency with `WeierstrassCurve.polynomial`
-/-- The partial derivative $W_Y(X, Y)$ of $W(X, Y)$ with respect to $Y$.
+lemma ofJ1728_c₄ : (ofJ1728 R).c₄ = -48 := by
+  rw [ofJ1728, c₄, b₂, b₄]
+  norm_num1
 
-TODO: define this in terms of `Polynomial.derivative`. -/
-protected noncomputable def polynomialY : R[X][Y] :=
-  C (C 2) * Y + C (C W.a₁ * X + C W.a₃)
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.polynomial_Y WeierstrassCurve.polynomialY
+lemma ofJ1728_Δ : (ofJ1728 R).Δ = -64 := by
+  rw [ofJ1728, Δ, b₂, b₄, b₆, b₈]
+  norm_num1
 
--- porting note: 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 [WeierstrassCurve.polynomialY]
-  eval_simp
-  rw [← add_assoc]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.eval_polynomial_Y WeierstrassCurve.eval_polynomialY
+variable {R} (j : R)
 
-@[simp]
-lemma eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
-  simp only [← C_0, eval_polynomialY, zero_add, mul_zero]
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.eval_polynomial_Y_zero WeierstrassCurve.eval_polynomialY_zero
-
--- porting note: added `protected` for consistency with `WeierstrassCurve.polynomial`
-/-- The proposition that an affine point $(x, y)$ on `W` is nonsingular.
-In other words, either $W_X(x, y) \ne 0$ or $W_Y(x, y) \ne 0$. -/
-protected def nonsingular (x y : R) : Prop :=
-  W.equation x y ∧ ((W.polynomialX.eval <| C y).eval x ≠ 0 ∨ (W.polynomialY.eval <| C y).eval x ≠ 0)
-#align weierstrass_curve.nonsingular WeierstrassCurve.nonsingular
-
-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₄) ≠ 0 ∨ 2 * y + W.a₁ * x + W.a₃ ≠ 0) := by
-  rw [WeierstrassCurve.nonsingular, equation_iff', eval_polynomialX, eval_polynomialY]
-#align weierstrass_curve.nonsingular_iff' WeierstrassCurve.nonsingular_iff'
+/-- The Weierstrass curve $Y^2 + (j - 1728)XY = X^3 - 36(j - 1728)^3X - (j - 1728)^5$.
+It is of j-invariant j if it is an elliptic curve. -/
+def ofJ : WeierstrassCurve R :=
+  ⟨j - 1728, 0, 0, -36 * (j - 1728) ^ 3, -(j - 1728) ^ 5⟩
 
--- porting note: 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 _ _ y]
-  congr! 3
+lemma ofJ_c₄ : (ofJ j).c₄ = j * (j - 1728) ^ 3 := by
+  simp only [ofJ, c₄, b₂, b₄]
   ring1
-#align weierstrass_curve.nonsingular_iff WeierstrassCurve.nonsingular_iff
 
-@[simp]
-lemma nonsingular_zero : W.nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨ W.a₄ ≠ 0) := by
-  rw [WeierstrassCurve.nonsingular, equation_zero, C_0, eval_polynomialX_zero, neg_ne_zero,
-    eval_polynomialY_zero, or_comm]
-#align weierstrass_curve.nonsingular_zero WeierstrassCurve.nonsingular_zero
-
-lemma nonsingular_iff_variableChange (x y : R) :
-    W.nonsingular x y ↔ (W.variableChange ⟨1, x, 0, y⟩).nonsingular 0 0 := by
-  rw [nonsingular_iff', equation_iff_variableChange, equation_zero, ← neg_ne_zero, or_comm,
-    nonsingular_zero, variableChange_a₃, variableChange_a₄, inv_one, Units.val_one]
-  simp only [variableChange]
-  congr! 3 <;> ring1
-#align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
-
-lemma nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
-    W.nonsingular x y ↔ (W.baseChange A).nonsingular (algebraMap R A x) (algebraMap R A y) := by
-  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange A 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
-#align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.nonsingular_iff_baseChange
-
-lemma nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
-    (W.baseChange A).nonsingular x y ↔
-      (W.baseChange B).nonsingular (algebraMap A B x) (algebraMap A B y) := by
-  rw [nonsingular_iff_baseChange (W.baseChange A) B, baseChange_baseChange]
-#align weierstrass_curve.nonsingular_iff_base_change_of_base_change WeierstrassCurve.nonsingular_iff_baseChange_of_baseChange
-
-lemma nonsingular_zero_of_Δ_ne_zero (h : W.equation 0 0) (hΔ : W.Δ ≠ 0) : W.nonsingular 0 0 := by
-  simp only [equation_zero, nonsingular_zero] at *
-  contrapose! hΔ
-  simp only [b₂, b₄, b₆, b₈, Δ, h, hΔ]
+lemma ofJ_Δ : (ofJ j).Δ = j ^ 2 * (j - 1728) ^ 9 := by
+  simp only [ofJ, Δ, b₂, b₄, b₆, b₈]
   ring1
-#align weierstrass_curve.nonsingular_zero_of_Δ_ne_zero WeierstrassCurve.nonsingular_zero_of_Δ_ne_zero
-
-/-- A Weierstrass curve is nonsingular at every point if its discriminant is non-zero. -/
-lemma nonsingular_of_Δ_ne_zero {x y : R} (h : W.equation x y) (hΔ : W.Δ ≠ 0) : W.nonsingular x y :=
-  (W.nonsingular_iff_variableChange x y).mpr <|
-    nonsingular_zero_of_Δ_ne_zero _ ((W.equation_iff_variableChange x y).mp h) <| by
-      rwa [variableChange_Δ, inv_one, Units.val_one, one_pow, one_mul]
-#align weierstrass_curve.nonsingular_of_Δ_ne_zero WeierstrassCurve.nonsingular_of_Δ_ne_zero
-
-/-! ### Ideals in the coordinate ring -/
-
--- porting note: in Lean 3, this is a `def` under a `derive comm_ring` tag.
--- This generates a reducible instance of `comm_ring` for `coordinate_ring`. In certain
--- circumstances this might be extremely slow, because all instances in its definition are unified
--- exponentially many times. In this case, one solution is to manually add the local attribute
--- `local attribute [irreducible] coordinate_ring.comm_ring` to block this type-level unification.
--- In Lean 4, this is no longer an issue and is now an `abbrev`. See Zulip thread:
--- https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.E2.9C.94.20class_group.2Emk
-/-- The coordinate ring $R[W] := R[X, Y] / \langle W(X, Y) \rangle$ of `W`. -/
-abbrev CoordinateRing : Type u :=
-  AdjoinRoot W.polynomial
-#align weierstrass_curve.coordinate_ring WeierstrassCurve.CoordinateRing
-
-/-- The function field $R(W) := \mathrm{Frac}(R[W])$ of `W`. -/
-abbrev FunctionField : Type u :=
-  FractionRing W.CoordinateRing
-#align weierstrass_curve.function_field WeierstrassCurve.FunctionField
-
-namespace CoordinateRing
-
--- porting note: added the abbreviation `mk` for `AdjoinRoot.mk W.polynomial`
-/-- An element of the coordinate ring `R[W]` of `W` over `R`. -/
-noncomputable abbrev mk : R[X][Y] →+* W.CoordinateRing :=
-  AdjoinRoot.mk W.polynomial
-
-open Ideal
-
-instance instIsDomainCoordinateRing [IsDomain R] [NormalizedGCDMonoid R] :
-    IsDomain W.CoordinateRing :=
-  (Quotient.isDomain_iff_prime _).mpr <| by
-    simpa only [span_singleton_prime W.polynomial_ne_zero, ← GCDMonoid.irreducible_iff_prime] using
-      W.irreducible_polynomial
-#align weierstrass_curve.coordinate_ring.is_domain WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing
-
-instance instIsDomainCoordinateRing_of_Field {F : Type u} [Field F] (W : WeierstrassCurve F) :
-    IsDomain W.CoordinateRing := by
-  classical exact instIsDomainCoordinateRing W
-#align weierstrass_curve.coordinate_ring.is_domain_of_field WeierstrassCurve.CoordinateRing.instIsDomainCoordinateRing_of_Field
-
-variable (x : R) (y : R[X])
-
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-/-- The class of the element $X - x$ in $R[W]$ for some $x \in R$. -/
-noncomputable def XClass : W.CoordinateRing :=
-  mk W <| C <| X - C x
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.X_class WeierstrassCurve.CoordinateRing.XClass
-
-lemma XClass_ne_zero [Nontrivial R] : XClass W x ≠ 0 :=
-  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (C_ne_zero.mpr <| X_sub_C_ne_zero x) <|
-    by rw [natDegree_polynomial, natDegree_C]; norm_num1
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.CoordinateRing.XClass_ne_zero
-
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-/-- The class of the element $Y - y(X)$ in $R[W]$ for some $y(X) \in R[X]$. -/
-noncomputable def YClass : W.CoordinateRing :=
-  mk W <| Y - C y
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.Y_class WeierstrassCurve.CoordinateRing.YClass
-
-lemma YClass_ne_zero [Nontrivial R] : YClass W y ≠ 0 :=
-  AdjoinRoot.mk_ne_zero_of_natDegree_lt W.monic_polynomial (X_sub_C_ne_zero y) <|
-    by rw [natDegree_polynomial, natDegree_X_sub_C]; norm_num1
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.Y_class_ne_zero WeierstrassCurve.CoordinateRing.YClass_ne_zero
 
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-/-- The ideal $\langle X - x \rangle$ of $R[W]$ for some $x \in R$. -/
-noncomputable def XIdeal : Ideal W.CoordinateRing :=
-  span {XClass W x}
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.CoordinateRing.XIdeal
-
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-/-- The ideal $\langle Y - y(X) \rangle$ of $R[W]$ for some $y(X) \in R[X]$. -/
-noncomputable def YIdeal : Ideal W.CoordinateRing :=
-  span {YClass W y}
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.CoordinateRing.YIdeal
-
--- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-/-- The ideal $\langle X - x, Y - y(X) \rangle$ of $R[W]$ for some $x \in R$ and $y(X) \in R[X]$. -/
-noncomputable def XYIdeal (x : R) (y : R[X]) : Ideal W.CoordinateRing :=
-  span {XClass W x, YClass W y}
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.XY_ideal WeierstrassCurve.CoordinateRing.XYIdeal
-
-/-! ### The coordinate ring as an `R[X]`-algebra -/
-
-noncomputable instance instAlgebraCoordinateRing : Algebra R[X] W.CoordinateRing :=
-  Quotient.algebra R[X]
-#align weierstrass_curve.coordinate_ring.algebra WeierstrassCurve.CoordinateRing.instAlgebraCoordinateRing
-
-noncomputable instance instAlgebraCoordinateRing' : Algebra R W.CoordinateRing :=
-  Quotient.algebra R
-#align weierstrass_curve.coordinate_ring.algebra' WeierstrassCurve.CoordinateRing.instAlgebraCoordinateRing'
-
-instance instIsScalarTowerCoordinateRing : IsScalarTower R R[X] W.CoordinateRing :=
-  Quotient.isScalarTower R R[X] _
-#align weierstrass_curve.coordinate_ring.is_scalar_tower WeierstrassCurve.CoordinateRing.instIsScalarTowerCoordinateRing
-
-instance instSubsingletonCoordinateRing [Subsingleton R] : Subsingleton W.CoordinateRing :=
-  Module.subsingleton R[X] _
-#align weierstrass_curve.coordinate_ring.subsingleton WeierstrassCurve.CoordinateRing.instSubsingletonCoordinateRing
-
-/-- The $R$-algebra isomorphism from $R[W] / \langle X - x, Y - y(X) \rangle$ to
-$R[X, Y] / \langle X - x, Y - y(X) \rangle$ provided that $W(x, y(x)) = 0$. -/
-noncomputable def quotientXYIdealEquiv' {x : R} {y : R[X]} (h : (W.polynomial.eval y).eval x = 0) :
-    (W.CoordinateRing ⧸ XYIdeal W x y) ≃ₐ[R]
-      R[X][Y] ⧸ (span {C (X - C x), Y - C y} : Ideal <| R[X][Y]) :=
-  (quotientEquivAlgOfEq R <| by
-    simp only [XYIdeal, XClass, YClass, ← Set.image_pair, ← map_span]; rfl).trans <|
-    DoubleQuot.quotQuotEquivQuotOfLEₐ R <| (span_singleton_le_iff_mem _).mpr <|
-      mem_span_C_X_sub_C_X_sub_C_iff_eval_eval_eq_zero.mpr h
-
--- porting note: split into `quotientXYIdealEquiv'` to avoid deterministic timeout
-/-- The $R$-algebra isomorphism from $R[W] / \langle X - x, Y - y(X) \rangle$ to $R$ obtained by
-evaluation at $y(X)$ and at $x$ provided that $W(x, y(x)) = 0$. -/
-noncomputable def quotientXYIdealEquiv {x : R} {y : R[X]} (h : (W.polynomial.eval y).eval x = 0) :
-    (W.CoordinateRing ⧸ XYIdeal W x y) ≃ₐ[R] R :=
-  (quotientXYIdealEquiv' W h).trans quotientSpanCXSubCXSubCAlgEquiv
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.quotient_XY_ideal_equiv WeierstrassCurve.CoordinateRing.quotientXYIdealEquiv
-
--- porting note: added `classical` explicitly
-/-- The basis $\{1, Y\}$ for the coordinate ring $R[W]$ over the polynomial ring $R[X]$. -/
-protected noncomputable def basis : Basis (Fin 2) R[X] W.CoordinateRing := by
-  classical exact (subsingleton_or_nontrivial R).by_cases (fun _ => default) fun _ =>
-    (AdjoinRoot.powerBasis' W.monic_polynomial).basis.reindex <| finCongr W.natDegree_polynomial
-#align weierstrass_curve.coordinate_ring.basis WeierstrassCurve.CoordinateRing.basis
-
-lemma basis_apply (n : Fin 2) :
-    CoordinateRing.basis W n = (AdjoinRoot.powerBasis' W.monic_polynomial).gen ^ (n : ℕ) := by
-  classical
-  nontriviality R
-  rw [CoordinateRing.basis, Or.by_cases, dif_neg <| not_subsingleton R, Basis.reindex_apply,
-    PowerBasis.basis_eq_pow]
-  rfl
-#align weierstrass_curve.coordinate_ring.basis_apply WeierstrassCurve.CoordinateRing.basis_apply
-
--- porting note: added `@[simp]` in lieu of `coe_basis`
-@[simp]
-lemma basis_zero : CoordinateRing.basis W 0 = 1 := by
-  simpa only [basis_apply] using pow_zero _
-#align weierstrass_curve.coordinate_ring.basis_zero WeierstrassCurve.CoordinateRing.basis_zero
-
--- porting note: added `@[simp]` in lieu of `coe_basis`
-@[simp]
-lemma basis_one : CoordinateRing.basis W 1 = mk W Y := by
-  simpa only [basis_apply] using pow_one _
-#align weierstrass_curve.coordinate_ring.basis_one WeierstrassCurve.CoordinateRing.basis_one
-
--- porting note: removed `@[simp]` in lieu of `basis_zero` and `basis_one`
-lemma coe_basis : (CoordinateRing.basis W : Fin 2 → W.CoordinateRing) = ![1, mk W Y] := by
-  ext n
-  fin_cases n
-  exacts [basis_zero W, basis_one W]
-#align weierstrass_curve.coordinate_ring.coe_basis WeierstrassCurve.CoordinateRing.coe_basis
-
-variable {W}
-
-lemma smul (x : R[X]) (y : W.CoordinateRing) : x • y = mk W (C x) * y :=
-  (algebraMap_smul W.CoordinateRing x y).symm
-#align weierstrass_curve.coordinate_ring.smul WeierstrassCurve.CoordinateRing.smul
-
-lemma smul_basis_eq_zero {p q : R[X]} (hpq : p • (1 : W.CoordinateRing) + q • mk W Y = 0) :
-    p = 0 ∧ q = 0 := by
-  have h := Fintype.linearIndependent_iff.mp (CoordinateRing.basis W).linearIndependent ![p, q]
-  erw [Fin.sum_univ_succ, basis_zero, Fin.sum_univ_one, basis_one] at h
-  exact ⟨h hpq 0, h hpq 1⟩
-#align weierstrass_curve.coordinate_ring.smul_basis_eq_zero WeierstrassCurve.CoordinateRing.smul_basis_eq_zero
-
-lemma exists_smul_basis_eq (x : W.CoordinateRing) :
-    ∃ p q : R[X], p • (1 : W.CoordinateRing) + q • mk W Y = x := by
-  have h := (CoordinateRing.basis W).sum_equivFun x
-  erw [Fin.sum_univ_succ, Fin.sum_univ_one, basis_zero, basis_one] at h
-  exact ⟨_, _, h⟩
-#align weierstrass_curve.coordinate_ring.exists_smul_basis_eq WeierstrassCurve.CoordinateRing.exists_smul_basis_eq
-
-variable (W)
-
-lemma smul_basis_mul_C (p q : R[X]) :
-    (p • (1 : W.CoordinateRing) + q • mk W Y) * mk W (C y) =
-      (p * y) • (1 : W.CoordinateRing) + (q * y) • mk W Y := by
-  simp only [smul, _root_.map_mul]
-  ring1
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.smul_basis_mul_C WeierstrassCurve.CoordinateRing.smul_basis_mul_C
-
-lemma smul_basis_mul_Y (p q : R[X]) :
-    (p • (1 : W.CoordinateRing) + q • mk W Y) * mk W Y =
-      (q * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)) • (1 : W.CoordinateRing) +
-        (p - q * (C W.a₁ * X + C W.a₃)) • mk W Y := by
-  have Y_sq :
-    mk W Y ^ 2 =
-      mk W (C (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) - C (C W.a₁ * X + C W.a₃) * Y) := by
-    exact AdjoinRoot.mk_eq_mk.mpr ⟨1, by rw [WeierstrassCurve.polynomial]; ring1⟩
-  simp_rw [smul, add_mul, mul_assoc, ← sq, Y_sq, C_sub, map_sub, C_mul, _root_.map_mul]
-  ring1
-set_option linter.uppercaseLean3 false in
-#align weierstrass_curve.coordinate_ring.smul_basis_mul_Y WeierstrassCurve.CoordinateRing.smul_basis_mul_Y
-
-/-! ### Norms on the coordinate ring -/
-
-lemma norm_smul_basis (p q : R[X]) :
-    Algebra.norm R[X] (p • (1 : W.CoordinateRing) + q • mk W Y) =
-      p ^ 2 - p * q * (C W.a₁ * X + C W.a₃) -
-        q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆) := by
-  simp_rw [Algebra.norm_eq_matrix_det <| CoordinateRing.basis W, Matrix.det_fin_two,
-    Algebra.leftMulMatrix_eq_repr_mul, basis_zero, mul_one, basis_one, smul_basis_mul_Y, map_add,
-    Finsupp.add_apply, map_smul, Finsupp.smul_apply, ← basis_zero, ← basis_one,
-    Basis.repr_self_apply, if_pos, one_ne_zero, if_false, smul_eq_mul]
-  ring1
-#align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
-
-lemma coe_norm_smul_basis (p q : R[X]) :
-    ↑(Algebra.norm R[X] <| p • (1 : W.CoordinateRing) + q • mk W Y) =
-      mk W ((C p + C q * X) * (C p + C q * (-Y - C (C W.a₁ * X + C W.a₃)))) :=
-  AdjoinRoot.mk_eq_mk.mpr
-    ⟨C q ^ 2, by simp only [norm_smul_basis, WeierstrassCurve.polynomial]; C_simp; ring1⟩
-#align weierstrass_curve.coordinate_ring.coe_norm_smul_basis WeierstrassCurve.CoordinateRing.coe_norm_smul_basis
-
-lemma degree_norm_smul_basis [IsDomain R] (p q : R[X]) :
-    (Algebra.norm R[X] <| p • (1 : W.CoordinateRing) + q • mk W Y).degree =
-      max (2 • p.degree) (2 • q.degree + 3) := by
-  have hdp : (p ^ 2).degree = 2 • p.degree := degree_pow p 2
-  have hdpq : (p * q * (C W.a₁ * X + C W.a₃)).degree ≤ p.degree + q.degree + 1 := by
-    simpa only [degree_mul] using add_le_add_left degree_linear_le (p.degree + q.degree)
-  have hdq :
-      (q ^ 2 * (X ^ 3 + C W.a₂ * X ^ 2 + C W.a₄ * X + C W.a₆)).degree = 2 • q.degree + 3 := by
-    rw [degree_mul, degree_pow, ← one_mul <| X ^ 3, ← C_1, degree_cubic <| one_ne_zero' R]
-  rw [norm_smul_basis]
-  by_cases hp : p = 0
-  · simpa only [hp, hdq, neg_zero, zero_sub, zero_mul, zero_pow zero_lt_two, degree_neg] using
-      (max_bot_left _).symm
-  · by_cases hq : q = 0
-    · simpa only [hq, hdp, sub_zero, zero_mul, mul_zero, zero_pow zero_lt_two] using
-        (max_bot_right _).symm
-    · rw [← not_congr degree_eq_bot] at hp hq
-      -- porting note: BUG `cases` tactic does not modify assumptions in `hp'` and `hq'`
-      rcases hp' : p.degree with _ | dp -- `hp' : ` should be redundant
-      · exact (hp hp').elim -- `hp'` should be `rfl`
-      · rw [hp'] at hdp hdpq -- line should be redundant
-        rcases hq' : q.degree with _ | dq -- `hq' : ` should be redundant
-        · exact (hq hq').elim -- `hq'` should be `rfl`
-        · rw [hq'] at hdpq hdq -- line should be redundant
-          rcases le_or_lt dp (dq + 1) with hpq | hpq
-          · convert (degree_sub_eq_right_of_degree_lt <| (degree_sub_le _ _).trans_lt <|
-                      max_lt_iff.mpr ⟨hdp.trans_lt _, hdpq.trans_lt _⟩).trans
-              (max_eq_right_of_lt _).symm <;> rw [hdq] <;>
-              exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
-          · rw [sub_sub]
-            convert (degree_sub_eq_left_of_degree_lt <| (degree_add_le _ _).trans_lt <|
-                      max_lt_iff.mpr ⟨hdpq.trans_lt _, hdq.trans_lt _⟩).trans
-              (max_eq_left_of_lt _).symm <;> rw [hdp] <;>
-              exact WithBot.coe_lt_coe.mpr <| by linarith only [hpq]
-#align weierstrass_curve.coordinate_ring.degree_norm_smul_basis WeierstrassCurve.CoordinateRing.degree_norm_smul_basis
-
-variable {W}
-
-lemma degree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
-    (Algebra.norm R[X] x).degree ≠ 1 := by
-  rcases exists_smul_basis_eq x with ⟨p, q, rfl⟩
-  rw [degree_norm_smul_basis]
-  rcases p.degree with (_ | _ | _ | _) <;> cases q.degree
-  any_goals rintro (_ | _)
-  -- porting note: replaced `dec_trivial` with `(cmp_eq_lt_iff _ _).mp rfl` but cannot be inlined
-  apply (lt_max_of_lt_right _).ne'
-  exact (cmp_eq_lt_iff _ _).mp rfl
-#align weierstrass_curve.coordinate_ring.degree_norm_ne_one WeierstrassCurve.CoordinateRing.degree_norm_ne_one
-
-lemma natDegree_norm_ne_one [IsDomain R] (x : W.CoordinateRing) :
-    (Algebra.norm R[X] x).natDegree ≠ 1 :=
-  mt (degree_eq_iff_natDegree_eq_of_pos zero_lt_one).mpr <| degree_norm_ne_one x
-#align weierstrass_curve.coordinate_ring.nat_degree_norm_ne_one WeierstrassCurve.CoordinateRing.natDegree_norm_ne_one
-
-end CoordinateRing
-
-end Polynomial
+end ModelsWithJ
 
 end WeierstrassCurve
 
@@ -1118,10 +571,11 @@ add_decl_doc Δ'
 /-- The discriminant of `E` is equal to the discriminant of `E` as a Weierstrass curve. -/
 add_decl_doc coe_Δ'
 
-variable [CommRing R] (E : EllipticCurve R)
+variable {R : Type u} [CommRing R] (E : EllipticCurve R)
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
 /-- The j-invariant `j` of an elliptic curve, which is invariant under isomorphisms over `R`. -/
+@[pp_dot]
 def j : R :=
   ↑E.Δ'⁻¹ * E.c₄ ^ 3
 #align elliptic_curve.j EllipticCurve.j
@@ -1131,16 +585,102 @@ lemma twoTorsionPolynomial_disc_ne_zero [Nontrivial R] [Invertible (2 : R)] :
   E.toWeierstrassCurve.twoTorsionPolynomial_disc_ne_zero <| E.coe_Δ' ▸ E.Δ'.isUnit
 #align elliptic_curve.two_torsion_polynomial_disc_ne_zero EllipticCurve.twoTorsionPolynomial_disc_ne_zero
 
-lemma nonsingular [Nontrivial R] {x y : R} (h : E.equation x y) : E.nonsingular x y :=
-  E.nonsingular_of_Δ_ne_zero h <| E.coe_Δ' ▸ E.Δ'.ne_zero
-#align elliptic_curve.nonsingular EllipticCurve.nonsingular
+section VariableChange
+
+/-! ### Variable changes -/
+
+variable (C : WeierstrassCurve.VariableChange R)
+
+-- porting note: was just `@[simps]`
+/-- The elliptic curve over `R` induced by an admissible linear change of variables
+$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
+When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
+@[pp_dot, simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
+def variableChange : EllipticCurve R :=
+  ⟨E.toWeierstrassCurve.variableChange C, C.u⁻¹ ^ 12 * E.Δ', by
+    rw [Units.val_mul, Units.val_pow_eq_pow_val, coe_Δ', E.variableChange_Δ]⟩
+#align elliptic_curve.variable_change EllipticCurve.variableChange
+
+lemma variableChange_id : E.variableChange WeierstrassCurve.VariableChange.id = E := by
+  simp only [variableChange, WeierstrassCurve.variableChange_id]
+  simp only [WeierstrassCurve.VariableChange.id, inv_one, one_pow, one_mul]
+
+lemma variableChange_comp (C C' : WeierstrassCurve.VariableChange R) (E : EllipticCurve R) :
+    E.variableChange (C.comp C') = (E.variableChange C').variableChange C := by
+  simp only [variableChange, WeierstrassCurve.variableChange_comp]
+  simp only [WeierstrassCurve.VariableChange.comp, mul_inv, mul_pow, ← mul_assoc]
+
+instance instMulActionVariableChange :
+    MulAction (WeierstrassCurve.VariableChange R) (EllipticCurve R) where
+  smul := fun C E => E.variableChange C
+  one_smul := variableChange_id
+  mul_smul := variableChange_comp
+
+lemma coe_variableChange_Δ' : (↑(E.variableChange C).Δ' : R) = (↑C.u⁻¹ : R) ^ 12 * E.Δ' := by
+  rw [variableChange_Δ', Units.val_mul, Units.val_pow_eq_pow_val]
+#align elliptic_curve.coe_variable_change_Δ' EllipticCurve.coe_variableChange_Δ'
+
+lemma coe_inv_variableChange_Δ' :
+    (↑(E.variableChange C).Δ'⁻¹ : R) = (C.u : R) ^ 12 * ↑E.Δ'⁻¹ := by
+  rw [variableChange_Δ', mul_inv, inv_pow, inv_inv, Units.val_mul, Units.val_pow_eq_pow_val]
+#align elliptic_curve.coe_inv_variable_change_Δ' EllipticCurve.coe_inv_variableChange_Δ'
+
+@[simp]
+lemma variableChange_j : (E.variableChange C).j = E.j := by
+  rw [j, coe_inv_variableChange_Δ']
+  have hu : (C.u * ↑C.u⁻¹ : R) ^ 12 = 1 := by rw [C.u.mul_inv, one_pow]
+  linear_combination (norm := (rw [variableChange_toWeierstrassCurve,
+    WeierstrassCurve.variableChange_c₄, j]; ring1)) E.j * hu
+#align elliptic_curve.variable_change_j EllipticCurve.variableChange_j
+
+end VariableChange
+
+section BaseChange
+
+/-! ### Base changes -/
+
+variable (A : Type v) [CommRing A] [Algebra R A]
+
+-- porting note: was just `@[simps]`
+/-- The elliptic curve over `R` base changed to `A`. -/
+@[pp_dot, simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
+def baseChange : EllipticCurve A :=
+  ⟨E.toWeierstrassCurve.baseChange A, Units.map (↑(algebraMap R A)) E.Δ',
+    by simp only [Units.coe_map, coe_Δ', E.baseChange_Δ]; rfl⟩
+#align elliptic_curve.base_change EllipticCurve.baseChange
+
+lemma coeBaseChange_Δ' : ↑(E.baseChange A).Δ' = algebraMap R A E.Δ' :=
+  rfl
+#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBaseChange_Δ'
+
+lemma coe_inv_baseChange_Δ' : ↑(E.baseChange A).Δ'⁻¹ = algebraMap R A ↑E.Δ'⁻¹ :=
+  rfl
+#align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
+
+@[simp]
+lemma baseChange_j : (E.baseChange A).j = algebraMap R A E.j := by
+  simp only [j, baseChange, E.baseChange_c₄]
+  map_simp
+  rfl
+#align elliptic_curve.base_change_j EllipticCurve.baseChange_j
+
+lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
+    Function.Injective <| baseChange (R := R) (A := A) := fun E E' h1 => by
+  rcases mk.inj h1 with ⟨h1, h2⟩
+  replace h2 := (Units.mk.inj h2).left
+  rcases WeierstrassCurve.mk.inj h1 with ⟨_, _, _, _, _⟩
+  ext <;> apply_fun _ using h <;> assumption
+
+end BaseChange
 
 section ModelsWithJ
 
+/-! ### Models with prescribed j-invariant -/
+
 variable (R)
 
-/-- When $3$ is invertible, $Y^2 + Y = X^3$ is an elliptic curve.
-It is of $j$-invariant $0$ (see `EllipticCurve.ofJ0_j`). -/
+/-- When 3 is invertible, $Y^2 + Y = X^3$ is an elliptic curve.
+It is of j-invariant 0 (see `EllipticCurve.ofJ0_j`). -/
 def ofJ0 [Invertible (3 : R)] : EllipticCurve R :=
   have := invertibleNeg (3 ^ 3 : R)
   ⟨WeierstrassCurve.ofJ0 R, unitOfInvertible (-3 ^ 3 : R),
@@ -1150,8 +690,8 @@ lemma ofJ0_j [Invertible (3 : R)] : (ofJ0 R).j = 0 := by
   simp only [j, ofJ0, WeierstrassCurve.ofJ0_c₄]
   ring1
 
-/-- When $2$ is invertible, $Y^2 = X^3 + X$ is an elliptic curve.
-It is of $j$-invariant $1728$ (see `EllipticCurve.ofJ1728_j`). -/
+/-- When 2 is invertible, $Y^2 = X^3 + X$ is an elliptic curve.
+It is of j-invariant 1728 (see `EllipticCurve.ofJ1728_j`). -/
 def ofJ1728 [Invertible (2 : R)] : EllipticCurve R :=
   have := invertibleNeg (2 ^ 6 : R)
   ⟨WeierstrassCurve.ofJ1728 R, unitOfInvertible (-2 ^ 6 : R),
@@ -1164,28 +704,28 @@ lemma ofJ1728_j [Invertible (2 : R)] : (ofJ1728 R).j = 1728 := by
 
 variable {R}
 
-/-- When $j$ and $j - 1728$ are both invertible,
+/-- When j and j - 1728 are both invertible,
 $Y^2 + (j - 1728)XY = X^3 - 36(j - 1728)^3X - (j - 1728)^5$ is an elliptic curve.
-It is of $j$-invariant $j$ (see `EllipticCurve.ofJ'_j`). -/
+It is of j-invariant j (see `EllipticCurve.ofJ'_j`). -/
 def ofJ' (j : R) [Invertible j] [Invertible (j - 1728)] : EllipticCurve R :=
   have := invertibleMul (j ^ 2) ((j - 1728) ^ 9)
   ⟨WeierstrassCurve.ofJ j, unitOfInvertible <| j ^ 2 * (j - 1728) ^ 9,
     (WeierstrassCurve.ofJ_Δ j).symm⟩
 
 lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j := by
-  field_simp [EllipticCurve.j, ofJ', @val_unitOfInvertible _ _ _ <| invertibleMul _ _,
+  field_simp [EllipticCurve.j, ofJ', @val_unitOfInvertible _ _ _ <| invertibleMul ..,
     WeierstrassCurve.ofJ_c₄]
   ring1
 
 variable {F : Type u} [Field F] (j : F)
 
 private lemma two_or_three_ne_zero : (2 : F) ≠ 0 ∨ (3 : F) ≠ 0 :=
-  ne_zero_or_ne_zero_of_nat_coprime (show Nat.Coprime 2 3 by norm_num1)
+  ne_zero_or_ne_zero_of_nat_coprime <| by decide
 
 variable [DecidableEq F]
 
-/-- For any element $j$ of a field $F$, there exists an elliptic curve over $F$
-with $j$-invariant equal to $j$ (see `EllipticCurve.ofJ_j`).
+/-- For any element j of a field $F$, there exists an elliptic curve over $F$
+with j-invariant equal to j (see `EllipticCurve.ofJ_j`).
 Its coefficients are given explicitly (see `EllipticCurve.ofJ0`, `EllipticCurve.ofJ1728`
 and `EllipticCurve.ofJ'`). -/
 def ofJ : EllipticCurve F :=
@@ -1228,9 +768,8 @@ lemma ofJ_1728_of_two_eq_zero (h2 : (2 : F) = 0) :
     ofJ 1728 = @ofJ0 _ _ (invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_left h2) := by
   rw [ofJ, dif_pos <| by rw [show (1728 : F) = 2 * 864 by norm_num1, h2, zero_mul], dif_neg]
 
-lemma ofJ_ne_0_ne_1728 (h0 : j ≠ 0) (h1728 : j ≠ 1728) :
-    ofJ j =
-      @ofJ' _ _ j (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728) := by
+lemma ofJ_ne_0_ne_1728 (h0 : j ≠ 0) (h1728 : j ≠ 1728) : ofJ j =
+    @ofJ' _ _ j (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728) := by
   rw [ofJ, dif_neg h0, dif_neg h1728]
 
 lemma ofJ_j : (ofJ j).j = j := by
@@ -1254,92 +793,4 @@ instance instInhabitedEllipticCurve : Inhabited <| EllipticCurve F :=
 
 end ModelsWithJ
 
-section VariableChange
-
-/-! ### Variable changes -/
-
-variable (C : WeierstrassCurve.VariableChange R)
-
--- porting note: was just `@[simps]`
-/-- The elliptic curve over `R` induced by an admissible linear change of variables
-$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
-When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
-@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
-def variableChange : EllipticCurve R :=
-  ⟨E.toWeierstrassCurve.variableChange C, C.u⁻¹ ^ 12 * E.Δ', by
-    rw [Units.val_mul, Units.val_pow_eq_pow_val, coe_Δ', E.variableChange_Δ]⟩
-#align elliptic_curve.variable_change EllipticCurve.variableChange
-
-lemma variableChange_id : E.variableChange WeierstrassCurve.VariableChange.id = E := by
-  simp only [variableChange, WeierstrassCurve.variableChange_id]
-  simp only [WeierstrassCurve.VariableChange.id, inv_one, one_pow, one_mul]
-
-lemma variableChange_comp (C C' : WeierstrassCurve.VariableChange R) (E : EllipticCurve R) :
-    E.variableChange (C.comp C') = (E.variableChange C').variableChange C := by
-  simp only [variableChange, WeierstrassCurve.variableChange_comp]
-  simp only [WeierstrassCurve.VariableChange.comp, mul_inv, mul_pow, ← mul_assoc]
-
-instance instMulActionVariableChange :
-    MulAction (WeierstrassCurve.VariableChange R) (EllipticCurve R) where
-  smul := fun C E => E.variableChange C
-  one_smul := variableChange_id
-  mul_smul := variableChange_comp
-
-lemma coe_variableChange_Δ' : (↑(E.variableChange C).Δ' : R) = (↑C.u⁻¹ : R) ^ 12 * E.Δ' := by
-  rw [variableChange_Δ', Units.val_mul, Units.val_pow_eq_pow_val]
-#align elliptic_curve.coe_variable_change_Δ' EllipticCurve.coe_variableChange_Δ'
-
-lemma coe_inv_variableChange_Δ' :
-    (↑(E.variableChange C).Δ'⁻¹ : R) = (C.u : R) ^ 12 * ↑E.Δ'⁻¹ := by
-  rw [variableChange_Δ', mul_inv, inv_pow, inv_inv, Units.val_mul, Units.val_pow_eq_pow_val]
-#align elliptic_curve.coe_inv_variable_change_Δ' EllipticCurve.coe_inv_variableChange_Δ'
-
-@[simp]
-lemma variableChange_j : (E.variableChange C).j = E.j := by
-  rw [j, coe_inv_variableChange_Δ']
-  have hu : (C.u * ↑C.u⁻¹ : R) ^ 12 = 1 := by rw [C.u.mul_inv, one_pow]
-  linear_combination (norm := (rw [variableChange_toWeierstrassCurve,
-    WeierstrassCurve.variableChange_c₄, j]; ring1)) E.j * hu
-#align elliptic_curve.variable_change_j EllipticCurve.variableChange_j
-
-end VariableChange
-
-section BaseChange
-
-/-! ### Base changes -/
-
-variable (A : Type v) [CommRing A] [Algebra R A]
-
--- porting note: was just `@[simps]`
-/-- The elliptic curve over `R` base changed to `A`. -/
-@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
-def baseChange : EllipticCurve A :=
-  ⟨E.toWeierstrassCurve.baseChange A, Units.map (↑(algebraMap R A)) E.Δ',
-    by simp only [Units.coe_map, coe_Δ', E.baseChange_Δ]; rfl⟩
-#align elliptic_curve.base_change EllipticCurve.baseChange
-
-lemma coeBaseChange_Δ' : ↑(E.baseChange A).Δ' = algebraMap R A E.Δ' :=
-  rfl
-#align elliptic_curve.coe_base_change_Δ' EllipticCurve.coeBaseChange_Δ'
-
-lemma coe_inv_baseChange_Δ' : ↑(E.baseChange A).Δ'⁻¹ = algebraMap R A ↑E.Δ'⁻¹ :=
-  rfl
-#align elliptic_curve.coe_inv_base_change_Δ' EllipticCurve.coe_inv_baseChange_Δ'
-
-@[simp]
-lemma baseChange_j : (E.baseChange A).j = algebraMap R A E.j := by
-  simp only [j, baseChange, E.baseChange_c₄]
-  map_simp
-  rfl
-#align elliptic_curve.base_change_j EllipticCurve.baseChange_j
-
-lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
-    Function.Injective <| baseChange (R := R) (A := A) := fun E E' h1 => by
-  rcases mk.inj h1 with ⟨h1, h2⟩
-  replace h2 := (Units.mk.inj h2).left
-  rcases WeierstrassCurve.mk.inj h1 with ⟨_, _, _, _, _⟩
-  ext <;> apply_fun _ using h <;> assumption
-
-end BaseChange
-
 end EllipticCurve
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -638,8 +638,8 @@ lemma irreducible_polynomial [IsDomain R] : Irreducible W.polynomial := by
   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
-  iterate 2 rw [degree_add_eq_right_of_degree_lt] <;> simp only [h]
-  iterate 2 rw [degree_add_eq_left_of_degree_lt] <;> simp only [h]
+  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.irreducible_polynomial
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
@@ -1029,7 +1029,7 @@ lemma norm_smul_basis (p q : R[X]) :
   simp_rw [Algebra.norm_eq_matrix_det <| CoordinateRing.basis W, Matrix.det_fin_two,
     Algebra.leftMulMatrix_eq_repr_mul, basis_zero, mul_one, basis_one, smul_basis_mul_Y, map_add,
     Finsupp.add_apply, map_smul, Finsupp.smul_apply, ← basis_zero, ← basis_one,
-    Basis.repr_self_apply, if_pos, if_neg, smul_eq_mul]
+    Basis.repr_self_apply, if_pos, one_ne_zero, if_false, smul_eq_mul]
   ring1
 #align weierstrass_curve.coordinate_ring.norm_smul_basis WeierstrassCurve.CoordinateRing.norm_smul_basis
 
chore: bump to v4.1.0-rc1 (2nd attempt) (#7216)

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

Diff
@@ -1180,7 +1180,7 @@ lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j :=
 variable {F : Type u} [Field F] (j : F)
 
 private lemma two_or_three_ne_zero : (2 : F) ≠ 0 ∨ (3 : F) ≠ 0 :=
-  ne_zero_or_ne_zero_of_nat_coprime (show Nat.coprime 2 3 by norm_num1)
+  ne_zero_or_ne_zero_of_nat_coprime (show Nat.Coprime 2 3 by norm_num1)
 
 variable [DecidableEq F]
 
Revert "chore: bump to v4.1.0-rc1 (#7174)" (#7198)

This reverts commit 6f8e8104. Unfortunately this bump was not linted correctly, as CI did not run runLinter Mathlib.

We can unrevert once that's fixed.

Diff
@@ -1180,7 +1180,7 @@ lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j :=
 variable {F : Type u} [Field F] (j : F)
 
 private lemma two_or_three_ne_zero : (2 : F) ≠ 0 ∨ (3 : F) ≠ 0 :=
-  ne_zero_or_ne_zero_of_nat_coprime (show Nat.Coprime 2 3 by norm_num1)
+  ne_zero_or_ne_zero_of_nat_coprime (show Nat.coprime 2 3 by norm_num1)
 
 variable [DecidableEq F]
 
chore: bump to v4.1.0-rc1 (#7174)

Some changes have already been review and delegated in #6910 and #7148.

The diff that needs looking at is https://github.com/leanprover-community/mathlib4/pull/7174/commits/64d6d07ee18163627c8f517eb31455411921c5ac

The std bump PR was insta-merged already!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -1180,7 +1180,7 @@ lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j :=
 variable {F : Type u} [Field F] (j : F)
 
 private lemma two_or_three_ne_zero : (2 : F) ≠ 0 ∨ (3 : F) ≠ 0 :=
-  ne_zero_or_ne_zero_of_nat_coprime (show Nat.coprime 2 3 by norm_num1)
+  ne_zero_or_ne_zero_of_nat_coprime (show Nat.Coprime 2 3 by norm_num1)
 
 variable [DecidableEq F]
 
fix: simps config for Units (#6514)
Diff
@@ -1144,7 +1144,7 @@ It is of $j$-invariant $0$ (see `EllipticCurve.ofJ0_j`). -/
 def ofJ0 [Invertible (3 : R)] : EllipticCurve R :=
   have := invertibleNeg (3 ^ 3 : R)
   ⟨WeierstrassCurve.ofJ0 R, unitOfInvertible (-3 ^ 3 : R),
-    by rw [unitOfInvertible_val, WeierstrassCurve.ofJ0_Δ R]; norm_num1⟩
+    by rw [val_unitOfInvertible, WeierstrassCurve.ofJ0_Δ R]; norm_num1⟩
 
 lemma ofJ0_j [Invertible (3 : R)] : (ofJ0 R).j = 0 := by
   simp only [j, ofJ0, WeierstrassCurve.ofJ0_c₄]
@@ -1155,10 +1155,10 @@ It is of $j$-invariant $1728$ (see `EllipticCurve.ofJ1728_j`). -/
 def ofJ1728 [Invertible (2 : R)] : EllipticCurve R :=
   have := invertibleNeg (2 ^ 6 : R)
   ⟨WeierstrassCurve.ofJ1728 R, unitOfInvertible (-2 ^ 6 : R),
-    by rw [unitOfInvertible_val, WeierstrassCurve.ofJ1728_Δ R]; norm_num1⟩
+    by rw [val_unitOfInvertible, WeierstrassCurve.ofJ1728_Δ R]; norm_num1⟩
 
 lemma ofJ1728_j [Invertible (2 : R)] : (ofJ1728 R).j = 1728 := by
-  field_simp [j, ofJ1728, @unitOfInvertible_val _ _ _ <| invertibleNeg _,
+  field_simp [j, ofJ1728, @val_unitOfInvertible _ _ _ <| invertibleNeg _,
     WeierstrassCurve.ofJ1728_c₄]
   norm_num1
 
@@ -1173,7 +1173,7 @@ def ofJ' (j : R) [Invertible j] [Invertible (j - 1728)] : EllipticCurve R :=
     (WeierstrassCurve.ofJ_Δ j).symm⟩
 
 lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j := by
-  field_simp [EllipticCurve.j, ofJ', @unitOfInvertible_val _ _ _ <| invertibleMul _ _,
+  field_simp [EllipticCurve.j, ofJ', @val_unitOfInvertible _ _ _ <| invertibleMul _ _,
     WeierstrassCurve.ofJ_c₄]
   ring1
 
chore: ensure all instances referred to directly have explicit names (#6423)

Per https://github.com/leanprover/lean4/issues/2343, we are going to need to change the automatic generation of instance names, as they become too long.

This PR ensures that everywhere in Mathlib that refers to an instance by name, that name is given explicitly, rather than being automatically generated.

There are four exceptions, which are now commented, with links to https://github.com/leanprover/lean4/issues/2343.

This was implemented by running Mathlib against a modified Lean that appended _ᾰ to all automatically generated names, and fixing everything.

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

Diff
@@ -118,7 +118,7 @@ add_decl_doc a₄
 /-- The `a₆` coefficient of a Weierstrass curve. -/
 add_decl_doc a₆
 
-instance [Inhabited R] : Inhabited <| WeierstrassCurve R :=
+instance instInhabitedWeierstrassCurve [Inhabited R] : Inhabited <| WeierstrassCurve R :=
   ⟨⟨default, default, default, default, default⟩⟩
 #align weierstrass_curve.inhabited WeierstrassCurve.instInhabitedWeierstrassCurve
 
@@ -919,7 +919,7 @@ instance instIsScalarTowerCoordinateRing : IsScalarTower R R[X] W.CoordinateRing
   Quotient.isScalarTower R R[X] _
 #align weierstrass_curve.coordinate_ring.is_scalar_tower WeierstrassCurve.CoordinateRing.instIsScalarTowerCoordinateRing
 
-instance [Subsingleton R] : Subsingleton W.CoordinateRing :=
+instance instSubsingletonCoordinateRing [Subsingleton R] : Subsingleton W.CoordinateRing :=
   Module.subsingleton R[X] _
 #align weierstrass_curve.coordinate_ring.subsingleton WeierstrassCurve.CoordinateRing.instSubsingletonCoordinateRing
 
feat(AlgebraicGeometry/EllipticCurve/Weierstrass): elliptic curves with specified j-invariant (#5935)

Main changes:

  • Define specific Weierstrass curves, whose j-invariants should be 0, 1728, or ≠ 0 and 1728.
  • Prove the quantities c₄, Δ and j for them (whenever they are defined).
  • Define an elliptic curve from an element j in a field, whose j-invariant is equal to j.
  • Generalize Inhabited (EllipticCurve ℚ) to Inhabited (EllipticCurve F) for any field F (computable if F has DecidableEq).
Diff
@@ -32,6 +32,8 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
 
  * `WeierstrassCurve`: a Weierstrass curve over a commutative ring.
  * `WeierstrassCurve.Δ`: the discriminant of a Weierstrass curve.
+ * `WeierstrassCurve.ofJ0`, `WeierstrassCurve.ofJ1728`, `WeierstrassCurve.ofJ`:
+    Weierstrass curves whose $j$-invariants are $0$, $1728$ and $j\neq 0,1728$, respectively.
  * `WeierstrassCurve.VariableChange`: a change of variables of Weierstrass curves.
  * `WeierstrassCurve.variableChange`: the Weierstrass curve induced by a change of variables.
  * `WeierstrassCurve.baseChange`: the Weierstrass curve base changed over an algebra.
@@ -44,6 +46,9 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
  * `WeierstrassCurve.CoordinateRing.basis`: the power basis of the coordinate ring over `R[X]`.
  * `EllipticCurve`: an elliptic curve over a commutative ring.
  * `EllipticCurve.j`: the j-invariant of an elliptic curve.
+ * `EllipticCurve.ofJ0`, `EllipticCurve.ofJ1728`, `EllipticCurve.ofJ'`: elliptic curves whose
+    $j$-invariants are $0$, $1728$ and $j\neq 0,1728$, respectively.
+ * `EllipticCurve.ofJ`: an elliptic curve over a field $F$, whose $j$-invariant equal to $j$.
 
 ## Main statements
 
@@ -58,6 +63,7 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
  * `EllipticCurve.nonsingular`: an elliptic curve is nonsingular at every point.
  * `EllipticCurve.variableChange_j`: the j-invariant of an elliptic curve is invariant under an
     admissible linear change of variables.
+ * `EllipticCurve.ofJ_j`: the $j$-invariant of `EllipticCurve.ofJ` is equal to $j$.
 
 ## Implementation notes
 
@@ -179,6 +185,53 @@ lemma c_relation : 1728 * W.Δ = W.c₄ ^ 3 - W.c₆ ^ 2 := by
 
 end Quantity
 
+section ModelsWithJ
+
+variable (R)
+
+/-- The Weierstrass curve $Y^2 + Y = X^3$.
+It is of $j$-invariant $0$ if it is an elliptic curve. -/
+def ofJ0 : WeierstrassCurve R :=
+  ⟨0, 0, 1, 0, 0⟩
+
+lemma ofJ0_c₄ : (ofJ0 R).c₄ = 0 := by
+  rw [ofJ0, c₄, b₂, b₄]
+  norm_num1
+
+lemma ofJ0_Δ : (ofJ0 R).Δ = -27 := by
+  rw [ofJ0, Δ, b₂, b₄, b₆, b₈]
+  norm_num1
+
+/-- The Weierstrass curve $Y^2 = X^3 + X$.
+It is of $j$-invariant $1728$ if it is an elliptic curve. -/
+def ofJ1728 : WeierstrassCurve R :=
+  ⟨0, 0, 0, 1, 0⟩
+
+lemma ofJ1728_c₄ : (ofJ1728 R).c₄ = -48 := by
+  rw [ofJ1728, c₄, b₂, b₄]
+  norm_num1
+
+lemma ofJ1728_Δ : (ofJ1728 R).Δ = -64 := by
+  rw [ofJ1728, Δ, b₂, b₄, b₆, b₈]
+  norm_num1
+
+variable {R} (j : R)
+
+/-- The Weierstrass curve $Y^2 + (j - 1728)XY = X^3 - 36(j - 1728)^3X - (j - 1728)^5$.
+It is of $j$-invariant $j$ if it is an elliptic curve. -/
+def ofJ : WeierstrassCurve R :=
+  ⟨j - 1728, 0, 0, -36 * (j - 1728) ^ 3, -(j - 1728) ^ 5⟩
+
+lemma ofJ_c₄ : (ofJ j).c₄ = j * (j - 1728) ^ 3 := by
+  simp only [ofJ, c₄, b₂, b₄]
+  ring1
+
+lemma ofJ_Δ : (ofJ j).Δ = j ^ 2 * (j - 1728) ^ 9 := by
+  simp only [ofJ, Δ, b₂, b₄, b₆, b₈]
+  ring1
+
+end ModelsWithJ
+
 section VariableChange
 
 /-! ### Variable changes -/
@@ -1065,12 +1118,6 @@ add_decl_doc Δ'
 /-- The discriminant of `E` is equal to the discriminant of `E` as a Weierstrass curve. -/
 add_decl_doc coe_Δ'
 
-instance instInhabitedEllipticCurve : Inhabited <| EllipticCurve ℚ :=
-  ⟨⟨⟨0, 0, 1, -1, 0⟩, ⟨37, 37⁻¹, by norm_num1, by norm_num1⟩,
-    by simp only [WeierstrassCurve.b₂, WeierstrassCurve.b₄, WeierstrassCurve.b₆,
-      WeierstrassCurve.b₈, WeierstrassCurve.Δ]; ring1⟩⟩
-#align elliptic_curve.inhabited EllipticCurve.instInhabitedEllipticCurve
-
 variable [CommRing R] (E : EllipticCurve R)
 
 -- porting note: removed `@[simp]` to avoid a `simpNF` linter error
@@ -1088,6 +1135,125 @@ lemma nonsingular [Nontrivial R] {x y : R} (h : E.equation x y) : E.nonsingular
   E.nonsingular_of_Δ_ne_zero h <| E.coe_Δ' ▸ E.Δ'.ne_zero
 #align elliptic_curve.nonsingular EllipticCurve.nonsingular
 
+section ModelsWithJ
+
+variable (R)
+
+/-- When $3$ is invertible, $Y^2 + Y = X^3$ is an elliptic curve.
+It is of $j$-invariant $0$ (see `EllipticCurve.ofJ0_j`). -/
+def ofJ0 [Invertible (3 : R)] : EllipticCurve R :=
+  have := invertibleNeg (3 ^ 3 : R)
+  ⟨WeierstrassCurve.ofJ0 R, unitOfInvertible (-3 ^ 3 : R),
+    by rw [unitOfInvertible_val, WeierstrassCurve.ofJ0_Δ R]; norm_num1⟩
+
+lemma ofJ0_j [Invertible (3 : R)] : (ofJ0 R).j = 0 := by
+  simp only [j, ofJ0, WeierstrassCurve.ofJ0_c₄]
+  ring1
+
+/-- When $2$ is invertible, $Y^2 = X^3 + X$ is an elliptic curve.
+It is of $j$-invariant $1728$ (see `EllipticCurve.ofJ1728_j`). -/
+def ofJ1728 [Invertible (2 : R)] : EllipticCurve R :=
+  have := invertibleNeg (2 ^ 6 : R)
+  ⟨WeierstrassCurve.ofJ1728 R, unitOfInvertible (-2 ^ 6 : R),
+    by rw [unitOfInvertible_val, WeierstrassCurve.ofJ1728_Δ R]; norm_num1⟩
+
+lemma ofJ1728_j [Invertible (2 : R)] : (ofJ1728 R).j = 1728 := by
+  field_simp [j, ofJ1728, @unitOfInvertible_val _ _ _ <| invertibleNeg _,
+    WeierstrassCurve.ofJ1728_c₄]
+  norm_num1
+
+variable {R}
+
+/-- When $j$ and $j - 1728$ are both invertible,
+$Y^2 + (j - 1728)XY = X^3 - 36(j - 1728)^3X - (j - 1728)^5$ is an elliptic curve.
+It is of $j$-invariant $j$ (see `EllipticCurve.ofJ'_j`). -/
+def ofJ' (j : R) [Invertible j] [Invertible (j - 1728)] : EllipticCurve R :=
+  have := invertibleMul (j ^ 2) ((j - 1728) ^ 9)
+  ⟨WeierstrassCurve.ofJ j, unitOfInvertible <| j ^ 2 * (j - 1728) ^ 9,
+    (WeierstrassCurve.ofJ_Δ j).symm⟩
+
+lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j := by
+  field_simp [EllipticCurve.j, ofJ', @unitOfInvertible_val _ _ _ <| invertibleMul _ _,
+    WeierstrassCurve.ofJ_c₄]
+  ring1
+
+variable {F : Type u} [Field F] (j : F)
+
+private lemma two_or_three_ne_zero : (2 : F) ≠ 0 ∨ (3 : F) ≠ 0 :=
+  ne_zero_or_ne_zero_of_nat_coprime (show Nat.coprime 2 3 by norm_num1)
+
+variable [DecidableEq F]
+
+/-- For any element $j$ of a field $F$, there exists an elliptic curve over $F$
+with $j$-invariant equal to $j$ (see `EllipticCurve.ofJ_j`).
+Its coefficients are given explicitly (see `EllipticCurve.ofJ0`, `EllipticCurve.ofJ1728`
+and `EllipticCurve.ofJ'`). -/
+def ofJ : EllipticCurve F :=
+  if h0 : j = 0 then
+    if h3 : (3 : F) = 0 then @ofJ1728 _ _ <| invertibleOfNonzero <|
+      two_or_three_ne_zero.neg_resolve_right h3
+    else @ofJ0 _ _ <| invertibleOfNonzero h3
+  else if h1728 : j = 1728 then
+    @ofJ1728 _ _ <| invertibleOfNonzero fun h => h0 <|
+    by rw [h1728, show (1728 : F) = 2 * 864 by norm_num1, h, zero_mul]
+  else @ofJ' _ _ j (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728)
+
+lemma ofJ_0_of_three_ne_zero [h3 : NeZero (3 : F)] :
+    ofJ 0 = @ofJ0 _ _ (invertibleOfNonzero h3.out) := by
+  rw [ofJ, dif_pos rfl, dif_neg h3.out]
+
+lemma ofJ_0_of_three_eq_zero (h3 : (3 : F) = 0) :
+    ofJ 0 = @ofJ1728 _ _ (invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_right h3) := by
+  rw [ofJ, dif_pos rfl, dif_pos h3]
+
+lemma ofJ_0_of_two_eq_zero (h2 : (2 : F) = 0) :
+    ofJ 0 = @ofJ0 _ _ (invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_left h2) :=
+  have := neZero_iff.2 <| two_or_three_ne_zero.neg_resolve_left h2
+  ofJ_0_of_three_ne_zero
+
+lemma ofJ_1728_of_three_eq_zero (h3 : (3 : F) = 0) :
+    ofJ 1728 = @ofJ1728 _ _ (invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_right h3) := by
+  rw [ofJ, dif_pos <| by rw [show (1728 : F) = 3 * 576 by norm_num1, h3, zero_mul], dif_pos h3]
+
+lemma ofJ_1728_of_two_ne_zero [h2 : NeZero (2 : F)] :
+    ofJ 1728 = @ofJ1728 _ _ (invertibleOfNonzero h2.out) := by
+  by_cases h3 : (3 : F) = 0
+  · exact ofJ_1728_of_three_eq_zero h3
+  · have h : (1728 : F) ≠ 0 := fun h => or_iff_not_and_not.mp
+      (mul_eq_zero.mp <| by rwa [show 2 ^ 6 * 3 ^ 3 = (1728 : F) by norm_num1])
+      ⟨pow_ne_zero 6 h2.out, pow_ne_zero 3 h3⟩
+    rw [ofJ, dif_neg h, dif_pos rfl]
+
+lemma ofJ_1728_of_two_eq_zero (h2 : (2 : F) = 0) :
+    ofJ 1728 = @ofJ0 _ _ (invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_left h2) := by
+  rw [ofJ, dif_pos <| by rw [show (1728 : F) = 2 * 864 by norm_num1, h2, zero_mul], dif_neg]
+
+lemma ofJ_ne_0_ne_1728 (h0 : j ≠ 0) (h1728 : j ≠ 1728) :
+    ofJ j =
+      @ofJ' _ _ j (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728) := by
+  rw [ofJ, dif_neg h0, dif_neg h1728]
+
+lemma ofJ_j : (ofJ j).j = j := by
+  by_cases h0 : j = 0
+  · by_cases h3 : (3 : F) = 0
+    · rw [h0, ofJ_0_of_three_eq_zero h3,
+        @ofJ1728_j _ _ <| invertibleOfNonzero <| two_or_three_ne_zero.neg_resolve_right h3,
+        show (1728 : F) = 3 * 576 by norm_num1, h3, zero_mul]
+    · rw [h0, ofJ_0_of_three_ne_zero (h3 := neZero_iff.2 h3), @ofJ0_j _ _ <| invertibleOfNonzero h3]
+  · by_cases h1728 : j = 1728
+    · have h2 : (2 : F) ≠ 0 :=
+        fun h => h0 <| by rw [h1728, show (1728 : F) = 2 * 864 by norm_num1, h, zero_mul]
+      rw [h1728, ofJ_1728_of_two_ne_zero (h2 := neZero_iff.2 h2),
+        @ofJ1728_j _ _ <| invertibleOfNonzero h2]
+    · rw [ofJ_ne_0_ne_1728 j h0 h1728,
+        @ofJ'_j _ _ _ (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728)]
+
+instance instInhabitedEllipticCurve : Inhabited <| EllipticCurve F :=
+  ⟨ofJ 37⟩
+#align elliptic_curve.inhabited EllipticCurve.instInhabitedEllipticCurve
+
+end ModelsWithJ
+
 section VariableChange
 
 /-! ### Variable changes -/
refactor(AlgebraicGeometry/EllipticCurve/Weierstrass): change the variableChange into a structure (#5841)

Main changes:

  • Change the variableChange (was u r s t everywhere) into a structure VariableChange.
  • Add id, comp and inv to VariableChange and prove that it form a group and acts on the set of elliptic curves to the left.
  • Add baseChange to VariableChange, prove the compatibility of it with base change of elliptic curves.
  • Prove that if the ring homomorphism is injective, then baseChange of VariableChange and elliptic curves are injective (NB: We don't say anything about elliptic curves modulo isomorphism yet!)
  • Prove that baseChange of VariableChange is a group homomorphism
Diff
@@ -32,6 +32,7 @@ splitting field of `R` are precisely the $X$-coordinates of the non-zero 2-torsi
 
  * `WeierstrassCurve`: a Weierstrass curve over a commutative ring.
  * `WeierstrassCurve.Δ`: the discriminant of a Weierstrass curve.
+ * `WeierstrassCurve.VariableChange`: a change of variables of Weierstrass curves.
  * `WeierstrassCurve.variableChange`: the Weierstrass curve induced by a change of variables.
  * `WeierstrassCurve.baseChange`: the Weierstrass curve base changed over an algebra.
  * `WeierstrassCurve.twoTorsionPolynomial`: the 2-torsion polynomial of a Weierstrass curve.
@@ -182,63 +183,184 @@ section VariableChange
 
 /-! ### Variable changes -/
 
-variable (u : Rˣ) (r s t : R)
+/-- An admissible linear change of variables of Weierstrass curves defined over a ring `R`.
+It consists of a tuple $(u,r,s,t)$ of elements in $R$, with $u$ invertible.
+As a matrix, it is $\begin{pmatrix}
+u^2 & 0 & r \cr
+u^2s & u^3 & t \cr
+0 & 0 & 1
+\end{pmatrix}$. -/
+@[ext]
+structure VariableChange (R : Type u) [CommRing R] where
+  (u : Rˣ)
+  (r s t : R)
+
+namespace VariableChange
+
+/-- The `u` coefficient of an admissible linear change of variables, which must be a unit. -/
+add_decl_doc u
+
+/-- The `r` coefficient of an admissible linear change of variables. -/
+add_decl_doc r
+
+/-- The `s` coefficient of an admissible linear change of variables. -/
+add_decl_doc s
+
+/-- The `t` coefficient of an admissible linear change of variables. -/
+add_decl_doc t
+
+variable (C C' C'' : VariableChange R)
+
+/-- The identity linear change of variables. As a matrix, it is just identity matrix. -/
+def id : VariableChange R :=
+  ⟨1, 0, 0, 0⟩
+
+/-- The composition of two linear change of variables. As matrices, it is just matrix
+multiplcation. -/
+def comp : VariableChange R where
+  u := C.u * C'.u
+  r := C.r * ↑C'.u ^ 2 + C'.r
+  s := ↑C'.u * C.s + C'.s
+  t := C.t * ↑C'.u ^ 3 + C.r * C'.s * ↑C'.u ^ 2 + C'.t
+
+/-- The inverse of a linear change of variables. As a matrix, it is just matrix inverse. -/
+def inv : VariableChange R where
+  u := C.u⁻¹
+  r := -C.r * ↑C.u⁻¹ ^ 2
+  s := -C.s * ↑C.u⁻¹
+  t := (C.r * C.s - C.t) * ↑C.u⁻¹ ^ 3
+
+lemma id_comp (C : VariableChange R) : comp id C = C := by
+  simp only [comp, id, zero_add, zero_mul, mul_zero, one_mul]
+
+lemma comp_id (C : VariableChange R) : comp C id = C := by
+  simp only [comp, id, add_zero, mul_zero, one_mul, mul_one, one_pow, Units.val_one]
+
+lemma comp_left_inv (C : VariableChange R) : comp (inv C) C = id := by
+  rw [comp, id, inv]
+  ext <;> dsimp only
+  · exact C.u.inv_mul
+  · linear_combination (norm := ring1) -C.r * pow_mul_pow_eq_one 2 C.u.inv_mul
+  · linear_combination (norm := ring1) -C.s * C.u.inv_mul
+  · linear_combination (norm := ring1)
+      (C.r * C.s - C.t) * pow_mul_pow_eq_one 3 C.u.inv_mul
+        + -C.r * C.s * pow_mul_pow_eq_one 2 C.u.inv_mul
+
+lemma comp_assoc (C C' C'' : VariableChange R) : comp (comp C C') C'' = comp C (comp C' C'') := by
+  ext <;> simp only [comp, Units.val_mul] <;> ring1
+
+instance instGroupVariableChange : Group (VariableChange R) where
+  one := id
+  inv := inv
+  mul := comp
+  one_mul := id_comp
+  mul_one := comp_id
+  mul_left_inv := comp_left_inv
+  mul_assoc := comp_assoc
+
+end VariableChange
+
+variable (C : VariableChange R)
 
 /-- The Weierstrass curve over `R` induced by an admissible linear change of variables
 $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$. -/
 @[simps]
 def variableChange : WeierstrassCurve R where
-  a₁ := ↑u⁻¹ * (W.a₁ + 2 * s)
-  a₂ := ↑u⁻¹ ^ 2 * (W.a₂ - s * W.a₁ + 3 * r - s ^ 2)
-  a₃ := ↑u⁻¹ ^ 3 * (W.a₃ + r * W.a₁ + 2 * t)
-  a₄ := ↑u⁻¹ ^ 4 * (W.a₄ - s * W.a₃ + 2 * r * W.a₂ - (t + r * s) * W.a₁ + 3 * r ^ 2 - 2 * s * t)
-  a₆ := ↑u⁻¹ ^ 6 * (W.a₆ + r * W.a₄ + r ^ 2 * W.a₂ + r ^ 3 - t * W.a₃ - t ^ 2 - r * t * W.a₁)
+  a₁ := ↑C.u⁻¹ * (W.a₁ + 2 * C.s)
+  a₂ := ↑C.u⁻¹ ^ 2 * (W.a₂ - C.s * W.a₁ + 3 * C.r - C.s ^ 2)
+  a₃ := ↑C.u⁻¹ ^ 3 * (W.a₃ + C.r * W.a₁ + 2 * C.t)
+  a₄ := ↑C.u⁻¹ ^ 4 * (W.a₄ - C.s * W.a₃ + 2 * C.r * W.a₂ - (C.t + C.r * C.s) * W.a₁ + 3 * C.r ^ 2
+    - 2 * C.s * C.t)
+  a₆ := ↑C.u⁻¹ ^ 6 * (W.a₆ + C.r * W.a₄ + C.r ^ 2 * W.a₂ + C.r ^ 3 - C.t * W.a₃ - C.t ^ 2
+    - C.r * C.t * W.a₁)
 #align weierstrass_curve.variable_change WeierstrassCurve.variableChange
 
+lemma variableChange_id : W.variableChange VariableChange.id = W := by
+  rw [VariableChange.id, variableChange, inv_one, Units.val_one]
+  ext <;> (dsimp only; ring1)
+
+lemma variableChange_comp (C C' : VariableChange R) (W : WeierstrassCurve R) :
+    W.variableChange (C.comp C') = (W.variableChange C').variableChange C := by
+  simp only [VariableChange.comp, variableChange]
+  ext <;> simp only [mul_inv, Units.val_mul]
+  · linear_combination (norm := ring1) ↑C.u⁻¹ * C.s * 2 * C'.u.inv_mul
+  · linear_combination (norm := ring1)
+      C.s * (-C'.s * 2 - W.a₁) * (↑C.u⁻¹ : R) ^ 2 * ↑C'.u⁻¹ * C'.u.inv_mul
+        + (C.r * 3 - C.s ^ 2) * (↑C.u⁻¹ : R) ^ 2 * pow_mul_pow_eq_one 2 C'.u.inv_mul
+  · linear_combination (norm := ring1)
+      C.r * (C'.s * 2 + W.a₁) * (↑C.u⁻¹ : R) ^ 3 * ↑C'.u⁻¹ * pow_mul_pow_eq_one 2 C'.u.inv_mul
+        + C.t * 2 * (↑C.u⁻¹ : R) ^ 3 * pow_mul_pow_eq_one 3 C'.u.inv_mul
+  · linear_combination (norm := ring1)
+      C.s * (-W.a₃ - C'.r * W.a₁ - C'.t * 2) * (↑C.u⁻¹ : R) ^ 4 * (↑C'.u⁻¹ : R) ^ 3 * C'.u.inv_mul
+        + (↑C.u⁻¹ : R) ^ 4 * (↑C'.u⁻¹ : R) ^ 2
+          * (C.r * C'.r * 6 + C.r * W.a₂ * 2 - C'.s * C.r * W.a₁ * 2 - C'.s ^ 2 * C.r * 2)
+          * pow_mul_pow_eq_one 2 C'.u.inv_mul
+        + -(↑C.u⁻¹ : R) ^ 4
+          * ↑C'.u⁻¹ * (C.s * C'.s * C.r * 2 + C.s * C.r * W.a₁ + C'.s * C.t * 2 + C.t * W.a₁)
+          * pow_mul_pow_eq_one 3 C'.u.inv_mul
+        + (↑C.u⁻¹ : R) ^ 4 * (C.r ^ 2 * 3 - C.s * C.t * 2) * pow_mul_pow_eq_one 4 C'.u.inv_mul
+  · linear_combination (norm := ring1)
+      C.r * (↑C.u⁻¹ : R) ^ 6 * (↑C'.u⁻¹ : R) ^ 4 * (C'.r * W.a₂ * 2 - C'.r * C'.s * W.a₁
+          + C'.r ^ 2 * 3 + W.a₄ - C'.s * C'.t * 2 - C'.s * W.a₃ - C'.t * W.a₁)
+          * pow_mul_pow_eq_one 2 C'.u.inv_mul
+        + -(↑C.u⁻¹ : R) ^ 6 * (↑C'.u⁻¹ : R) ^ 3 * C.t * (C'.r * W.a₁ + C'.t * 2 + W.a₃)
+          * pow_mul_pow_eq_one 3 C'.u.inv_mul
+        + C.r ^ 2 * (↑C.u⁻¹ : R) ^ 6 * (↑C'.u⁻¹ : R) ^ 2
+          * (C'.r * 3 + W.a₂ - C'.s * W.a₁ - C'.s ^ 2) * pow_mul_pow_eq_one 4 C'.u.inv_mul
+        + -C.r * C.t * (↑C.u⁻¹ : R) ^ 6 * ↑C'.u⁻¹ * (C'.s * 2 + W.a₁)
+          * pow_mul_pow_eq_one 5 C'.u.inv_mul
+        + (↑C.u⁻¹ : R) ^ 6 * (C.r ^ 3 - C.t ^ 2) * pow_mul_pow_eq_one 6 C'.u.inv_mul
+
+instance instMulActionVariableChange : MulAction (VariableChange R) (WeierstrassCurve R) where
+  smul := fun C W => W.variableChange C
+  one_smul := variableChange_id
+  mul_smul := variableChange_comp
+
 @[simp]
-lemma variableChange_b₂ : (W.variableChange u r s t).b₂ = (↑u⁻¹ : R) ^ 2 * (W.b₂ + 12 * r) := by
+lemma variableChange_b₂ : (W.variableChange C).b₂ = (↑C.u⁻¹ : R) ^ 2 * (W.b₂ + 12 * C.r) := by
   simp only [b₂, variableChange_a₁, variableChange_a₂]
   ring1
 #align weierstrass_curve.variable_change_b₂ WeierstrassCurve.variableChange_b₂
 
 @[simp]
 lemma variableChange_b₄ :
-    (W.variableChange u r s t).b₄ = (↑u⁻¹ : R) ^ 4 * (W.b₄ + r * W.b₂ + 6 * r ^ 2) := by
+    (W.variableChange C).b₄ = (↑C.u⁻¹ : R) ^ 4 * (W.b₄ + C.r * W.b₂ + 6 * C.r ^ 2) := by
   simp only [b₂, b₄, variableChange_a₁, variableChange_a₃, variableChange_a₄]
   ring1
 #align weierstrass_curve.variable_change_b₄ WeierstrassCurve.variableChange_b₄
 
 @[simp]
 lemma variableChange_b₆ :
-    (W.variableChange u r s t).b₆ =
-      (↑u⁻¹ : R) ^ 6 * (W.b₆ + 2 * r * W.b₄ + r ^ 2 * W.b₂ + 4 * r ^ 3) := by
+    (W.variableChange C).b₆ =
+      (↑C.u⁻¹ : R) ^ 6 * (W.b₆ + 2 * C.r * W.b₄ + C.r ^ 2 * W.b₂ + 4 * C.r ^ 3) := by
   simp only [b₂, b₄, b₆, variableChange_a₃, variableChange_a₆]
   ring1
 #align weierstrass_curve.variable_change_b₆ WeierstrassCurve.variableChange_b₆
 
 @[simp]
 lemma variableChange_b₈ :
-    (W.variableChange u r s t).b₈ =
-      (↑u⁻¹ : R) ^ 8 * (W.b₈ + 3 * r * W.b₆ + 3 * r ^ 2 * W.b₄ + r ^ 3 * W.b₂ + 3 * r ^ 4) := by
+    (W.variableChange C).b₈ =
+      (↑C.u⁻¹ : R) ^ 8 * (W.b₈ + 3 * C.r * W.b₆ + 3 * C.r ^ 2 * W.b₄ + C.r ^ 3 * W.b₂
+        + 3 * C.r ^ 4) := by
   simp only [b₂, b₄, b₆, b₈, variableChange_a₁, variableChange_a₂, variableChange_a₃,
     variableChange_a₄, variableChange_a₆]
   ring1
 #align weierstrass_curve.variable_change_b₈ WeierstrassCurve.variableChange_b₈
 
 @[simp]
-lemma variableChange_c₄ : (W.variableChange u r s t).c₄ = (↑u⁻¹ : R) ^ 4 * W.c₄ := by
+lemma variableChange_c₄ : (W.variableChange C).c₄ = (↑C.u⁻¹ : R) ^ 4 * W.c₄ := by
   simp only [c₄, variableChange_b₂, variableChange_b₄]
   ring1
 #align weierstrass_curve.variable_change_c₄ WeierstrassCurve.variableChange_c₄
 
 @[simp]
-lemma variableChange_c₆ : (W.variableChange u r s t).c₆ = (↑u⁻¹ : R) ^ 6 * W.c₆ := by
+lemma variableChange_c₆ : (W.variableChange C).c₆ = (↑C.u⁻¹ : R) ^ 6 * W.c₆ := by
   simp only [c₆, variableChange_b₂, variableChange_b₄, variableChange_b₆]
   ring1
 #align weierstrass_curve.variable_change_c₆ WeierstrassCurve.variableChange_c₆
 
 @[simp]
-lemma variableChange_Δ : (W.variableChange u r s t).Δ = (↑u⁻¹ : R) ^ 12 * W.Δ := by
+lemma variableChange_Δ : (W.variableChange C).Δ = (↑C.u⁻¹ : R) ^ 12 * W.Δ := by
   simp only [b₂, b₄, b₆, b₈, Δ, variableChange_a₁, variableChange_a₂, variableChange_a₃,
     variableChange_a₄, variableChange_a₆]
   ring1
@@ -310,6 +432,56 @@ lemma baseChange_baseChange : (W.baseChange A).baseChange B = W.baseChange B :=
   ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
 #align weierstrass_curve.base_change_base_change WeierstrassCurve.baseChange_baseChange
 
+lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
+    Function.Injective <| baseChange (R := R) (A := A) := fun W W' h1 => by
+  rcases mk.inj h1 with ⟨_, _, _, _, _⟩
+  ext <;> apply_fun _ using h <;> assumption
+
+namespace VariableChange
+
+variable (C : VariableChange R)
+
+/-- The change of variables over `R` base changed to `A`. -/
+@[simps]
+def baseChange : VariableChange A :=
+  ⟨Units.map (algebraMap R A) C.u, algebraMap R A C.r, algebraMap R A C.s, algebraMap R A C.t⟩
+
+lemma baseChange_id : baseChange A (id : VariableChange R) = id := by
+  simp only [id, baseChange]
+  ext <;> simp only [map_one, Units.val_one, map_zero]
+
+lemma baseChange_comp (C' : VariableChange R) :
+    baseChange A (C.comp C') = (baseChange A C).comp (baseChange A C') := by
+  simp only [comp, baseChange]
+  ext <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe,
+    map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow]
+
+/-- The base change of change of variables over `R` to `A` is a group homomorphism. -/
+def baseChangeMap : VariableChange R →* VariableChange A where
+  toFun := baseChange A
+  map_one' := baseChange_id A
+  map_mul' := baseChange_comp A
+
+lemma baseChange_self : C.baseChange R = C :=
+  rfl
+
+lemma baseChange_baseChange : (C.baseChange A).baseChange B = C.baseChange B := by
+  ext <;> exact (IsScalarTower.algebraMap_apply R A B _).symm
+
+lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
+    Function.Injective <| baseChange (R := R) A := fun C C' h1 => by
+  rcases mk.inj h1 with ⟨h1, _, _, _⟩
+  replace h1 := (Units.mk.inj h1).left
+  ext <;> apply_fun _ using h <;> assumption
+
+end VariableChange
+
+lemma baseChange_variableChange (C : VariableChange R) :
+    (W.baseChange A).variableChange (C.baseChange A) = (W.variableChange C).baseChange A := by
+  simp only [baseChange, variableChange, VariableChange.baseChange]
+  ext <;> simp only [Units.coe_map, Units.coe_map_inv, MonoidHom.coe_coe,
+    map_ofNat, map_neg, map_add, map_sub, map_mul, map_pow]
+
 end BaseChange
 
 section TorsionPolynomial
@@ -455,7 +627,7 @@ lemma equation_zero : W.equation 0 0 ↔ W.a₆ = 0 := by
 #align weierstrass_curve.equation_zero WeierstrassCurve.equation_zero
 
 lemma equation_iff_variableChange (x y : R) :
-    W.equation x y ↔ (W.variableChange 1 x 0 y).equation 0 0 := by
+    W.equation x y ↔ (W.variableChange ⟨1, x, 0, y⟩).equation 0 0 := by
   rw [equation_iff', ← neg_eq_zero, equation_zero, variableChange_a₆, inv_one, Units.val_one]
   congr! 1
   ring1
@@ -554,9 +726,10 @@ lemma nonsingular_zero : W.nonsingular 0 0 ↔ W.a₆ = 0 ∧ (W.a₃ ≠ 0 ∨
 #align weierstrass_curve.nonsingular_zero WeierstrassCurve.nonsingular_zero
 
 lemma nonsingular_iff_variableChange (x y : R) :
-    W.nonsingular x y ↔ (W.variableChange 1 x 0 y).nonsingular 0 0 := by
+    W.nonsingular x y ↔ (W.variableChange ⟨1, x, 0, y⟩).nonsingular 0 0 := by
   rw [nonsingular_iff', equation_iff_variableChange, equation_zero, ← neg_ne_zero, or_comm,
     nonsingular_zero, variableChange_a₃, variableChange_a₄, inv_one, Units.val_one]
+  simp only [variableChange]
   congr! 3 <;> ring1
 #align weierstrass_curve.nonsingular_iff_variable_change WeierstrassCurve.nonsingular_iff_variableChange
 
@@ -919,7 +1092,7 @@ section VariableChange
 
 /-! ### Variable changes -/
 
-variable (u : Rˣ) (r s t : R)
+variable (C : WeierstrassCurve.VariableChange R)
 
 -- porting note: was just `@[simps]`
 /-- The elliptic curve over `R` induced by an admissible linear change of variables
@@ -927,23 +1100,38 @@ $(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some
 When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
 @[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
 def variableChange : EllipticCurve R :=
-  ⟨E.toWeierstrassCurve.variableChange u r s t, u⁻¹ ^ 12 * E.Δ', by
+  ⟨E.toWeierstrassCurve.variableChange C, C.u⁻¹ ^ 12 * E.Δ', by
     rw [Units.val_mul, Units.val_pow_eq_pow_val, coe_Δ', E.variableChange_Δ]⟩
 #align elliptic_curve.variable_change EllipticCurve.variableChange
 
-lemma coe_variableChange_Δ' : (↑(E.variableChange u r s t).Δ' : R) = (↑u⁻¹ : R) ^ 12 * E.Δ' := by
+lemma variableChange_id : E.variableChange WeierstrassCurve.VariableChange.id = E := by
+  simp only [variableChange, WeierstrassCurve.variableChange_id]
+  simp only [WeierstrassCurve.VariableChange.id, inv_one, one_pow, one_mul]
+
+lemma variableChange_comp (C C' : WeierstrassCurve.VariableChange R) (E : EllipticCurve R) :
+    E.variableChange (C.comp C') = (E.variableChange C').variableChange C := by
+  simp only [variableChange, WeierstrassCurve.variableChange_comp]
+  simp only [WeierstrassCurve.VariableChange.comp, mul_inv, mul_pow, ← mul_assoc]
+
+instance instMulActionVariableChange :
+    MulAction (WeierstrassCurve.VariableChange R) (EllipticCurve R) where
+  smul := fun C E => E.variableChange C
+  one_smul := variableChange_id
+  mul_smul := variableChange_comp
+
+lemma coe_variableChange_Δ' : (↑(E.variableChange C).Δ' : R) = (↑C.u⁻¹ : R) ^ 12 * E.Δ' := by
   rw [variableChange_Δ', Units.val_mul, Units.val_pow_eq_pow_val]
 #align elliptic_curve.coe_variable_change_Δ' EllipticCurve.coe_variableChange_Δ'
 
 lemma coe_inv_variableChange_Δ' :
-    (↑(E.variableChange u r s t).Δ'⁻¹ : R) = (u : R) ^ 12 * ↑E.Δ'⁻¹ := by
+    (↑(E.variableChange C).Δ'⁻¹ : R) = (C.u : R) ^ 12 * ↑E.Δ'⁻¹ := by
   rw [variableChange_Δ', mul_inv, inv_pow, inv_inv, Units.val_mul, Units.val_pow_eq_pow_val]
 #align elliptic_curve.coe_inv_variable_change_Δ' EllipticCurve.coe_inv_variableChange_Δ'
 
 @[simp]
-lemma variableChange_j : (E.variableChange u r s t).j = E.j := by
+lemma variableChange_j : (E.variableChange C).j = E.j := by
   rw [j, coe_inv_variableChange_Δ']
-  have hu : (u * ↑u⁻¹ : R) ^ 12 = 1 := by rw [u.mul_inv, one_pow]
+  have hu : (C.u * ↑C.u⁻¹ : R) ^ 12 = 1 := by rw [C.u.mul_inv, one_pow]
   linear_combination (norm := (rw [variableChange_toWeierstrassCurve,
     WeierstrassCurve.variableChange_c₄, j]; ring1)) E.j * hu
 #align elliptic_curve.variable_change_j EllipticCurve.variableChange_j
@@ -979,6 +1167,13 @@ lemma baseChange_j : (E.baseChange A).j = algebraMap R A E.j := by
   rfl
 #align elliptic_curve.base_change_j EllipticCurve.baseChange_j
 
+lemma baseChange_injective (h : Function.Injective <| algebraMap R A) :
+    Function.Injective <| baseChange (R := R) (A := A) := fun E E' h1 => by
+  rcases mk.inj h1 with ⟨h1, h2⟩
+  replace h2 := (Units.mk.inj h2).left
+  rcases WeierstrassCurve.mk.inj h1 with ⟨_, _, _, _, _⟩
+  ext <;> apply_fun _ using h <;> assumption
+
 end BaseChange
 
 end EllipticCurve
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) 2021 Kevin Buzzard. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Kevin Buzzard, David Kurniadi Angdinata
-
-! This file was ported from Lean 3 source module algebraic_geometry.elliptic_curve.weierstrass
-! 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.Algebra.CubicDiscriminant
 import Mathlib.RingTheory.Norm
 import Mathlib.Tactic.LinearCombination
 
+#align_import algebraic_geometry.elliptic_curve.weierstrass from "leanprover-community/mathlib"@"e2e7f2ac359e7514e4d40061d7c08bb69487ba4e"
+
 /-!
 # Weierstrass equations of elliptic 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>

Diff
@@ -431,8 +431,7 @@ lemma eval_polynomial (x y : R) :
 
 @[simp]
 lemma eval_polynomial_zero : (W.polynomial.eval 0).eval 0 = -W.a₆ := by
-  simp only [← C_0, eval_polynomial, zero_add, zero_sub, MulZeroClass.mul_zero,
-    zero_pow <| Nat.zero_lt_succ _]
+  simp only [← C_0, eval_polynomial, zero_add, zero_sub, mul_zero, zero_pow <| Nat.zero_lt_succ _]
 #align weierstrass_curve.eval_polynomial_zero WeierstrassCurve.eval_polynomial_zero
 
 -- porting note: added `protected` for consistency with `WeierstrassCurve.polynomial`
@@ -468,9 +467,9 @@ lemma equation_iff_variableChange (x y : R) :
 lemma equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.equation x y ↔ (W.baseChange A).equation (algebraMap R A x) (algebraMap R A y) := by
   simp only [equation_iff]
-  refine' ⟨fun h => _, fun h => _⟩
-  · convert congr_arg (algebraMap R A) h <;> map_simp <;> rfl
-  · apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; exact h
+  exact
+    ⟨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⟩
 #align weierstrass_curve.equation_iff_base_change WeierstrassCurve.equation_iff_baseChange
 
 lemma equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
@@ -500,8 +499,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, MulZeroClass.mul_zero,
-    zero_pow zero_lt_two]
+  simp only [← C_0, eval_polynomialX, zero_add, zero_sub, mul_zero, zero_pow zero_lt_two]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.eval_polynomial_X_zero WeierstrassCurve.eval_polynomialX_zero
 
@@ -525,7 +523,7 @@ set_option linter.uppercaseLean3 false in
 
 @[simp]
 lemma eval_polynomialY_zero : (W.polynomialY.eval 0).eval 0 = W.a₃ := by
-  simp only [← C_0, eval_polynomialY, zero_add, MulZeroClass.mul_zero]
+  simp only [← C_0, eval_polynomialY, zero_add, mul_zero]
 set_option linter.uppercaseLean3 false in
 #align weierstrass_curve.eval_polynomial_Y_zero WeierstrassCurve.eval_polynomialY_zero
 
@@ -568,9 +566,9 @@ lemma nonsingular_iff_variableChange (x y : R) :
 lemma nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
     W.nonsingular x y ↔ (W.baseChange A).nonsingular (algebraMap R A x) (algebraMap R A y) := by
   rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange A 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 => _)⟩
+  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
 #align weierstrass_curve.nonsingular_iff_base_change WeierstrassCurve.nonsingular_iff_baseChange
@@ -597,18 +595,14 @@ lemma nonsingular_of_Δ_ne_zero {x y : R} (h : W.equation x y) (hΔ : W.Δ ≠ 0
 
 /-! ### Ideals in the coordinate ring -/
 
--- porting note: verify that using `abbrev` instead of `def` does not cause an issue, otherwise
--- define a new `notation`, and verify if the new def-eq cache (lean4#1102) fixed this issue
-/-- The coordinate ring $R[W] := R[X, Y] / \langle W(X, Y) \rangle$ of `W`.
-
-In Lean 3, this is a `def` under a `derive [inhabited, comm_ring]` tag with the following comments.
-Note that `deriving comm_ring` generates a reducible instance of `comm_ring` for `coordinate_ring`.
-In certain circumstances this might be extremely slow, because all instances in its definition are
-unified exponentially many times. In this case, one solution is to manually add the local attribute
-`local attribute [irreducible] coordinate_ring.comm_ring` to block this type-level unification.
-
-See Zulip thread:
-https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.E2.9C.94.20class_group.2Emk -/
+-- porting note: in Lean 3, this is a `def` under a `derive comm_ring` tag.
+-- This generates a reducible instance of `comm_ring` for `coordinate_ring`. In certain
+-- circumstances this might be extremely slow, because all instances in its definition are unified
+-- exponentially many times. In this case, one solution is to manually add the local attribute
+-- `local attribute [irreducible] coordinate_ring.comm_ring` to block this type-level unification.
+-- In Lean 4, this is no longer an issue and is now an `abbrev`. See Zulip thread:
+-- https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/.E2.9C.94.20class_group.2Emk
+/-- The coordinate ring $R[W] := R[X, Y] / \langle W(X, Y) \rangle$ of `W`. -/
 abbrev CoordinateRing : Type u :=
   AdjoinRoot W.polynomial
 #align weierstrass_curve.coordinate_ring WeierstrassCurve.CoordinateRing
@@ -622,8 +616,8 @@ namespace CoordinateRing
 
 -- porting note: added the abbreviation `mk` for `AdjoinRoot.mk W.polynomial`
 /-- An element of the coordinate ring `R[W]` of `W` over `R`. -/
-noncomputable abbrev mk (x : R[X][X]) : W.CoordinateRing :=
-  AdjoinRoot.mk W.polynomial x
+noncomputable abbrev mk : R[X][Y] →+* W.CoordinateRing :=
+  AdjoinRoot.mk W.polynomial
 
 open Ideal
 
feat: port AlgebraicGeometry.EllipticCurve.Weierstrass (#5294)

Co-authored-by: Xavier-François Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com> Co-authored-by: Moritz Firsching <firsching@google.com>

Dependencies 10 + 712

713 files ported (98.6%)
291808 lines ported (98.8%)
Show graph

The unported dependencies are