l3lab/ntp-mathlib huggingface dataset:
instance [NonUnitalNonAssocSemiring R] : Mul (HahnSeries Γ R) where
  mul x y :=
    { coeff := fun a =>
        ∑ ij in addAntidiagonal x.isPwo_support y.isPwo_support a, x.coeff ij.fst * y.coeff ij.snd
      isPwo_support' :=
        haveI h :
          { a : Γ |
              (∑ ij : Γ × Γ in addAntidiagonal x.isPwo_support y.isPwo_support a,
                  x.coeff ij.fst * y.coeff ij.snd) ≠
                0 } ⊆
            { a : Γ | (addAntidiagonal x.isPwo_support y.isPwo_support a).Nonempty } := by
          intro a ha
          contrapose! ha
          

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
ha : a ∉ {a | Finset.Nonempty (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a)}
⊢ a ∉
    {a |
      ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a, coeff x ij.1 * coeff y ij.2 ≠
        0}

Next tactic:
simp [not_nonempty_iff_eq_empty.1 ha]
theorem mul_coeff_right' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hys : y.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal x.isPwo_support hs a, x.coeff ij.fst * y.coeff ij.snd := by
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hys : support y ⊆ s
⊢ coeff (x * y) a = ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hs a, coeff x ij.1 * coeff y ij.2

Next tactic:
rw [mul_coeff]
theorem mul_coeff_right' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hys : y.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal x.isPwo_support hs a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hys : support y ⊆ s
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a, coeff x ij.1 * coeff y ij.2 =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hs a, coeff x ij.1 * coeff y ij.2

Next tactic:
apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_right hys) _ fun _ _ => rfl
theorem mul_coeff_right' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hys : y.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal x.isPwo_support hs a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_right hys) _ fun _ _ => rfl
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hys : support y ⊆ s
⊢ ∀
    x_1 ∈
      addAntidiagonal (_ : Set.IsPwo (support x)) hs a \
        addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a,
    coeff x x_1.1 * coeff y x_1.2 = 0

Next tactic:
intro b hb
theorem mul_coeff_right' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hys : y.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal x.isPwo_support hs a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_right hys) _ fun _ _ => rfl
  intro b hb
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hys : support y ⊆ s
b : Γ × Γ
hb :
  b ∈
    addAntidiagonal (_ : Set.IsPwo (support x)) hs a \
      addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a
⊢ coeff x b.1 * coeff y b.2 = 0

Next tactic:
simp only [not_and, mem_sdiff, mem_addAntidiagonal, mem_support, not_imp_not] at hb
theorem mul_coeff_right' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hys : y.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal x.isPwo_support hs a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_right hys) _ fun _ _ => rfl
  intro b hb
  simp only [not_and, mem_sdiff, mem_addAntidiagonal, mem_support, not_imp_not] at hb
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hys : support y ⊆ s
b : Γ × Γ
hb : (coeff x b.1 ≠ 0 ∧ b.2 ∈ s ∧ b.1 + b.2 = a) ∧ (coeff x b.1 ≠ 0 → b.1 + b.2 = a → coeff y b.2 = 0)
⊢ coeff x b.1 * coeff y b.2 = 0

Next tactic:
rw [hb.2 hb.1.1 hb.1.2.2, mul_zero]
theorem mul_coeff_left' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hxs : x.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal hs y.isPwo_support a, x.coeff ij.fst * y.coeff ij.snd := by
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hxs : support x ⊆ s
⊢ coeff (x * y) a = ∑ ij in addAntidiagonal hs (_ : Set.IsPwo (support y)) a, coeff x ij.1 * coeff y ij.2

Next tactic:
rw [mul_coeff]
theorem mul_coeff_left' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hxs : x.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal hs y.isPwo_support a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hxs : support x ⊆ s
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a, coeff x ij.1 * coeff y ij.2 =
    ∑ ij in addAntidiagonal hs (_ : Set.IsPwo (support y)) a, coeff x ij.1 * coeff y ij.2

Next tactic:
apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_left hxs) _ fun _ _ => rfl
theorem mul_coeff_left' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hxs : x.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal hs y.isPwo_support a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_left hxs) _ fun _ _ => rfl
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hxs : support x ⊆ s
⊢ ∀
    x_1 ∈
      addAntidiagonal hs (_ : Set.IsPwo (support y)) a \
        addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a,
    coeff x x_1.1 * coeff y x_1.2 = 0

Next tactic:
intro b hb
theorem mul_coeff_left' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hxs : x.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal hs y.isPwo_support a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_left hxs) _ fun _ _ => rfl
  intro b hb
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hxs : support x ⊆ s
b : Γ × Γ
hb :
  b ∈
    addAntidiagonal hs (_ : Set.IsPwo (support y)) a \
      addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a
⊢ coeff x b.1 * coeff y b.2 = 0

Next tactic:
simp only [not_and', mem_sdiff, mem_addAntidiagonal, mem_support, not_ne_iff] at hb
theorem mul_coeff_left' [NonUnitalNonAssocSemiring R] {x y : HahnSeries Γ R} {a : Γ} {s : Set Γ}
    (hs : s.IsPwo) (hxs : x.support ⊆ s) :
    (x * y).coeff a =
      ∑ ij in addAntidiagonal hs y.isPwo_support a, x.coeff ij.fst * y.coeff ij.snd := by
  rw [mul_coeff]
  apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_left hxs) _ fun _ _ => rfl
  intro b hb
  simp only [not_and', mem_sdiff, mem_addAntidiagonal, mem_support, not_ne_iff] at hb
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
s : Set Γ
hs : Set.IsPwo s
hxs : support x ⊆ s
b : Γ × Γ
hb : (b.1 ∈ s ∧ coeff y b.2 ≠ 0 ∧ b.1 + b.2 = a) ∧ (coeff y b.2 ≠ 0 ∧ b.1 + b.2 = a → coeff x b.1 = 0)
⊢ coeff x b.1 * coeff y b.2 = 0

Next tactic:
rw [hb.2 ⟨hb.1.2.1, hb.1.2.2⟩, zero_mul]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
⊢ x * (y + z) = x * y + x * z

Next tactic:
ext a
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
⊢ coeff (x * (y + z)) a = coeff (x * y + x * z) a

Next tactic:
have hwf := y.isPwo_support.union z.isPwo_support
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
⊢ coeff (x * (y + z)) a = coeff (x * y + x * z) a

Next tactic:
rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · 

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hwf a, coeff x ij.1 * coeff (y + z) ij.2 =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hwf a, coeff x ij.1 * coeff y ij.2 +
      ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hwf a, coeff x ij.1 * coeff z ij.2

Next tactic:
simp only [add_coeff, mul_add, sum_add_distrib]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · 

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
⊢ support (y + z) ⊆ support y ∪ support z

Next tactic:
intro b
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
b : Γ
⊢ b ∈ support (y + z) → b ∈ support y ∪ support z

Next tactic:
simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
b : Γ
⊢ ¬coeff y b + coeff z b = 0 → ¬coeff y b = 0 ∨ ¬coeff z b = 0

Next tactic:
contrapose!
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
b : Γ
⊢ coeff y b = 0 ∧ coeff z b = 0 → coeff y b + coeff z b = 0

Next tactic:
intro h
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support y ∪ support z)
b : Γ
h : coeff y b = 0 ∧ coeff z b = 0
⊢ coeff y b + coeff z b = 0

Next tactic:
rw [h.1, h.2, add_zero]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        rw [h.1, h.2, add_zero]
    right_distrib := fun x y z => by
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
⊢ (x + y) * z = x * z + y * z

Next tactic:
ext a
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        rw [h.1, h.2, add_zero]
    right_distrib := fun x y z => by
      ext a
      

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
⊢ coeff ((x + y) * z) a = coeff (x * z + y * z) a

Next tactic:
have hwf := x.isPwo_support.union y.isPwo_support
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        rw [h.1, h.2, add_zero]
    right_distrib := fun x y z => by
      ext a
      have hwf := x.isPwo_support.union y.isPwo_support
      

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support x ∪ support y)
⊢ coeff ((x + y) * z) a = coeff (x * z + y * z) a

Next tactic:
rw [mul_coeff_left' hwf, add_coeff, mul_coeff_left' hwf (Set.subset_union_right _ _),
        mul_coeff_left' hwf (Set.subset_union_left _ _)]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        rw [h.1, h.2, add_zero]
    right_distrib := fun x y z => by
      ext a
      have hwf := x.isPwo_support.union y.isPwo_support
      rw [mul_coeff_left' hwf, add_coeff, mul_coeff_left' hwf (Set.subset_union_right _ _),
        mul_coeff_left' hwf (Set.subset_union_left _ _)]
      · 

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support x ∪ support y)
⊢ ∑ ij in addAntidiagonal hwf (_ : Set.IsPwo (support z)) a, coeff (x + y) ij.1 * coeff z ij.2 =
    ∑ ij in addAntidiagonal hwf (_ : Set.IsPwo (support z)) a, coeff x ij.1 * coeff z ij.2 +
      ∑ ij in addAntidiagonal hwf (_ : Set.IsPwo (support z)) a, coeff y ij.1 * coeff z ij.2

Next tactic:
simp only [add_coeff, add_mul, sum_add_distrib]
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        rw [h.1, h.2, add_zero]
    right_distrib := fun x y z => by
      ext a
      have hwf := x.isPwo_support.union y.isPwo_support
      rw [mul_coeff_left' hwf, add_coeff, mul_coeff_left' hwf (Set.subset_union_right _ _),
        mul_coeff_left' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, add_mul, sum_add_distrib]
      · 

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support x ∪ support y)
⊢ support (x + y) ⊆ support x ∪ support y

Next tactic:
intro b
instance [NonUnitalNonAssocSemiring R] : Distrib (HahnSeries Γ R) :=
  { inferInstanceAs (Mul (HahnSeries Γ R)),
    inferInstanceAs (Add (HahnSeries Γ R)) with
    left_distrib := fun x y z => by
      ext a
      have hwf := y.isPwo_support.union z.isPwo_support
      rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
        mul_coeff_right' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, mul_add, sum_add_distrib]
      · intro b
        simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
        contrapose!
        intro h
        rw [h.1, h.2, add_zero]
    right_distrib := fun x y z => by
      ext a
      have hwf := x.isPwo_support.union y.isPwo_support
      rw [mul_coeff_left' hwf, add_coeff, mul_coeff_left' hwf (Set.subset_union_right _ _),
        mul_coeff_left' hwf (Set.subset_union_left _ _)]
      · simp only [add_coeff, add_mul, sum_add_distrib]
      · intro b
        

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : Mul (HahnSeries Γ R) := inferInstanceAs (Mul (HahnSeries Γ R))
src✝ : Add (HahnSeries Γ R) := inferInstanceAs (Add (HahnSeries Γ R))
x y z : HahnSeries Γ R
a : Γ
hwf : Set.IsPwo (support x ∪ support y)
b : Γ
⊢ b ∈ support (x + y) → b ∈ support x ∪ support y

Next tactic:
simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]