l3lab/ntp-mathlib huggingface dataset:
instance [NonUnitalCommSemiring R] : NonUnitalCommSemiring (HahnSeries Γ R) :=
  { inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R)) with
    mul_comm := fun x y => by
      ext
      

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalCommSemiring R
src✝ : NonUnitalSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R))
x y : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x * y) x✝ = coeff (y * x) x✝

Next tactic:
simp_rw [mul_coeff, mul_comm]
instance [NonUnitalCommSemiring R] : NonUnitalCommSemiring (HahnSeries Γ R) :=
  { inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R)) with
    mul_comm := fun x y => by
      ext
      simp_rw [mul_coeff, mul_comm]
      

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalCommSemiring R
src✝ : NonUnitalSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R))
x y : HahnSeries Γ R
x✝ : Γ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) x✝, coeff x ij.1 * coeff y ij.2 =
    ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support x)) x✝, coeff x x_1.2 * coeff y x_1.1

Next tactic:
refine'
          sum_bij (fun a _ => a.swap) (fun a ha => _) (fun a _ => rfl)
            (fun _ _ _ _ => Prod.swap_inj.1) fun a ha => ⟨a.swap, _, a.swap_swap.symm⟩
instance [NonUnitalCommSemiring R] : NonUnitalCommSemiring (HahnSeries Γ R) :=
  { inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R)) with
    mul_comm := fun x y => by
      ext
      simp_rw [mul_coeff, mul_comm]
      refine'
          sum_bij (fun a _ => a.swap) (fun a ha => _) (fun a _ => rfl)
            (fun _ _ _ _ => Prod.swap_inj.1) fun a ha => ⟨a.swap, _, a.swap_swap.symm⟩ <;>
        

Proof state:
case coeff.h.refine'_1
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalCommSemiring R
src✝ : NonUnitalSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R))
x y : HahnSeries Γ R
x✝ : Γ
a : Γ × Γ
ha : a ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) x✝
⊢ (fun a x => Prod.swap a) a ha ∈ addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support x)) x✝

Next tactic:
rwa [swap_mem_addAntidiagonal]
instance [NonUnitalCommSemiring R] : NonUnitalCommSemiring (HahnSeries Γ R) :=
  { inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R)) with
    mul_comm := fun x y => by
      ext
      simp_rw [mul_coeff, mul_comm]
      refine'
          sum_bij (fun a _ => a.swap) (fun a ha => _) (fun a _ => rfl)
            (fun _ _ _ _ => Prod.swap_inj.1) fun a ha => ⟨a.swap, _, a.swap_swap.symm⟩ <;>
        

Proof state:
case coeff.h.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalCommSemiring R
src✝ : NonUnitalSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalSemiring (HahnSeries Γ R))
x y : HahnSeries Γ R
x✝ : Γ
a : Γ × Γ
ha : a ∈ addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support x)) x✝
⊢ Prod.swap a ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) x✝

Next tactic:
rwa [swap_mem_addAntidiagonal]
instance {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R] [NoZeroDivisors R] :
    NoZeroDivisors (HahnSeries Γ R) where
    eq_zero_or_eq_zero_of_mul_eq_zero {x y} xy := by
      

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1358114
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x * y = 0
⊢ x = 0 ∨ y = 0

Next tactic:
contrapose! xy
instance {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R] [NoZeroDivisors R] :
    NoZeroDivisors (HahnSeries Γ R) where
    eq_zero_or_eq_zero_of_mul_eq_zero {x y} xy := by
      contrapose! xy
      

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1358114
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x ≠ 0 ∧ y ≠ 0
⊢ x * y ≠ 0

Next tactic:
rw [Ne, HahnSeries.ext_iff, Function.funext_iff, not_forall]
instance {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R] [NoZeroDivisors R] :
    NoZeroDivisors (HahnSeries Γ R) where
    eq_zero_or_eq_zero_of_mul_eq_zero {x y} xy := by
      contrapose! xy
      rw [Ne, HahnSeries.ext_iff, Function.funext_iff, not_forall]
      

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1358114
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x ≠ 0 ∧ y ≠ 0
⊢ ∃ x_1, ¬coeff (x * y) x_1 = coeff 0 x_1

Next tactic:
refine' ⟨x.order + y.order, _⟩
instance {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R] [NoZeroDivisors R] :
    NoZeroDivisors (HahnSeries Γ R) where
    eq_zero_or_eq_zero_of_mul_eq_zero {x y} xy := by
      contrapose! xy
      rw [Ne, HahnSeries.ext_iff, Function.funext_iff, not_forall]
      refine' ⟨x.order + y.order, _⟩
      

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1358114
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x ≠ 0 ∧ y ≠ 0
⊢ ¬coeff (x * y) (order x + order y) = coeff 0 (order x + order y)

Next tactic:
rw [mul_coeff_order_add_order x y, zero_coeff, mul_eq_zero]
instance {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R] [NoZeroDivisors R] :
    NoZeroDivisors (HahnSeries Γ R) where
    eq_zero_or_eq_zero_of_mul_eq_zero {x y} xy := by
      contrapose! xy
      rw [Ne, HahnSeries.ext_iff, Function.funext_iff, not_forall]
      refine' ⟨x.order + y.order, _⟩
      rw [mul_coeff_order_add_order x y, zero_coeff, mul_eq_zero]
      

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1358114
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x ≠ 0 ∧ y ≠ 0
⊢ ¬(coeff x (order x) = 0 ∨ coeff y (order y) = 0)

Next tactic:
simp [coeff_order_ne_zero, xy]
@[simp]
theorem order_mul {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R]
    [NoZeroDivisors R] {x y : HahnSeries Γ R} (hx : x ≠ 0) (hy : y ≠ 0) :
    (x * y).order = x.order + y.order := by
  

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : x ≠ 0
hy : y ≠ 0
⊢ order (x * y) = order x + order y

Next tactic:
apply le_antisymm
@[simp]
theorem order_mul {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R]
    [NoZeroDivisors R] {x y : HahnSeries Γ R} (hx : x ≠ 0) (hy : y ≠ 0) :
    (x * y).order = x.order + y.order := by
  apply le_antisymm
  · 

Proof state:
case a
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : x ≠ 0
hy : y ≠ 0
⊢ order (x * y) ≤ order x + order y

Next tactic:
apply order_le_of_coeff_ne_zero
@[simp]
theorem order_mul {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R]
    [NoZeroDivisors R] {x y : HahnSeries Γ R} (hx : x ≠ 0) (hy : y ≠ 0) :
    (x * y).order = x.order + y.order := by
  apply le_antisymm
  · apply order_le_of_coeff_ne_zero
    

Proof state:
case a.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : x ≠ 0
hy : y ≠ 0
⊢ coeff (x * y) (order x + order y) ≠ 0

Next tactic:
rw [mul_coeff_order_add_order x y]
@[simp]
theorem order_mul {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R]
    [NoZeroDivisors R] {x y : HahnSeries Γ R} (hx : x ≠ 0) (hy : y ≠ 0) :
    (x * y).order = x.order + y.order := by
  apply le_antisymm
  · apply order_le_of_coeff_ne_zero
    rw [mul_coeff_order_add_order x y]
    

Proof state:
case a.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : x ≠ 0
hy : y ≠ 0
⊢ coeff x (order x) * coeff y (order y) ≠ 0

Next tactic:
exact mul_ne_zero (coeff_order_ne_zero hx) (coeff_order_ne_zero hy)
@[simp]
theorem order_mul {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R]
    [NoZeroDivisors R] {x y : HahnSeries Γ R} (hx : x ≠ 0) (hy : y ≠ 0) :
    (x * y).order = x.order + y.order := by
  apply le_antisymm
  · apply order_le_of_coeff_ne_zero
    rw [mul_coeff_order_add_order x y]
    exact mul_ne_zero (coeff_order_ne_zero hx) (coeff_order_ne_zero hy)
  · 

Proof state:
case a
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : x ≠ 0
hy : y ≠ 0
⊢ order x + order y ≤ order (x * y)

Next tactic:
rw [order_of_ne hx, order_of_ne hy, order_of_ne (mul_ne_zero hx hy), ← Set.IsWf.min_add]
@[simp]
theorem order_mul {Γ} [LinearOrderedCancelAddCommMonoid Γ] [NonUnitalNonAssocSemiring R]
    [NoZeroDivisors R] {x y : HahnSeries Γ R} (hx : x ≠ 0) (hy : y ≠ 0) :
    (x * y).order = x.order + y.order := by
  apply le_antisymm
  · apply order_le_of_coeff_ne_zero
    rw [mul_coeff_order_add_order x y]
    exact mul_ne_zero (coeff_order_ne_zero hx) (coeff_order_ne_zero hy)
  · rw [order_of_ne hx, order_of_ne hy, order_of_ne (mul_ne_zero hx hy), ← Set.IsWf.min_add]
    

Proof state:
case a
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : x ≠ 0
hy : y ≠ 0
⊢ Set.IsWf.min (_ : Set.IsWf (support x + support y)) (_ : Set.Nonempty (support x + support y)) ≤
    Set.IsWf.min (_ : Set.IsWf (support (x * y))) (_ : Set.Nonempty (support (x * y)))

Next tactic:
exact Set.IsWf.min_le_min_of_subset support_mul_subset_add_support
@[simp]
theorem order_pow {Γ} [LinearOrderedCancelAddCommMonoid Γ] [Semiring R] [NoZeroDivisors R]
    (x : HahnSeries Γ R) (n : ℕ) : (x ^ n).order = n • x.order := by
  

Proof state:
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Semiring R
inst✝ : NoZeroDivisors R
x : HahnSeries Γ R
n : ℕ
⊢ order (x ^ n) = n • order x

Next tactic:
induction' n with h IH
@[simp]
theorem order_pow {Γ} [LinearOrderedCancelAddCommMonoid Γ] [Semiring R] [NoZeroDivisors R]
    (x : HahnSeries Γ R) (n : ℕ) : (x ^ n).order = n • x.order := by
  induction' n with h IH
  · 

Proof state:
case zero
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Semiring R
inst✝ : NoZeroDivisors R
x : HahnSeries Γ R
⊢ order (x ^ Nat.zero) = Nat.zero • order x

Next tactic:
simp
@[simp]
theorem order_pow {Γ} [LinearOrderedCancelAddCommMonoid Γ] [Semiring R] [NoZeroDivisors R]
    (x : HahnSeries Γ R) (n : ℕ) : (x ^ n).order = n • x.order := by
  induction' n with h IH
  · simp
  

Proof state:
case succ
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Semiring R
inst✝ : NoZeroDivisors R
x : HahnSeries Γ R
h : ℕ
IH : order (x ^ h) = h • order x
⊢ order (x ^ Nat.succ h) = Nat.succ h • order x

Next tactic:
rcases eq_or_ne x 0 with (rfl | hx)
@[simp]
theorem order_pow {Γ} [LinearOrderedCancelAddCommMonoid Γ] [Semiring R] [NoZeroDivisors R]
    (x : HahnSeries Γ R) (n : ℕ) : (x ^ n).order = n • x.order := by
  induction' n with h IH
  · simp
  rcases eq_or_ne x 0 with (rfl | hx)
  · 

Proof state:
case succ.inl
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Semiring R
inst✝ : NoZeroDivisors R
h : ℕ
IH : order (0 ^ h) = h • order 0
⊢ order (0 ^ Nat.succ h) = Nat.succ h • order 0

Next tactic:
simp
@[simp]
theorem order_pow {Γ} [LinearOrderedCancelAddCommMonoid Γ] [Semiring R] [NoZeroDivisors R]
    (x : HahnSeries Γ R) (n : ℕ) : (x ^ n).order = n • x.order := by
  induction' n with h IH
  · simp
  rcases eq_or_ne x 0 with (rfl | hx)
  · simp
  

Proof state:
case succ.inr
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Semiring R
inst✝ : NoZeroDivisors R
x : HahnSeries Γ R
h : ℕ
IH : order (x ^ h) = h • order x
hx : x ≠ 0
⊢ order (x ^ Nat.succ h) = Nat.succ h • order x

Next tactic:
rw [pow_succ', order_mul (pow_ne_zero _ hx) hx, succ_nsmul', IH]
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
⊢ (single a) r * (single b) s = (single (a + b)) (r * s)

Next tactic:
ext x
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
x : Γ
⊢ coeff ((single a) r * (single b) s) x = coeff ((single (a + b)) (r * s)) x

Next tactic:
by_cases h : x = a + b
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · 

Proof state:
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
x : Γ
h : x = a + b
⊢ coeff ((single a) r * (single b) s) x = coeff ((single (a + b)) (r * s)) x

Next tactic:
rw [h, mul_single_coeff_add]
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · rw [h, mul_single_coeff_add]
    

Proof state:
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
x : Γ
h : x = a + b
⊢ coeff ((single a) r) a * s = coeff ((single (a + b)) (r * s)) (a + b)

Next tactic:
simp
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · rw [h, mul_single_coeff_add]
    simp
  · 

Proof state:
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
x : Γ
h : ¬x = a + b
⊢ coeff ((single a) r * (single b) s) x = coeff ((single (a + b)) (r * s)) x

Next tactic:
rw [single_coeff_of_ne h, mul_coeff, sum_eq_zero]
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · rw [h, mul_single_coeff_add]
    simp
  · rw [single_coeff_of_ne h, mul_coeff, sum_eq_zero]
    

Proof state:
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
x : Γ
h : ¬x = a + b
⊢ ∀ x_1 ∈ addAntidiagonal (_ : Set.IsPwo (support ((single a) r))) (_ : Set.IsPwo (support ((single b) s))) x,
    coeff ((single a) r) x_1.1 * coeff ((single b) s) x_1.2 = 0

Next tactic:
simp_rw [mem_addAntidiagonal]
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · rw [h, mul_single_coeff_add]
    simp
  · rw [single_coeff_of_ne h, mul_coeff, sum_eq_zero]
    simp_rw [mem_addAntidiagonal]
    

Proof state:
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
x : Γ
h : ¬x = a + b
⊢ ∀ (x_1 : Γ × Γ),
    x_1.1 ∈ support ((single a) r) ∧ x_1.2 ∈ support ((single b) s) ∧ x_1.1 + x_1.2 = x →
      coeff ((single a) r) x_1.1 * coeff ((single b) s) x_1.2 = 0

Next tactic:
rintro ⟨y, z⟩ ⟨hy, hz, rfl⟩
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · rw [h, mul_single_coeff_add]
    simp
  · rw [single_coeff_of_ne h, mul_coeff, sum_eq_zero]
    simp_rw [mem_addAntidiagonal]
    rintro ⟨y, z⟩ ⟨hy, hz, rfl⟩
    

Proof state:
case neg.mk.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
y z : Γ
hy : (y, z).1 ∈ support ((single a) r)
hz : (y, z).2 ∈ support ((single b) s)
h : ¬(y, z).1 + (y, z).2 = a + b
⊢ coeff ((single a) r) (y, z).1 * coeff ((single b) s) (y, z).2 = 0

Next tactic:
rw [eq_of_mem_support_single hy, eq_of_mem_support_single hz] at h
@[simp]
theorem single_mul_single {a b : Γ} {r s : R} :
    single a r * single b s = single (a + b) (r * s) := by
  ext x
  by_cases h : x = a + b
  · rw [h, mul_single_coeff_add]
    simp
  · rw [single_coeff_of_ne h, mul_coeff, sum_eq_zero]
    simp_rw [mem_addAntidiagonal]
    rintro ⟨y, z⟩ ⟨hy, hz, rfl⟩
    rw [eq_of_mem_support_single hy, eq_of_mem_support_single hz] at h
    

Proof state:
case neg.mk.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
a b : Γ
r s : R
y z : Γ
hy : (y, z).1 ∈ support ((single a) r)
hz : (y, z).2 ∈ support ((single b) s)
h : ¬a + b = a + b
⊢ coeff ((single a) r) (y, z).1 * coeff ((single b) s) (y, z).2 = 0

Next tactic:
exact (h rfl).elim
/-- `C a` is the constant Hahn Series `a`. `C` is provided as a ring homomorphism. -/
@[simps]
def C : R →+* HahnSeries Γ R where
  toFun := single 0
  map_zero' := single_eq_zero
  map_one' := rfl
  map_add' x y := by
    ext a
    by_cases h : a = 0 <;> simp [h]
  map_mul' x y := by 

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
x y : R
⊢ OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
      OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y

Next tactic:
rw [single_mul_single, zero_add]
/-- `C a` is the constant Hahn Series `a`. `C` is provided as a ring homomorphism. -/
@[simps]
def C : R →+* HahnSeries Γ R where
  toFun := single 0
  map_zero' := single_eq_zero
  map_one' := rfl
  map_add' x y := by
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
x y : R
⊢ OneHom.toFun
      (↑{ toOneHom := { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) },
          map_mul' :=
            (_ :
              ∀ (x y : R),
                OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
                  OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
                    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y) })
      (x + y) =
    OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
                    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
                      OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y) })
        x +
      OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
                    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
                      OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y) })
        y

Next tactic:
ext a
/-- `C a` is the constant Hahn Series `a`. `C` is provided as a ring homomorphism. -/
@[simps]
def C : R →+* HahnSeries Γ R where
  toFun := single 0
  map_zero' := single_eq_zero
  map_one' := rfl
  map_add' x y := by
    ext a
    

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
x y : R
a : Γ
⊢ coeff
      (OneHom.toFun
        (↑{ toOneHom := { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) },
            map_mul' :=
              (_ :
                ∀ (x y : R),
                  OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
                    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
                      OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y) })
        (x + y))
      a =
    coeff
      (OneHom.toFun
          (↑{ toOneHom := { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : R),
                    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
                      OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
                        OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y) })
          x +
        OneHom.toFun
          (↑{ toOneHom := { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) },
              map_mul' :=
                (_ :
                  ∀ (x y : R),
                    OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } (x * y) =
                      OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } x *
                        OneHom.toFun { toFun := ⇑(single 0), map_one' := (_ : (single 0) 1 = (single 0) 1) } y) })
          y)
      a

Next tactic:
by_cases h : a = 0