Theorem: EllipticCurve.ofJ_j
File: Mathlib/AlgebraicGeometry/EllipticCurve/Weierstrass.lean

tactic: by_cases h0 : j = 0
state_before: R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
⊢ (ofJ j).j = j
state_after: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
⊢ (ofJ j).j = j

case neg
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
⊢ (ofJ j).j = j

tactic: by_cases h3 : (3 : F) = 0
state_before: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
⊢ (ofJ j).j = j
state_after: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
⊢ (ofJ j).j = j

case neg
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : ¬3 = 0
⊢ (ofJ j).j = j

tactic: 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]
state_before: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
⊢ (ofJ j).j = j
state_after: no goals

tactic: norm_num1
state_before: R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
⊢ 1728 = 3 * 576
state_after: no goals

tactic: rw [h0, ofJ_0_of_three_ne_zero (h3 := neZero_iff.2 h3), @ofJ0_j _ _ <| invertibleOfNonzero h3]
state_before: case neg
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : ¬3 = 0
⊢ (ofJ j).j = j
state_after: no goals

tactic: by_cases h1728 : j = 1728
state_before: case neg
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
⊢ (ofJ j).j = j
state_after: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
⊢ (ofJ j).j = j

case neg
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
⊢ (ofJ j).j = j

tactic: have h2 : (2 : F) ≠ 0 :=
  fun h => h0 <| by rw [h1728, show (1728 : F) = 2 * 864 by norm_num1, h, zero_mul]
state_before: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
⊢ (ofJ j).j = j
state_after: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h2 : 2 ≠ 0
⊢ (ofJ j).j = j

tactic: rw [h1728, ofJ_1728_of_two_ne_zero (h2 := neZero_iff.2 h2),
  @ofJ1728_j _ _ <| invertibleOfNonzero h2]
state_before: case pos
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h2 : 2 ≠ 0
⊢ (ofJ j).j = j
state_after: no goals

tactic: rw [h1728, show (1728 : F) = 2 * 864 by norm_num1, h, zero_mul]
state_before: R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h : 2 = 0
⊢ j = 0
state_after: no goals

tactic: norm_num1
state_before: R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h : 2 = 0
⊢ 1728 = 2 * 864
state_after: no goals

tactic: rw [ofJ_ne_0_ne_1728 j h0 h1728,
  @ofJ'_j _ _ _ (invertibleOfNonzero h0) (invertibleOfNonzero <| sub_ne_zero_of_ne h1728)]
state_before: case neg
R : Type u
inst✝² : CommRing R
E : EllipticCurve R
F : Type u
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
⊢ (ofJ j).j = j
state_after: no goals