Skip to content

Commit

Permalink
chore: classify avoid simpNF linter error porting notes (#10760)
Browse files Browse the repository at this point in the history
Classifies by adding issue number (#10759) to porting notes claiming: 

> removed `@[simp]` to avoid a `simpNF` linter error.
  • Loading branch information
pitmonticone committed Feb 20, 2024
1 parent 58db12e commit 63e4e10
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions Mathlib/AlgebraicGeometry/EllipticCurve/Affine.lean
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ lemma irreducible_polynomial [IsDomain R] : Irreducible W.polynomial := by
iterate 2 rw [degree_add_eq_left_of_degree_lt] <;> simp only [h] <;> decide
#align weierstrass_curve.irreducible_polynomial WeierstrassCurve.Affine.irreducible_polynomial

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma eval_polynomial (x y : R) : (W.polynomial.eval <| C y).eval x =
y ^ 2 + W.a₁ * x * y + W.a₃ * y - (x ^ 3 + W.a₂ * x ^ 2 + W.a₄ * x + W.a₆) := by
simp only [polynomial]
Expand All @@ -198,7 +198,7 @@ lemma equation_iff' (x y : R) : W.equation x y ↔
rw [equation, eval_polynomial]
#align weierstrass_curve.equation_iff' WeierstrassCurve.Affine.equation_iff'

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma equation_iff (x y : R) :
W.equation x y ↔ y ^ 2 + W.a₁ * x * y + W.a₃ * y = x ^ 3 + W.a₂ * x ^ 2 + W.a₄ * x + W.a₆ := by
rw [equation_iff', sub_eq_zero]
Expand Down Expand Up @@ -231,7 +231,7 @@ noncomputable def polynomialX : R[X][Y] :=
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.polynomial_X WeierstrassCurve.Affine.polynomialX

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma eval_polynomialX (x y : R) :
(W.polynomialX.eval <| C y).eval x = W.a₁ * y - (3 * x ^ 2 + 2 * W.a₂ * x + W.a₄) := by
simp only [polynomialX]
Expand All @@ -254,7 +254,7 @@ noncomputable def polynomialY : R[X][Y] :=
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.polynomial_Y WeierstrassCurve.Affine.polynomialY

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma eval_polynomialY (x y : R) :
(W.polynomialY.eval <| C y).eval x = 2 * y + W.a₁ * x + W.a₃ := by
simp only [polynomialY]
Expand All @@ -281,7 +281,7 @@ lemma nonsingular_iff' (x y : R) : W.nonsingular x y ↔ W.equation x y ∧
rw [nonsingular, equation_iff', eval_polynomialX, eval_polynomialY]
#align weierstrass_curve.nonsingular_iff' WeierstrassCurve.Affine.nonsingular_iff'

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma nonsingular_iff (x y : R) : W.nonsingular x y ↔
W.equation x y ∧ (W.a₁ * y ≠ 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄ ∨ y ≠ -y - W.a₁ * x - W.a₃) := by
rw [nonsingular_iff', sub_ne_zero, ← sub_ne_zero (a := y)]
Expand Down Expand Up @@ -344,7 +344,7 @@ lemma negY_negY (x y : R) : W.negY x (W.negY x y) = y := by
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.neg_Y_neg_Y WeierstrassCurve.Affine.negY_negY

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma eval_negPolynomial (x y : R) : (W.negPolynomial.eval <| C y).eval x = W.negY x y := by
rw [negY, sub_sub, negPolynomial]
eval_simp
Expand Down Expand Up @@ -656,7 +656,7 @@ instance : Inhabited W.Point :=
instance : Zero W.Point :=
⟨zero⟩

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma zero_def : (zero : W.Point) = 0 :=
rfl
#align weierstrass_curve.point.zero_def WeierstrassCurve.Affine.Point.zero_def
Expand All @@ -673,7 +673,7 @@ def neg : W.Point → W.Point
instance : Neg W.Point :=
⟨neg⟩

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma neg_def (P : W.Point) : P.neg = -P :=
rfl
#align weierstrass_curve.point.neg_def WeierstrassCurve.Affine.Point.neg_def
Expand Down Expand Up @@ -711,7 +711,7 @@ noncomputable def add : W.Point → W.Point → W.Point
noncomputable instance instAddPoint : Add W.Point :=
⟨add⟩

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma add_def (P Q : W.Point) : P.add Q = P + Q :=
rfl
#align weierstrass_curve.point.add_def WeierstrassCurve.Affine.Point.add_def
Expand Down
20 changes: 10 additions & 10 deletions Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ instance instIsDomainCoordinateRing_of_Field {F : Type u} [Field F] (W : Affine
noncomputable abbrev mk : R[X][Y] →+* W.CoordinateRing :=
AdjoinRoot.mk W.polynomial

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): 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 (x : R) : W.CoordinateRing :=
mk W <| C <| X - C x
Expand All @@ -125,7 +125,7 @@ lemma XClass_ne_zero [Nontrivial R] (x : R) : XClass W x ≠ 0 :=
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.coordinate_ring.X_class_ne_zero WeierstrassCurve.Affine.CoordinateRing.XClass_ne_zero

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): 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 (y : R[X]) : W.CoordinateRing :=
mk W <| Y - C y
Expand All @@ -144,21 +144,21 @@ lemma C_addPolynomial (x y L : R) : mk W (C <| W.addPolynomial x y L) =
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.coordinate_ring.C_add_polynomial WeierstrassCurve.Affine.CoordinateRing.C_addPolynomial

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): 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 (x : R) : Ideal W.CoordinateRing :=
span {XClass W x}
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.coordinate_ring.X_ideal WeierstrassCurve.Affine.CoordinateRing.XIdeal

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): 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 (y : R[X]) : Ideal W.CoordinateRing :=
span {YClass W y}
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.coordinate_ring.Y_ideal WeierstrassCurve.Affine.CoordinateRing.YIdeal

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): 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}
Expand Down Expand Up @@ -303,7 +303,7 @@ lemma XYIdeal_mul_XYIdeal {x₁ x₂ y₁ y₂ : F} (h₁ : W.equation x₁ y₁
set_option linter.uppercaseLean3 false in
#align weierstrass_curve.XY_ideal_mul_XY_ideal WeierstrassCurve.Affine.CoordinateRing.XYIdeal_mul_XYIdeal

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
/-- The non-zero fractional ideal $\langle X - x, Y - y \rangle$ of $F(W)$ for some $x, y \in F$. -/
noncomputable def XYIdeal' {x y : F} (h : W.nonsingular x y) :
(FractionalIdeal W.CoordinateRing⁰ W.FunctionField)ˣ :=
Expand Down Expand Up @@ -563,7 +563,7 @@ noncomputable def toClass : W.Point →+ Additive (ClassGroup W.CoordinateRing)
(CoordinateRing.mk_XYIdeal'_mul_mk_XYIdeal' h₁ h₂ fun h => (hx h).elim).symm
#align weierstrass_curve.point.to_class WeierstrassCurve.Affine.Point.toClass

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma toClass_zero : toClass (0 : W.Point) = 0 :=
rfl
#align weierstrass_curve.point.to_class_zero WeierstrassCurve.Affine.Point.toClass_zero
Expand All @@ -573,7 +573,7 @@ lemma toClass_some {x y : F} (h : W.nonsingular x y) :
rfl
#align weierstrass_curve.point.to_class_some WeierstrassCurve.Affine.Point.toClass_some

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q := by
rcases P, Q with ⟨_ | @⟨x₁, y₁, _⟩, _ | @⟨x₂, y₂, _⟩⟩
any_goals rfl
Expand All @@ -591,12 +591,12 @@ lemma add_eq_zero (P Q : W.Point) : P + Q = 0 ↔ P = -Q := by
· exact fun ⟨hx, hy⟩ => some_add_some_of_Yeq hx hy
#align weierstrass_curve.point.add_eq_zero WeierstrassCurve.Affine.Point.add_eq_zero

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma add_left_neg (P : W.Point) : -P + P = 0 := by
rw [add_eq_zero]
#align weierstrass_curve.point.add_left_neg WeierstrassCurve.Affine.Point.add_left_neg

-- porting note: removed `@[simp]` to avoid a `simpNF` linter error
-- Porting note (#10619): removed `@[simp]` to avoid a `simpNF` linter error
lemma neg_add_eq_zero (P Q : W.Point) : -P + Q = 0 ↔ P = Q := by
rw [add_eq_zero, neg_inj]
#align weierstrass_curve.point.neg_add_eq_zero WeierstrassCurve.Affine.Point.neg_add_eq_zero
Expand Down
16 changes: 8 additions & 8 deletions Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand All @@ -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
Expand Down Expand Up @@ -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 :=
Expand Down

0 comments on commit 63e4e10

Please sign in to comment.