Theorem: WeierstrassCurve.Affine.Point.toClass_apply
File: Mathlib/AlgebraicGeometry/EllipticCurve/Group.lean

Proof steps:
state_before: R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
⊢ ∀ (x y : W.Point),
    { toFun := toClassFun, map_zero' := ⋯ }.toFun (x + y) =
      { toFun := toClassFun, map_zero' := ⋯ }.toFun x + { toFun := toClassFun, map_zero' := ⋯ }.toFun y
state_after: case zero.zero
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (zero + zero) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun zero + { toFun := toClassFun, map_zero' := ⋯ }.toFun zero

case zero.some
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (zero + some h₂) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun zero + { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₂)

case some.zero
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁ + zero) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁) + { toFun := toClassFun, map_zero' := ⋯ }.toFun zero

case some.some
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁ + some h₂) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁) + { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₂)
tactic: rintro (_ | @⟨x₁, y₁, h₁⟩) (_ | @⟨x₂, y₂, h₂⟩)
state_before: case zero.zero
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (zero + zero) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun zero + { toFun := toClassFun, map_zero' := ⋯ }.toFun zero

case zero.some
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (zero + some h₂) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun zero + { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₂)

case some.zero
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁ + zero) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁) + { toFun := toClassFun, map_zero' := ⋯ }.toFun zero

case some.some
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
⊢ { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁ + some h₂) =
    { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₁) + { toFun := toClassFun, map_zero' := ⋯ }.toFun (some h₂)
state_after: case some.some
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
⊢ (match some h₁ + some h₂ with
    | zero => 0
    | some h => Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h))) =
    Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₁)) +
      Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₂))
tactic: any_goals simp only [zero_def, toClassFun, zero_add, add_zero]
state_before: case some.some
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
⊢ (match some h₁ + some h₂ with
    | zero => 0
    | some h => Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h))) =
    Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₁)) +
      Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₂))
state_after: case some.some.inl.intro
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₂ : F
h₂ : W.Nonsingular x₁ y₂
h₁ : W.Nonsingular x₁ (W.negY x₁ y₂)
⊢ (match some h₁ + some h₂ with
    | zero => 0
    | some h => Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h))) =
    Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₁)) +
      Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₂))

case some.some.inr
R : Type u
S : Type v
inst✝² : CommRing R
inst✝¹ : CommRing S
W✝ : Affine R
f : R →+* S
F : Type u
inst✝ : Field F
W : Affine F
x₁ y₁ : F
h₁ : W.Nonsingular x₁ y₁
x₂ y₂ : F
h₂ : W.Nonsingular x₂ y₂
h : ¬(x₁ = x₂ ∧ y₁ = W.negY x₂ y₂)
⊢ (match some h₁ + some h₂ with
    | zero => 0
    | some h => Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h))) =
    Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₁)) +
      Additive.ofMul (ClassGroup.mk (CoordinateRing.XYIdeal' h₂))
tactic: obtain ⟨rfl, rfl⟩ | h := em (x₁ = x₂ ∧ y₁ = W.negY x₂ y₂)