l3lab/ntp-mathlib huggingface dataset:
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
        exact NoZeroSMulDivisors.algebraMap_injective F K 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₂
⊢ (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_Xne hx, slope_of_Xne]
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
        exact NoZeroSMulDivisors.algebraMap_injective F K hy
  · rw [slope_of_Xne hx, slope_of_Xne]
    · 

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₂
⊢ ((algebraMap F K) y₁ - (algebraMap F K) y₂) / ((algebraMap F K) x₁ - (algebraMap F K) x₂) =
    (algebraMap F K) ((y₁ - y₂) / (x₁ - x₂))

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
        simp only [baseChange_negY]
        rfl
      · rw [baseChange_negY]
        contrapose! hy
        exact NoZeroSMulDivisors.algebraMap_injective F K hy
  · rw [slope_of_Xne hx, slope_of_Xne]
    · 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₂
⊢ (algebraMap F K) x₁ ≠ (algebraMap F K) x₂

Next tactic:
contrapose! 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]
      · map_simp
        simp only [baseChange_negY]
        rfl
      · rw [baseChange_negY]
        contrapose! hy
        exact NoZeroSMulDivisors.algebraMap_injective F K hy
  · rw [slope_of_Xne hx, slope_of_Xne]
    · map_simp
    · contrapose! 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 : (algebraMap F K) x₁ = (algebraMap F K) x₂
⊢ x₁ = x₂

Next tactic:
exact NoZeroSMulDivisors.algebraMap_injective F K hx
lemma baseChange_slope_of_baseChange {R : Type u} [CommRing R] (W : Affine R) (F : Type v) [Field F]
    [Algebra R F] (K : Type w) [Field K] [Algebra R K] [Algebra F K] [IsScalarTower R 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.baseChange F).toAffine.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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R 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.baseChange F).toAffine.slope x₁ x₂ y₁ y₂)

Next tactic:
rw [← baseChange_slope, baseChange_baseChange]
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := 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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
⊢ ∀ (x y : Point (W.baseChange F)),
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (x + y) =
      ZeroHom.toFun
          { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) } x +
        ZeroHom.toFun
          { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) } y

Next tactic:
rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals 

Proof state:
case zero.zero
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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (zero + zero) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) } zero +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) } zero

Next tactic:
rfl
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals 

Proof state:
case zero.some
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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (zero + some h✝) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) } zero +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝)

Next tactic:
rfl
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals 

Proof state:
case some.zero
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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝ : (W.baseChange F).nonsingular x₁ y₁
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (some h✝ + zero) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝) +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) } zero

Next tactic:
rfl
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals 

Proof state:
case some.some
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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (some h✝¹ + some h✝) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝¹) +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝)

Next tactic:
rfl
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    

Proof state:
case some.some
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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (some h✝¹ + some h✝) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝¹) +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝)

Next tactic:
by_cases hx : x₁ = x₂
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (some h✝¹ + some h✝) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝¹) +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝)

Next tactic:
by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    by_cases hx : x₁ = x₂
    · by_cases hy : y₁ = (W.baseChange F).toAffine.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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (some h✝¹ + some h✝) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝¹) +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝)

Next tactic:
simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    by_cases hx : x₁ = x₂
    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
      · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
        

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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
⊢ 0 =
    some (_ : (W.baseChange K).toAffine.nonsingular ((algebraMap F K) x₁) ((algebraMap F K) y₁)) +
      some (_ : (W.baseChange K).toAffine.nonsingular ((algebraMap F K) x₂) ((algebraMap F K) y₂))

Next tactic:
rw [some_add_some_of_Yeq <| congr_arg _ hx]
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    by_cases hx : x₁ = x₂
    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
      · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
        rw [some_add_some_of_Yeq <| congr_arg _ hx]
        · 

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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
⊢ (algebraMap F K) y₁ = (W.baseChange K).negY ((algebraMap F K) x₂) ((algebraMap F K) y₂)

Next tactic:
rw [hy, baseChange_negY_of_baseChange]
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    by_cases hx : x₁ = x₂
    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
      · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
        rw [some_add_some_of_Yeq <| congr_arg _ hx]
        · rw [hy, baseChange_negY_of_baseChange]
      · 

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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
hy : ¬y₁ = (W.baseChange F).toAffine.negY x₂ y₂
⊢ ZeroHom.toFun { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
      (some h✝¹ + some h✝) =
    ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝¹) +
      ZeroHom.toFun
        { toFun := ofBaseChangeFun W F K, map_zero' := (_ : ofBaseChangeFun W F K 0 = ofBaseChangeFun W F K 0) }
        (some h✝)

Next tactic:
simp only [some_add_some_of_Yne hx hy, ofBaseChangeFun]
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    by_cases hx : x₁ = x₂
    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
      · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
        rw [some_add_some_of_Yeq <| congr_arg _ hx]
        · rw [hy, baseChange_negY_of_baseChange]
      · simp only [some_add_some_of_Yne hx hy, ofBaseChangeFun]
        

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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
hy : ¬y₁ = (W.baseChange F).toAffine.negY x₂ y₂
⊢ some
      (_ :
        (W.baseChange K).toAffine.nonsingular
          ((algebraMap F K) ((W.baseChange F).toAffine.addX x₁ x₂ ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂)))
          ((algebraMap F K) ((W.baseChange F).toAffine.addY x₁ x₂ y₁ ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂)))) =
    some (_ : (W.baseChange K).toAffine.nonsingular ((algebraMap F K) x₁) ((algebraMap F K) y₁)) +
      some (_ : (W.baseChange K).toAffine.nonsingular ((algebraMap F K) x₂) ((algebraMap F K) y₂))

Next tactic:
rw [some_add_some_of_Yne <| congr_arg _ hx]
/-- The group homomorphism from `W⟮F⟯` to `W⟮K⟯` induced by a base change from `F` to `K`. -/
@[simps]
def ofBaseChange : W⟮F⟯ →+ W⟮K⟯ where
  toFun := ofBaseChangeFun W F K
  map_zero' := rfl
  map_add' := by
    rintro (_ | @⟨x₁, y₁, _⟩) (_ | @⟨x₂, y₂, _⟩)
    any_goals rfl
    by_cases hx : x₁ = x₂
    · by_cases hy : y₁ = (W.baseChange F).toAffine.negY x₂ y₂
      · simp only [some_add_some_of_Yeq hx hy, ofBaseChangeFun]
        rw [some_add_some_of_Yeq <| congr_arg _ hx]
        · rw [hy, baseChange_negY_of_baseChange]
      · simp only [some_add_some_of_Yne hx hy, ofBaseChangeFun]
        rw [some_add_some_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
R : Type u
inst✝⁶ : CommRing R
W : Affine R
F : Type v
inst✝⁵ : Field F
inst✝⁴ : Algebra R F
K : Type w
inst✝³ : Field K
inst✝² : Algebra R K
inst✝¹ : Algebra F K
inst✝ : IsScalarTower R F K
x₁ y₁ : F
h✝¹ : (W.baseChange F).nonsingular x₁ y₁
x₂ y₂ : F
h✝ : (W.baseChange F).nonsingular x₂ y₂
hx : x₁ = x₂
hy : ¬y₁ = (W.baseChange F).toAffine.negY x₂ y₂
⊢ some
      (_ :
        (W.baseChange K).toAffine.nonsingular
          ((algebraMap F K) ((W.baseChange F).toAffine.addX x₁ x₂ ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂)))
          ((algebraMap F K) ((W.baseChange F).toAffine.addY x₁ x₂ y₁ ((W.baseChange F).toAffine.slope x₁ x₂ y₁ y₂)))) =
    some
      (_ :
        (W.baseChange K).nonsingular
          ((W.baseChange K).addX ((algebraMap F K) x₁) ((algebraMap F K) x₂)
            ((W.baseChange K).slope ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
              ((algebraMap F K) y₂)))
          ((W.baseChange K).addY ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
            ((W.baseChange K).slope ((algebraMap F K) x₁) ((algebraMap F K) x₂) ((algebraMap F K) y₁)
              ((algebraMap F K) y₂))))

Next tactic:
simp only [baseChange_addX_of_baseChange, baseChange_addY_of_baseChange,
            baseChange_slope_of_baseChange]