l3lab/ntp-mathlib huggingface dataset:
lemma nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
    W.nonsingular x y ↔
      (W.baseChange A).toAffine.nonsingular (algebraMap R A x) (algebraMap R A y) := by
  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange A x y]
  refine ⟨Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_),
    Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_)⟩
  any_goals apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; exact h
  any_goals convert congr_arg (algebraMap R A) h <;> 

Proof state:
case h.e'_3
R : Type u
inst✝⁸ : CommRing R
W : Affine R
A : Type v
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
B : Type w
inst✝⁵ : CommRing B
inst✝⁴ : Algebra R B
inst✝³ : Algebra A B
inst✝² : IsScalarTower R A B
inst✝¹ : Nontrivial A
inst✝ : NoZeroSMulDivisors R A
x y : R
h : y = -y - W.a₁ * x - W.a₃
⊢ -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃ =
    (algebraMap R A) (-y - W.a₁ * x - W.a₃)

Next tactic:
map_simp
lemma nonsingular_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
    W.nonsingular x y ↔
      (W.baseChange A).toAffine.nonsingular (algebraMap R A x) (algebraMap R A y) := by
  rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange A x y]
  refine ⟨Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_),
    Or.imp (not_imp_not.mpr fun h => ?_) (not_imp_not.mpr fun h => ?_)⟩
  any_goals apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; exact h
  any_goals convert congr_arg (algebraMap R A) h <;> map_simp <;> 

Proof state:
case h.e'_3
R : Type u
inst✝⁸ : CommRing R
W : Affine R
A : Type v
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
B : Type w
inst✝⁵ : CommRing B
inst✝⁴ : Algebra R B
inst✝³ : Algebra A B
inst✝² : IsScalarTower R A B
inst✝¹ : Nontrivial A
inst✝ : NoZeroSMulDivisors R A
x y : R
h : y = -y - W.a₁ * x - W.a₃
⊢ -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃ =
    -(algebraMap R A) y - (algebraMap R A) W.a₁ * (algebraMap R A) x - (algebraMap R A) W.a₃

Next tactic:
rfl
lemma nonsingular_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
    (W.baseChange A).toAffine.nonsingular x y ↔
      (W.baseChange B).toAffine.nonsingular (algebraMap A B x) (algebraMap A B y) := by
  

Proof state:
R : Type u
inst✝⁸ : CommRing R
W : Affine R
A : Type v
inst✝⁷ : CommRing A
inst✝⁶ : Algebra R A
B : Type w
inst✝⁵ : CommRing B
inst✝⁴ : Algebra R B
inst✝³ : Algebra A B
inst✝² : IsScalarTower R A B
inst✝¹ : Nontrivial B
inst✝ : NoZeroSMulDivisors A B
x y : A
⊢ (W.baseChange A).toAffine.nonsingular x y ↔
    (W.baseChange B).toAffine.nonsingular ((algebraMap A B) x) ((algebraMap A B) y)

Next tactic:
rw [(W.baseChange A).toAffine.nonsingular_iff_baseChange B, baseChange_baseChange]
lemma baseChange_negY (x y : R) :
    (W.baseChange A).toAffine.negY (algebraMap R A x) (algebraMap R A y) =
      algebraMap R A (W.negY x y) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x y : R
⊢ (W.baseChange A).toAffine.negY ((algebraMap R A) x) ((algebraMap R A) y) = (algebraMap R A) (W.negY x y)

Next tactic:
simp only [negY]
lemma baseChange_negY (x y : R) :
    (W.baseChange A).toAffine.negY (algebraMap R A x) (algebraMap R A y) =
      algebraMap R A (W.negY x y) := by
  simp only [negY]
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x y : R
⊢ -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃ =
    (algebraMap R A) (-y - W.a₁ * x - W.a₃)

Next tactic:
map_simp
lemma baseChange_negY (x y : R) :
    (W.baseChange A).toAffine.negY (algebraMap R A x) (algebraMap R A y) =
      algebraMap R A (W.negY x y) := by
  simp only [negY]
  map_simp
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x y : R
⊢ -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃ =
    -(algebraMap R A) y - (algebraMap R A) W.a₁ * (algebraMap R A) x - (algebraMap R A) W.a₃

Next tactic:
rfl
lemma baseChange_negY_of_baseChange (x y : A) :
    (W.baseChange B).toAffine.negY (algebraMap A B x) (algebraMap A B y) =
      algebraMap A B ((W.baseChange A).toAffine.negY x y) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x y : A
⊢ (W.baseChange B).toAffine.negY ((algebraMap A B) x) ((algebraMap A B) y) =
    (algebraMap A B) ((W.baseChange A).toAffine.negY x y)

Next tactic:
rw [← baseChange_negY, baseChange_baseChange]
lemma baseChange_addX (x₁ x₂ L : R) :
    (W.baseChange A).toAffine.addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
      algebraMap R A (W.addX x₁ x₂ L) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ L : R
⊢ (W.baseChange A).toAffine.addX ((algebraMap R A) x₁) ((algebraMap R A) x₂) ((algebraMap R A) L) =
    (algebraMap R A) (W.addX x₁ x₂ L)

Next tactic:
simp only [addX]
lemma baseChange_addX (x₁ x₂ L : R) :
    (W.baseChange A).toAffine.addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
      algebraMap R A (W.addX x₁ x₂ L) := by
  simp only [addX]
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ L : R
⊢ (algebraMap R A) L ^ 2 + (W.baseChange A).toAffine.a₁ * (algebraMap R A) L - (W.baseChange A).toAffine.a₂ -
        (algebraMap R A) x₁ -
      (algebraMap R A) x₂ =
    (algebraMap R A) (L ^ 2 + W.a₁ * L - W.a₂ - x₁ - x₂)

Next tactic:
map_simp
lemma baseChange_addX (x₁ x₂ L : R) :
    (W.baseChange A).toAffine.addX (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A L) =
      algebraMap R A (W.addX x₁ x₂ L) := by
  simp only [addX]
  map_simp
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ L : R
⊢ (algebraMap R A) L ^ 2 + (W.baseChange A).toAffine.a₁ * (algebraMap R A) L - (W.baseChange A).toAffine.a₂ -
        (algebraMap R A) x₁ -
      (algebraMap R A) x₂ =
    (algebraMap R A) L ^ 2 + (algebraMap R A) W.a₁ * (algebraMap R A) L - (algebraMap R A) W.a₂ - (algebraMap R A) x₁ -
      (algebraMap R A) x₂

Next tactic:
rfl
lemma baseChange_addX_of_baseChange (x₁ x₂ L : A) :
    (W.baseChange B).toAffine.addX (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B L) =
      algebraMap A B ((W.baseChange A).toAffine.addX x₁ x₂ L) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ L : A
⊢ (W.baseChange B).toAffine.addX ((algebraMap A B) x₁) ((algebraMap A B) x₂) ((algebraMap A B) L) =
    (algebraMap A B) ((W.baseChange A).toAffine.addX x₁ x₂ L)

Next tactic:
rw [← baseChange_addX, baseChange_baseChange]
lemma baseChange_addY' (x₁ x₂ y₁ L : R) :
    (W.baseChange A).toAffine.addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
      (algebraMap R A L) = algebraMap R A (W.addY' x₁ x₂ y₁ L) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ y₁ L : R
⊢ (W.baseChange A).toAffine.addY' ((algebraMap R A) x₁) ((algebraMap R A) x₂) ((algebraMap R A) y₁)
      ((algebraMap R A) L) =
    (algebraMap R A) (W.addY' x₁ x₂ y₁ L)

Next tactic:
simp only [addY', baseChange_addX]
lemma baseChange_addY' (x₁ x₂ y₁ L : R) :
    (W.baseChange A).toAffine.addY' (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
      (algebraMap R A L) = algebraMap R A (W.addY' x₁ x₂ y₁ L) := by
  simp only [addY', baseChange_addX]
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ y₁ L : R
⊢ (algebraMap R A) L * ((algebraMap R A) (W.addX x₁ x₂ L) - (algebraMap R A) x₁) + (algebraMap R A) y₁ =
    (algebraMap R A) (L * (W.addX x₁ x₂ L - x₁) + y₁)

Next tactic:
map_simp
lemma baseChange_addY'_of_baseChange (x₁ x₂ y₁ L : A) :
    (W.baseChange B).toAffine.addY' (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
      (algebraMap A B L) = algebraMap A B ((W.baseChange A).toAffine.addY' x₁ x₂ y₁ L) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ y₁ L : A
⊢ (W.baseChange B).toAffine.addY' ((algebraMap A B) x₁) ((algebraMap A B) x₂) ((algebraMap A B) y₁)
      ((algebraMap A B) L) =
    (algebraMap A B) ((W.baseChange A).toAffine.addY' x₁ x₂ y₁ L)

Next tactic:
rw [← baseChange_addY', baseChange_baseChange]
lemma baseChange_addY (x₁ x₂ y₁ L : R) :
    (W.baseChange A).toAffine.addY (algebraMap R A x₁) (algebraMap R A x₂) (algebraMap R A y₁)
      (algebraMap R A L) = algebraMap R A (W.toAffine.addY x₁ x₂ y₁ L) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ y₁ L : R
⊢ (W.baseChange A).toAffine.addY ((algebraMap R A) x₁) ((algebraMap R A) x₂) ((algebraMap R A) y₁)
      ((algebraMap R A) L) =
    (algebraMap R A) (W.toAffine.addY x₁ x₂ y₁ L)

Next tactic:
simp only [addY, baseChange_addY', baseChange_addX, baseChange_negY]
lemma baseChange_addY_of_baseChange (x₁ x₂ y₁ L : A) :
    (W.baseChange B).toAffine.addY (algebraMap A B x₁) (algebraMap A B x₂) (algebraMap A B y₁)
      (algebraMap A B L) = algebraMap A B ((W.baseChange A).toAffine.addY x₁ x₂ y₁ L) := by
  

Proof state:
R : Type u
inst✝⁶ : CommRing R
W : Affine R
A : Type v
inst✝⁵ : CommRing A
inst✝⁴ : Algebra R A
B : Type w
inst✝³ : CommRing B
inst✝² : Algebra R B
inst✝¹ : Algebra A B
inst✝ : IsScalarTower R A B
x₁ x₂ y₁ L : A
⊢ (W.baseChange B).toAffine.addY ((algebraMap A B) x₁) ((algebraMap A B) x₂) ((algebraMap A B) y₁)
      ((algebraMap A B) L) =
    (algebraMap A B) ((W.baseChange A).toAffine.addY x₁ x₂ y₁ L)

Next tactic:
rw [← baseChange_addY, baseChange_baseChange]
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  

Proof state:
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
⊢ (W.baseChange K).toAffine.slope ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
      ((algebraMap F K) y₂) =
    (algebraMap F K) (W.slope x₁ x₂ y₁ y₂)

Next tactic:
by_cases hx : x₁ = x₂
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · 

Proof state:
case pos
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
⊢ (W.baseChange K).toAffine.slope ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
      ((algebraMap F K) y₂) =
    (algebraMap F K) (W.slope x₁ x₂ y₁ y₂)

Next tactic:
by_cases hy : y₁ = W.negY x₂ y₂
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · 

Proof state:
case pos
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : y₁ = W.negY x₂ y₂
⊢ (W.baseChange K).toAffine.slope ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
      ((algebraMap F K) y₂) =
    (algebraMap F K) (W.slope x₁ x₂ y₁ y₂)

Next tactic:
rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · 

Proof state:
case pos
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : y₁ = W.negY x₂ y₂
⊢ (algebraMap F K) y₁ = (W.baseChange K).toAffine.negY ((algebraMap F K) x₂) ((algebraMap F K) y₂)

Next tactic:
rw [hy, baseChange_negY]
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · 

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : ¬y₁ = W.negY x₂ y₂
⊢ (W.baseChange K).toAffine.slope ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
      ((algebraMap F K) y₂) =
    (algebraMap F K) (W.slope x₁ x₂ y₁ y₂)

Next tactic:
rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
      · 

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : ¬y₁ = W.negY x₂ y₂
⊢ (3 * (algebraMap F K) x₁ ^ 2 + 2 * (W.baseChange K).toAffine.a₂ * (algebraMap F K) x₁ + (W.baseChange K).toAffine.a₄ -
        (W.baseChange K).toAffine.a₁ * (algebraMap F K) y₁) /
      ((algebraMap F K) y₁ - (W.baseChange K).toAffine.negY ((algebraMap F K) x₁) ((algebraMap F K) y₁)) =
    (algebraMap F K) ((3 * x₁ ^ 2 + 2 * W.a₂ * x₁ + W.a₄ - W.a₁ * y₁) / (y₁ - W.negY x₁ y₁))

Next tactic:
map_simp
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
      · map_simp
        

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : ¬y₁ = W.negY x₂ y₂
⊢ (3 * (algebraMap F K) x₁ ^ 2 + 2 * (W.baseChange K).toAffine.a₂ * (algebraMap F K) x₁ + (W.baseChange K).toAffine.a₄ -
        (W.baseChange K).toAffine.a₁ * (algebraMap F K) y₁) /
      ((algebraMap F K) y₁ - (W.baseChange K).toAffine.negY ((algebraMap F K) x₁) ((algebraMap F K) y₁)) =
    (3 * (algebraMap F K) x₁ ^ 2 + 2 * (algebraMap F K) W.a₂ * (algebraMap F K) x₁ + (algebraMap F K) W.a₄ -
        (algebraMap F K) W.a₁ * (algebraMap F K) y₁) /
      ((algebraMap F K) y₁ - (algebraMap F K) (W.negY x₁ y₁))

Next tactic:
simp only [baseChange_negY]
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
      · map_simp
        simp only [baseChange_negY]
        

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : ¬y₁ = W.negY x₂ y₂
⊢ (3 * (algebraMap F K) x₁ ^ 2 + 2 * (W.baseChange K).toAffine.a₂ * (algebraMap F K) x₁ + (W.baseChange K).toAffine.a₄ -
        (W.baseChange K).toAffine.a₁ * (algebraMap F K) y₁) /
      ((algebraMap F K) y₁ - (algebraMap F K) (W.negY x₁ y₁)) =
    (3 * (algebraMap F K) x₁ ^ 2 + 2 * (algebraMap F K) W.a₂ * (algebraMap F K) x₁ + (algebraMap F K) W.a₄ -
        (algebraMap F K) W.a₁ * (algebraMap F K) y₁) /
      ((algebraMap F K) y₁ - (algebraMap F K) (W.negY x₁ y₁))

Next tactic:
rfl
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
      · map_simp
        simp only [baseChange_negY]
        rfl
      · 

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : ¬y₁ = W.negY x₂ y₂
⊢ (algebraMap F K) y₁ ≠ (W.baseChange K).toAffine.negY ((algebraMap F K) x₂) ((algebraMap F K) y₂)

Next tactic:
rw [baseChange_negY]
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
      · map_simp
        simp only [baseChange_negY]
        rfl
      · rw [baseChange_negY]
        

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : ¬y₁ = W.negY x₂ y₂
⊢ (algebraMap F K) y₁ ≠ (algebraMap F K) (W.negY x₂ y₂)

Next tactic:
contrapose! hy
lemma baseChange_slope {F : Type u} [Field F] (W : Affine F) (K : Type v) [Field K] [Algebra F K]
    (x₁ x₂ y₁ y₂ : F) :
    (W.baseChange K).toAffine.slope (algebraMap F K x₁) (algebraMap F K x₂) (algebraMap F K y₁)
      (algebraMap F K y₂) = algebraMap F K (W.slope x₁ x₂ y₁ y₂) := by
  by_cases hx : x₁ = x₂
  · by_cases hy : y₁ = W.negY x₂ y₂
    · rw [slope_of_Yeq hx hy, slope_of_Yeq <| congr_arg _ hx, map_zero]
      · rw [hy, baseChange_negY]
    · rw [slope_of_Yne hx hy, slope_of_Yne <| congr_arg _ hx]
      · map_simp
        simp only [baseChange_negY]
        rfl
      · rw [baseChange_negY]
        contrapose! hy
        

Proof state:
case neg
R : Type u
inst✝⁹ : CommRing R
W✝ : Affine R
A : Type v
inst✝⁸ : CommRing A
inst✝⁷ : Algebra R A
B : Type w
inst✝⁶ : CommRing B
inst✝⁵ : Algebra R B
inst✝⁴ : Algebra A B
inst✝³ : IsScalarTower R A B
F : Type u
inst✝² : Field F
W : Affine F
K : Type v
inst✝¹ : Field K
inst✝ : Algebra F K
x₁ x₂ y₁ y₂ : F
hx : x₁ = x₂
hy : (algebraMap F K) y₁ = (algebraMap F K) (W.negY x₂ y₂)
⊢ y₁ = W.negY x₂ y₂

Next tactic:
exact NoZeroSMulDivisors.algebraMap_injective F K hy