-- Mathlib/AlgebraicGeometry/EllipticCurve/Jacobian.lean
lemma addMap_of_Z_eq_zero_right {P : PointClass F} {Q : Fin 3 → F} (hP : W.NonsingularLift P)
    (hQ : W.Nonsingular Q) (hQz : Q z = 0) : W.addMap P ⟦Q⟧ = P

Proof state:
case mk
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
⊢ W.addMap (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P) ⟦Q⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Tactic:
by_cases hPz : P z = 0

Result:
case pos
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : P z = 0
⊢ W.addMap (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P) ⟦Q⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

case neg
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : ¬P z = 0
⊢ W.addMap (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P) ⟦Q⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Proof state:
F : Type u
inst✝ : Field F
W : Jacobian F
P : PointClass F
Q : Fin 3 → F
hP : W.NonsingularLift P
hQ : W.Nonsingular Q
hQz : Q z = 0
⊢ W.addMap P ⟦Q⟧ = P

Tactic:
rcases P with ⟨P⟩

Result:
case mk
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
⊢ W.addMap (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P) ⟦Q⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Proof state:
case neg
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : ¬P z = 0
⊢ W.addMap (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P) ⟦Q⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Tactic:
erw [addMap_eq, add_of_Z_eq_zero_right hQ.left hPz hQz,
  smul_eq _ ((isUnit_X_of_Z_eq_zero hQ hQz).mul <| Ne.isUnit hPz).neg]

Result:
case neg
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : ¬P z = 0
⊢ ⟦P⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Proof state:
case pos
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : P z = 0
⊢ W.addMap (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P) ⟦Q⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Tactic:
erw [addMap_eq, add_of_Z_eq_zero hP hQ hPz hQz,
  smul_eq _ <| (isUnit_X_of_Z_eq_zero hP hPz).pow 2, Quotient.eq]

Result:
case pos
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : P z = 0
⊢ (MulAction.orbitRel Fˣ (Fin 3 → F)) ![1, 1, 0] P

Proof state:
case neg
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : ¬P z = 0
⊢ ⟦P⟧ = Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P

Tactic:
rfl

Result:
no goals

Proof state:
case pos
F : Type u
inst✝ : Field F
W : Jacobian F
P✝ : PointClass F
Q : Fin 3 → F
hQ : W.Nonsingular Q
hQz : Q z = 0
P : Fin 3 → F
hP : W.NonsingularLift (Quot.mk (⇑(MulAction.orbitRel Fˣ (Fin 3 → F))) P)
hPz : P z = 0
⊢ (MulAction.orbitRel Fˣ (Fin 3 → F)) ![1, 1, 0] P

Tactic:
exact Setoid.symm <| equiv_zero_of_Z_eq_zero hP hPz

Result:
no goals