l3lab/ntp-mathlib huggingface dataset:
theorem support_hsum_subset {s : SummableFamily Γ R α} : s.hsum.support ⊆ ⋃ a : α, (s a).support :=
  fun g hg => by
  rw [mem_support, hsum_coeff, finsum_eq_sum _ (s.finite_co_support _)] at hg
  obtain ⟨a, _, h2⟩ := exists_ne_zero_of_sum_ne_zero hg
  

Proof state:
case intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
hg : ∑ i in Set.Finite.toFinset (_ : Set.Finite (Function.support fun a => coeff (s a) g)), coeff (s i) g ≠ 0
a : α
left✝ : a ∈ Set.Finite.toFinset (_ : Set.Finite (Function.support fun a => coeff (s a) g))
h2 : coeff (s a) g ≠ 0
⊢ g ∈ ⋃ a, support (s a)

Next tactic:
rw [Set.mem_iUnion]
theorem support_hsum_subset {s : SummableFamily Γ R α} : s.hsum.support ⊆ ⋃ a : α, (s a).support :=
  fun g hg => by
  rw [mem_support, hsum_coeff, finsum_eq_sum _ (s.finite_co_support _)] at hg
  obtain ⟨a, _, h2⟩ := exists_ne_zero_of_sum_ne_zero hg
  rw [Set.mem_iUnion]
  

Proof state:
case intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
hg : ∑ i in Set.Finite.toFinset (_ : Set.Finite (Function.support fun a => coeff (s a) g)), coeff (s i) g ≠ 0
a : α
left✝ : a ∈ Set.Finite.toFinset (_ : Set.Finite (Function.support fun a => coeff (s a) g))
h2 : coeff (s a) g ≠ 0
⊢ ∃ i, g ∈ support (s i)

Next tactic:
exact ⟨a, h2⟩
@[simp]
theorem hsum_add {s t : SummableFamily Γ R α} : (s + t).hsum = s.hsum + t.hsum := by
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s t : SummableFamily Γ R α
⊢ hsum (s + t) = hsum s + hsum t

Next tactic:
ext g
@[simp]
theorem hsum_add {s t : SummableFamily Γ R α} : (s + t).hsum = s.hsum + t.hsum := by
  ext g
  

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s t : SummableFamily Γ R α
g : Γ
⊢ coeff (hsum (s + t)) g = coeff (hsum s + hsum t) g

Next tactic:
simp only [hsum_coeff, add_coeff, add_apply]
@[simp]
theorem hsum_add {s t : SummableFamily Γ R α} : (s + t).hsum = s.hsum + t.hsum := by
  ext g
  simp only [hsum_coeff, add_coeff, add_apply]
  

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s t : SummableFamily Γ R α
g : Γ
⊢ ∑ᶠ (i : α), (coeff (s i) g + coeff (t i) g) = ∑ᶠ (i : α), coeff (s i) g + ∑ᶠ (i : α), coeff (t i) g

Next tactic:
exact finsum_add_distrib (s.finite_co_support _) (t.finite_co_support _)
instance : AddCommGroup (SummableFamily Γ R α) :=
  { inferInstanceAs (AddCommMonoid (SummableFamily Γ R α)) with
    neg := fun s =>
      { toFun := fun a => -s a
        isPwo_iUnion_support' := by
          

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommGroup R
α : Type u_3
s✝ t : SummableFamily Γ R α
a : α
src✝ : AddCommMonoid (SummableFamily Γ R α) := inferInstanceAs (AddCommMonoid (SummableFamily Γ R α))
s : SummableFamily Γ R α
⊢ Set.IsPwo (⋃ a, support ((fun a => -s a) a))

Next tactic:
simp_rw [support_neg]
instance : AddCommGroup (SummableFamily Γ R α) :=
  { inferInstanceAs (AddCommMonoid (SummableFamily Γ R α)) with
    neg := fun s =>
      { toFun := fun a => -s a
        isPwo_iUnion_support' := by
          simp_rw [support_neg]
          

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommGroup R
α : Type u_3
s✝ t : SummableFamily Γ R α
a : α
src✝ : AddCommMonoid (SummableFamily Γ R α) := inferInstanceAs (AddCommMonoid (SummableFamily Γ R α))
s : SummableFamily Γ R α
⊢ Set.IsPwo (⋃ a, support (s a))

Next tactic:
exact s.isPwo_iUnion_support'
instance : AddCommGroup (SummableFamily Γ R α) :=
  { inferInstanceAs (AddCommMonoid (SummableFamily Γ R α)) with
    neg := fun s =>
      { toFun := fun a => -s a
        isPwo_iUnion_support' := by
          simp_rw [support_neg]
          exact s.isPwo_iUnion_support'
        finite_co_support' := fun g => by
          

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommGroup R
α : Type u_3
s✝ t : SummableFamily Γ R α
a : α
src✝ : AddCommMonoid (SummableFamily Γ R α) := inferInstanceAs (AddCommMonoid (SummableFamily Γ R α))
s : SummableFamily Γ R α
g : Γ
⊢ Set.Finite {a | coeff ((fun a => -s a) a) g ≠ 0}

Next tactic:
simp only [neg_coeff', Pi.neg_apply, Ne.def, neg_eq_zero]
instance : AddCommGroup (SummableFamily Γ R α) :=
  { inferInstanceAs (AddCommMonoid (SummableFamily Γ R α)) with
    neg := fun s =>
      { toFun := fun a => -s a
        isPwo_iUnion_support' := by
          simp_rw [support_neg]
          exact s.isPwo_iUnion_support'
        finite_co_support' := fun g => by
          simp only [neg_coeff', Pi.neg_apply, Ne.def, neg_eq_zero]
          

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommGroup R
α : Type u_3
s✝ t : SummableFamily Γ R α
a : α
src✝ : AddCommMonoid (SummableFamily Γ R α) := inferInstanceAs (AddCommMonoid (SummableFamily Γ R α))
s : SummableFamily Γ R α
g : Γ
⊢ Set.Finite {a | ¬coeff (s a) g = 0}

Next tactic:
exact s.finite_co_support g
instance : AddCommGroup (SummableFamily Γ R α) :=
  { inferInstanceAs (AddCommMonoid (SummableFamily Γ R α)) with
    neg := fun s =>
      { toFun := fun a => -s a
        isPwo_iUnion_support' := by
          simp_rw [support_neg]
          exact s.isPwo_iUnion_support'
        finite_co_support' := fun g => by
          simp only [neg_coeff', Pi.neg_apply, Ne.def, neg_eq_zero]
          exact s.finite_co_support g }
    add_left_neg := fun a => by
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommGroup R
α : Type u_3
s t : SummableFamily Γ R α
a✝ : α
src✝ : AddCommMonoid (SummableFamily Γ R α) := inferInstanceAs (AddCommMonoid (SummableFamily Γ R α))
a : SummableFamily Γ R α
⊢ -a + a = 0

Next tactic:
ext
instance : AddCommGroup (SummableFamily Γ R α) :=
  { inferInstanceAs (AddCommMonoid (SummableFamily Γ R α)) with
    neg := fun s =>
      { toFun := fun a => -s a
        isPwo_iUnion_support' := by
          simp_rw [support_neg]
          exact s.isPwo_iUnion_support'
        finite_co_support' := fun g => by
          simp only [neg_coeff', Pi.neg_apply, Ne.def, neg_eq_zero]
          exact s.finite_co_support g }
    add_left_neg := fun a => by
      ext
      

Proof state:
case h.coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommGroup R
α : Type u_3
s t : SummableFamily Γ R α
a✝¹ : α
src✝ : AddCommMonoid (SummableFamily Γ R α) := inferInstanceAs (AddCommMonoid (SummableFamily Γ R α))
a : SummableFamily Γ R α
a✝ : α
x✝ : Γ
⊢ coeff ((-a + a) a✝) x✝ = coeff (0 a✝) x✝

Next tactic:
apply add_left_neg
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
⊢ Set.IsPwo (⋃ a, support ((fun a => x * s a) a))

Next tactic:
apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
⊢ ⋃ a, support ((fun a => x * s a) a) ⊆ support x + ⋃ a, support (s a)

Next tactic:
refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
⊢ ⋃ i, support x + support (s i) ⊆ support x + ⋃ a, support (s a)

Next tactic:
intro g
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ g ∈ ⋃ i, support x + support (s i) → g ∈ support x + ⋃ a, support (s a)

Next tactic:
simp only [Set.mem_iUnion, exists_imp]
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ ∀ (x_1 : α), g ∈ support x + support (s x_1) → g ∈ support x + ⋃ a, support (s a)

Next tactic:
exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
      finite_co_support' := fun g => by
        

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ Set.Finite {a | coeff ((fun a => x * s a) a) g ≠ 0}

Next tactic:
refine'
          ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion'
                fun ij _ => _).subset
            fun a ha => _
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
      finite_co_support' := fun g => by
        refine'
          ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion'
                fun ij _ => _).subset
            fun a ha => _
        · 

Proof state:
case refine'_1
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ (i : Γ × Γ) → i ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g) → Set α

Next tactic:
exact fun ij _ => Function.support fun a => (s a).coeff ij.2
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
      finite_co_support' := fun g => by
        refine'
          ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion'
                fun ij _ => _).subset
            fun a ha => _
        · exact fun ij _ => Function.support fun a => (s a).coeff ij.2
        · 

Proof state:
case refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
ij : Γ × Γ
x✝ : ij ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g)
⊢ Set.Finite (Function.support fun a => coeff (s a) ij.2)

Next tactic:
apply s.finite_co_support
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
      finite_co_support' := fun g => by
        refine'
          ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion'
                fun ij _ => _).subset
            fun a ha => _
        · exact fun ij _ => Function.support fun a => (s a).coeff ij.2
        · apply s.finite_co_support
        · 

Proof state:
case refine'_3
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
a : α
ha : a ∈ {a | coeff ((fun a => x * s a) a) g ≠ 0}
⊢ a ∈
    ⋃ i ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g),
      Function.support fun a => coeff (s a) i.2

Next tactic:
obtain ⟨i, j, hi, hj, rfl⟩ := support_mul_subset_add_support ha
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
      finite_co_support' := fun g => by
        refine'
          ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion'
                fun ij _ => _).subset
            fun a ha => _
        · exact fun ij _ => Function.support fun a => (s a).coeff ij.2
        · apply s.finite_co_support
        · obtain ⟨i, j, hi, hj, rfl⟩ := support_mul_subset_add_support ha
          

Proof state:
case refine'_3.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
a : α
i j : Γ
hi : i ∈ support x
hj : j ∈ support (s a)
ha : a ∈ {a | coeff ((fun a => x * s a) a) ((fun x x_1 => x + x_1) i j) ≠ 0}
⊢ a ∈
    ⋃
      i_1 ∈
        ↑(addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a)))
            ((fun x x_1 => x + x_1) i j)),
      Function.support fun a => coeff (s a) i_1.2

Next tactic:
simp only [exists_prop, Set.mem_iUnion, mem_addAntidiagonal, mul_coeff, mem_support,
            isPwo_support, Prod.exists]
instance : SMul (HahnSeries Γ R) (SummableFamily Γ R α) where
  smul x s :=
    { toFun := fun a => x * s a
      isPwo_iUnion_support' := by
        apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
        refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
        intro g
        simp only [Set.mem_iUnion, exists_imp]
        exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
      finite_co_support' := fun g => by
        refine'
          ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion'
                fun ij _ => _).subset
            fun a ha => _
        · exact fun ij _ => Function.support fun a => (s a).coeff ij.2
        · apply s.finite_co_support
        · obtain ⟨i, j, hi, hj, rfl⟩ := support_mul_subset_add_support ha
          simp only [exists_prop, Set.mem_iUnion, mem_addAntidiagonal, mul_coeff, mem_support,
            isPwo_support, Prod.exists]
          

Proof state:
case refine'_3.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
a : α
i j : Γ
hi : i ∈ support x
hj : j ∈ support (s a)
ha : a ∈ {a | coeff ((fun a => x * s a) a) ((fun x x_1 => x + x_1) i j) ≠ 0}
⊢ ∃ a_1 b,
    (a_1, b) ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) (i + j)) ∧
      a ∈ Function.support fun a => coeff (s a) b

Next tactic:
exact ⟨i, j, mem_coe.2 (mem_addAntidiagonal.2 ⟨hi, Set.mem_iUnion.2 ⟨a, hj⟩, rfl⟩), hj⟩
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
⊢ hsum (x • s) = x * hsum s

Next tactic:
ext g
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ coeff (hsum (x • s)) g = coeff (x * hsum s) g

Next tactic:
simp only [mul_coeff, hsum_coeff, smul_apply]
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  simp only [mul_coeff, hsum_coeff, smul_apply]
  

Proof state:
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ ∑ᶠ (i : α),
      ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (s i))) g,
        coeff x ij.1 * coeff (s i) ij.2 =
    ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (hsum s))) g,
      coeff x x_1.1 * ∑ᶠ (i : α), coeff (s i) x_1.2

Next tactic:
refine'
    (Eq.trans (finsum_congr fun a => _)
          (finsum_sum_comm (addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g)
            (fun i ij => x.coeff (Prod.fst ij) * (s i).coeff ij.snd) _)).trans
      _
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  simp only [mul_coeff, hsum_coeff, smul_apply]
  refine'
    (Eq.trans (finsum_congr fun a => _)
          (finsum_sum_comm (addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g)
            (fun i ij => x.coeff (Prod.fst ij) * (s i).coeff ij.snd) _)).trans
      _
  · 

Proof state:
case coeff.h.refine'_1
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
a : α
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (s a))) g,
      coeff x ij.1 * coeff (s a) ij.2 =
    ∑ b in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g,
      coeff x b.1 * coeff (s a) b.2

Next tactic:
refine' sum_subset (addAntidiagonal_mono_right
      (Set.subset_iUnion (fun j => support (toFun s j)) a)) _
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  simp only [mul_coeff, hsum_coeff, smul_apply]
  refine'
    (Eq.trans (finsum_congr fun a => _)
          (finsum_sum_comm (addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g)
            (fun i ij => x.coeff (Prod.fst ij) * (s i).coeff ij.snd) _)).trans
      _
  · refine' sum_subset (addAntidiagonal_mono_right
      (Set.subset_iUnion (fun j => support (toFun s j)) a)) _
    

Proof state:
case coeff.h.refine'_1
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
a : α
⊢ ∀ x_1 ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g,
    x_1 ∉ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (s a))) g →
      coeff x x_1.1 * coeff (s a) x_1.2 = 0

Next tactic:
rintro ⟨i, j⟩ hU ha
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  simp only [mul_coeff, hsum_coeff, smul_apply]
  refine'
    (Eq.trans (finsum_congr fun a => _)
          (finsum_sum_comm (addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g)
            (fun i ij => x.coeff (Prod.fst ij) * (s i).coeff ij.snd) _)).trans
      _
  · refine' sum_subset (addAntidiagonal_mono_right
      (Set.subset_iUnion (fun j => support (toFun s j)) a)) _
    rintro ⟨i, j⟩ hU ha
    

Proof state:
case coeff.h.refine'_1.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
a : α
i j : Γ
hU : (i, j) ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g
ha : (i, j) ∉ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (s a))) g
⊢ coeff x (i, j).1 * coeff (s a) (i, j).2 = 0

Next tactic:
rw [mem_addAntidiagonal] at *
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  simp only [mul_coeff, hsum_coeff, smul_apply]
  refine'
    (Eq.trans (finsum_congr fun a => _)
          (finsum_sum_comm (addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g)
            (fun i ij => x.coeff (Prod.fst ij) * (s i).coeff ij.snd) _)).trans
      _
  · refine' sum_subset (addAntidiagonal_mono_right
      (Set.subset_iUnion (fun j => support (toFun s j)) a)) _
    rintro ⟨i, j⟩ hU ha
    rw [mem_addAntidiagonal] at *
    

Proof state:
case coeff.h.refine'_1.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
a : α
i j : Γ
hU : (i, j).1 ∈ support x ∧ (i, j).2 ∈ ⋃ a, support (s a) ∧ (i, j).1 + (i, j).2 = g
ha : ¬((i, j).1 ∈ support x ∧ (i, j).2 ∈ support (s a) ∧ (i, j).1 + (i, j).2 = g)
⊢ coeff x (i, j).1 * coeff (s a) (i, j).2 = 0

Next tactic:
rw [Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
@[simp]
theorem hsum_smul {x : HahnSeries Γ R} {s : SummableFamily Γ R α} : (x • s).hsum = x * s.hsum := by
  ext g
  simp only [mul_coeff, hsum_coeff, smul_apply]
  refine'
    (Eq.trans (finsum_congr fun a => _)
          (finsum_sum_comm (addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g)
            (fun i ij => x.coeff (Prod.fst ij) * (s i).coeff ij.snd) _)).trans
      _
  · refine' sum_subset (addAntidiagonal_mono_right
      (Set.subset_iUnion (fun j => support (toFun s j)) a)) _
    rintro ⟨i, j⟩ hU ha
    rw [mem_addAntidiagonal] at *
    rw [Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
  · 

Proof state:
case coeff.h.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ ∀ b ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g,
    Set.Finite (Function.support fun a => (fun i ij => coeff x ij.1 * coeff (s i) ij.2) a b)

Next tactic:
rintro ⟨i, j⟩ _