File: Mathlib/AlgebraicGeometry/EllipticCurve/Projective.lean

full_name: _aux_Mathlib_AlgebraicGeometry_EllipticCurve_Projective___macroRules_termX_1
code: local notation "x" => 0
goal: Lean.Macro

full_name: _aux_Mathlib_AlgebraicGeometry_EllipticCurve_Projective___macroRules_termY_1
code: local notation "y" => 1
goal: Lean.Macro

full_name: _aux_Mathlib_AlgebraicGeometry_EllipticCurve_Projective___macroRules_termZ_1
code: local notation "z" => 2
goal: Lean.Macro

full_name: tacticMatrix_simp._@.Mathlib.AlgebraicGeometry.EllipticCurve.Projective._hyg.405
code: macro "matrix_simp" : tactic =>
  `(tactic| simp only [Matrix.head_cons, Matrix.tail_cons, Matrix.smul_empty, Matrix.smul_cons,
    Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two])
goal: Lean.ParserDescr

full_name: _aux_Mathlib_AlgebraicGeometry_EllipticCurve_Projective___macroRules_tacticMatrix_simp_1
code: macro "matrix_simp" : tactic =>
  `(tactic| simp only [Matrix.head_cons, Matrix.tail_cons, Matrix.smul_empty, Matrix.smul_cons,
    Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two])
goal: Lean.Macro

full_name: WeierstrassCurve.Projective
code: /-- An abbreviation for a Weierstrass curve in projective coordinates. -/
abbrev WeierstrassCurve.Projective 
goal: Type u_1

full_name: WeierstrassCurve.Projective.tacticEval_simp._@.Mathlib.AlgebraicGeometry.EllipticCurve.Projective._hyg.802
code: macro "eval_simp" : tactic =>
  `(tactic| simp only [eval_C, eval_X, eval_add, eval_sub, eval_mul, eval_pow])
goal: Lean.ParserDescr

full_name: WeierstrassCurve.Projective._aux_Mathlib_AlgebraicGeometry_EllipticCurve_Projective___macroRules_WeierstrassCurve_Projective_tacticEval_simp_1
code: macro "eval_simp" : tactic =>
  `(tactic| simp only [eval_C, eval_X, eval_add, eval_sub, eval_mul, eval_pow])
goal: Lean.Macro

full_name: WeierstrassCurve.Projective.tacticPderiv_simp._@.Mathlib.AlgebraicGeometry.EllipticCurve.Projective._hyg.1163
code: macro "pderiv_simp" : tactic =>
  `(tactic| simp only [map_ofNat, map_neg, map_add, map_sub, map_mul, pderiv_mul, pderiv_pow,
    pderiv_C, pderiv_X_self, pderiv_X_of_ne one_ne_zero, pderiv_X_of_ne one_ne_zero.symm,
    pderiv_X_of_ne (by decide : (2 : Fin 3) ≠ 0), pderiv_X_of_ne (by decide : (0 : Fin 3) ≠ 2),
    pderiv_X_of_ne (by decide : (2 : Fin 3) ≠ 1), pderiv_X_of_ne (by decide : (1 : Fin 3) ≠ 2)])
goal: Lean.ParserDescr

full_name: WeierstrassCurve.Projective._aux_Mathlib_AlgebraicGeometry_EllipticCurve_Projective___macroRules_WeierstrassCurve_Projective_tacticPderiv_simp_1
code: macro "pderiv_simp" : tactic =>
  `(tactic| simp only [map_ofNat, map_neg, map_add, map_sub, map_mul, pderiv_mul, pderiv_pow,
    pderiv_C, pderiv_X_self, pderiv_X_of_ne one_ne_zero, pderiv_X_of_ne one_ne_zero.symm,
    pderiv_X_of_ne (by decide : (2 : Fin 3) ≠ 0), pderiv_X_of_ne (by decide : (0 : Fin 3) ≠ 2),
    pderiv_X_of_ne (by decide : (2 : Fin 3) ≠ 1), pderiv_X_of_ne (by decide : (1 : Fin 3) ≠ 2)])
goal: Lean.Macro

full_name: WeierstrassCurve.Projective.fin3_def
code: lemma fin3_def {R : Type u} (P : Fin 3 → R) : P = ![P x, P y, P z] 
goal: P = ![P 0, P 1, P 2]

full_name: WeierstrassCurve.Projective.smul_fin3
code: lemma smul_fin3 {R : Type u} [CommRing R] (P : Fin 3 → R) (u : Rˣ) :
    u • P = ![u * P x, u * P y, u * P z] 
goal: u • P = ![↑u * P 0, ↑u * P 1, ↑u * P 2]

full_name: WeierstrassCurve.Projective.smul_fin3_ext
code: lemma smul_fin3_ext {R : Type u} [CommRing R] (P : Fin 3 → R) (u : Rˣ) :
    (u • P) x = u * P x ∧ (u • P) y = u * P y ∧ (u • P) z = u * P z 
goal: (u • P) 0 = ↑u * P 0 ∧ (u • P) 1 = ↑u * P 1 ∧ (u • P) 2 = ↑u * P 2

full_name: WeierstrassCurve.Projective.instSetoidPoint
code: /-- The equivalence setoid for a point representative. -/
scoped instance instSetoidPoint : Setoid <| Fin 3 → R 
goal: Setoid (Fin 3 → R)

full_name: WeierstrassCurve.Projective.PointClass
code: /-- The equivalence class of a point representative. -/
abbrev PointClass (R : Type u) [CommRing R] : Type u 
goal: Type u

full_name: WeierstrassCurve.Projective.toAffine
code: /-- The coercion to a Weierstrass curve in affine coordinates. -/
abbrev toAffine : Affine R 
goal: WeierstrassCurve.Affine R

full_name: WeierstrassCurve.Projective.polynomial
code: /-- The polynomial $W(X, Y, Z) := Y^2Z + a_1XYZ + a_3YZ^2 - (X^3 + a_2X^2Z + a_4XZ^2 + a_6Z^3)$
associated to a Weierstrass curve `W` over `R`. This is represented as a term of type
`MvPolynomial (Fin 3) R`, where `X 0`, `X 1`, and `X 2` represent $X$, $Y$, and $Z$ respectively. -/
noncomputable def polynomial : MvPolynomial (Fin 3) R 
goal: MvPolynomial (Fin 3) R

full_name: WeierstrassCurve.Projective.eval_polynomial
code: lemma eval_polynomial (P : Fin 3 → R) : eval P W.polynomial =
    P y ^ 2 * P z + W.a₁ * P x * P y * P z + W.a₃ * P y * P z ^ 2
      - (P x ^ 3 + W.a₂ * P x ^ 2 * P z + W.a₄ * P x * P z ^ 2 + W.a₆ * P z ^ 3) 
goal: (MvPolynomial.eval P) W.polynomial =
  P 1 ^ 2 * P 2 + W.a₁ * P 0 * P 1 * P 2 + W.a₃ * P 1 * P 2 ^ 2 -
    (P 0 ^ 3 + W.a₂ * P 0 ^ 2 * P 2 + W.a₄ * P 0 * P 2 ^ 2 + W.a₆ * P 2 ^ 3)

full_name: WeierstrassCurve.Projective.Equation
code: /-- The proposition that a point representative $(x, y, z)$ lies in `W`.
In other words, $W(x, y, z) = 0$. -/
def Equation (P : Fin 3 → R) : Prop 
goal: Prop

full_name: WeierstrassCurve.Projective.equation_iff
code: lemma equation_iff (P : Fin 3 → R) : W.Equation P ↔
    P y ^ 2 * P z + W.a₁ * P x * P y * P z + W.a₃ * P y * P z ^ 2
      = P x ^ 3 + W.a₂ * P x ^ 2 * P z + W.a₄ * P x * P z ^ 2 + W.a₆ * P z ^ 3 
goal: W.Equation P ↔
  P 1 ^ 2 * P 2 + W.a₁ * P 0 * P 1 * P 2 + W.a₃ * P 1 * P 2 ^ 2 =
    P 0 ^ 3 + W.a₂ * P 0 ^ 2 * P 2 + W.a₄ * P 0 * P 2 ^ 2 + W.a₆ * P 2 ^ 3

full_name: WeierstrassCurve.Projective.equation_zero
code: lemma equation_zero (Y : R) : W.Equation ![0, Y, 0] 
goal: W.Equation ![0, Y, 0]

full_name: WeierstrassCurve.Projective.equation_some
code: lemma equation_some (X Y : R) : W.Equation ![X, Y, 1] ↔ W.toAffine.Equation X Y 
goal: W.Equation ![X, Y, 1] ↔ W.toAffine.Equation X Y

full_name: WeierstrassCurve.Projective.equation_smul_iff
code: lemma equation_smul_iff (P : Fin 3 → R) (u : Rˣ) : W.Equation (u • P) ↔ W.Equation P 
goal: W.Equation (u • P) ↔ W.Equation P

full_name: WeierstrassCurve.Projective.polynomialX
code: /-- The partial derivative $W_X(X, Y, Z)$ of $W(X, Y, Z)$ with respect to $X$. -/
noncomputable def polynomialX : MvPolynomial (Fin 3) R 
goal: MvPolynomial (Fin 3) R

full_name: WeierstrassCurve.Projective.polynomialX_eq
code: lemma polynomialX_eq : W.polynomialX =
    C W.a₁ * X 1 * X 2 - (C 3 * X 0 ^ 2 + C (2 * W.a₂) * X 0 * X 2 + C W.a₄ * X 2 ^ 2) 
goal: W.polynomialX =
  MvPolynomial.C W.a₁ * MvPolynomial.X 1 * MvPolynomial.X 2 -
    (MvPolynomial.C 3 * MvPolynomial.X 0 ^ 2 + MvPolynomial.C (2 * W.a₂) * MvPolynomial.X 0 * MvPolynomial.X 2 +
      MvPolynomial.C W.a₄ * MvPolynomial.X 2 ^ 2)

full_name: WeierstrassCurve.Projective.eval_polynomialX
code: lemma eval_polynomialX (P : Fin 3 → R) : eval P W.polynomialX =
    W.a₁ * P y * P z - (3 * P x ^ 2 + 2 * W.a₂ * P x * P z + W.a₄ * P z ^ 2) 
goal: (MvPolynomial.eval P) W.polynomialX = W.a₁ * P 1 * P 2 - (3 * P 0 ^ 2 + 2 * W.a₂ * P 0 * P 2 + W.a₄ * P 2 ^ 2)

full_name: WeierstrassCurve.Projective.polynomialY
code: /-- The partial derivative $W_Y(X, Y, Z)$ of $W(X, Y, Z)$ with respect to $Y$. -/
noncomputable def polynomialY : MvPolynomial (Fin 3) R 
goal: MvPolynomial (Fin 3) R

full_name: WeierstrassCurve.Projective.polynomialY_eq
code: lemma polynomialY_eq : W.polynomialY =
    C 2 * X 1 * X 2 + C W.a₁ * X 0 * X 2 + C W.a₃ * X 2 ^ 2 
goal: W.polynomialY =
  MvPolynomial.C 2 * MvPolynomial.X 1 * MvPolynomial.X 2 + MvPolynomial.C W.a₁ * MvPolynomial.X 0 * MvPolynomial.X 2 +
    MvPolynomial.C W.a₃ * MvPolynomial.X 2 ^ 2

full_name: WeierstrassCurve.Projective.eval_polynomialY
code: lemma eval_polynomialY (P : Fin 3 → R) :
    eval P W.polynomialY = 2 * P y * P z + W.a₁ * P x * P z + W.a₃ * P z ^ 2 
goal: (MvPolynomial.eval P) W.polynomialY = 2 * P 1 * P 2 + W.a₁ * P 0 * P 2 + W.a₃ * P 2 ^ 2

full_name: WeierstrassCurve.Projective.polynomialZ
code: /-- The partial derivative $W_Z(X, Y, Z)$ of $W(X, Y, Z)$ with respect to $Z$. -/
noncomputable def polynomialZ : MvPolynomial (Fin 3) R 
goal: MvPolynomial (Fin 3) R

full_name: WeierstrassCurve.Projective.polynomialZ_eq
code: lemma polynomialZ_eq : W.polynomialZ =
    X 1 ^ 2 + C W.a₁ * X 0 * X 1 + C (2 * W.a₃) * X 1 * X 2
      - (C W.a₂ * X 0 ^ 2 + C (2 * W.a₄) * X 0 * X 2 + C (3 * W.a₆) * X 2 ^ 2) 
goal: W.polynomialZ =
  MvPolynomial.X 1 ^ 2 + MvPolynomial.C W.a₁ * MvPolynomial.X 0 * MvPolynomial.X 1 +
      MvPolynomial.C (2 * W.a₃) * MvPolynomial.X 1 * MvPolynomial.X 2 -
    (MvPolynomial.C W.a₂ * MvPolynomial.X 0 ^ 2 + MvPolynomial.C (2 * W.a₄) * MvPolynomial.X 0 * MvPolynomial.X 2 +
      MvPolynomial.C (3 * W.a₆) * MvPolynomial.X 2 ^ 2)

full_name: WeierstrassCurve.Projective.eval_polynomialZ
code: lemma eval_polynomialZ (P : Fin 3 → R) : eval P W.polynomialZ =
    P y ^ 2 + W.a₁ * P x * P y + 2 * W.a₃ * P y * P z
      - (W.a₂ * P x ^ 2 + 2 * W.a₄ * P x * P z + 3 * W.a₆ * P z ^ 2) 
goal: (MvPolynomial.eval P) W.polynomialZ =
  P 1 ^ 2 + W.a₁ * P 0 * P 1 + 2 * W.a₃ * P 1 * P 2 - (W.a₂ * P 0 ^ 2 + 2 * W.a₄ * P 0 * P 2 + 3 * W.a₆ * P 2 ^ 2)

full_name: WeierstrassCurve.Projective.polynomial_relation
code: /-- Euler's homogeneous function theorem. -/
theorem polynomial_relation (P : Fin 3 → R) : 3 * eval P W.polynomial =
    P x * eval P W.polynomialX + P y * eval P W.polynomialY + P z * eval P W.polynomialZ 
goal: 3 * (MvPolynomial.eval P) W.polynomial =
  P 0 * (MvPolynomial.eval P) W.polynomialX + P 1 * (MvPolynomial.eval P) W.polynomialY +
    P 2 * (MvPolynomial.eval P) W.polynomialZ

full_name: WeierstrassCurve.Projective.Nonsingular
code: /-- The proposition that a point representative $(x, y, z)$ in `W` is nonsingular.
In other words, either $W_X(x, y, z) \ne 0$, $W_Y(x, y, z) \ne 0$, or $W_Z(x, y, z) \ne 0$. -/
def Nonsingular (P : Fin 3 → R) : Prop 
goal: Prop

full_name: WeierstrassCurve.Projective.nonsingular_iff
code: lemma nonsingular_iff (P : Fin 3 → R) : W.Nonsingular P ↔ W.Equation P ∧
    (W.a₁ * P y * P z ≠ 3 * P x ^ 2 + 2 * W.a₂ * P x * P z + W.a₄ * P z ^ 2 ∨
      P y * P z ≠ -P y * P z - W.a₁ * P x * P z - W.a₃ * P z ^ 2 ∨
      P y ^ 2 + W.a₁ * P x * P y + 2 * W.a₃ * P y * P z
        ≠ W.a₂ * P x ^ 2 + 2 * W.a₄ * P x * P z + 3 * W.a₆ * P z ^ 2) 
goal: W.Nonsingular P ↔
  W.Equation P ∧
    (W.a₁ * P 1 * P 2 ≠ 3 * P 0 ^ 2 + 2 * W.a₂ * P 0 * P 2 + W.a₄ * P 2 ^ 2 ∨
      P 1 * P 2 ≠ -P 1 * P 2 - W.a₁ * P 0 * P 2 - W.a₃ * P 2 ^ 2 ∨
        P 1 ^ 2 + W.a₁ * P 0 * P 1 + 2 * W.a₃ * P 1 * P 2 ≠ W.a₂ * P 0 ^ 2 + 2 * W.a₄ * P 0 * P 2 + 3 * W.a₆ * P 2 ^ 2)

full_name: WeierstrassCurve.Projective.nonsingular_zero
code: lemma nonsingular_zero [Nontrivial R] : W.Nonsingular ![0, 1, 0] 
goal: W.Nonsingular ![0, 1, 0]

full_name: WeierstrassCurve.Projective.nonsingular_zero'
code: lemma nonsingular_zero' [NoZeroDivisors R] {Y : R} (hy : Y ≠ 0) : W.Nonsingular ![0, Y, 0] 
goal: W.Nonsingular ![0, Y, 0]

full_name: WeierstrassCurve.Projective.nonsingular_some
code: lemma nonsingular_some (X Y : R) : W.Nonsingular ![X, Y, 1] ↔ W.toAffine.Nonsingular X Y 
goal: W.Nonsingular ![X, Y, 1] ↔ W.toAffine.Nonsingular X Y

full_name: WeierstrassCurve.Projective.nonsingular_smul_iff
code: lemma nonsingular_smul_iff (P : Fin 3 → R) (u : Rˣ) : W.Nonsingular (u • P) ↔ W.Nonsingular P 
goal: W.Nonsingular (u • P) ↔ W.Nonsingular P

full_name: WeierstrassCurve.Projective.nonsingular_of_equiv
code: lemma nonsingular_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : W.Nonsingular P ↔ W.Nonsingular Q 
goal: W.Nonsingular P ↔ W.Nonsingular Q

full_name: WeierstrassCurve.Projective.NonsingularLift
code: /-- The proposition that a point class on `W` is nonsingular. If `P` is a point representative,
then `W.NonsingularLift ⟦P⟧` is definitionally equivalent to `W.Nonsingular P`. -/
def NonsingularLift (P : PointClass R) : Prop 
goal: Prop

full_name: WeierstrassCurve.Projective.nonsingularLift_iff
code: @[simp]
lemma nonsingularLift_iff (P : Fin 3 → R) : W.NonsingularLift ⟦P⟧ ↔ W.Nonsingular P 
goal: W.NonsingularLift ⟦P⟧ ↔ W.Nonsingular P

full_name: WeierstrassCurve.Projective.nonsingularLift_zero
code: lemma nonsingularLift_zero [Nontrivial R] : W.NonsingularLift ⟦![0, 1, 0]⟧ 
goal: W.NonsingularLift ⟦![0, 1, 0]⟧

full_name: WeierstrassCurve.Projective.nonsingularLift_zero'
code: lemma nonsingularLift_zero' [NoZeroDivisors R] {Y : R} (hy : Y ≠ 0) :
    W.NonsingularLift ⟦![0, Y, 0]⟧ 
goal: W.NonsingularLift ⟦![0, Y, 0]⟧

full_name: WeierstrassCurve.Projective.nonsingularLift_some
code: lemma nonsingularLift_some (X Y : R) :
    W.NonsingularLift ⟦![X, Y, 1]⟧ ↔ W.toAffine.Nonsingular X Y 
goal: W.NonsingularLift ⟦![X, Y, 1]⟧ ↔ W.toAffine.Nonsingular X Y

full_name: WeierstrassCurve.Projective.equiv_of_Z_eq_zero
code: lemma equiv_of_Z_eq_zero {P Q : Fin 3 → F} (hP : W.Nonsingular P) (hQ : W.Nonsingular Q)
    (hPz : P z = 0) (hQz : Q z = 0) : P ≈ Q 
goal: P ≈ Q

full_name: WeierstrassCurve.Projective.equiv_zero_of_Z_eq_zero
code: lemma equiv_zero_of_Z_eq_zero {P : Fin 3 → F} (h : W.Nonsingular P) (hPz : P z = 0) :
    P ≈ ![0, 1, 0] 
goal: P ≈ ![0, 1, 0]

full_name: WeierstrassCurve.Projective.equiv_some_of_Z_ne_zero
code: lemma equiv_some_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) : P ≈ ![P x / P z, P y / P z, 1] 
goal: P ≈ ![P 0 / P 2, P 1 / P 2, 1]

full_name: WeierstrassCurve.Projective.nonsingular_iff_affine_of_Z_ne_zero
code: lemma nonsingular_iff_affine_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    W.Nonsingular P ↔ W.toAffine.Nonsingular (P x / P z) (P y / P z) 
goal: W.Nonsingular P ↔ W.toAffine.Nonsingular (P 0 / P 2) (P 1 / P 2)

full_name: WeierstrassCurve.Projective.nonsingular_of_affine_of_Z_ne_zero
code: lemma nonsingular_of_affine_of_Z_ne_zero {P : Fin 3 → F}
    (h : W.toAffine.Nonsingular (P x / P z) (P y / P z)) (hPz : P z ≠ 0) : W.Nonsingular P 
goal: W.Nonsingular P

full_name: WeierstrassCurve.Projective.nonsingular_affine_of_Z_ne_zero
code: lemma nonsingular_affine_of_Z_ne_zero {P : Fin 3 → F} (h : W.Nonsingular P) (hPz : P z ≠ 0) :
    W.toAffine.Nonsingular (P x / P z) (P y / P z) 
goal: W.toAffine.Nonsingular (P 0 / P 2) (P 1 / P 2)