l3lab/ntp-mathlib huggingface dataset:
lemma equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
    W.equation x y ↔ (W.baseChange A).toAffine.equation (algebraMap R A x) (algebraMap R A y) := by
  simpa only [equation_iff]
    using ⟨fun h => by convert congr_arg (algebraMap R A) h <;> map_simp <;> rfl,
      fun h => by apply NoZeroSMulDivisors.algebraMap_injective R A; 

Proof state:
case a
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 :
  (algebraMap R A) y ^ 2 + (W.baseChange A).toAffine.a₁ * (algebraMap R A) x * (algebraMap R A) y +
      (W.baseChange A).toAffine.a₃ * (algebraMap R A) y =
    (algebraMap R A) x ^ 3 + (W.baseChange A).toAffine.a₂ * (algebraMap R A) x ^ 2 +
        (W.baseChange A).toAffine.a₄ * (algebraMap R A) x +
      (W.baseChange A).toAffine.a₆
⊢ (algebraMap R A) (y ^ 2 + W.a₁ * x * y + W.a₃ * y) = (algebraMap R A) (x ^ 3 + W.a₂ * x ^ 2 + W.a₄ * x + W.a₆)

Next tactic:
map_simp
lemma equation_iff_baseChange [Nontrivial A] [NoZeroSMulDivisors R A] (x y : R) :
    W.equation x y ↔ (W.baseChange A).toAffine.equation (algebraMap R A x) (algebraMap R A y) := by
  simpa only [equation_iff]
    using ⟨fun h => by convert congr_arg (algebraMap R A) h <;> map_simp <;> rfl,
      fun h => by apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; 

Proof state:
case a
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 :
  (algebraMap R A) y ^ 2 + (W.baseChange A).toAffine.a₁ * (algebraMap R A) x * (algebraMap R A) y +
      (W.baseChange A).toAffine.a₃ * (algebraMap R A) y =
    (algebraMap R A) x ^ 3 + (W.baseChange A).toAffine.a₂ * (algebraMap R A) x ^ 2 +
        (W.baseChange A).toAffine.a₄ * (algebraMap R A) x +
      (W.baseChange A).toAffine.a₆
⊢ (algebraMap R A) y ^ 2 + (algebraMap R A) W.a₁ * (algebraMap R A) x * (algebraMap R A) y +
      (algebraMap R A) W.a₃ * (algebraMap R A) y =
    (algebraMap R A) x ^ 3 + (algebraMap R A) W.a₂ * (algebraMap R A) x ^ 2 +
        (algebraMap R A) W.a₄ * (algebraMap R A) x +
      (algebraMap R A) W.a₆

Next tactic:
exact h
lemma equation_iff_baseChange_of_baseChange [Nontrivial B] [NoZeroSMulDivisors A B] (x y : A) :
    (W.baseChange A).toAffine.equation x y ↔
      (W.baseChange B).toAffine.equation (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.equation x y ↔ (W.baseChange B).toAffine.equation ((algebraMap A B) x) ((algebraMap A B) y)

Next tactic:
rw [(W.baseChange A).toAffine.equation_iff_baseChange B, baseChange_baseChange]
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
  

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 A
inst✝ : NoZeroSMulDivisors R A
x y : R
⊢ W.nonsingular x y ↔ (W.baseChange A).toAffine.nonsingular ((algebraMap R A) x) ((algebraMap R A) y)

Next tactic:
rw [nonsingular_iff, nonsingular_iff, and_congr <| W.equation_iff_baseChange A x y]
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]
  

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 A
inst✝ : NoZeroSMulDivisors R A
x y : R
⊢ W.a₁ * y ≠ 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄ ∨ y ≠ -y - W.a₁ * x - W.a₃ ↔
    (W.baseChange A).toAffine.a₁ * (algebraMap R A) y ≠
        3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x +
          (W.baseChange A).toAffine.a₄ ∨
      (algebraMap R A) y ≠
        -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃

Next tactic:
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 => ?_)⟩
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 => ?_)⟩
  

Proof state:
case refine_1
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 :
  (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄
⊢ W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
case refine_2
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 :
  (algebraMap R A) y =
    -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃
⊢ y = -y - W.a₁ * x - W.a₃
case refine_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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄
case refine_4
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 =
    -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃

Next tactic:
any_goals apply NoZeroSMulDivisors.algebraMap_injective R A; map_simp; exact h
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 

Proof state:
case refine_1
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 :
  (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄
⊢ W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄

Next tactic:
apply NoZeroSMulDivisors.algebraMap_injective R A
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; 

Proof state:
case refine_1.a
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 :
  (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄
⊢ (algebraMap R A) (W.a₁ * y) = (algebraMap R A) (3 * x ^ 2 + 2 * 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; 

Proof state:
case refine_1.a
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 :
  (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄
⊢ (algebraMap R A) W.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (algebraMap R A) W.a₂ * (algebraMap R A) x + (algebraMap R A) W.a₄

Next tactic:
exact h
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 

Proof state:
case refine_2
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 :
  (algebraMap R A) y =
    -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃
⊢ y = -y - W.a₁ * x - W.a₃

Next tactic:
apply NoZeroSMulDivisors.algebraMap_injective R A
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; 

Proof state:
case refine_2.a
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 :
  (algebraMap R A) y =
    -(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) (-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; 

Proof state:
case refine_2.a
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 :
  (algebraMap R A) y =
    -(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) y - (algebraMap R A) W.a₁ * (algebraMap R A) x - (algebraMap R A) W.a₃

Next tactic:
exact h
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 

Proof state:
case refine_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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄

Next tactic:
apply NoZeroSMulDivisors.algebraMap_injective R A
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 

Proof state:
case refine_4
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 =
    -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃

Next tactic:
apply NoZeroSMulDivisors.algebraMap_injective R A
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
  

Proof state:
case refine_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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄
case refine_4
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 =
    -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃

Next tactic:
any_goals convert congr_arg (algebraMap R A) h <;> map_simp <;> rfl
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 

Proof state:
case refine_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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ (W.baseChange A).toAffine.a₁ * (algebraMap R A) y =
    3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄

Next tactic:
convert congr_arg (algebraMap R A) h
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'_2
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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ (W.baseChange A).toAffine.a₁ * (algebraMap R A) y = (algebraMap R A) (W.a₁ * y)

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 <;> 

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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ 3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄ =
    (algebraMap R A) (3 * x ^ 2 + 2 * 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'_2
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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ (W.baseChange A).toAffine.a₁ * (algebraMap R A) y = (algebraMap R A) W.a₁ * (algebraMap R A) y

Next tactic:
rfl
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 : W.a₁ * y = 3 * x ^ 2 + 2 * W.a₂ * x + W.a₄
⊢ 3 * (algebraMap R A) x ^ 2 + 2 * (W.baseChange A).toAffine.a₂ * (algebraMap R A) x + (W.baseChange A).toAffine.a₄ =
    3 * (algebraMap R A) x ^ 2 + 2 * (algebraMap R A) W.a₂ * (algebraMap R A) x + (algebraMap R A) W.a₄

Next tactic:
rfl
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 

Proof state:
case refine_4
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 =
    -(algebraMap R A) y - (W.baseChange A).toAffine.a₁ * (algebraMap R A) x - (W.baseChange A).toAffine.a₃

Next tactic:
convert congr_arg (algebraMap R A) h