l3lab/ntp-mathlib huggingface dataset:
@[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]
  · rintro ⟨i, j⟩ _
    

Proof state:
case coeff.h.refine'_2.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g i j : Γ
a✝ : (i, j) ∈ 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 (i, j))

Next tactic:
refine' (s.finite_co_support j).subset _
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    

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

Next tactic:
simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    

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

Next tactic:
intro a 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
    rw [mem_addAntidiagonal] at *
    rw [Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    

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

Next tactic:
rw [ha, 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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · 

Proof state:
case coeff.h.refine'_3
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ ∑ b in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g,
      ∑ᶠ (a : α), coeff x b.1 * coeff (s a) b.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' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · 

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

Next tactic:
rintro ⟨i, j⟩ _
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      

Proof state:
case coeff.h.refine'_3.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 i j : Γ
a✝ : (i, j) ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g
⊢ ∑ᶠ (a : α), coeff x (i, j).1 * coeff (s a) (i, j).2 = coeff x (i, j).1 * ∑ᶠ (i_1 : α), coeff (s i_1) (i, j).2

Next tactic:
rw [mul_finsum]
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      

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

Next tactic:
apply s.finite_co_support
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · 

Proof state:
case coeff.h.refine'_3.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ support (hsum s) ⊆ ⋃ a, support (s a)

Next tactic:
intro x hx
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · intro x hx
      

Proof state:
case coeff.h.refine'_3.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x✝ : HahnSeries Γ R
s : SummableFamily Γ R α
g x : Γ
hx : x ∈ support (hsum s)
⊢ x ∈ ⋃ a, support (s a)

Next tactic:
simp only [Set.mem_iUnion, Ne.def, mem_support]
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · intro x hx
      simp only [Set.mem_iUnion, Ne.def, mem_support]
      

Proof state:
case coeff.h.refine'_3.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x✝ : HahnSeries Γ R
s : SummableFamily Γ R α
g x : Γ
hx : x ∈ support (hsum s)
⊢ ∃ i, ¬coeff (s i) x = 0

Next tactic:
contrapose! hx
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · intro x hx
      simp only [Set.mem_iUnion, Ne.def, mem_support]
      contrapose! hx
      

Proof state:
case coeff.h.refine'_3.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x✝ : HahnSeries Γ R
s : SummableFamily Γ R α
g x : Γ
hx : ∀ (i : α), coeff (s i) x = 0
⊢ x ∉ support (hsum s)

Next tactic:
simp [hx]
@[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]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · intro x hx
      simp only [Set.mem_iUnion, Ne.def, mem_support]
      contrapose! hx
      simp [hx]
    · 

Proof state:
case coeff.h.refine'_3.refine'_3
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g : Γ
⊢ ∀ x_1 ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ a, support (s a))) g,
    x_1 ∉ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (hsum s))) g →
      coeff x x_1.1 * ∑ᶠ (i : α), coeff (s i) 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
    rw [mem_addAntidiagonal] at *
    rw [Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · intro x hx
      simp only [Set.mem_iUnion, Ne.def, mem_support]
      contrapose! hx
      simp [hx]
    · rintro ⟨i, j⟩ hU ha
      

Proof state:
case coeff.h.refine'_3.refine'_3.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g 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 (hsum s))) g
⊢ coeff x (i, j).1 * ∑ᶠ (i_1 : α), coeff (s i_1) (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 *
    rw [Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
  · rintro ⟨i, j⟩ _
    refine' (s.finite_co_support j).subset _
    simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
    intro a ha
    rw [ha, mul_zero]
  · refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
    · rintro ⟨i, j⟩ _
      rw [mul_finsum]
      apply s.finite_co_support
    · intro x hx
      simp only [Set.mem_iUnion, Ne.def, mem_support]
      contrapose! hx
      simp [hx]
    · rintro ⟨i, j⟩ hU ha
      rw [mem_addAntidiagonal] at *
      

Proof state:
case coeff.h.refine'_3.refine'_3.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
α : Type u_3
x : HahnSeries Γ R
s : SummableFamily Γ R α
g 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 (hsum s) ∧ (i, j).1 + (i, j).2 = g)
⊢ coeff x (i, j).1 * ∑ᶠ (i_1 : α), coeff (s i_1) (i, j).2 = 0

Next tactic:
rw [← hsum_coeff, Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩,
        mul_zero]
@[simp]
theorem hsum_sub {R : Type*} [Ring R] {s t : SummableFamily Γ R α} :
    (s - t).hsum = s.hsum - t.hsum := by
  

Proof state:
Γ : Type u_1
R✝ : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
inst✝¹ : Semiring R✝
α : Type u_3
R : Type u_4
inst✝ : Ring R
s t : SummableFamily Γ R α
⊢ hsum (s - t) = hsum s - hsum t

Next tactic:
rw [← lsum_apply, LinearMap.map_sub, lsum_apply, lsum_apply]
/-- A family with only finitely many nonzero elements is summable. -/
def ofFinsupp (f : α →₀ HahnSeries Γ R) : SummableFamily Γ R α where
  toFun := f
  isPwo_iUnion_support' := by
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
⊢ Set.IsPwo (⋃ a, support (f a))

Next tactic:
apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
/-- A family with only finitely many nonzero elements is summable. -/
def ofFinsupp (f : α →₀ HahnSeries Γ R) : SummableFamily Γ R α where
  toFun := f
  isPwo_iUnion_support' := by
    apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
⊢ ⋃ a, support (f a) ⊆ ⋃ i ∈ f.support, support (f i)

Next tactic:
refine' Set.iUnion_subset_iff.2 fun a g hg => _
/-- A family with only finitely many nonzero elements is summable. -/
def ofFinsupp (f : α →₀ HahnSeries Γ R) : SummableFamily Γ R α where
  toFun := f
  isPwo_iUnion_support' := by
    apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
    refine' Set.iUnion_subset_iff.2 fun a g hg => _
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
a : α
g : Γ
hg : g ∈ support (f a)
⊢ g ∈ ⋃ i ∈ f.support, support (f i)

Next tactic:
have haf : a ∈ f.support := by
      rw [Finsupp.mem_support_iff, ← support_nonempty_iff]
      exact ⟨g, hg⟩
/-- A family with only finitely many nonzero elements is summable. -/
def ofFinsupp (f : α →₀ HahnSeries Γ R) : SummableFamily Γ R α where
  toFun := f
  isPwo_iUnion_support' := by
    apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
    refine' Set.iUnion_subset_iff.2 fun a g hg => _
    have haf : a ∈ f.support := by
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
a : α
g : Γ
hg : g ∈ support (f a)
⊢ a ∈ f.support

Next tactic:
rw [Finsupp.mem_support_iff, ← support_nonempty_iff]
/-- A family with only finitely many nonzero elements is summable. -/
def ofFinsupp (f : α →₀ HahnSeries Γ R) : SummableFamily Γ R α where
  toFun := f
  isPwo_iUnion_support' := by
    apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
    refine' Set.iUnion_subset_iff.2 fun a g hg => _
    have haf : a ∈ f.support := by
      rw [Finsupp.mem_support_iff, ← support_nonempty_iff]
      

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
a : α
g : Γ
hg : g ∈ support (f a)
⊢ Set.Nonempty (support (f a))

Next tactic:
exact ⟨g, hg⟩
/-- A family with only finitely many nonzero elements is summable. -/
def ofFinsupp (f : α →₀ HahnSeries Γ R) : SummableFamily Γ R α where
  toFun := f
  isPwo_iUnion_support' := by
    apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
    refine' Set.iUnion_subset_iff.2 fun a g hg => _
    have haf : a ∈ f.support := by
      rw [Finsupp.mem_support_iff, ← support_nonempty_iff]
      exact ⟨g, hg⟩
    

Proof state:
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
a : α
g : Γ
hg : g ∈ support (f a)
haf : a ∈ f.support
⊢ g ∈ ⋃ i ∈ f.support, support (f i)

Next tactic:
exact Set.mem_biUnion haf hg