-- Mathlib/AlgebraicGeometry/EllipticCurve/ModelsWithJ.lean
lemma ofJ_j : (ofJ j).j = j

Proof state:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h2 : 2 ≠ 0
this : Fact (IsUnit 2)
⊢ (ofJ j).j = j

Tactic:
simp_rw [h1728, ofJ_1728_of_two_ne_zero h2, ofJ1728_j]

Result:
no goals

Proof state:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
this✝ : Fact (IsUnit j)
this : Fact (IsUnit (j - 1728))
⊢ (ofJ j).j = j

Tactic:
simp_rw [ofJ_ne_0_ne_1728 j h0 h1728, ofJNe0Or1728_j]

Result:
no goals

Proof state:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : ¬3 = 0
this : Fact (IsUnit 3)
⊢ (ofJ j).j = j

Tactic:
simp_rw [h0, ofJ_0_of_three_ne_zero h3, ofJ0_j]

Result:
no goals

Proof state:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
this : Fact (IsUnit j)
⊢ (ofJ j).j = j

Tactic:
have := Fact.mk (sub_ne_zero.2 h1728).isUnit

Result:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
this✝ : Fact (IsUnit j)
this : Fact (IsUnit (j - 1728))
⊢ (ofJ j).j = j

Proof state:
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h : 2 = 0
⊢ j = 0

Tactic:
linear_combination h1728 + 864 * h

Result:
no goals

Proof state:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
⊢ (ofJ j).j = j

Tactic:
have := Fact.mk (isUnit_of_mul_eq_one (2 : F) 2 (by linear_combination h3))

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
this : Fact (IsUnit 2)
⊢ (ofJ j).j = j

Proof state:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
⊢ (ofJ j).j = j

Tactic:
have := Fact.mk (Ne.isUnit h0)

Result:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
this : Fact (IsUnit j)
⊢ (ofJ j).j = j

Proof state:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
⊢ (ofJ j).j = j

Tactic:
by_cases h1728 : j = 1728

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
⊢ (ofJ j).j = j

case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : ¬j = 1728
⊢ (ofJ j).j = j

Proof state:
case pos
F : Type u_2
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 linear_combination h1728 + 864 * h)

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h2 : 2 ≠ 0
⊢ (ofJ j).j = j

Proof state:
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
⊢ (ofJ j).j = j

Tactic:
by_cases h0 : j = 0

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
⊢ (ofJ j).j = j

case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
⊢ (ofJ j).j = j

Proof state:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h2 : 2 ≠ 0
⊢ (ofJ j).j = j

Tactic:
have := Fact.mk h2.isUnit

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : ¬j = 0
h1728 : j = 1728
h2 : 2 ≠ 0
this : Fact (IsUnit 2)
⊢ (ofJ j).j = j

Proof state:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
this : Fact (IsUnit 2)
⊢ (ofJ j).j = j

Tactic:
simp_rw [h0, ofJ_0_of_three_eq_zero h3, ofJ1728_j]

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
this : Fact (IsUnit 2)
⊢ 1728 = 0

Proof state:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : ¬3 = 0
⊢ (ofJ j).j = j

Tactic:
have := Fact.mk (Ne.isUnit h3)

Result:
case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : ¬3 = 0
this : Fact (IsUnit 3)
⊢ (ofJ j).j = j

Proof state:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
⊢ (ofJ j).j = j

Tactic:
by_cases h3 : (3 : F) = 0

Result:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
⊢ (ofJ j).j = j

case neg
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : ¬3 = 0
⊢ (ofJ j).j = j

Proof state:
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
⊢ 2 * 2 = 1

Tactic:
linear_combination h3

Result:
no goals

Proof state:
case pos
F : Type u_2
inst✝¹ : Field F
j : F
inst✝ : DecidableEq F
h0 : j = 0
h3 : 3 = 0
this : Fact (IsUnit 2)
⊢ 1728 = 0

Tactic:
linear_combination 576 * h3

Result:
no goals