[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
⊢ Set.IsPwo (Function.support 0)
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
x : HahnSeries Γ R
⊢ Set.Nonempty (support x) ↔ x ≠ 0
[PROOFSTEP]
rw [support, support_nonempty_iff, Ne.def, coeff_fun_eq_zero_iff]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a b : Γ
r : R
⊢ coeff (↑(single a) r) b = if b = a then r else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a b : Γ
r : R
h : b = a
⊢ coeff (↑(single a) r) b = r
[PROOFSTEP]
simp [h]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a b : Γ
r : R
h : ¬b = a
⊢ coeff (↑(single a) r) b = 0
[PROOFSTEP]
simp [h]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a✝ b : Γ
r✝ : R
a : Γ
r s : R
rs : ↑(single a) r = ↑(single a) s
⊢ r = s
[PROOFSTEP]
rw [← single_coeff_same a r, ← single_coeff_same a s, rs]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a✝ b : Γ
r✝ : R
a : Γ
r : R
⊢ ↑(single a) r = 0 ↔ r = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a✝ b : Γ
r✝ : R
a : Γ
r : R
⊢ ↑(single a) r = 0 → r = 0
[PROOFSTEP]
contrapose!
[GOAL]
case mp
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a✝ b : Γ
r✝ : R
a : Γ
r : R
⊢ r ≠ 0 → ↑(single a) r ≠ 0
[PROOFSTEP]
exact single_ne_zero
[GOAL]
case mpr
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : Zero R
a✝ b : Γ
r✝ : R
a : Γ
r : R
⊢ r = 0 → ↑(single a) r = 0
[PROOFSTEP]
simp (config := { contextual := true })
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Zero R
a b : Γ
r : R
inst✝¹ : Nonempty Γ
inst✝ : Nontrivial R
⊢ ∃ x y, x ≠ y
[PROOFSTEP]
obtain ⟨r, s, rs⟩ := exists_pair_ne R
[GOAL]
case intro.intro
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Zero R
a b : Γ
r✝ : R
inst✝¹ : Nonempty Γ
inst✝ : Nontrivial R
r s : R
rs : r ≠ s
⊢ ∃ x y, x ≠ y
[PROOFSTEP]
inhabit Γ
[GOAL]
case intro.intro
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Zero R
a b : Γ
r✝ : R
inst✝¹ : Nonempty Γ
inst✝ : Nontrivial R
r s : R
rs : r ≠ s
inhabited_h : Inhabited Γ
⊢ ∃ x y, x ≠ y
[PROOFSTEP]
refine' ⟨single default r, single default s, fun con => rs _⟩
[GOAL]
case intro.intro
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Zero R
a b : Γ
r✝ : R
inst✝¹ : Nonempty Γ
inst✝ : Nontrivial R
r s : R
rs : r ≠ s
inhabited_h : Inhabited Γ
con : ↑(single default) r = ↑(single default) s
⊢ r = s
[PROOFSTEP]
rw [← single_coeff_same (default : Γ) r, con, single_coeff_same]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
hx : x ≠ 0
⊢ coeff x (order x) ≠ 0
[PROOFSTEP]
rw [order_of_ne hx]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
hx : x ≠ 0
⊢ coeff x (Set.IsWf.min (_ : Set.IsWf (support x)) (_ : Set.Nonempty (support x))) ≠ 0
[PROOFSTEP]
exact x.isWf_support.min_mem (support_nonempty_iff.2 hx)
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
i : Γ
hi : i < order x
⊢ coeff x i = 0
[PROOFSTEP]
rcases eq_or_ne x 0 with (rfl | hx)
[GOAL]
case inl
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
i : Γ
hi : i < order 0
⊢ coeff 0 i = 0
[PROOFSTEP]
simp
[GOAL]
case inr
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
i : Γ
hi : i < order x
hx : x ≠ 0
⊢ coeff x i = 0
[PROOFSTEP]
contrapose! hi
[GOAL]
case inr
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
i : Γ
hx : x ≠ 0
hi : coeff x i ≠ 0
⊢ ¬i < order x
[PROOFSTEP]
rw [← mem_support] at hi 
[GOAL]
case inr
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
i : Γ
hx : x ≠ 0
hi : i ∈ support x
⊢ ¬i < order x
[PROOFSTEP]
rw [order_of_ne hx]
[GOAL]
case inr
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
inst✝ : Zero Γ
x : HahnSeries Γ R
i : Γ
hx : x ≠ 0
hi : i ∈ support x
⊢ ¬i < Set.IsWf.min (_ : Set.IsWf (support x)) (_ : Set.Nonempty (support x))
[PROOFSTEP]
exact Set.IsWf.not_lt_min _ _ hi
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b✝ : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
b : Γ'
hb : b ∈ Function.support fun b => if h : b ∈ ↑f '' support x then coeff x (Classical.choose h) else 0
⊢ b ∈ ↑f '' support x
[PROOFSTEP]
contrapose! hb
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b✝ : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
b : Γ'
hb : ¬b ∈ (fun a => ↑f a) '' support x
⊢ ¬b ∈
      Function.support fun b =>
        if h : b ∈ (fun a => ↑f a) '' support x then coeff x (Classical.choose (_ : b ∈ ↑f '' support x)) else 0
[PROOFSTEP]
rw [Function.mem_support, dif_neg hb, Classical.not_not]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ coeff (embDomain f x) (↑f a) = coeff x a
[PROOFSTEP]
rw [embDomain]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ coeff
      { coeff := fun b => if h : b ∈ ↑f '' support x then coeff x (Classical.choose h) else 0,
        isPwo_support' :=
          (_ :
            Set.IsPwo (Function.support fun b => if h : b ∈ ↑f '' support x then coeff x (Classical.choose h) else 0)) }
      (↑f a) =
    coeff x a
[PROOFSTEP]
dsimp only
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
⊢ (if h : ↑f a ∈ ↑f '' support x then coeff x (Classical.choose h) else 0) = coeff x a
[PROOFSTEP]
by_cases ha : a ∈ x.support
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∈ support x
⊢ (if h : ↑f a ∈ ↑f '' support x then coeff x (Classical.choose h) else 0) = coeff x a
[PROOFSTEP]
rw [dif_pos (Set.mem_image_of_mem f ha)]
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : a ∈ support x
⊢ coeff x (Classical.choose (_ : ↑f a ∈ ↑f '' support x)) = coeff x a
[PROOFSTEP]
exact congr rfl (f.injective (Classical.choose_spec (Set.mem_image_of_mem f ha)).2)
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : ¬a ∈ support x
⊢ (if h : ↑f a ∈ ↑f '' support x then coeff x (Classical.choose h) else 0) = coeff x a
[PROOFSTEP]
rw [dif_neg, Classical.not_not.1 fun c => ha ((mem_support _ _).2 c)]
[GOAL]
case neg.hnc
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : ¬a ∈ support x
⊢ ¬↑f a ∈ ↑f '' support x
[PROOFSTEP]
contrapose! ha
[GOAL]
case neg.hnc
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : ↑f a ∈ ↑f '' support x
⊢ a ∈ support x
[PROOFSTEP]
obtain ⟨b, hb1, hb2⟩ := (Set.mem_image _ _ _).1 ha
[GOAL]
case neg.hnc.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a✝ b✝ : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
a : Γ
ha : ↑f a ∈ ↑f '' support x
b : Γ
hb1 : b ∈ support x
hb2 : ↑f b = ↑f a
⊢ a ∈ support x
[PROOFSTEP]
rwa [f.injective hb2] at hb1 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
⊢ support (embDomain f x) ⊆ ↑f '' support x
[PROOFSTEP]
intro g hg
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
g : Γ'
hg : g ∈ support (embDomain f x)
⊢ g ∈ ↑f '' support x
[PROOFSTEP]
contrapose! hg
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ (fun a => ↑f a) '' support x
⊢ ¬g ∈ support (embDomain f x)
[PROOFSTEP]
rw [mem_support, embDomain_notin_image_support hg, Classical.not_not]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
⊢ embDomain f 0 = 0
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x✝ : Γ'
⊢ coeff (embDomain f 0) x✝ = coeff 0 x✝
[PROOFSTEP]
simp [embDomain_notin_image_support]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
⊢ embDomain f (↑(single g) r) = ↑(single (↑f g)) r
[PROOFSTEP]
ext g'
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
g' : Γ'
⊢ coeff (embDomain f (↑(single g) r)) g' = coeff (↑(single (↑f g)) r) g'
[PROOFSTEP]
by_cases h : g' = f g
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
g' : Γ'
h : g' = ↑f g
⊢ coeff (embDomain f (↑(single g) r)) g' = coeff (↑(single (↑f g)) r) g'
[PROOFSTEP]
simp [h]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
g' : Γ'
h : ¬g' = ↑f g
⊢ coeff (embDomain f (↑(single g) r)) g' = coeff (↑(single (↑f g)) r) g'
[PROOFSTEP]
rw [embDomain_notin_image_support, single_coeff_of_ne h]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
g' : Γ'
h : ¬g' = ↑f g
⊢ ¬g' ∈ ↑f '' support (↑(single g) r)
[PROOFSTEP]
by_cases hr : r = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
g' : Γ'
h : ¬g' = ↑f g
hr : r = 0
⊢ ¬g' ∈ ↑f '' support (↑(single g) r)
[PROOFSTEP]
simp [hr]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r✝ : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
g : Γ
r : R
g' : Γ'
h : ¬g' = ↑f g
hr : ¬r = 0
⊢ ¬g' ∈ ↑f '' support (↑(single g) r)
[PROOFSTEP]
rwa [support_single_of_ne hr, Set.image_singleton, Set.mem_singleton_iff]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
xy : embDomain f x = embDomain f y
⊢ x = y
[PROOFSTEP]
ext g
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
xy : embDomain f x = embDomain f y
g : Γ
⊢ coeff x g = coeff y g
[PROOFSTEP]
rw [HahnSeries.ext_iff, Function.funext_iff] at xy 
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
xy : ∀ (a : Γ'), coeff (embDomain f x) a = coeff (embDomain f y) a
g : Γ
⊢ coeff x g = coeff y g
[PROOFSTEP]
have xyg := xy (f g)
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : Zero R
a b : Γ
r : R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
xy : ∀ (a : Γ'), coeff (embDomain f x) a = coeff (embDomain f y) a
g : Γ
xyg : coeff (embDomain f x) (↑f g) = coeff (embDomain f y) (↑f g)
⊢ coeff x g = coeff y g
[PROOFSTEP]
rwa [embDomain_coeff, embDomain_coeff] at xyg 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x y z : HahnSeries Γ R
⊢ x + y + z = x + (y + z)
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x y z : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x + y + z) x✝ = coeff (x + (y + z)) x✝
[PROOFSTEP]
apply add_assoc
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x : HahnSeries Γ R
⊢ 0 + x = x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x : HahnSeries Γ R
x✝ : Γ
⊢ coeff (0 + x) x✝ = coeff x x✝
[PROOFSTEP]
apply zero_add
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x : HahnSeries Γ R
⊢ x + 0 = x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x + 0) x✝ = coeff x x✝
[PROOFSTEP]
apply add_zero
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x y : HahnSeries Γ R
a : Γ
ha : a ∈ support (x + y)
⊢ a ∈ support x ∪ support y
[PROOFSTEP]
rw [mem_support, add_coeff] at ha 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x y : HahnSeries Γ R
a : Γ
ha : coeff x a + coeff y a ≠ 0
⊢ a ∈ support x ∪ support y
[PROOFSTEP]
rw [Set.mem_union, mem_support, mem_support]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x y : HahnSeries Γ R
a : Γ
ha : coeff x a + coeff y a ≠ 0
⊢ coeff x a ≠ 0 ∨ coeff y a ≠ 0
[PROOFSTEP]
contrapose! ha
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
x y : HahnSeries Γ R
a : Γ
ha : coeff x a = 0 ∧ coeff y a = 0
⊢ coeff x a + coeff y a = 0
[PROOFSTEP]
rw [ha.1, ha.2, add_zero]
[GOAL]
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
⊢ min (order x) (order y) ≤ order (x + y)
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
hx : x = 0
⊢ min (order x) (order y) ≤ order (x + y)
[PROOFSTEP]
simp [hx]
[GOAL]
case neg
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
hx : ¬x = 0
⊢ min (order x) (order y) ≤ order (x + y)
[PROOFSTEP]
by_cases hy : y = 0
[GOAL]
case pos
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
hx : ¬x = 0
hy : y = 0
⊢ min (order x) (order y) ≤ order (x + y)
[PROOFSTEP]
simp [hy]
[GOAL]
case neg
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
hx : ¬x = 0
hy : ¬y = 0
⊢ min (order x) (order y) ≤ order (x + y)
[PROOFSTEP]
rw [order_of_ne hx, order_of_ne hy, order_of_ne hxy]
[GOAL]
case neg
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
hx : ¬x = 0
hy : ¬y = 0
⊢ min (Set.IsWf.min (_ : Set.IsWf (support x)) (_ : Set.Nonempty (support x)))
      (Set.IsWf.min (_ : Set.IsWf (support y)) (_ : Set.Nonempty (support y))) ≤
    Set.IsWf.min (_ : Set.IsWf (support (x + y))) (_ : Set.Nonempty (support (x + y)))
[PROOFSTEP]
refine' le_of_eq_of_le _ (Set.IsWf.min_le_min_of_subset (support_add_subset (x := x) (y := y)))
[GOAL]
case neg.refine'_1
Γ✝ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ✝
inst✝¹ : AddMonoid R
Γ : Type u_3
inst✝ : LinearOrderedCancelAddCommMonoid Γ
x y : HahnSeries Γ R
hxy : x + y ≠ 0
hx : ¬x = 0
hy : ¬y = 0
⊢ min (Set.IsWf.min (_ : Set.IsWf (support x)) (_ : Set.Nonempty (support x)))
      (Set.IsWf.min (_ : Set.IsWf (support y)) (_ : Set.Nonempty (support y))) =
    Set.IsWf.min ?neg.refine'_2✝ ?neg.refine'_3✝
[PROOFSTEP]
exact (Set.IsWf.min_union _ _ _ _).symm
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
a : Γ
src✝ : ZeroHom R (HahnSeries Γ R) := single a
x y : R
⊢ ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } (x + y) =
    ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } x +
      ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } y
[PROOFSTEP]
ext b
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
a : Γ
src✝ : ZeroHom R (HahnSeries Γ R) := single a
x y : R
b : Γ
⊢ coeff (ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } (x + y)) b =
    coeff
      (ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } x +
        ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } y)
      b
[PROOFSTEP]
by_cases h : b = a
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
a : Γ
src✝ : ZeroHom R (HahnSeries Γ R) := single a
x y : R
b : Γ
h : b = a
⊢ coeff (ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } (x + y)) b =
    coeff
      (ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } x +
        ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } y)
      b
[PROOFSTEP]
simp [h]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddMonoid R
a : Γ
src✝ : ZeroHom R (HahnSeries Γ R) := single a
x y : R
b : Γ
h : ¬b = a
⊢ coeff (ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } (x + y)) b =
    coeff
      (ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } x +
        ZeroHom.toFun { toFun := src✝.toFun, map_zero' := (_ : ZeroHom.toFun src✝ 0 = 0) } y)
      b
[PROOFSTEP]
simp [h]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddMonoid R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
⊢ embDomain f (x + y) = embDomain f x + embDomain f y
[PROOFSTEP]
ext g
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddMonoid R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
g : Γ'
⊢ coeff (embDomain f (x + y)) g = coeff (embDomain f x + embDomain f y) g
[PROOFSTEP]
by_cases hg : g ∈ Set.range f
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddMonoid R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
g : Γ'
hg : g ∈ Set.range ↑f
⊢ coeff (embDomain f (x + y)) g = coeff (embDomain f x + embDomain f y) g
[PROOFSTEP]
obtain ⟨a, rfl⟩ := hg
[GOAL]
case pos.intro
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddMonoid R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
a : Γ
⊢ coeff (embDomain f (x + y)) (↑f a) = coeff (embDomain f x + embDomain f y) (↑f a)
[PROOFSTEP]
simp
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddMonoid R
Γ' : Type u_3
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
x y : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ Set.range ↑f
⊢ coeff (embDomain f (x + y)) g = coeff (embDomain f x + embDomain f y) g
[PROOFSTEP]
simp [embDomain_notin_range hg]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
src✝ : AddMonoid (HahnSeries Γ R) := inferInstanceAs (AddMonoid (HahnSeries Γ R))
x y : HahnSeries Γ R
⊢ x + y = y + x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
src✝ : AddMonoid (HahnSeries Γ R) := inferInstanceAs (AddMonoid (HahnSeries Γ R))
x y : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x + y) x✝ = coeff (y + x) x✝
[PROOFSTEP]
apply add_comm
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
src✝ : AddMonoid (HahnSeries Γ R) := inferInstanceAs (AddMonoid (HahnSeries Γ R))
x : HahnSeries Γ R
⊢ Set.IsPwo (Function.support fun a => -coeff x a)
[PROOFSTEP]
rw [Function.support_neg]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
src✝ : AddMonoid (HahnSeries Γ R) := inferInstanceAs (AddMonoid (HahnSeries Γ R))
x : HahnSeries Γ R
⊢ Set.IsPwo (Function.support fun a => coeff x a)
[PROOFSTEP]
exact x.isPwo_support
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
src✝ : AddMonoid (HahnSeries Γ R) := inferInstanceAs (AddMonoid (HahnSeries Γ R))
x : HahnSeries Γ R
⊢ -x + x = 0
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
src✝ : AddMonoid (HahnSeries Γ R) := inferInstanceAs (AddMonoid (HahnSeries Γ R))
x : HahnSeries Γ R
x✝ : Γ
⊢ coeff (-x + x) x✝ = coeff 0 x✝
[PROOFSTEP]
apply add_left_neg
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
x : HahnSeries Γ R
⊢ support (-x) = support x
[PROOFSTEP]
ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
x : HahnSeries Γ R
x✝ : Γ
⊢ x✝ ∈ support (-x) ↔ x✝ ∈ support x
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
x y : HahnSeries Γ R
⊢ (x - y).coeff = x.coeff - y.coeff
[PROOFSTEP]
ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
x y : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x - y) x✝ = (x.coeff - y.coeff) x✝
[PROOFSTEP]
simp [sub_eq_add_neg]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddGroup R
x y : HahnSeries Γ R
a : Γ
⊢ coeff (x - y) a = coeff x a - coeff y a
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddGroup R
inst✝ : Zero Γ
f : HahnSeries Γ R
⊢ order (-f) = order f
[PROOFSTEP]
by_cases hf : f = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddGroup R
inst✝ : Zero Γ
f : HahnSeries Γ R
hf : f = 0
⊢ order (-f) = order f
[PROOFSTEP]
simp only [hf, neg_zero]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : PartialOrder Γ
inst✝¹ : AddGroup R
inst✝ : Zero Γ
f : HahnSeries Γ R
hf : ¬f = 0
⊢ order (-f) = order f
[PROOFSTEP]
simp only [order, support_neg, neg_eq_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝ : HahnSeries Γ V
⊢ 1 • x✝ = x✝
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝¹ : HahnSeries Γ V
x✝ : Γ
⊢ coeff (1 • x✝¹) x✝ = coeff x✝¹ x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝² x✝¹ : R
x✝ : HahnSeries Γ V
⊢ (x✝² * x✝¹) • x✝ = x✝² • x✝¹ • x✝
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝³ x✝² : R
x✝¹ : HahnSeries Γ V
x✝ : Γ
⊢ coeff ((x✝³ * x✝²) • x✝¹) x✝ = coeff (x✝³ • x✝² • x✝¹) x✝
[PROOFSTEP]
simp [mul_smul]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝ : R
⊢ x✝ • 0 = 0
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝¹ : R
x✝ : Γ
⊢ coeff (x✝¹ • 0) x✝ = coeff 0 x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝² : R
x✝¹ x✝ : HahnSeries Γ V
⊢ x✝² • (x✝¹ + x✝) = x✝² • x✝¹ + x✝² • x✝
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
V : Type u_3
inst✝² : Monoid R
inst✝¹ : AddMonoid V
inst✝ : DistribMulAction R V
x✝³ : R
x✝² x✝¹ : HahnSeries Γ V
x✝ : Γ
⊢ coeff (x✝³ • (x✝² + x✝¹)) x✝ = coeff (x✝³ • x✝² + x✝³ • x✝¹) x✝
[PROOFSTEP]
simp [smul_add]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝⁷ : PartialOrder Γ
V : Type u_3
inst✝⁶ : Monoid R
inst✝⁵ : AddMonoid V
inst✝⁴ : DistribMulAction R V
S : Type u_4
inst✝³ : Monoid S
inst✝² : DistribMulAction S V
inst✝¹ : SMul R S
inst✝ : IsScalarTower R S V
r : R
s : S
a : HahnSeries Γ V
⊢ (r • s) • a = r • s • a
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝⁷ : PartialOrder Γ
V : Type u_3
inst✝⁶ : Monoid R
inst✝⁵ : AddMonoid V
inst✝⁴ : DistribMulAction R V
S : Type u_4
inst✝³ : Monoid S
inst✝² : DistribMulAction S V
inst✝¹ : SMul R S
inst✝ : IsScalarTower R S V
r : R
s : S
a : HahnSeries Γ V
x✝ : Γ
⊢ coeff ((r • s) • a) x✝ = coeff (r • s • a) x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝⁶ : PartialOrder Γ
V : Type u_3
inst✝⁵ : Monoid R
inst✝⁴ : AddMonoid V
inst✝³ : DistribMulAction R V
S : Type u_4
inst✝² : Monoid S
inst✝¹ : DistribMulAction S V
inst✝ : SMulCommClass R S V
r : R
s : S
a : HahnSeries Γ V
⊢ r • s • a = s • r • a
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝⁶ : PartialOrder Γ
V : Type u_3
inst✝⁵ : Monoid R
inst✝⁴ : AddMonoid V
inst✝³ : DistribMulAction R V
S : Type u_4
inst✝² : Monoid S
inst✝¹ : DistribMulAction S V
inst✝ : SMulCommClass R S V
r : R
s : S
a : HahnSeries Γ V
x✝ : Γ
⊢ coeff (r • s • a) x✝ = coeff (s • r • a) x✝
[PROOFSTEP]
simp [smul_comm]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
src✝ : DistribMulAction R (HahnSeries Γ V) := inferInstanceAs (DistribMulAction R (HahnSeries Γ V))
x✝² x✝¹ : R
x✝ : HahnSeries Γ V
⊢ (x✝² + x✝¹) • x✝ = x✝² • x✝ + x✝¹ • x✝
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
src✝ : DistribMulAction R (HahnSeries Γ V) := inferInstanceAs (DistribMulAction R (HahnSeries Γ V))
x✝³ x✝² : R
x✝¹ : HahnSeries Γ V
x✝ : Γ
⊢ coeff ((x✝³ + x✝²) • x✝¹) x✝ = coeff (x✝³ • x✝¹ + x✝² • x✝¹) x✝
[PROOFSTEP]
simp [add_smul]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
src✝ : DistribMulAction R (HahnSeries Γ V) := inferInstanceAs (DistribMulAction R (HahnSeries Γ V))
x✝ : HahnSeries Γ V
⊢ 0 • x✝ = 0
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
src✝ : DistribMulAction R (HahnSeries Γ V) := inferInstanceAs (DistribMulAction R (HahnSeries Γ V))
x✝¹ : HahnSeries Γ V
x✝ : Γ
⊢ coeff (0 • x✝¹) x✝ = coeff 0 x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
a : Γ
src✝ : R →+ HahnSeries Γ R := addMonoidHom a
r s : R
⊢ AddHom.toFun
      { toFun := src✝.toFun,
        map_add' :=
          (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
      (r • s) =
    ↑(RingHom.id R) r •
      AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        s
[PROOFSTEP]
ext b
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
a : Γ
src✝ : R →+ HahnSeries Γ R := addMonoidHom a
r s : R
b : Γ
⊢ coeff
      (AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        (r • s))
      b =
    coeff
      (↑(RingHom.id R) r •
        AddHom.toFun
          { toFun := src✝.toFun,
            map_add' :=
              (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
          s)
      b
[PROOFSTEP]
by_cases h : b = a
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
a : Γ
src✝ : R →+ HahnSeries Γ R := addMonoidHom a
r s : R
b : Γ
h : b = a
⊢ coeff
      (AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        (r • s))
      b =
    coeff
      (↑(RingHom.id R) r •
        AddHom.toFun
          { toFun := src✝.toFun,
            map_add' :=
              (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
          s)
      b
[PROOFSTEP]
simp [h]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝³ : PartialOrder Γ
inst✝² : Semiring R
V : Type u_3
inst✝¹ : AddCommMonoid V
inst✝ : Module R V
a : Γ
src✝ : R →+ HahnSeries Γ R := addMonoidHom a
r s : R
b : Γ
h : ¬b = a
⊢ coeff
      (AddHom.toFun
        { toFun := src✝.toFun,
          map_add' :=
            (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
        (r • s))
      b =
    coeff
      (↑(RingHom.id R) r •
        AddHom.toFun
          { toFun := src✝.toFun,
            map_add' :=
              (_ : ∀ (x y : R), ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }
          s)
      b
[PROOFSTEP]
simp [h]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝⁴ : PartialOrder Γ
inst✝³ : Semiring R
V : Type u_3
inst✝² : AddCommMonoid V
inst✝¹ : Module R V
Γ' : Type u_4
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
r : R
x : HahnSeries Γ R
⊢ embDomain f (r • x) = r • embDomain f x
[PROOFSTEP]
ext g
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝⁴ : PartialOrder Γ
inst✝³ : Semiring R
V : Type u_3
inst✝² : AddCommMonoid V
inst✝¹ : Module R V
Γ' : Type u_4
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
r : R
x : HahnSeries Γ R
g : Γ'
⊢ coeff (embDomain f (r • x)) g = coeff (r • embDomain f x) g
[PROOFSTEP]
by_cases hg : g ∈ Set.range f
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝⁴ : PartialOrder Γ
inst✝³ : Semiring R
V : Type u_3
inst✝² : AddCommMonoid V
inst✝¹ : Module R V
Γ' : Type u_4
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
r : R
x : HahnSeries Γ R
g : Γ'
hg : g ∈ Set.range ↑f
⊢ coeff (embDomain f (r • x)) g = coeff (r • embDomain f x) g
[PROOFSTEP]
obtain ⟨a, rfl⟩ := hg
[GOAL]
case pos.intro
Γ : Type u_1
R : Type u_2
inst✝⁴ : PartialOrder Γ
inst✝³ : Semiring R
V : Type u_3
inst✝² : AddCommMonoid V
inst✝¹ : Module R V
Γ' : Type u_4
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
r : R
x : HahnSeries Γ R
a : Γ
⊢ coeff (embDomain f (r • x)) (↑f a) = coeff (r • embDomain f x) (↑f a)
[PROOFSTEP]
simp
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝⁴ : PartialOrder Γ
inst✝³ : Semiring R
V : Type u_3
inst✝² : AddCommMonoid V
inst✝¹ : Module R V
Γ' : Type u_4
inst✝ : PartialOrder Γ'
f : Γ ↪o Γ'
r : R
x : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ Set.range ↑f
⊢ coeff (embDomain f (r • x)) g = coeff (r • embDomain f x) g
[PROOFSTEP]
simp [embDomain_notin_range hg]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : MulZeroOneClass R
⊢ order 1 = 0
[PROOFSTEP]
cases' subsingleton_or_nontrivial R with h h
[GOAL]
case inl
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : MulZeroOneClass R
h : Subsingleton R
⊢ order 1 = 0
[PROOFSTEP]
haveI := h
[GOAL]
case inr
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : MulZeroOneClass R
h : Nontrivial R
⊢ order 1 = 0
[PROOFSTEP]
haveI := h
[GOAL]
case inl
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : MulZeroOneClass R
h this : Subsingleton R
⊢ order 1 = 0
[PROOFSTEP]
rw [Subsingleton.elim (1 : HahnSeries Γ R) 0, order_zero]
[GOAL]
case inr
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : MulZeroOneClass R
h this : Nontrivial R
⊢ order 1 = 0
[PROOFSTEP]
exact order_single one_ne_zero
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
⊢ {a |
      ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a,
          coeff x ij.fst * coeff y ij.snd ≠
        0} ⊆
    {a | Finset.Nonempty (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a)}
[PROOFSTEP]
intro a ha
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
a : Γ
ha :
  a ∈
    {a |
      ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a,
          coeff x ij.fst * coeff y ij.snd ≠
        0}
⊢ a ∈ {a | Finset.Nonempty (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a)}
[PROOFSTEP]
contrapose! ha
[GOAL]
Γ : 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.fst * coeff y ij.snd ≠
          0}
[PROOFSTEP]
simp [not_nonempty_iff_eq_empty.1 ha]
[GOAL]
Γ : 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.fst * coeff y ij.snd
[PROOFSTEP]
rw [mul_coeff]
[GOAL]
Γ : 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.fst * coeff y ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hs a, coeff x ij.fst * coeff y ij.snd
[PROOFSTEP]
apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_right hys) _ fun _ _ => rfl
[GOAL]
Γ : 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 : Γ × Γ),
    x_1 ∈
        addAntidiagonal (_ : Set.IsPwo (support x)) hs a \
          addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a →
      coeff x x_1.fst * coeff y x_1.snd = 0
[PROOFSTEP]
intro b hb
[GOAL]
Γ : 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.fst * coeff y b.snd = 0
[PROOFSTEP]
simp only [not_and, mem_sdiff, mem_addAntidiagonal, mem_support, not_imp_not] at hb 
[GOAL]
Γ : 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.fst ≠ 0 ∧ b.snd ∈ s ∧ b.fst + b.snd = a) ∧ (coeff x b.fst ≠ 0 → b.fst + b.snd = a → coeff y b.snd = 0)
⊢ coeff x b.fst * coeff y b.snd = 0
[PROOFSTEP]
rw [hb.2 hb.1.1 hb.1.2.2, mul_zero]
[GOAL]
Γ : 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.fst * coeff y ij.snd
[PROOFSTEP]
rw [mul_coeff]
[GOAL]
Γ : 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.fst * coeff y ij.snd =
    ∑ ij in addAntidiagonal hs (_ : Set.IsPwo (support y)) a, coeff x ij.fst * coeff y ij.snd
[PROOFSTEP]
apply sum_subset_zero_on_sdiff (addAntidiagonal_mono_left hxs) _ fun _ _ => rfl
[GOAL]
Γ : 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 : Γ × Γ),
    x_1 ∈
        addAntidiagonal hs (_ : Set.IsPwo (support y)) a \
          addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a →
      coeff x x_1.fst * coeff y x_1.snd = 0
[PROOFSTEP]
intro b hb
[GOAL]
Γ : 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.fst * coeff y b.snd = 0
[PROOFSTEP]
simp only [not_and', mem_sdiff, mem_addAntidiagonal, mem_support, not_ne_iff] at hb 
[GOAL]
Γ : 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.fst ∈ s ∧ coeff y b.snd ≠ 0 ∧ b.fst + b.snd = a) ∧ (coeff y b.snd ≠ 0 ∧ b.fst + b.snd = a → coeff x b.fst = 0)
⊢ coeff x b.fst * coeff y b.snd = 0
[PROOFSTEP]
rw [hb.2 ⟨hb.1.2.1, hb.1.2.2⟩, zero_mul]
[GOAL]
Γ : 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
[PROOFSTEP]
ext a
[GOAL]
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
[PROOFSTEP]
have hwf := y.isPwo_support.union z.isPwo_support
[GOAL]
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
[PROOFSTEP]
rw [mul_coeff_right' hwf, add_coeff, mul_coeff_right' hwf (Set.subset_union_right _ _),
  mul_coeff_right' hwf (Set.subset_union_left _ _)]
[GOAL]
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.fst * coeff (y + z) ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hwf a, coeff x ij.fst * coeff y ij.snd +
      ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) hwf a, coeff x ij.fst * coeff z ij.snd
[PROOFSTEP]
simp only [add_coeff, mul_add, sum_add_distrib]
[GOAL]
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
[PROOFSTEP]
intro b
[GOAL]
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
[PROOFSTEP]
simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
[GOAL]
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
[PROOFSTEP]
contrapose!
[GOAL]
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
[PROOFSTEP]
intro h
[GOAL]
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
[PROOFSTEP]
rw [h.1, h.2, add_zero]
[GOAL]
Γ : 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
[PROOFSTEP]
ext a
[GOAL]
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
[PROOFSTEP]
have hwf := x.isPwo_support.union y.isPwo_support
[GOAL]
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
[PROOFSTEP]
rw [mul_coeff_left' hwf, add_coeff, mul_coeff_left' hwf (Set.subset_union_right _ _),
  mul_coeff_left' hwf (Set.subset_union_left _ _)]
[GOAL]
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.fst * coeff z ij.snd =
    ∑ ij in addAntidiagonal hwf (_ : Set.IsPwo (support z)) a, coeff x ij.fst * coeff z ij.snd +
      ∑ ij in addAntidiagonal hwf (_ : Set.IsPwo (support z)) a, coeff y ij.fst * coeff z ij.snd
[PROOFSTEP]
simp only [add_coeff, add_mul, sum_add_distrib]
[GOAL]
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
[PROOFSTEP]
intro b
[GOAL]
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
[PROOFSTEP]
simp only [add_coeff, Ne.def, Set.mem_union, Set.mem_setOf_eq, mem_support]
[GOAL]
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 : Γ
⊢ ¬coeff x b + coeff y b = 0 → ¬coeff x b = 0 ∨ ¬coeff y b = 0
[PROOFSTEP]
contrapose!
[GOAL]
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 : Γ
⊢ coeff x b = 0 ∧ coeff y b = 0 → coeff x b + coeff y b = 0
[PROOFSTEP]
intro h
[GOAL]
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 : Γ
h : coeff x b = 0 ∧ coeff y b = 0
⊢ coeff x b + coeff y b = 0
[PROOFSTEP]
rw [h.1, h.2, add_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
⊢ coeff (↑(single b) r * x) (a + b) = r * coeff x a
[PROOFSTEP]
by_cases hr : r = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : r = 0
⊢ coeff (↑(single b) r * x) (a + b) = r * coeff x a
[PROOFSTEP]
simp [hr, mul_coeff]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
⊢ coeff (↑(single b) r * x) (a + b) = r * coeff x a
[PROOFSTEP]
simp only [hr, smul_coeff, mul_coeff, support_single_of_ne, Ne.def, not_false_iff, smul_eq_mul]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b),
      coeff (↑(single b) r) x_1.fst * coeff x x_1.snd =
    r * coeff x a
[PROOFSTEP]
by_cases hx : x.coeff a = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b),
      coeff (↑(single b) r) x_1.fst * coeff x x_1.snd =
    r * coeff x a
[PROOFSTEP]
simp only [hx, mul_zero]
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b),
      coeff (↑(single b) r) x_1.fst * coeff x x_1.snd =
    0
[PROOFSTEP]
rw [sum_congr _ fun _ _ => rfl, sum_empty]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
⊢ addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b) = ∅
[PROOFSTEP]
ext ⟨a1, a2⟩
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
⊢ (a1, a2) ∈ addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b) ↔ (a1, a2) ∈ ∅
[PROOFSTEP]
simp only [not_mem_empty, not_and, Set.mem_singleton_iff, Classical.not_not, mem_addAntidiagonal, Set.mem_setOf_eq,
  iff_false_iff]
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
⊢ a1 = b → a2 ∈ support x → ¬a1 + a2 = a + b
[PROOFSTEP]
rintro rfl h2 h1
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
h2 : a2 ∈ support x
h1 : a1 + a2 = a + a1
⊢ False
[PROOFSTEP]
rw [add_comm] at h1 
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
h2 : a2 ∈ support x
h1 : a2 + a1 = a + a1
⊢ False
[PROOFSTEP]
rw [← add_right_cancel h1] at hx 
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
a1 a2 : Γ
hx : coeff x a2 = 0
h2 : a2 ∈ support x
h1 : a2 + a1 = a + a1
⊢ False
[PROOFSTEP]
exact h2 hx
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b),
      coeff (↑(single b) r) x_1.fst * coeff x x_1.snd =
    r * coeff x a
[PROOFSTEP]
trans ∑ ij : Γ × Γ in {(b, a)}, (single b r).coeff ij.fst * x.coeff ij.snd
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b),
      coeff (↑(single b) r) x_1.fst * coeff x x_1.snd =
    ∑ ij in {(b, a)}, coeff (↑(single b) r) ij.fst * coeff x ij.snd
[PROOFSTEP]
apply sum_congr _ fun _ _ => rfl
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b) = {(b, a)}
[PROOFSTEP]
ext ⟨a1, a2⟩
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ (a1, a2) ∈ addAntidiagonal (_ : Set.IsPwo {b}) (_ : Set.IsPwo (support x)) (a + b) ↔ (a1, a2) ∈ {(b, a)}
[PROOFSTEP]
simp only [Set.mem_singleton_iff, Prod.mk.inj_iff, mem_addAntidiagonal, mem_singleton, Set.mem_setOf_eq]
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ a1 = b ∧ a2 ∈ support x ∧ a1 + a2 = a + b ↔ a1 = b ∧ a2 = a
[PROOFSTEP]
constructor
[GOAL]
case a.mk.mp
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ a1 = b ∧ a2 ∈ support x ∧ a1 + a2 = a + b → a1 = b ∧ a2 = a
[PROOFSTEP]
rintro ⟨rfl, _, h1⟩
[GOAL]
case a.mk.mp.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
left✝ : a2 ∈ support x
h1 : a1 + a2 = a + a1
⊢ a1 = a1 ∧ a2 = a
[PROOFSTEP]
rw [add_comm] at h1 
[GOAL]
case a.mk.mp.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
left✝ : a2 ∈ support x
h1 : a2 + a1 = a + a1
⊢ a1 = a1 ∧ a2 = a
[PROOFSTEP]
refine' ⟨rfl, add_right_cancel h1⟩
[GOAL]
case a.mk.mpr
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ a1 = b ∧ a2 = a → a1 = b ∧ a2 ∈ support x ∧ a1 + a2 = a + b
[PROOFSTEP]
rintro ⟨rfl, rfl⟩
[GOAL]
case a.mk.mpr.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
hr : ¬r = 0
a1 a2 : Γ
hx : ¬coeff x a2 = 0
⊢ a1 = a1 ∧ a2 ∈ support x ∧ a1 + a2 = a2 + a1
[PROOFSTEP]
exact ⟨rfl, by simp [hx], add_comm _ _⟩
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
hr : ¬r = 0
a1 a2 : Γ
hx : ¬coeff x a2 = 0
⊢ a2 ∈ support x
[PROOFSTEP]
simp [hx]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ ∑ ij in {(b, a)}, coeff (↑(single b) r) ij.fst * coeff x ij.snd = r * coeff x a
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
⊢ coeff (x * ↑(single b) r) (a + b) = coeff x a * r
[PROOFSTEP]
by_cases hr : r = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : r = 0
⊢ coeff (x * ↑(single b) r) (a + b) = coeff x a * r
[PROOFSTEP]
simp [hr, mul_coeff]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
⊢ coeff (x * ↑(single b) r) (a + b) = coeff x a * r
[PROOFSTEP]
simp only [hr, smul_coeff, mul_coeff, support_single_of_ne, Ne.def, not_false_iff, smul_eq_mul]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b),
      coeff x x_1.fst * coeff (↑(single b) r) x_1.snd =
    coeff x a * r
[PROOFSTEP]
by_cases hx : x.coeff a = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b),
      coeff x x_1.fst * coeff (↑(single b) r) x_1.snd =
    coeff x a * r
[PROOFSTEP]
simp only [hx, zero_mul]
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b),
      coeff x x_1.fst * coeff (↑(single b) r) x_1.snd =
    0
[PROOFSTEP]
rw [sum_congr _ fun _ _ => rfl, sum_empty]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
⊢ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b) = ∅
[PROOFSTEP]
ext ⟨a1, a2⟩
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
⊢ (a1, a2) ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b) ↔ (a1, a2) ∈ ∅
[PROOFSTEP]
simp only [not_mem_empty, not_and, Set.mem_singleton_iff, Classical.not_not, mem_addAntidiagonal, Set.mem_setOf_eq,
  iff_false_iff]
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
⊢ a1 ∈ support x → a2 = b → ¬a1 + a2 = a + b
[PROOFSTEP]
rintro h2 rfl h1
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
hx : coeff x a = 0
a1 a2 : Γ
h2 : a1 ∈ support x
h1 : a1 + a2 = a + a2
⊢ False
[PROOFSTEP]
rw [← add_right_cancel h1] at hx 
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
a1 : Γ
hx : coeff x a1 = 0
a2 : Γ
h2 : a1 ∈ support x
h1 : a1 + a2 = a + a2
⊢ False
[PROOFSTEP]
exact h2 hx
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b),
      coeff x x_1.fst * coeff (↑(single b) r) x_1.snd =
    coeff x a * r
[PROOFSTEP]
trans ∑ ij : Γ × Γ in {(a, b)}, x.coeff ij.fst * (single b r).coeff ij.snd
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b),
      coeff x x_1.fst * coeff (↑(single b) r) x_1.snd =
    ∑ ij in {(a, b)}, coeff x ij.fst * coeff (↑(single b) r) ij.snd
[PROOFSTEP]
apply sum_congr _ fun _ _ => rfl
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b) = {(a, b)}
[PROOFSTEP]
ext ⟨a1, a2⟩
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ (a1, a2) ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo {b}) (a + b) ↔ (a1, a2) ∈ {(a, b)}
[PROOFSTEP]
simp only [Set.mem_singleton_iff, Prod.mk.inj_iff, mem_addAntidiagonal, mem_singleton, Set.mem_setOf_eq]
[GOAL]
case a.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ a1 ∈ support x ∧ a2 = b ∧ a1 + a2 = a + b ↔ a1 = a ∧ a2 = b
[PROOFSTEP]
constructor
[GOAL]
case a.mk.mp
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ a1 ∈ support x ∧ a2 = b ∧ a1 + a2 = a + b → a1 = a ∧ a2 = b
[PROOFSTEP]
rintro ⟨_, rfl, h1⟩
[GOAL]
case a.mk.mp.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
left✝ : a1 ∈ support x
h1 : a1 + a2 = a + a2
⊢ a1 = a ∧ a2 = a2
[PROOFSTEP]
refine' ⟨add_right_cancel h1, rfl⟩
[GOAL]
case a.mk.mpr
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
a1 a2 : Γ
⊢ a1 = a ∧ a2 = b → a1 ∈ support x ∧ a2 = b ∧ a1 + a2 = a + b
[PROOFSTEP]
rintro ⟨rfl, rfl⟩
[GOAL]
case a.mk.mpr.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
hr : ¬r = 0
a1 a2 : Γ
hx : ¬coeff x a1 = 0
⊢ a1 ∈ support x ∧ a2 = a2 ∧ a1 + a2 = a1 + a2
[PROOFSTEP]
simp [hx]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a b : Γ
hr : ¬r = 0
hx : ¬coeff x a = 0
⊢ ∑ ij in {(a, b)}, coeff x ij.fst * coeff (↑(single b) r) ij.snd = coeff x a * r
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
⊢ coeff (x * ↑(single 0) r) a = coeff x a * r
[PROOFSTEP]
rw [← add_zero a, mul_single_coeff_add, add_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
r : R
x : HahnSeries Γ R
a : Γ
⊢ coeff (↑(single 0) r * x) a = r * coeff x a
[PROOFSTEP]
rw [← add_zero a, single_mul_coeff_add, add_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
r : R
x : HahnSeries Γ R
⊢ ↑(single 0) r * x = r • x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : Semiring R
r : R
x : HahnSeries Γ R
x✝ : Γ
⊢ coeff (↑(single 0) r * x) x✝ = coeff (r • x) x✝
[PROOFSTEP]
exact single_zero_mul_coeff
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
⊢ support (x * y) ⊆ support x + support y
[PROOFSTEP]
apply Set.Subset.trans (fun x hx => _) support_addAntidiagonal_subset_add
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
⊢ Set.IsPwo (support x)
[PROOFSTEP]
exact x.isPwo_support
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
⊢ Set.IsPwo (support y)
[PROOFSTEP]
exact y.isPwo_support
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
⊢ ∀ (x_1 : Γ),
    x_1 ∈ support (x * y) →
      x_1 ∈ {a | Finset.Nonempty (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a)}
[PROOFSTEP]
intro x hx
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x✝ y : HahnSeries Γ R
x : Γ
hx : x ∈ support (x✝ * y)
⊢ x ∈ {a | Finset.Nonempty (addAntidiagonal (_ : Set.IsPwo (support x✝)) (_ : Set.IsPwo (support y)) a)}
[PROOFSTEP]
contrapose! hx
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x✝ y : HahnSeries Γ R
x : Γ
hx : ¬x ∈ {a | Finset.Nonempty (addAntidiagonal (_ : Set.IsPwo (support x✝)) (_ : Set.IsPwo (support y)) a)}
⊢ ¬x ∈ support (x✝ * y)
[PROOFSTEP]
simp only [not_nonempty_iff_eq_empty, Ne.def, Set.mem_setOf_eq] at hx 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x✝ y : HahnSeries Γ R
x : Γ
hx : addAntidiagonal (_ : Set.IsPwo (support x✝)) (_ : Set.IsPwo (support y)) x = ∅
⊢ ¬x ∈ support (x✝ * y)
[PROOFSTEP]
simp [hx, mul_coeff]
[GOAL]
Γ✝ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝¹ : LinearOrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
⊢ coeff (x * y) (order x + order y) = coeff x (order x) * coeff y (order y)
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
Γ✝ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝¹ : LinearOrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
hx : x = 0
⊢ coeff (x * y) (order x + order y) = coeff x (order x) * coeff y (order y)
[PROOFSTEP]
simp [hx, mul_coeff]
[GOAL]
case neg
Γ✝ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝¹ : LinearOrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
hx : ¬x = 0
⊢ coeff (x * y) (order x + order y) = coeff x (order x) * coeff y (order y)
[PROOFSTEP]
by_cases hy : y = 0
[GOAL]
case pos
Γ✝ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝¹ : LinearOrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : y = 0
⊢ coeff (x * y) (order x + order y) = coeff x (order x) * coeff y (order y)
[PROOFSTEP]
simp [hy, mul_coeff]
[GOAL]
case neg
Γ✝ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ✝
Γ : Type u_3
inst✝¹ : LinearOrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
⊢ coeff (x * y) (order x + order y) = coeff x (order x) * coeff y (order y)
[PROOFSTEP]
rw [order_of_ne hx, order_of_ne hy, mul_coeff, Finset.addAntidiagonal_min_add_min, Finset.sum_singleton]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
⊢ x * y * z = x * (y * z)
[PROOFSTEP]
ext b
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ coeff (x * y * z) b = coeff (x * (y * z)) b
[PROOFSTEP]
rw [mul_coeff_left' (x.isPwo_support.add y.isPwo_support) support_mul_subset_add_support,
  mul_coeff_right' (y.isPwo_support.add z.isPwo_support) support_mul_subset_add_support]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b,
      coeff (x * y) ij.fst * coeff z ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y + support z)) b,
      coeff x ij.fst * coeff (y * z) ij.snd
[PROOFSTEP]
simp only [mul_coeff, add_coeff, sum_mul, mul_sum, sum_sigma']
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ ∑ x_1 in
      Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
        addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst,
      coeff x x_1.snd.fst * coeff y x_1.snd.snd * coeff z x_1.fst.snd =
    ∑ x_1 in
      Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y + support z)) b) fun a =>
        addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support z)) a.snd,
      coeff x x_1.fst.fst * (coeff y x_1.snd.fst * coeff z x_1.snd.snd)
[PROOFSTEP]
refine' sum_bij_ne_zero (fun a _ _ => ⟨⟨a.2.1, a.2.2 + a.1.2⟩, ⟨a.2.2, a.1.2⟩⟩) _ _ _ _
[GOAL]
case coeff.h.refine'_1
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ ∀ (a : (_ : Γ × Γ) × Γ × Γ)
    (h₁ :
      a ∈
        Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
          addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst)
    (h₂ : coeff x a.snd.fst * coeff y a.snd.snd * coeff z a.fst.snd ≠ 0),
    (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a h₁ h₂ ∈
      Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y + support z)) b) fun a =>
        addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support z)) a.snd
[PROOFSTEP]
rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ H1 H2
[GOAL]
case coeff.h.refine'_1.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i j k l : Γ
H1 :
  { fst := (i, j), snd := (k, l) } ∈
    Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
      addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst
H2 :
  coeff x { fst := (i, j), snd := (k, l) }.snd.fst * coeff y { fst := (i, j), snd := (k, l) }.snd.snd *
      coeff z { fst := (i, j), snd := (k, l) }.fst.snd ≠
    0
⊢ (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) })
      { fst := (i, j), snd := (k, l) } H1 H2 ∈
    Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y + support z)) b) fun a =>
      addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support z)) a.snd
[PROOFSTEP]
simp only [and_true_iff, Set.image2_add, eq_self_iff_true, mem_addAntidiagonal, Ne.def, Set.image_prod, mem_sigma,
  Set.mem_setOf_eq] at H1 H2 ⊢
[GOAL]
case coeff.h.refine'_1.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i j k l : Γ
H2 : ¬coeff x k * coeff y l * coeff z j = 0
H1 : (i ∈ support x + support y ∧ j ∈ support z ∧ i + j = b) ∧ k ∈ support x ∧ l ∈ support y ∧ k + l = i
⊢ (k ∈ support x ∧ l + j ∈ support y + support z ∧ k + (l + j) = b) ∧ l ∈ support y ∧ j ∈ support z
[PROOFSTEP]
obtain ⟨⟨H3, nz, rfl⟩, nx, ny, rfl⟩ := H1
[GOAL]
case coeff.h.refine'_1.mk.mk.mk.intro.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
j k l : Γ
H2 : ¬coeff x k * coeff y l * coeff z j = 0
nz : j ∈ support z
nx : k ∈ support x
ny : l ∈ support y
H3 : k + l ∈ support x + support y
⊢ (k ∈ support x ∧ l + j ∈ support y + support z ∧ k + (l + j) = k + l + j) ∧ l ∈ support y ∧ j ∈ support z
[PROOFSTEP]
exact ⟨⟨nx, Set.add_mem_add ny nz, (add_assoc _ _ _).symm⟩, ny, nz⟩
[GOAL]
case coeff.h.refine'_2
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ ∀ (a₁ a₂ : (_ : Γ × Γ) × Γ × Γ)
    (h₁₁ :
      a₁ ∈
        Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
          addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst)
    (h₁₂ : coeff x a₁.snd.fst * coeff y a₁.snd.snd * coeff z a₁.fst.snd ≠ 0)
    (h₂₁ :
      a₂ ∈
        Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
          addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst)
    (h₂₂ : coeff x a₂.snd.fst * coeff y a₂.snd.snd * coeff z a₂.fst.snd ≠ 0),
    (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a₁ h₁₁ h₁₂ =
        (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a₂ h₂₁ h₂₂ →
      a₁ = a₂
[PROOFSTEP]
rintro ⟨⟨i1, j1⟩, k1, l1⟩ ⟨⟨i2, j2⟩, k2, l2⟩ H1 H2 H3 H4 H5
[GOAL]
case coeff.h.refine'_2.mk.mk.mk.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i1 j1 k1 l1 i2 j2 k2 l2 : Γ
H1 :
  { fst := (i1, j1), snd := (k1, l1) } ∈
    Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
      addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst
H2 :
  coeff x { fst := (i1, j1), snd := (k1, l1) }.snd.fst * coeff y { fst := (i1, j1), snd := (k1, l1) }.snd.snd *
      coeff z { fst := (i1, j1), snd := (k1, l1) }.fst.snd ≠
    0
H3 :
  { fst := (i2, j2), snd := (k2, l2) } ∈
    Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
      addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst
H4 :
  coeff x { fst := (i2, j2), snd := (k2, l2) }.snd.fst * coeff y { fst := (i2, j2), snd := (k2, l2) }.snd.snd *
      coeff z { fst := (i2, j2), snd := (k2, l2) }.fst.snd ≠
    0
H5 :
  (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) })
      { fst := (i1, j1), snd := (k1, l1) } H1 H2 =
    (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) })
      { fst := (i2, j2), snd := (k2, l2) } H3 H4
⊢ { fst := (i1, j1), snd := (k1, l1) } = { fst := (i2, j2), snd := (k2, l2) }
[PROOFSTEP]
simp only [Set.image2_add, Prod.mk.inj_iff, mem_addAntidiagonal, Ne.def, Set.image_prod, mem_sigma, Set.mem_setOf_eq,
  heq_iff_eq] at H1 H3 H5 
[GOAL]
case coeff.h.refine'_2.mk.mk.mk.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i1 j1 k1 l1 i2 j2 k2 l2 : Γ
H2 :
  coeff x { fst := (i1, j1), snd := (k1, l1) }.snd.fst * coeff y { fst := (i1, j1), snd := (k1, l1) }.snd.snd *
      coeff z { fst := (i1, j1), snd := (k1, l1) }.fst.snd ≠
    0
H4 :
  coeff x { fst := (i2, j2), snd := (k2, l2) }.snd.fst * coeff y { fst := (i2, j2), snd := (k2, l2) }.snd.snd *
      coeff z { fst := (i2, j2), snd := (k2, l2) }.fst.snd ≠
    0
H5 : { fst := (k1, l1 + j1), snd := (l1, j1) } = { fst := (k2, l2 + j2), snd := (l2, j2) }
H1 : (i1 ∈ support x + support y ∧ j1 ∈ support z ∧ i1 + j1 = b) ∧ k1 ∈ support x ∧ l1 ∈ support y ∧ k1 + l1 = i1
H3 : (i2 ∈ support x + support y ∧ j2 ∈ support z ∧ i2 + j2 = b) ∧ k2 ∈ support x ∧ l2 ∈ support y ∧ k2 + l2 = i2
⊢ { fst := (i1, j1), snd := (k1, l1) } = { fst := (i2, j2), snd := (k2, l2) }
[PROOFSTEP]
obtain (⟨⟨rfl, _⟩, rfl, rfl⟩ : (k1 = k2 ∧ l1 + j1 = l2 + j2) ∧ l1 = l2 ∧ j1 = j2) := by simpa using H5
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i1 j1 k1 l1 i2 j2 k2 l2 : Γ
H2 :
  coeff x { fst := (i1, j1), snd := (k1, l1) }.snd.fst * coeff y { fst := (i1, j1), snd := (k1, l1) }.snd.snd *
      coeff z { fst := (i1, j1), snd := (k1, l1) }.fst.snd ≠
    0
H4 :
  coeff x { fst := (i2, j2), snd := (k2, l2) }.snd.fst * coeff y { fst := (i2, j2), snd := (k2, l2) }.snd.snd *
      coeff z { fst := (i2, j2), snd := (k2, l2) }.fst.snd ≠
    0
H5 : { fst := (k1, l1 + j1), snd := (l1, j1) } = { fst := (k2, l2 + j2), snd := (l2, j2) }
H1 : (i1 ∈ support x + support y ∧ j1 ∈ support z ∧ i1 + j1 = b) ∧ k1 ∈ support x ∧ l1 ∈ support y ∧ k1 + l1 = i1
H3 : (i2 ∈ support x + support y ∧ j2 ∈ support z ∧ i2 + j2 = b) ∧ k2 ∈ support x ∧ l2 ∈ support y ∧ k2 + l2 = i2
⊢ (k1 = k2 ∧ l1 + j1 = l2 + j2) ∧ l1 = l2 ∧ j1 = j2
[PROOFSTEP]
simpa using H5
[GOAL]
case coeff.h.refine'_2.mk.mk.mk.mk.mk.mk.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i1 j1 k1 l1 i2 : Γ
H2 :
  coeff x { fst := (i1, j1), snd := (k1, l1) }.snd.fst * coeff y { fst := (i1, j1), snd := (k1, l1) }.snd.snd *
      coeff z { fst := (i1, j1), snd := (k1, l1) }.fst.snd ≠
    0
H1 : (i1 ∈ support x + support y ∧ j1 ∈ support z ∧ i1 + j1 = b) ∧ k1 ∈ support x ∧ l1 ∈ support y ∧ k1 + l1 = i1
right✝ : l1 + j1 = l1 + j1
H4 :
  coeff x { fst := (i2, j1), snd := (k1, l1) }.snd.fst * coeff y { fst := (i2, j1), snd := (k1, l1) }.snd.snd *
      coeff z { fst := (i2, j1), snd := (k1, l1) }.fst.snd ≠
    0
H5 : { fst := (k1, l1 + j1), snd := (l1, j1) } = { fst := (k1, l1 + j1), snd := (l1, j1) }
H3 : (i2 ∈ support x + support y ∧ j1 ∈ support z ∧ i2 + j1 = b) ∧ k1 ∈ support x ∧ l1 ∈ support y ∧ k1 + l1 = i2
⊢ { fst := (i1, j1), snd := (k1, l1) } = { fst := (i2, j1), snd := (k1, l1) }
[PROOFSTEP]
simp only [and_true_iff, Prod.mk.inj_iff, eq_self_iff_true, heq_iff_eq, ← H1.2.2.2, ← H3.2.2.2]
[GOAL]
case coeff.h.refine'_3
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ ∀ (b_1 : (_ : Γ × Γ) × Γ × Γ),
    (b_1 ∈
        Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y + support z)) b) fun a =>
          addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support z)) a.snd) →
      coeff x b_1.fst.fst * (coeff y b_1.snd.fst * coeff z b_1.snd.snd) ≠ 0 →
        ∃ a h₁ h₂,
          b_1 = (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a h₁ h₂
[PROOFSTEP]
rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ H1 H2
[GOAL]
case coeff.h.refine'_3.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i j k l : Γ
H1 :
  { fst := (i, j), snd := (k, l) } ∈
    Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y + support z)) b) fun a =>
      addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support z)) a.snd
H2 :
  coeff x { fst := (i, j), snd := (k, l) }.fst.fst *
      (coeff y { fst := (i, j), snd := (k, l) }.snd.fst * coeff z { fst := (i, j), snd := (k, l) }.snd.snd) ≠
    0
⊢ ∃ a h₁ h₂,
    { fst := (i, j), snd := (k, l) } =
      (fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a h₁ h₂
[PROOFSTEP]
simp only [exists_prop, Set.image2_add, Prod.mk.inj_iff, mem_addAntidiagonal, Sigma.exists, Ne.def, Set.image_prod,
  mem_sigma, Set.mem_setOf_eq, heq_iff_eq, Prod.exists] at H1 H2 ⊢
[GOAL]
case coeff.h.refine'_3.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i j k l : Γ
H2 : ¬coeff x i * (coeff y k * coeff z l) = 0
H1 : (i ∈ support x ∧ j ∈ support y + support z ∧ i + j = b) ∧ k ∈ support y ∧ l ∈ support z ∧ k + l = j
⊢ ∃ a b_1 a_1 b_2,
    ((a ∈ support x + support y ∧ b_1 ∈ support z ∧ a + b_1 = b) ∧ a_1 ∈ support x ∧ b_2 ∈ support y ∧ a_1 + b_2 = a) ∧
      ¬coeff x a_1 * coeff y b_2 * coeff z b_1 = 0 ∧
        { fst := (i, j), snd := (k, l) } = { fst := (a_1, b_2 + b_1), snd := (b_2, b_1) }
[PROOFSTEP]
obtain ⟨⟨nx, H, rfl⟩, ny, nz, rfl⟩ := H1
[GOAL]
case coeff.h.refine'_3.mk.mk.mk.intro.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
i k l : Γ
H2 : ¬coeff x i * (coeff y k * coeff z l) = 0
nx : i ∈ support x
ny : k ∈ support y
nz : l ∈ support z
H : k + l ∈ support y + support z
⊢ ∃ a b a_1 b_1,
    ((a ∈ support x + support y ∧ b ∈ support z ∧ a + b = i + (k + l)) ∧
        a_1 ∈ support x ∧ b_1 ∈ support y ∧ a_1 + b_1 = a) ∧
      ¬coeff x a_1 * coeff y b_1 * coeff z b = 0 ∧
        { fst := (i, k + l), snd := (k, l) } = { fst := (a_1, b_1 + b), snd := (b_1, b) }
[PROOFSTEP]
exact
  ⟨i + k, l, i, k, ⟨⟨Set.add_mem_add nx ny, nz, add_assoc _ _ _⟩, nx, ny, rfl⟩, fun h => H2 <| by rw [← h, mul_assoc],
    rfl⟩
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
i k l : Γ
H2 : ¬coeff x i * (coeff y k * coeff z l) = 0
nx : i ∈ support x
ny : k ∈ support y
nz : l ∈ support z
H : k + l ∈ support y + support z
h : coeff x i * coeff y k * coeff z l = 0
⊢ coeff x i * (coeff y k * coeff z l) = 0
[PROOFSTEP]
rw [← h, mul_assoc]
[GOAL]
case coeff.h.refine'_4
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b : Γ
⊢ ∀ (a : (_ : Γ × Γ) × Γ × Γ)
    (h₁ :
      a ∈
        Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
          addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst)
    (h₂ : coeff x a.snd.fst * coeff y a.snd.snd * coeff z a.fst.snd ≠ 0),
    coeff x a.snd.fst * coeff y a.snd.snd * coeff z a.fst.snd =
      coeff x
          ((fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a h₁
                h₂).fst.fst *
        (coeff y
            ((fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a h₁
                  h₂).snd.fst *
          coeff z
            ((fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }) a h₁
                  h₂).snd.snd)
[PROOFSTEP]
rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩ _ _
[GOAL]
case coeff.h.refine'_4.mk.mk.mk
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalSemiring R
x y z : HahnSeries Γ R
b i j k l : Γ
h₁✝ :
  { fst := (i, j), snd := (k, l) } ∈
    Finset.sigma (addAntidiagonal (_ : Set.IsPwo (support x + support y)) (_ : Set.IsPwo (support z)) b) fun a =>
      addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) a.fst
h₂✝ :
  coeff x { fst := (i, j), snd := (k, l) }.snd.fst * coeff y { fst := (i, j), snd := (k, l) }.snd.snd *
      coeff z { fst := (i, j), snd := (k, l) }.fst.snd ≠
    0
⊢ coeff x { fst := (i, j), snd := (k, l) }.snd.fst * coeff y { fst := (i, j), snd := (k, l) }.snd.snd *
      coeff z { fst := (i, j), snd := (k, l) }.fst.snd =
    coeff x
        ((fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) })
              { fst := (i, j), snd := (k, l) } h₁✝ h₂✝).fst.fst *
      (coeff y
          ((fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) })
                { fst := (i, j), snd := (k, l) } h₁✝ h₂✝).snd.fst *
        coeff z
          ((fun a x_1 x => { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) })
                { fst := (i, j), snd := (k, l) } h₁✝ h₂✝).snd.snd)
[PROOFSTEP]
simp [mul_assoc]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : AddCommMonoid (HahnSeries Γ R) := inferInstanceAs (AddCommMonoid (HahnSeries Γ R))
src✝ : Distrib (HahnSeries Γ R) := inferInstanceAs (Distrib (HahnSeries Γ R))
x✝ : HahnSeries Γ R
⊢ 0 * x✝ = 0
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : AddCommMonoid (HahnSeries Γ R) := inferInstanceAs (AddCommMonoid (HahnSeries Γ R))
src✝ : Distrib (HahnSeries Γ R) := inferInstanceAs (Distrib (HahnSeries Γ R))
x✝¹ : HahnSeries Γ R
x✝ : Γ
⊢ coeff (0 * x✝¹) x✝ = coeff 0 x✝
[PROOFSTEP]
simp [mul_coeff]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : AddCommMonoid (HahnSeries Γ R) := inferInstanceAs (AddCommMonoid (HahnSeries Γ R))
src✝ : Distrib (HahnSeries Γ R) := inferInstanceAs (Distrib (HahnSeries Γ R))
x✝ : HahnSeries Γ R
⊢ x✝ * 0 = 0
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonUnitalNonAssocSemiring R
src✝¹ : AddCommMonoid (HahnSeries Γ R) := inferInstanceAs (AddCommMonoid (HahnSeries Γ R))
src✝ : Distrib (HahnSeries Γ R) := inferInstanceAs (Distrib (HahnSeries Γ R))
x✝¹ : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x✝¹ * 0) x✝ = coeff 0 x✝
[PROOFSTEP]
simp [mul_coeff]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
src✝¹ : AddMonoidWithOne (HahnSeries Γ R) := AddMonoidWithOne.unary
src✝ : NonUnitalNonAssocSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalNonAssocSemiring (HahnSeries Γ R))
x : HahnSeries Γ R
⊢ 1 * x = x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
src✝¹ : AddMonoidWithOne (HahnSeries Γ R) := AddMonoidWithOne.unary
src✝ : NonUnitalNonAssocSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalNonAssocSemiring (HahnSeries Γ R))
x : HahnSeries Γ R
x✝ : Γ
⊢ coeff (1 * x) x✝ = coeff x x✝
[PROOFSTEP]
exact single_zero_mul_coeff.trans (one_mul _)
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
src✝¹ : AddMonoidWithOne (HahnSeries Γ R) := AddMonoidWithOne.unary
src✝ : NonUnitalNonAssocSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalNonAssocSemiring (HahnSeries Γ R))
x : HahnSeries Γ R
⊢ x * 1 = x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
src✝¹ : AddMonoidWithOne (HahnSeries Γ R) := AddMonoidWithOne.unary
src✝ : NonUnitalNonAssocSemiring (HahnSeries Γ R) := inferInstanceAs (NonUnitalNonAssocSemiring (HahnSeries Γ R))
x : HahnSeries Γ R
x✝ : Γ
⊢ coeff (x * 1) x✝ = coeff x x✝
[PROOFSTEP]
exact mul_single_zero_coeff.trans (mul_one _)
[GOAL]
Γ : 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 * y = y * x
[PROOFSTEP]
ext
[GOAL]
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✝
[PROOFSTEP]
simp_rw [mul_coeff, mul_comm]
[GOAL]
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.fst * coeff y ij.snd =
    ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support y)) (_ : Set.IsPwo (support x)) x✝,
      coeff x x_1.snd * coeff y x_1.fst
[PROOFSTEP]
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⟩
[GOAL]
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✝
[PROOFSTEP]
rwa [swap_mem_addAntidiagonal]
[GOAL]
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✝
[PROOFSTEP]
rwa [swap_mem_addAntidiagonal]
[GOAL]
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x * y = 0
⊢ x = 0 ∨ y = 0
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x * y = 0
hx : x = 0
⊢ x = 0 ∨ y = 0
[PROOFSTEP]
left
[GOAL]
case pos.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x * y = 0
hx : x = 0
⊢ x = 0
[PROOFSTEP]
exact hx
[GOAL]
case neg
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x * y = 0
hx : ¬x = 0
⊢ x = 0 ∨ y = 0
[PROOFSTEP]
right
[GOAL]
case neg.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
xy : x * y = 0
hx : ¬x = 0
⊢ y = 0
[PROOFSTEP]
contrapose! xy
[GOAL]
case neg.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : ¬x = 0
xy : y ≠ 0
⊢ x * y ≠ 0
[PROOFSTEP]
rw [Ne, HahnSeries.ext_iff, Function.funext_iff, not_forall]
[GOAL]
case neg.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : ¬x = 0
xy : y ≠ 0
⊢ ∃ x_1, ¬coeff (x * y) x_1 = coeff 0 x_1
[PROOFSTEP]
refine' ⟨x.order + y.order, _⟩
[GOAL]
case neg.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : ¬x = 0
xy : y ≠ 0
⊢ ¬coeff (x * y) (order x + order y) = coeff 0 (order x + order y)
[PROOFSTEP]
rw [mul_coeff_order_add_order x y, zero_coeff, mul_eq_zero]
[GOAL]
case neg.h
Γ✝ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ✝
Γ : Type ?u.1364118
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : NonUnitalNonAssocSemiring R
inst✝ : NoZeroDivisors R
x y : HahnSeries Γ R
hx : ¬x = 0
xy : y ≠ 0
⊢ ¬(coeff x (order x) = 0 ∨ coeff y (order y) = 0)
[PROOFSTEP]
simp [coeff_order_ne_zero, hx, xy]
[GOAL]
Γ✝ : 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
[PROOFSTEP]
apply le_antisymm
[GOAL]
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
[PROOFSTEP]
apply order_le_of_coeff_ne_zero
[GOAL]
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
[PROOFSTEP]
rw [mul_coeff_order_add_order x y]
[GOAL]
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
[PROOFSTEP]
exact mul_ne_zero (coeff_order_ne_zero hx) (coeff_order_ne_zero hy)
[GOAL]
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)
[PROOFSTEP]
rw [order_of_ne hx, order_of_ne hy, order_of_ne (mul_ne_zero hx hy), ← Set.IsWf.min_add]
[GOAL]
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)))
[PROOFSTEP]
exact Set.IsWf.min_le_min_of_subset support_mul_subset_add_support
[GOAL]
Γ✝ : 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
[PROOFSTEP]
induction' n with h IH
[GOAL]
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
[PROOFSTEP]
simp
[GOAL]
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
[PROOFSTEP]
rcases eq_or_ne x 0 with (rfl | hx)
[GOAL]
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
[PROOFSTEP]
simp
[GOAL]
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
[PROOFSTEP]
rw [pow_succ', order_mul (pow_ne_zero _ hx) hx, succ_nsmul', IH]
[GOAL]
Γ : 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)
[PROOFSTEP]
ext x
[GOAL]
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
[PROOFSTEP]
by_cases h : x = a + b
[GOAL]
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
[PROOFSTEP]
rw [h, mul_single_coeff_add]
[GOAL]
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)
[PROOFSTEP]
simp
[GOAL]
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
[PROOFSTEP]
rw [single_coeff_of_ne h, mul_coeff, sum_eq_zero]
[GOAL]
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 ∈ addAntidiagonal (_ : Set.IsPwo (support (↑(single a) r))) (_ : Set.IsPwo (support (↑(single b) s))) x →
      coeff (↑(single a) r) x_1.fst * coeff (↑(single b) s) x_1.snd = 0
[PROOFSTEP]
simp_rw [mem_addAntidiagonal]
[GOAL]
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.fst ∈ support (↑(single a) r) ∧ x_1.snd ∈ support (↑(single b) s) ∧ x_1.fst + x_1.snd = x →
      coeff (↑(single a) r) x_1.fst * coeff (↑(single b) s) x_1.snd = 0
[PROOFSTEP]
rintro ⟨y, z⟩ ⟨hy, hz, rfl⟩
[GOAL]
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).fst ∈ support (↑(single a) r)
hz : (y, z).snd ∈ support (↑(single b) s)
h : ¬(y, z).fst + (y, z).snd = a + b
⊢ coeff (↑(single a) r) (y, z).fst * coeff (↑(single b) s) (y, z).snd = 0
[PROOFSTEP]
rw [eq_of_mem_support_single hy, eq_of_mem_support_single hz] at h 
[GOAL]
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).fst ∈ support (↑(single a) r)
hz : (y, z).snd ∈ support (↑(single b) s)
h : ¬a + b = a + b
⊢ coeff (↑(single a) r) (y, z).fst * coeff (↑(single b) s) (y, z).snd = 0
[PROOFSTEP]
exact (h rfl).elim
[GOAL]
Γ : 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
[PROOFSTEP]
rw [single_mul_single, zero_add]
[GOAL]
Γ : 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
[PROOFSTEP]
ext a
[GOAL]
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
[PROOFSTEP]
by_cases h : a = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
x y : R
a : Γ
h : a = 0
⊢ 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
[PROOFSTEP]
simp [h]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
x y : R
a : Γ
h : ¬a = 0
⊢ 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
[PROOFSTEP]
simp [h]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
⊢ Injective ↑C
[PROOFSTEP]
intro r s rs
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r s : R
rs : ↑C r = ↑C s
⊢ r = s
[PROOFSTEP]
rw [HahnSeries.ext_iff, Function.funext_iff] at rs 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r s : R
rs : ∀ (a : Γ), coeff (↑C r) a = coeff (↑C s) a
⊢ r = s
[PROOFSTEP]
have h := rs 0
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r s : R
rs : ∀ (a : Γ), coeff (↑C r) a = coeff (↑C s) a
h : coeff (↑C r) 0 = coeff (↑C s) 0
⊢ r = s
[PROOFSTEP]
rwa [C_apply, single_coeff_same, C_apply, single_coeff_same] at h 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r : R
h : r ≠ 0
⊢ ↑C r ≠ 0
[PROOFSTEP]
contrapose! h
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r : R
h : ↑C r = 0
⊢ r = 0
[PROOFSTEP]
rw [← C_zero] at h 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r : R
h : ↑C r = ↑C 0
⊢ r = 0
[PROOFSTEP]
exact C_injective h
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r : R
⊢ order (↑C r) = 0
[PROOFSTEP]
by_cases h : r = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r : R
h : r = 0
⊢ order (↑C r) = 0
[PROOFSTEP]
rw [h, C_zero, order_zero]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : OrderedCancelAddCommMonoid Γ
inst✝ : NonAssocSemiring R
r : R
h : ¬r = 0
⊢ order (↑C r) = 0
[PROOFSTEP]
exact order_single h
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
⊢ embDomain f (x * y) = embDomain f x * embDomain f y
[PROOFSTEP]
ext g
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
⊢ coeff (embDomain f (x * y)) g = coeff (embDomain f x * embDomain f y) g
[PROOFSTEP]
by_cases hg : g ∈ Set.range f
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : g ∈ Set.range ↑f
⊢ coeff (embDomain f (x * y)) g = coeff (embDomain f x * embDomain f y) g
[PROOFSTEP]
obtain ⟨g, rfl⟩ := hg
[GOAL]
case pos.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ coeff (embDomain f (x * y)) (↑f g) = coeff (embDomain f x * embDomain f y) (↑f g)
[PROOFSTEP]
simp only [mul_coeff, embDomain_coeff]
[GOAL]
case pos.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g, coeff x ij.fst * coeff y ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd
[PROOFSTEP]
trans
  ∑ ij in
    (addAntidiagonal x.isPwo_support y.isPwo_support g).map (Function.Embedding.prodMap f.toEmbedding f.toEmbedding),
    (embDomain f x).coeff ij.1 * (embDomain f y).coeff ij.2
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g, coeff x ij.fst * coeff y ij.snd =
    ∑ ij in
      Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
        (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∑ ij in
      Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
        (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd =
    ∑ ij in addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g),
      coeff (embDomain f x) ij.fst * coeff (embDomain f y) ij.snd
[PROOFSTEP]
apply sum_subset
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g) ⊆
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case h.mk
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
i j : Γ'
hij :
  (i, j) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
⊢ (i, j) ∈ addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
[PROOFSTEP]
simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal, Function.Embedding.coe_prodMap, mem_support,
  Prod.exists] at hij 
[GOAL]
case h.mk
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
i j : Γ'
hij : ∃ a b, (coeff x a ≠ 0 ∧ coeff y b ≠ 0 ∧ a + b = g) ∧ Prod.map ↑f.toEmbedding ↑f.toEmbedding (a, b) = (i, j)
⊢ (i, j) ∈ addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
[PROOFSTEP]
obtain ⟨i, j, ⟨hx, hy, rfl⟩, rfl, rfl⟩ := hij
[GOAL]
case h.mk.intro.intro.intro.intro.intro.refl
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
i j : Γ
hx : coeff x i ≠ 0
hy : coeff y j ≠ 0
⊢ (↑f.toEmbedding i, ↑f.toEmbedding j) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f (i + j))
[PROOFSTEP]
simp [hx, hy, hf]
[GOAL]
case hf
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
⊢ ∀ (x_1 : Γ' × Γ'),
    x_1 ∈ addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g) →
      ¬x_1 ∈
            Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
              (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g) →
        coeff (embDomain f x) x_1.fst * coeff (embDomain f y) x_1.snd = 0
[PROOFSTEP]
rintro ⟨_, _⟩ h1 h2
[GOAL]
case hf.mk
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
fst✝ snd✝ : Γ'
h1 :
  (fst✝, snd✝) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 :
  ¬(fst✝, snd✝) ∈
      Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
        (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
⊢ coeff (embDomain f x) (fst✝, snd✝).fst * coeff (embDomain f y) (fst✝, snd✝).snd = 0
[PROOFSTEP]
contrapose! h2
[GOAL]
case hf.mk
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
fst✝ snd✝ : Γ'
h1 :
  (fst✝, snd✝) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) fst✝ * coeff (embDomain f y) snd✝ ≠ 0
⊢ (fst✝, snd✝) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
[PROOFSTEP]
obtain ⟨i, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).1
[GOAL]
case hf.mk.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ
snd✝ : Γ'
i : Γ
left✝ : i ∈ support x
h1 :
  (↑f i, snd✝) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) snd✝ ≠ 0
⊢ (↑f i, snd✝) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
[PROOFSTEP]
obtain ⟨j, _, rfl⟩ := support_embDomain_subset (ne_zero_and_ne_zero_of_mul h2).2
[GOAL]
case hf.mk.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g i : Γ
left✝¹ : i ∈ support x
j : Γ
left✝ : j ∈ support y
h1 :
  (↑f i, ↑f j) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) (↑f j) ≠ 0
⊢ (↑f i, ↑f j) ∈
    Finset.map (Embedding.prodMap f.toEmbedding f.toEmbedding)
      (addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support y)) g)
[PROOFSTEP]
simp only [exists_prop, mem_map, Prod.mk.inj_iff, mem_addAntidiagonal, Function.Embedding.coe_prodMap, mem_support,
  Prod.exists]
[GOAL]
case hf.mk.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g i : Γ
left✝¹ : i ∈ support x
j : Γ
left✝ : j ∈ support y
h1 :
  (↑f i, ↑f j) ∈
    addAntidiagonal (_ : Set.IsPwo (support (embDomain f x))) (_ : Set.IsPwo (support (embDomain f y))) (↑f g)
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) (↑f j) ≠ 0
⊢ ∃ a b, (coeff x a ≠ 0 ∧ coeff y b ≠ 0 ∧ a + b = g) ∧ Prod.map ↑f.toEmbedding ↑f.toEmbedding (a, b) = (↑f i, ↑f j)
[PROOFSTEP]
simp only [mem_addAntidiagonal, embDomain_coeff, mem_support, ← hf, OrderEmbedding.eq_iff_eq] at h1 
[GOAL]
case hf.mk.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g i : Γ
left✝¹ : i ∈ support x
j : Γ
left✝ : j ∈ support y
h2 : coeff (embDomain f x) (↑f i) * coeff (embDomain f y) (↑f j) ≠ 0
h1 : coeff x i ≠ 0 ∧ coeff y j ≠ 0 ∧ i + j = g
⊢ ∃ a b, (coeff x a ≠ 0 ∧ coeff y b ≠ 0 ∧ a + b = g) ∧ Prod.map ↑f.toEmbedding ↑f.toEmbedding (a, b) = (↑f i, ↑f j)
[PROOFSTEP]
exact ⟨i, j, h1, rfl⟩
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ Set.range ↑f
⊢ coeff (embDomain f (x * y)) g = coeff (embDomain f x * embDomain f y) g
[PROOFSTEP]
rw [embDomain_notin_range hg, eq_comm]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : ¬g ∈ Set.range ↑f
⊢ coeff (embDomain f x * embDomain f y) g = 0
[PROOFSTEP]
contrapose! hg
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
g : Γ'
hg : coeff (embDomain f x * embDomain f y) g ≠ 0
⊢ g ∈ Set.range ↑f
[PROOFSTEP]
obtain ⟨_, _, hi, hj, rfl⟩ := support_mul_subset_add_support ((mem_support _ _).2 hg)
[GOAL]
case neg.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
w✝¹ w✝ : Γ'
hi : w✝¹ ∈ support (embDomain f x)
hj : w✝ ∈ support (embDomain f y)
hg : coeff (embDomain f x * embDomain f y) ((fun x x_1 => x + x_1) w✝¹ w✝) ≠ 0
⊢ (fun x x_1 => x + x_1) w✝¹ w✝ ∈ Set.range ↑f
[PROOFSTEP]
obtain ⟨i, _, rfl⟩ := support_embDomain_subset hi
[GOAL]
case neg.intro.intro.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
w✝ : Γ'
hj : w✝ ∈ support (embDomain f y)
i : Γ
left✝ : i ∈ support x
hi : ↑f i ∈ support (embDomain f x)
hg : coeff (embDomain f x * embDomain f y) ((fun x x_1 => x + x_1) (↑f i) w✝) ≠ 0
⊢ (fun x x_1 => x + x_1) (↑f i) w✝ ∈ Set.range ↑f
[PROOFSTEP]
obtain ⟨j, _, rfl⟩ := support_embDomain_subset hj
[GOAL]
case neg.intro.intro.intro.intro.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonUnitalNonAssocSemiring R
f : Γ ↪o Γ'
hf : ∀ (x y : Γ), ↑f (x + y) = ↑f x + ↑f y
x y : HahnSeries Γ R
i : Γ
left✝¹ : i ∈ support x
hi : ↑f i ∈ support (embDomain f x)
j : Γ
left✝ : j ∈ support y
hj : ↑f j ∈ support (embDomain f y)
hg : coeff (embDomain f x * embDomain f y) ((fun x x_1 => x + x_1) (↑f i) (↑f j)) ≠ 0
⊢ (fun x x_1 => x + x_1) (↑f i) (↑f j) ∈ Set.range ↑f
[PROOFSTEP]
refine' ⟨i + j, hf i j⟩
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : OrderedCancelAddCommMonoid Γ
Γ' : Type u_3
inst✝¹ : OrderedCancelAddCommMonoid Γ'
inst✝ : NonAssocSemiring R
f : Γ →+ Γ'
hfi : Injective ↑f
hf : ∀ (g g' : Γ), ↑f g ≤ ↑f g' ↔ g ≤ g'
r : R
⊢ ↑(single (↑{ toEmbedding := { toFun := ↑f, inj' := hfi }, map_rel_iff' := (_ : ∀ {a b : Γ}, ↑f a ≤ ↑f b ↔ a ≤ b) } 0))
      r =
    ↑C r
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : (fun x => HahnSeries Γ A) r
⊢ ↑(RingHom.comp C (algebraMap R A)) r * x = x * ↑(RingHom.comp C (algebraMap R A)) r
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : (fun x => HahnSeries Γ A) r
x✝ : Γ
⊢ coeff (↑(RingHom.comp C (algebraMap R A)) r * x) x✝ = coeff (x * ↑(RingHom.comp C (algebraMap R A)) r) x✝
[PROOFSTEP]
simp only [smul_coeff, single_zero_mul_eq_smul, RingHom.coe_comp, RingHom.toFun_eq_coe, C_apply, Function.comp_apply,
  algebraMap_smul, mul_single_zero_coeff]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : (fun x => HahnSeries Γ A) r
x✝ : Γ
⊢ r • coeff x x✝ = coeff x x✝ * ↑(algebraMap R A) r
[PROOFSTEP]
rw [← Algebra.commutes, Algebra.smul_def]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : (fun x => HahnSeries Γ A) r
⊢ r • x = ↑(RingHom.comp C (algebraMap R A)) r * x
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝³ : OrderedCancelAddCommMonoid Γ
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
x : (fun x => HahnSeries Γ A) r
x✝ : Γ
⊢ coeff (r • x) x✝ = coeff (↑(RingHom.comp C (algebraMap R A)) r * x) x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
⊢ ⊥ ≠ ⊤
[PROOFSTEP]
rw [Ne.def, SetLike.ext_iff, not_forall]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
⊢ ∃ x, ¬(x ∈ ⊥ ↔ x ∈ ⊤)
[PROOFSTEP]
obtain ⟨a, ha⟩ := exists_ne (0 : Γ)
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
⊢ ∃ x, ¬(x ∈ ⊥ ↔ x ∈ ⊤)
[PROOFSTEP]
refine' ⟨single a 1, _⟩
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
⊢ ¬(↑(single a) 1 ∈ ⊥ ↔ ↑(single a) 1 ∈ ⊤)
[PROOFSTEP]
simp only [Algebra.mem_bot, not_exists, Set.mem_range, iff_true_iff, Algebra.mem_top]
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
⊢ ∀ (x : R), ¬↑(algebraMap R (HahnSeries Γ R)) x = ↑(single a) 1
[PROOFSTEP]
intro x
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
x : R
⊢ ¬↑(algebraMap R (HahnSeries Γ R)) x = ↑(single a) 1
[PROOFSTEP]
rw [HahnSeries.ext_iff, Function.funext_iff, not_forall]
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
x : R
⊢ ∃ x_1, ¬coeff (↑(algebraMap R (HahnSeries Γ R)) x) x_1 = coeff (↑(single a) 1) x_1
[PROOFSTEP]
refine' ⟨a, _⟩
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
x : R
⊢ ¬coeff (↑(algebraMap R (HahnSeries Γ R)) x) a = coeff (↑(single a) 1) a
[PROOFSTEP]
rw [single_coeff_same, algebraMap_apply, C_apply, single_coeff_of_ne ha]
[GOAL]
case intro
Γ : Type u_1
R : Type u_2
inst✝⁵ : OrderedCancelAddCommMonoid Γ
inst✝⁴ : CommSemiring R
A : Type u_3
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nontrivial Γ
inst✝ : Nontrivial R
a : Γ
ha : a ≠ 0
x : R
⊢ ¬0 = 1
[PROOFSTEP]
exact zero_ne_one
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : HahnSeries ℕ R
⊢ (fun f =>
        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
      ((fun f => PowerSeries.mk f.coeff) f) =
    f
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : HahnSeries ℕ R
x✝ : ℕ
⊢ coeff
      ((fun f =>
          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
        ((fun f => PowerSeries.mk f.coeff) f))
      x✝ =
    coeff f x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : PowerSeries R
⊢ (fun f => PowerSeries.mk f.coeff)
      ((fun f =>
          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
        f) =
    f
[PROOFSTEP]
ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : PowerSeries R
n✝ : ℕ
⊢ ↑(PowerSeries.coeff R n✝)
      ((fun f => PowerSeries.mk f.coeff)
        ((fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
          f)) =
    ↑(PowerSeries.coeff R n✝) f
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
⊢ Equiv.toFun
      { toFun := fun f => PowerSeries.mk f.coeff,
        invFun := fun f =>
          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
        left_inv :=
          (_ :
            ∀ (f : HahnSeries ℕ R),
              (fun f =>
                    { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                      isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                  ((fun f => PowerSeries.mk f.coeff) f) =
                f),
        right_inv :=
          (_ :
            ∀ (f : PowerSeries R),
              (fun f => PowerSeries.mk f.coeff)
                  ((fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    f) =
                f) }
      (f * g) =
    Equiv.toFun
        { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries ℕ R),
                (fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    ((fun f => PowerSeries.mk f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : PowerSeries R),
                (fun f => PowerSeries.mk f.coeff)
                    ((fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      f) =
                  f) }
        f *
      Equiv.toFun
        { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries ℕ R),
                (fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    ((fun f => PowerSeries.mk f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : PowerSeries R),
                (fun f => PowerSeries.mk f.coeff)
                    ((fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      f) =
                  f) }
        g
[PROOFSTEP]
ext n
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ ↑(PowerSeries.coeff R n)
      (Equiv.toFun
        { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries ℕ R),
                (fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    ((fun f => PowerSeries.mk f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : PowerSeries R),
                (fun f => PowerSeries.mk f.coeff)
                    ((fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      f) =
                  f) }
        (f * g)) =
    ↑(PowerSeries.coeff R n)
      (Equiv.toFun
          { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f =>
              { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries ℕ R),
                  (fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      ((fun f => PowerSeries.mk f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : PowerSeries R),
                  (fun f => PowerSeries.mk f.coeff)
                      ((fun f =>
                          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                        f) =
                    f) }
          f *
        Equiv.toFun
          { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f =>
              { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries ℕ R),
                  (fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      ((fun f => PowerSeries.mk f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : PowerSeries R),
                  (fun f => PowerSeries.mk f.coeff)
                      ((fun f =>
                          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                        f) =
                    f) }
          g)
[PROOFSTEP]
simp only [PowerSeries.coeff_mul, PowerSeries.coeff_mk, mul_coeff, isPwo_support]
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n, coeff f ij.fst * coeff g ij.snd =
    ∑ x in Nat.antidiagonal n, coeff f x.fst * coeff g x.snd
[PROOFSTEP]
classical
refine' sum_filter_ne_zero.symm.trans ((sum_congr _ fun _ _ => rfl).trans sum_filter_ne_zero)
ext m
simp only [Nat.mem_antidiagonal, mem_addAntidiagonal, and_congr_left_iff, mem_filter, mem_support]
rintro h
rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n, coeff f ij.fst * coeff g ij.snd =
    ∑ x in Nat.antidiagonal n, coeff f x.fst * coeff g x.snd
[PROOFSTEP]
refine' sum_filter_ne_zero.symm.trans ((sum_congr _ fun _ _ => rfl).trans sum_filter_ne_zero)
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0)
      (addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n) =
    filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0) (Nat.antidiagonal n)
[PROOFSTEP]
ext m
[GOAL]
case h.a
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
m : ℕ × ℕ
⊢ m ∈
      filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0)
        (addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n) ↔
    m ∈ filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0) (Nat.antidiagonal n)
[PROOFSTEP]
simp only [Nat.mem_antidiagonal, mem_addAntidiagonal, and_congr_left_iff, mem_filter, mem_support]
[GOAL]
case h.a
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
m : ℕ × ℕ
⊢ coeff f m.fst * coeff g m.snd ≠ 0 → (coeff f m.fst ≠ 0 ∧ coeff g m.snd ≠ 0 ∧ m.fst + m.snd = n ↔ m.fst + m.snd = n)
[PROOFSTEP]
rintro h
[GOAL]
case h.a
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
m : ℕ × ℕ
h : coeff f m.fst * coeff g m.snd ≠ 0
⊢ coeff f m.fst ≠ 0 ∧ coeff g m.snd ≠ 0 ∧ m.fst + m.snd = n ↔ m.fst + m.snd = n
[PROOFSTEP]
rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
⊢ Equiv.toFun
      { toFun := fun f => PowerSeries.mk f.coeff,
        invFun := fun f =>
          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
        left_inv :=
          (_ :
            ∀ (f : HahnSeries ℕ R),
              (fun f =>
                    { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                      isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                  ((fun f => PowerSeries.mk f.coeff) f) =
                f),
        right_inv :=
          (_ :
            ∀ (f : PowerSeries R),
              (fun f => PowerSeries.mk f.coeff)
                  ((fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    f) =
                f) }
      (f + g) =
    Equiv.toFun
        { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries ℕ R),
                (fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    ((fun f => PowerSeries.mk f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : PowerSeries R),
                (fun f => PowerSeries.mk f.coeff)
                    ((fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      f) =
                  f) }
        f +
      Equiv.toFun
        { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries ℕ R),
                (fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    ((fun f => PowerSeries.mk f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : PowerSeries R),
                (fun f => PowerSeries.mk f.coeff)
                    ((fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      f) =
                  f) }
        g
[PROOFSTEP]
ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n✝ : ℕ
⊢ ↑(PowerSeries.coeff R n✝)
      (Equiv.toFun
        { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f =>
            { coeff := fun n => ↑(PowerSeries.coeff R n) f,
              isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries ℕ R),
                (fun f =>
                      { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                        isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                    ((fun f => PowerSeries.mk f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : PowerSeries R),
                (fun f => PowerSeries.mk f.coeff)
                    ((fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      f) =
                  f) }
        (f + g)) =
    ↑(PowerSeries.coeff R n✝)
      (Equiv.toFun
          { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f =>
              { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries ℕ R),
                  (fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      ((fun f => PowerSeries.mk f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : PowerSeries R),
                  (fun f => PowerSeries.mk f.coeff)
                      ((fun f =>
                          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                        f) =
                    f) }
          f +
        Equiv.toFun
          { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f =>
              { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries ℕ R),
                  (fun f =>
                        { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                          isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                      ((fun f => PowerSeries.mk f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : PowerSeries R),
                  (fun f => PowerSeries.mk f.coeff)
                      ((fun f =>
                          { coeff := fun n => ↑(PowerSeries.coeff R n) f,
                            isPwo_support' := (_ : Set.IsPwo (Function.support fun n => ↑(PowerSeries.coeff R n) f)) })
                        f) =
                    f) }
          g)
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
x : PowerSeries R
⊢ ∀ {a b : ℕ},
    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
        ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
      a ≤ b
[PROOFSTEP]
simp only [Function.Embedding.coeFn_mk]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
x : PowerSeries R
⊢ ∀ {a b : ℕ}, ↑a ≤ ↑b ↔ a ≤ b
[PROOFSTEP]
exact Nat.cast_le
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
x : PowerSeries R
n : ℕ
⊢ coeff (↑(ofPowerSeries Γ R) x) ↑n = ↑(PowerSeries.coeff R n) x
[PROOFSTEP]
simp [ofPowerSeries_apply]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
⊢ ↑(ofPowerSeries Γ R) (↑(PowerSeries.C R) r) = ↑C r
[PROOFSTEP]
ext n
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
⊢ coeff (↑(ofPowerSeries Γ R) (↑(PowerSeries.C R) r)) n = coeff (↑C r) n
[PROOFSTEP]
simp only [ofPowerSeries_apply, C, RingHom.coe_mk, MonoidHom.coe_mk, OneHom.coe_mk, ne_eq, single_coeff]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) (↑(PowerSeries.C R) r)))
      n =
    if n = 0 then r else 0
[PROOFSTEP]
split_ifs with hn
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
hn : n = 0
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) (↑(PowerSeries.C R) r)))
      n =
    r
[PROOFSTEP]
subst hn
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) (↑(PowerSeries.C R) r)))
      0 =
    r
[PROOFSTEP]
convert @embDomain_coeff ℕ R _ _ Γ _ _ _ 0
[GOAL]
case h.e'_2.h.e'_6
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
⊢ 0 =
    ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
      0
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
⊢ r = coeff (↑(RingEquiv.symm toPowerSeries) (↑(PowerSeries.C R) r)) 0
[PROOFSTEP]
simp
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
hn : ¬n = 0
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) (↑(PowerSeries.C R) r)))
      n =
    0
[PROOFSTEP]
rw [embDomain_notin_image_support]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
hn : ¬n = 0
⊢ ¬n ∈
      ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
            map_rel_iff' :=
              (_ :
                ∀ {a b : ℕ},
                  ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                      ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                    a ≤ b) } ''
        support (↑(RingEquiv.symm toPowerSeries) (↑(PowerSeries.C R) r))
[PROOFSTEP]
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support, PowerSeries.coeff_C]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
hn : ¬n = 0
⊢ ∀ (x : ℕ),
    ¬((if x = 0 then r else 0) ≠ 0 ∧
        ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
                map_rel_iff' :=
                  (_ :
                    ∀ {a b : ℕ},
                      ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                          ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                        a ≤ b) }
            x =
          n)
[PROOFSTEP]
intro
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
r : R
n : Γ
hn : ¬n = 0
x✝ : ℕ
⊢ ¬((if x✝ = 0 then r else 0) ≠ 0 ∧
      ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
              map_rel_iff' :=
                (_ :
                  ∀ {a b : ℕ},
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                        ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                      a ≤ b) }
          x✝ =
        n)
[PROOFSTEP]
simp (config := { contextual := true }) [Ne.symm hn]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
⊢ ↑(ofPowerSeries Γ R) PowerSeries.X = ↑(single 1) 1
[PROOFSTEP]
ext n
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
⊢ coeff (↑(ofPowerSeries Γ R) PowerSeries.X) n = coeff (↑(single 1) 1) n
[PROOFSTEP]
simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) PowerSeries.X))
      n =
    if n = 1 then 1 else 0
[PROOFSTEP]
split_ifs with hn
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : n = 1
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) PowerSeries.X))
      n =
    1
[PROOFSTEP]
rw [hn]
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : n = 1
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) PowerSeries.X))
      1 =
    1
[PROOFSTEP]
convert @embDomain_coeff ℕ R _ _ Γ _ _ _ 1
[GOAL]
case h.e'_2.h.e'_6
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : n = 1
⊢ 1 =
    ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
      1
[PROOFSTEP]
simp
[GOAL]
case h.e'_3
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : n = 1
⊢ 1 = coeff (↑(RingEquiv.symm toPowerSeries) PowerSeries.X) 1
[PROOFSTEP]
simp
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : ¬n = 1
⊢ coeff
      (embDomain
        { toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
          map_rel_iff' :=
            (_ :
              ∀ {a b : ℕ},
                ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                  a ≤ b) }
        (↑(RingEquiv.symm toPowerSeries) PowerSeries.X))
      n =
    0
[PROOFSTEP]
rw [embDomain_notin_image_support]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : ¬n = 1
⊢ ¬n ∈
      ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
            map_rel_iff' :=
              (_ :
                ∀ {a b : ℕ},
                  ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                      ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                    a ≤ b) } ''
        support (↑(RingEquiv.symm toPowerSeries) PowerSeries.X)
[PROOFSTEP]
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support, PowerSeries.coeff_X]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : ¬n = 1
⊢ ∀ (x : ℕ),
    ¬((if x = 1 then 1 else 0) ≠ 0 ∧
        ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
                map_rel_iff' :=
                  (_ :
                    ∀ {a b : ℕ},
                      ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                          ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                        a ≤ b) }
            x =
          n)
[PROOFSTEP]
intro
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : StrictOrderedSemiring Γ
n : Γ
hn : ¬n = 1
x✝ : ℕ
⊢ ¬((if x✝ = 1 then 1 else 0) ≠ 0 ∧
      ↑{ toEmbedding := { toFun := Nat.cast, inj' := (_ : Injective Nat.cast) },
              map_rel_iff' :=
                (_ :
                  ∀ {a b : ℕ},
                    ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } a ≤
                        ↑{ toFun := Nat.cast, inj' := (_ : Injective Nat.cast) } b ↔
                      a ≤ b) }
          x✝ =
        n)
[PROOFSTEP]
simp (config := { contextual := true }) [Ne.symm hn]
[GOAL]
Γ : Type u_1
R✝ : Type u_2
inst✝² : Semiring R✝
inst✝¹ : StrictOrderedSemiring Γ
R : Type u_3
inst✝ : CommSemiring R
n : ℕ
⊢ ↑(ofPowerSeries Γ R) (PowerSeries.X ^ n) = ↑(single ↑n) 1
[PROOFSTEP]
rw [RingHom.map_pow]
[GOAL]
Γ : Type u_1
R✝ : Type u_2
inst✝² : Semiring R✝
inst✝¹ : StrictOrderedSemiring Γ
R : Type u_3
inst✝ : CommSemiring R
n : ℕ
⊢ ↑(ofPowerSeries Γ R) PowerSeries.X ^ n = ↑(single ↑n) 1
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
Γ : Type u_1
R✝ : Type u_2
inst✝² : Semiring R✝
inst✝¹ : StrictOrderedSemiring Γ
R : Type u_3
inst✝ : CommSemiring R
⊢ ↑(ofPowerSeries Γ R) PowerSeries.X ^ Nat.zero = ↑(single ↑Nat.zero) 1
[PROOFSTEP]
simp
[GOAL]
case zero
Γ : Type u_1
R✝ : Type u_2
inst✝² : Semiring R✝
inst✝¹ : StrictOrderedSemiring Γ
R : Type u_3
inst✝ : CommSemiring R
⊢ 1 = ↑(single 0) 1
[PROOFSTEP]
rfl
[GOAL]
case succ
Γ : Type u_1
R✝ : Type u_2
inst✝² : Semiring R✝
inst✝¹ : StrictOrderedSemiring Γ
R : Type u_3
inst✝ : CommSemiring R
n : ℕ
ih : ↑(ofPowerSeries Γ R) PowerSeries.X ^ n = ↑(single ↑n) 1
⊢ ↑(ofPowerSeries Γ R) PowerSeries.X ^ Nat.succ n = ↑(single ↑(Nat.succ n)) 1
[PROOFSTEP]
rw [pow_succ, pow_succ, ih, ofPowerSeries_X, mul_comm, single_mul_single, one_mul, Nat.cast_succ, add_comm]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f : HahnSeries (σ →₀ ℕ) R
⊢ (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) ((fun f => f.coeff) f) = f
[PROOFSTEP]
ext
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f : HahnSeries (σ →₀ ℕ) R
x✝ : σ →₀ ℕ
⊢ coeff ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) ((fun f => f.coeff) f)) x✝ =
    coeff f x✝
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f : MvPowerSeries σ R
⊢ (fun f => f.coeff) ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) = f
[PROOFSTEP]
ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f : MvPowerSeries σ R
n✝ : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n✝)
      ((fun f => f.coeff) ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f)) =
    ↑(MvPowerSeries.coeff R n✝) f
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
⊢ Equiv.toFun
      { toFun := fun f => f.coeff,
        invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
        left_inv :=
          (_ :
            ∀ (f : HahnSeries (σ →₀ ℕ) R),
              (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) ((fun f => f.coeff) f) =
                f),
        right_inv :=
          (_ :
            ∀ (f : MvPowerSeries σ R),
              (fun f => f.coeff) ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                f) }
      (f * g) =
    Equiv.toFun
        { toFun := fun f => f.coeff,
          invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries (σ →₀ ℕ) R),
                (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                    ((fun f => f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : MvPowerSeries σ R),
                (fun f => f.coeff)
                    ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                  f) }
        f *
      Equiv.toFun
        { toFun := fun f => f.coeff,
          invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries (σ →₀ ℕ) R),
                (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                    ((fun f => f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : MvPowerSeries σ R),
                (fun f => f.coeff)
                    ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                  f) }
        g
[PROOFSTEP]
ext n
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n)
      (Equiv.toFun
        { toFun := fun f => f.coeff,
          invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries (σ →₀ ℕ) R),
                (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                    ((fun f => f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : MvPowerSeries σ R),
                (fun f => f.coeff)
                    ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                  f) }
        (f * g)) =
    ↑(MvPowerSeries.coeff R n)
      (Equiv.toFun
          { toFun := fun f => f.coeff,
            invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries (σ →₀ ℕ) R),
                  (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                      ((fun f => f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : MvPowerSeries σ R),
                  (fun f => f.coeff)
                      ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                    f) }
          f *
        Equiv.toFun
          { toFun := fun f => f.coeff,
            invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries (σ →₀ ℕ) R),
                  (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                      ((fun f => f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : MvPowerSeries σ R),
                  (fun f => f.coeff)
                      ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                    f) }
          g)
[PROOFSTEP]
simp only [MvPowerSeries.coeff_mul]
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n) (f * g).coeff =
    ∑ x in Finsupp.antidiagonal n, ↑(MvPowerSeries.coeff R x.fst) f.coeff * ↑(MvPowerSeries.coeff R x.snd) g.coeff
[PROOFSTEP]
classical
change (f * g).coeff n = _
simp_rw [mul_coeff]
refine' sum_filter_ne_zero.symm.trans ((sum_congr _ fun _ _ => rfl).trans sum_filter_ne_zero)
ext m
simp only [and_congr_left_iff, mem_addAntidiagonal, mem_filter, mem_support, Finsupp.mem_antidiagonal]
rintro h
rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n) (f * g).coeff =
    ∑ x in Finsupp.antidiagonal n, ↑(MvPowerSeries.coeff R x.fst) f.coeff * ↑(MvPowerSeries.coeff R x.snd) g.coeff
[PROOFSTEP]
change (f * g).coeff n = _
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
⊢ coeff (f * g) n =
    ∑ x in Finsupp.antidiagonal n, ↑(MvPowerSeries.coeff R x.fst) f.coeff * ↑(MvPowerSeries.coeff R x.snd) g.coeff
[PROOFSTEP]
simp_rw [mul_coeff]
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
⊢ ∑ ij in addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n, coeff f ij.fst * coeff g ij.snd =
    ∑ x in Finsupp.antidiagonal n, ↑(MvPowerSeries.coeff R x.fst) f.coeff * ↑(MvPowerSeries.coeff R x.snd) g.coeff
[PROOFSTEP]
refine' sum_filter_ne_zero.symm.trans ((sum_congr _ fun _ _ => rfl).trans sum_filter_ne_zero)
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
⊢ filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0)
      (addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n) =
    filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0) (Finsupp.antidiagonal n)
[PROOFSTEP]
ext m
[GOAL]
case h.a
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
m : (σ →₀ ℕ) × (σ →₀ ℕ)
⊢ m ∈
      filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0)
        (addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n) ↔
    m ∈ filter (fun x => coeff f x.fst * coeff g x.snd ≠ 0) (Finsupp.antidiagonal n)
[PROOFSTEP]
simp only [and_congr_left_iff, mem_addAntidiagonal, mem_filter, mem_support, Finsupp.mem_antidiagonal]
[GOAL]
case h.a
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
m : (σ →₀ ℕ) × (σ →₀ ℕ)
⊢ coeff f m.fst * coeff g m.snd ≠ 0 → (coeff f m.fst ≠ 0 ∧ coeff g m.snd ≠ 0 ∧ m.fst + m.snd = n ↔ m.fst + m.snd = n)
[PROOFSTEP]
rintro h
[GOAL]
case h.a
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n : σ →₀ ℕ
m : (σ →₀ ℕ) × (σ →₀ ℕ)
h : coeff f m.fst * coeff g m.snd ≠ 0
⊢ coeff f m.fst ≠ 0 ∧ coeff g m.snd ≠ 0 ∧ m.fst + m.snd = n ↔ m.fst + m.snd = n
[PROOFSTEP]
rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
⊢ Equiv.toFun
      { toFun := fun f => f.coeff,
        invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
        left_inv :=
          (_ :
            ∀ (f : HahnSeries (σ →₀ ℕ) R),
              (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) ((fun f => f.coeff) f) =
                f),
        right_inv :=
          (_ :
            ∀ (f : MvPowerSeries σ R),
              (fun f => f.coeff) ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                f) }
      (f + g) =
    Equiv.toFun
        { toFun := fun f => f.coeff,
          invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries (σ →₀ ℕ) R),
                (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                    ((fun f => f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : MvPowerSeries σ R),
                (fun f => f.coeff)
                    ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                  f) }
        f +
      Equiv.toFun
        { toFun := fun f => f.coeff,
          invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries (σ →₀ ℕ) R),
                (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                    ((fun f => f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : MvPowerSeries σ R),
                (fun f => f.coeff)
                    ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                  f) }
        g
[PROOFSTEP]
ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : Semiring R
inst✝¹ : StrictOrderedSemiring Γ
σ : Type u_3
inst✝ : Fintype σ
f g : HahnSeries (σ →₀ ℕ) R
n✝ : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n✝)
      (Equiv.toFun
        { toFun := fun f => f.coeff,
          invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
          left_inv :=
            (_ :
              ∀ (f : HahnSeries (σ →₀ ℕ) R),
                (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                    ((fun f => f.coeff) f) =
                  f),
          right_inv :=
            (_ :
              ∀ (f : MvPowerSeries σ R),
                (fun f => f.coeff)
                    ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                  f) }
        (f + g)) =
    ↑(MvPowerSeries.coeff R n✝)
      (Equiv.toFun
          { toFun := fun f => f.coeff,
            invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries (σ →₀ ℕ) R),
                  (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                      ((fun f => f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : MvPowerSeries σ R),
                  (fun f => f.coeff)
                      ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                    f) }
          f +
        Equiv.toFun
          { toFun := fun f => f.coeff,
            invFun := fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) },
            left_inv :=
              (_ :
                ∀ (f : HahnSeries (σ →₀ ℕ) R),
                  (fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) })
                      ((fun f => f.coeff) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : MvPowerSeries σ R),
                  (fun f => f.coeff)
                      ((fun f => { coeff := f, isPwo_support' := (_ : Set.IsPwo (Function.support f)) }) f) =
                    f) }
          g)
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : HahnSeries ℕ A ≃+* PowerSeries A := toPowerSeries
r : R
⊢ Equiv.toFun src✝.toEquiv (↑(algebraMap R (HahnSeries ℕ A)) r) = ↑(algebraMap R (PowerSeries A)) r
[PROOFSTEP]
ext n
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : HahnSeries ℕ A ≃+* PowerSeries A := toPowerSeries
r : R
n : ℕ
⊢ ↑(PowerSeries.coeff A n) (Equiv.toFun src✝.toEquiv (↑(algebraMap R (HahnSeries ℕ A)) r)) =
    ↑(PowerSeries.coeff A n) (↑(algebraMap R (PowerSeries A)) r)
[PROOFSTEP]
simp only [algebraMap_apply, PowerSeries.algebraMap_apply, C_apply, coeff_toPowerSeries]
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : HahnSeries ℕ A ≃+* PowerSeries A := toPowerSeries
r : R
n : ℕ
⊢ ↑(PowerSeries.coeff A n) (Equiv.toFun toPowerSeries.toEquiv (↑(single 0) (↑(algebraMap R A) r))) =
    ↑(PowerSeries.coeff A n) (↑(PowerSeries.C A) (↑(algebraMap R A) r))
[PROOFSTEP]
cases' n with n
[GOAL]
case h.zero
Γ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : HahnSeries ℕ A ≃+* PowerSeries A := toPowerSeries
r : R
⊢ ↑(PowerSeries.coeff A Nat.zero) (Equiv.toFun toPowerSeries.toEquiv (↑(single 0) (↑(algebraMap R A) r))) =
    ↑(PowerSeries.coeff A Nat.zero) (↑(PowerSeries.C A) (↑(algebraMap R A) r))
[PROOFSTEP]
simp [PowerSeries.coeff_zero_eq_constantCoeff, single_coeff_same]
[GOAL]
case h.succ
Γ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : HahnSeries ℕ A ≃+* PowerSeries A := toPowerSeries
r : R
n : ℕ
⊢ ↑(PowerSeries.coeff A (Nat.succ n)) (Equiv.toFun toPowerSeries.toEquiv (↑(single 0) (↑(algebraMap R A) r))) =
    ↑(PowerSeries.coeff A (Nat.succ n)) (↑(PowerSeries.C A) (↑(algebraMap R A) r))
[PROOFSTEP]
simp [n.succ_ne_zero, Ne.def, not_false_iff, single_coeff_of_ne]
[GOAL]
case h.succ
Γ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : HahnSeries ℕ A ≃+* PowerSeries A := toPowerSeries
r : R
n : ℕ
⊢ 0 = ↑(PowerSeries.coeff A (Nat.succ n)) (↑(PowerSeries.C A) (↑(algebraMap R A) r))
[PROOFSTEP]
rw [PowerSeries.coeff_C, if_neg n.succ_ne_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
⊢ ↑(order 1) = 0
[PROOFSTEP]
simp [order_of_ne]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : x = 0
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
by_cases hy : y = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : x = 0
hy : y = 0
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
simp [hx, hy]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : x = 0
hy : ¬y = 0
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
simp [hx, hy]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
by_cases hy : y = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : y = 0
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
simp [hx, hy]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
⊢ min ((fun x => if x = 0 then ⊤ else ↑(order x)) x) ((fun x => if x = 0 then ⊤ else ↑(order x)) y) ≤
    (fun x => if x = 0 then ⊤ else ↑(order x)) (x + y)
[PROOFSTEP]
simp only [hx, hy, support_nonempty_iff, if_neg, not_false_iff, isWf_support]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
⊢ min ↑(order x) ↑(order y) ≤ if x + y = 0 then ⊤ else ↑(order (x + y))
[PROOFSTEP]
by_cases hxy : x + y = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
hxy : x + y = 0
⊢ min ↑(order x) ↑(order y) ≤ if x + y = 0 then ⊤ else ↑(order (x + y))
[PROOFSTEP]
simp [hxy]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
hxy : ¬x + y = 0
⊢ min ↑(order x) ↑(order y) ≤ if x + y = 0 then ⊤ else ↑(order (x + y))
[PROOFSTEP]
rw [if_neg hxy, ← WithTop.coe_min, WithTop.coe_le_coe]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
hxy : ¬x + y = 0
⊢ min (order x) (order y) ≤ order (x + y)
[PROOFSTEP]
exact min_order_le_order_add hxy
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
⊢ (fun x => if x = 0 then ⊤ else ↑(order x)) (x * y) =
    (fun x => if x = 0 then ⊤ else ↑(order x)) x + (fun x => if x = 0 then ⊤ else ↑(order x)) y
[PROOFSTEP]
by_cases hx : x = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : x = 0
⊢ (fun x => if x = 0 then ⊤ else ↑(order x)) (x * y) =
    (fun x => if x = 0 then ⊤ else ↑(order x)) x + (fun x => if x = 0 then ⊤ else ↑(order x)) y
[PROOFSTEP]
simp [hx]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
⊢ (fun x => if x = 0 then ⊤ else ↑(order x)) (x * y) =
    (fun x => if x = 0 then ⊤ else ↑(order x)) x + (fun x => if x = 0 then ⊤ else ↑(order x)) y
[PROOFSTEP]
by_cases hy : y = 0
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : y = 0
⊢ (fun x => if x = 0 then ⊤ else ↑(order x)) (x * y) =
    (fun x => if x = 0 then ⊤ else ↑(order x)) x + (fun x => if x = 0 then ⊤ else ↑(order x)) y
[PROOFSTEP]
simp [hy]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
⊢ (fun x => if x = 0 then ⊤ else ↑(order x)) (x * y) =
    (fun x => if x = 0 then ⊤ else ↑(order x)) x + (fun x => if x = 0 then ⊤ else ↑(order x)) y
[PROOFSTEP]
dsimp only
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x y : HahnSeries Γ R
hx : ¬x = 0
hy : ¬y = 0
⊢ (if x * y = 0 then ⊤ else ↑(order (x * y))) = (if x = 0 then ⊤ else ↑(order x)) + if y = 0 then ⊤ else ↑(order y)
[PROOFSTEP]
rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithTop.coe_add, WithTop.coe_eq_coe, order_mul hx hy]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
g : Γ
h : coeff x g ≠ 0
⊢ ↑(addVal Γ R) x ≤ ↑g
[PROOFSTEP]
rw [addVal_apply_of_ne (ne_zero_of_coeff_ne_zero h), WithTop.coe_le_coe]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
g : Γ
h : coeff x g ≠ 0
⊢ order x ≤ g
[PROOFSTEP]
exact order_le_of_coeff_ne_zero h
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
[PROOFSTEP]
apply (x.isWf_support.isPwo.addSubmonoid_closure _).mono _
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ ∀ (x_1 : Γ), x_1 ∈ support x → 0 ≤ x_1
[PROOFSTEP]
exact fun g hg => WithTop.coe_le_coe.1 (le_trans (le_of_lt hx) (addVal_le_of_coeff_ne_zero hg))
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ ⋃ (n : ℕ), support (x ^ n) ⊆ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
refine' Set.iUnion_subset fun n => _
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
⊢ support (x ^ n) ⊆ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ support (x ^ Nat.zero) ⊆ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
intro g hn
[GOAL]
case succ
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
ih : support (x ^ n) ⊆ ↑(AddSubmonoid.closure (support x))
⊢ support (x ^ Nat.succ n) ⊆ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
intro g hn
[GOAL]
case zero
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hn : g ∈ support (x ^ Nat.zero)
⊢ g ∈ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
simp only [Nat.zero_eq, pow_zero, support_one, Set.mem_singleton_iff] at hn 
[GOAL]
case zero
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hn : g = 0
⊢ g ∈ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
rw [hn, SetLike.mem_coe]
[GOAL]
case zero
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hn : g = 0
⊢ 0 ∈ AddSubmonoid.closure (support x)
[PROOFSTEP]
exact AddSubmonoid.zero_mem _
[GOAL]
case succ
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
ih : support (x ^ n) ⊆ ↑(AddSubmonoid.closure (support x))
g : Γ
hn : g ∈ support (x ^ Nat.succ n)
⊢ g ∈ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
obtain ⟨i, j, hi, hj, rfl⟩ := support_mul_subset_add_support hn
[GOAL]
case succ.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : Ring R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
ih : support (x ^ n) ⊆ ↑(AddSubmonoid.closure (support x))
i j : Γ
hi : i ∈ support x
hj : j ∈ support (npowRec n x)
hn : (fun x x_1 => x + x_1) i j ∈ support (x ^ Nat.succ n)
⊢ (fun x x_1 => x + x_1) i j ∈ ↑(AddSubmonoid.closure (support x))
[PROOFSTEP]
exact SetLike.mem_coe.2 (AddSubmonoid.add_mem _ (AddSubmonoid.subset_closure hi) (ih hj))
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
⊢ ⋃ (a : α), support ((↑x + ↑y) a) ⊆ (⋃ (a : α), support (↑x a)) ∪ ⋃ (a : α), support (↑y a)
[PROOFSTEP]
rw [← Set.iUnion_union_distrib]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
⊢ ⋃ (a : α), support ((↑x + ↑y) a) ⊆ ⋃ (i : α), support (↑x i) ∪ support (↑y i)
[PROOFSTEP]
exact Set.iUnion_mono fun a => support_add_subset
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
g : Γ
⊢ {a | coeff ((↑x + ↑y) a) g ≠ 0} ⊆
    (Function.support fun a => coeff (↑x a) g) ∪ Function.support fun a => coeff (↑y a) g
[PROOFSTEP]
intro a ha
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
g : Γ
a : α
ha : a ∈ {a | coeff ((↑x + ↑y) a) g ≠ 0}
⊢ a ∈ (Function.support fun a => coeff (↑x a) g) ∪ Function.support fun a => coeff (↑y a) g
[PROOFSTEP]
change (x a).coeff g + (y a).coeff g ≠ 0 at ha 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
g : Γ
a : α
ha : coeff (↑x a) g + coeff (↑y a) g ≠ 0
⊢ a ∈ (Function.support fun a => coeff (↑x a) g) ∪ Function.support fun a => coeff (↑y a) g
[PROOFSTEP]
rw [Set.mem_union, Function.mem_support, Function.mem_support]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
g : Γ
a : α
ha : coeff (↑x a) g + coeff (↑y a) g ≠ 0
⊢ coeff (↑x a) g ≠ 0 ∨ coeff (↑y a) g ≠ 0
[PROOFSTEP]
contrapose! ha
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
x y : SummableFamily Γ R α
g : Γ
a : α
ha : coeff (↑x a) g = 0 ∧ coeff (↑y a) g = 0
⊢ coeff (↑x a) g + coeff (↑y a) g = 0
[PROOFSTEP]
rw [ha.1, ha.2, add_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
⊢ Set.IsPwo (⋃ (a : α), support (OfNat.ofNat 0 a))
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
⊢ ∀ (g : Γ), Set.Finite {a | coeff (OfNat.ofNat 0 a) g ≠ 0}
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
r s t : SummableFamily Γ R α
⊢ r + s + t = r + (s + t)
[PROOFSTEP]
ext
[GOAL]
case h.coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
r s t : SummableFamily Γ R α
a✝ : α
x✝ : Γ
⊢ coeff (↑(r + s + t) a✝) x✝ = coeff (↑(r + (s + t)) a✝) x✝
[PROOFSTEP]
apply add_assoc
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
⊢ 0 + s = s
[PROOFSTEP]
ext
[GOAL]
case h.coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
a✝ : α
x✝ : Γ
⊢ coeff (↑(0 + s) a✝) x✝ = coeff (↑s a✝) x✝
[PROOFSTEP]
apply zero_add
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
⊢ s + 0 = s
[PROOFSTEP]
ext
[GOAL]
case h.coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
a✝ : α
x✝ : Γ
⊢ coeff (↑(s + 0) a✝) x✝ = coeff (↑s a✝) x✝
[PROOFSTEP]
apply add_zero
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s t : SummableFamily Γ R α
⊢ s + t = t + s
[PROOFSTEP]
ext
[GOAL]
case h.coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s t : SummableFamily Γ R α
a✝ : α
x✝ : Γ
⊢ coeff (↑(s + t) a✝) x✝ = coeff (↑(t + s) a✝) x✝
[PROOFSTEP]
apply add_comm
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
⊢ (g ∈ Function.support fun g => ∑ᶠ (i : α), coeff (↑s i) g) → g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
contrapose
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
⊢ ¬g ∈ ⋃ (a : α), support (↑s a) → ¬g ∈ Function.support fun g => ∑ᶠ (i : α), coeff (↑s i) g
[PROOFSTEP]
rw [Set.mem_iUnion, not_exists, Function.mem_support, Classical.not_not]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
⊢ (∀ (x : α), ¬g ∈ support (↑s x)) → ∑ᶠ (i : α), coeff (↑s i) g = 0
[PROOFSTEP]
simp_rw [mem_support, Classical.not_not]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
⊢ (∀ (x : α), coeff (↑s x) g = 0) → ∑ᶠ (i : α), coeff (↑s i) g = 0
[PROOFSTEP]
intro h
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
h : ∀ (x : α), coeff (↑s x) g = 0
⊢ ∑ᶠ (i : α), coeff (↑s i) g = 0
[PROOFSTEP]
rw [finsum_congr h, finsum_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
s : SummableFamily Γ R α
g : Γ
hg : g ∈ support (hsum s)
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
rw [mem_support, hsum_coeff, finsum_eq_sum _ (s.finite_co_support _)] at hg 
[GOAL]
Γ : 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
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
obtain ⟨a, _, h2⟩ := exists_ne_zero_of_sum_ne_zero hg
[GOAL]
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)
[PROOFSTEP]
rw [Set.mem_iUnion]
[GOAL]
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)
[PROOFSTEP]
exact ⟨a, h2⟩
[GOAL]
Γ : 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
[PROOFSTEP]
ext g
[GOAL]
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
[PROOFSTEP]
simp only [hsum_coeff, add_coeff, add_apply]
[GOAL]
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
[PROOFSTEP]
exact finsum_add_distrib (s.finite_co_support _) (t.finite_co_support _)
[GOAL]
Γ : 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))
[PROOFSTEP]
simp_rw [support_neg]
[GOAL]
Γ : 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))
[PROOFSTEP]
exact s.isPwo_iUnion_support'
[GOAL]
Γ : 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}
[PROOFSTEP]
simp only [neg_coeff', Pi.neg_apply, Ne.def, neg_eq_zero]
[GOAL]
Γ : 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}
[PROOFSTEP]
exact s.finite_co_support g
[GOAL]
Γ : 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
[PROOFSTEP]
ext
[GOAL]
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✝
[PROOFSTEP]
apply add_left_neg
[GOAL]
Γ : 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))
[PROOFSTEP]
apply (x.isPwo_support.add s.isPwo_iUnion_support).mono
[GOAL]
Γ : 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)
[PROOFSTEP]
refine' Set.Subset.trans (Set.iUnion_mono fun a => support_mul_subset_add_support) _
[GOAL]
Γ : 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)
[PROOFSTEP]
intro g
[GOAL]
Γ : 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)
[PROOFSTEP]
simp only [Set.mem_iUnion, exists_imp]
[GOAL]
Γ : 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)
[PROOFSTEP]
exact fun a ha => (Set.add_subset_add (Set.Subset.refl _) (Set.subset_iUnion _ a)) ha
[GOAL]
Γ : 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}
[PROOFSTEP]
refine'
  ((addAntidiagonal x.isPwo_support s.isPwo_iUnion_support g).finite_toSet.biUnion' fun ij _ => _).subset fun a ha => _
[GOAL]
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 α
[PROOFSTEP]
exact fun ij _ => Function.support fun a => (s a).coeff ij.2
[GOAL]
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.snd)
[PROOFSTEP]
apply s.finite_co_support
[GOAL]
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 : Γ × Γ) (_ :
      i ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ (a : α), support (↑s a))) g)),
      Function.support fun a => coeff (↑s a) i.snd
[PROOFSTEP]
obtain ⟨i, j, hi, hj, rfl⟩ := support_mul_subset_add_support ha
[GOAL]
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 : Γ × Γ) (_ :
      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.snd
[PROOFSTEP]
simp only [exists_prop, Set.mem_iUnion, mem_addAntidiagonal, mul_coeff, mem_support, isPwo_support, Prod.exists]
[GOAL]
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
[PROOFSTEP]
exact ⟨i, j, mem_coe.2 (mem_addAntidiagonal.2 ⟨hi, Set.mem_iUnion.2 ⟨a, hj⟩, rfl⟩), hj⟩
[GOAL]
Γ : 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
[PROOFSTEP]
ext g
[GOAL]
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
[PROOFSTEP]
simp only [mul_coeff, hsum_coeff, smul_apply]
[GOAL]
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.fst * coeff (↑s i) ij.snd =
    ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (hsum s))) g,
      coeff x x_1.fst * ∑ᶠ (i : α), coeff (↑s i) x_1.snd
[PROOFSTEP]
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
    _
[GOAL]
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.fst * coeff (↑s a) ij.snd =
    ∑ b in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ (a : α), support (↑s a))) g,
      coeff x b.fst * coeff (↑s a) b.snd
[PROOFSTEP]
refine' sum_subset (addAntidiagonal_mono_right (Set.subset_iUnion (fun j => support (toFun s j)) a)) _
[GOAL]
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 : Γ × Γ),
    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.fst * coeff (↑s a) x_1.snd = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hU ha
[GOAL]
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).fst * coeff (↑s a) (i, j).snd = 0
[PROOFSTEP]
rw [mem_addAntidiagonal] at *
[GOAL]
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).fst ∈ support x ∧ (i, j).snd ∈ ⋃ (a : α), support (↑s a) ∧ (i, j).fst + (i, j).snd = g
ha : ¬((i, j).fst ∈ support x ∧ (i, j).snd ∈ support (↑s a) ∧ (i, j).fst + (i, j).snd = g)
⊢ coeff x (i, j).fst * coeff (↑s a) (i, j).snd = 0
[PROOFSTEP]
rw [Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
[GOAL]
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 : Γ × Γ),
    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.fst * coeff (↑s i) ij.snd) a b)
[PROOFSTEP]
rintro ⟨i, j⟩ _
[GOAL]
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.fst * coeff (↑s i) ij.snd) a (i, j))
[PROOFSTEP]
refine' (s.finite_co_support j).subset _
[GOAL]
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.fst * coeff (↑s i) ij.snd) a (i, j)) ⊆
    Function.support fun a => coeff (↑s a) j
[PROOFSTEP]
simp_rw [Function.support_subset_iff', Function.mem_support, Classical.not_not]
[GOAL]
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
[PROOFSTEP]
intro a ha
[GOAL]
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
[PROOFSTEP]
rw [ha, mul_zero]
[GOAL]
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.fst * coeff (↑s a) b.snd =
    ∑ x_1 in addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (support (hsum s))) g,
      coeff x x_1.fst * ∑ᶠ (i : α), coeff (↑s i) x_1.snd
[PROOFSTEP]
refine' (sum_congr rfl _).trans (sum_subset (addAntidiagonal_mono_right _) _).symm
[GOAL]
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 : Γ × Γ),
    x_1 ∈ addAntidiagonal (_ : Set.IsPwo (support x)) (_ : Set.IsPwo (⋃ (a : α), support (↑s a))) g →
      ∑ᶠ (a : α), coeff x x_1.fst * coeff (↑s a) x_1.snd = coeff x x_1.fst * ∑ᶠ (i : α), coeff (↑s i) x_1.snd
[PROOFSTEP]
rintro ⟨i, j⟩ _
[GOAL]
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).fst * coeff (↑s a) (i, j).snd =
    coeff x (i, j).fst * ∑ᶠ (i_1 : α), coeff (↑s i_1) (i, j).snd
[PROOFSTEP]
rw [mul_finsum]
[GOAL]
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).snd)
[PROOFSTEP]
apply s.finite_co_support
[GOAL]
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)
[PROOFSTEP]
intro x hx
[GOAL]
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)
[PROOFSTEP]
simp only [Set.mem_iUnion, Ne.def, mem_support]
[GOAL]
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
[PROOFSTEP]
contrapose! hx
[GOAL]
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)
[PROOFSTEP]
simp [hx]
[GOAL]
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 : Γ × Γ),
    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.fst * ∑ᶠ (i : α), coeff (↑s i) x_1.snd = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hU ha
[GOAL]
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).fst * ∑ᶠ (i_1 : α), coeff (↑s i_1) (i, j).snd = 0
[PROOFSTEP]
rw [mem_addAntidiagonal] at *
[GOAL]
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).fst ∈ support x ∧ (i, j).snd ∈ ⋃ (a : α), support (↑s a) ∧ (i, j).fst + (i, j).snd = g
ha : ¬((i, j).fst ∈ support x ∧ (i, j).snd ∈ support (hsum s) ∧ (i, j).fst + (i, j).snd = g)
⊢ coeff x (i, j).fst * ∑ᶠ (i_1 : α), coeff (↑s i_1) (i, j).snd = 0
[PROOFSTEP]
rw [← hsum_coeff, Classical.not_not.1 fun con => ha ⟨hU.1, con, hU.2.2⟩, mul_zero]
[GOAL]
Γ : 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
[PROOFSTEP]
rw [← lsum_apply, LinearMap.map_sub, lsum_apply, lsum_apply]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
⊢ Set.IsPwo (⋃ (a : α), support (↑f a))
[PROOFSTEP]
apply (f.support.isPwo_bUnion.2 fun a _ => (f a).isPwo_support).mono
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
⊢ ⋃ (a : α), support (↑f a) ⊆ ⋃ (i : α) (_ : i ∈ f.support), support (↑f i)
[PROOFSTEP]
refine' Set.iUnion_subset_iff.2 fun a g hg => _
[GOAL]
Γ : 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 : α) (_ : i ∈ f.support), support (↑f i)
[PROOFSTEP]
have haf : a ∈ f.support := by
  rw [Finsupp.mem_support_iff, ← support_nonempty_iff]
  exact ⟨g, hg⟩
[GOAL]
Γ : 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
[PROOFSTEP]
rw [Finsupp.mem_support_iff, ← support_nonempty_iff]
[GOAL]
Γ : 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))
[PROOFSTEP]
exact ⟨g, hg⟩
[GOAL]
Γ : 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 : α) (_ : i ∈ f.support), support (↑f i)
[PROOFSTEP]
exact Set.mem_biUnion haf hg
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
⊢ Set.Finite {a | coeff (↑f a) g ≠ 0}
[PROOFSTEP]
refine' f.support.finite_toSet.subset fun a ha => _
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
a : α
ha : a ∈ {a | coeff (↑f a) g ≠ 0}
⊢ a ∈ ↑f.support
[PROOFSTEP]
simp only [coeff.addMonoidHom_apply, mem_coe, Finsupp.mem_support_iff, Ne.def, Function.mem_support]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
a : α
ha : a ∈ {a | coeff (↑f a) g ≠ 0}
⊢ ¬↑f a = 0
[PROOFSTEP]
contrapose! ha
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
a : α
ha : ↑f a = 0
⊢ ¬a ∈ {a | coeff (↑f a) g ≠ 0}
[PROOFSTEP]
simp [ha]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
⊢ hsum (ofFinsupp f) = Finsupp.sum f fun x => id
[PROOFSTEP]
ext g
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
⊢ coeff (hsum (ofFinsupp f)) g = coeff (Finsupp.sum f fun x => id) g
[PROOFSTEP]
simp only [hsum_coeff, coe_ofFinsupp, Finsupp.sum, Ne.def]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
⊢ ∑ᶠ (i : α), coeff (↑f i) g = coeff (∑ x in f.support, id (↑f x)) g
[PROOFSTEP]
simp_rw [← coeff.addMonoidHom_apply, id.def]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
⊢ ∑ᶠ (i : α), ↑(coeff.addMonoidHom g) (↑f i) = ↑(coeff.addMonoidHom g) (∑ x in f.support, ↑f x)
[PROOFSTEP]
rw [map_sum, finsum_eq_sum_of_support_subset]
[GOAL]
case coeff.h.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
⊢ (Function.support fun i => ↑(coeff.addMonoidHom g) (↑f i)) ⊆ ↑f.support
[PROOFSTEP]
intro x h
[GOAL]
case coeff.h.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
x : α
h : x ∈ Function.support fun i => ↑(coeff.addMonoidHom g) (↑f i)
⊢ x ∈ ↑f.support
[PROOFSTEP]
simp only [coeff.addMonoidHom_apply, mem_coe, Finsupp.mem_support_iff, Ne.def]
[GOAL]
case coeff.h.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
x : α
h : x ∈ Function.support fun i => ↑(coeff.addMonoidHom g) (↑f i)
⊢ ¬↑f x = 0
[PROOFSTEP]
contrapose! h
[GOAL]
case coeff.h.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
f : α →₀ HahnSeries Γ R
g : Γ
x : α
h : ↑f x = 0
⊢ ¬x ∈ Function.support fun i => ↑(coeff.addMonoidHom g) (↑f i)
[PROOFSTEP]
simp [h]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
⊢ Set.IsPwo (⋃ (a : β), support ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) a))
[PROOFSTEP]
refine' s.isPwo_iUnion_support.mono (Set.iUnion_subset fun b g h => _)
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
h : g ∈ support ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) b)
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
by_cases hb : b ∈ Set.range f
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
h : g ∈ support ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) b)
hb : b ∈ Set.range ↑f
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
dsimp only at h 
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
h : g ∈ support (if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0)
hb : b ∈ Set.range ↑f
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
rw [dif_pos hb] at h 
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
hb : b ∈ Set.range ↑f
h : g ∈ support (↑s (Classical.choose hb))
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
exact Set.mem_iUnion.2 ⟨Classical.choose hb, h⟩
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
h : g ∈ support ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) b)
hb : ¬b ∈ Set.range ↑f
⊢ g ∈ ⋃ (a : α), support (↑s a)
[PROOFSTEP]
contrapose! h
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
hb : ¬b ∈ Set.range ↑f
h : ¬g ∈ ⋃ (a : α), support (↑s a)
⊢ ¬g ∈ support (if h : b ∈ Set.range ↑f then ↑s (Classical.choose (_ : b ∈ Set.range ↑f)) else 0)
[PROOFSTEP]
rw [dif_neg hb]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
b : β
g : Γ
hb : ¬b ∈ Set.range ↑f
h : ¬g ∈ ⋃ (a : α), support (↑s a)
⊢ ¬g ∈ support 0
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
g : Γ
⊢ {a | coeff ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) a) g ≠ 0} ⊆
    ↑f '' Function.support fun a => coeff (↑s a) g
[PROOFSTEP]
intro b h
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
g : Γ
b : β
h : b ∈ {a | coeff ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) a) g ≠ 0}
⊢ b ∈ ↑f '' Function.support fun a => coeff (↑s a) g
[PROOFSTEP]
by_cases hb : b ∈ Set.range f
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
g : Γ
b : β
h : b ∈ {a | coeff ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) a) g ≠ 0}
hb : b ∈ Set.range ↑f
⊢ b ∈ ↑f '' Function.support fun a => coeff (↑s a) g
[PROOFSTEP]
simp only [Ne.def, Set.mem_setOf_eq, dif_pos hb] at h 
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
g : Γ
b : β
hb : b ∈ Set.range ↑f
h : ¬coeff (↑s (Classical.choose (_ : b ∈ Set.range ↑f))) g = 0
⊢ b ∈ ↑f '' Function.support fun a => coeff (↑s a) g
[PROOFSTEP]
exact ⟨Classical.choose hb, h, Classical.choose_spec hb⟩
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
g : Γ
b : β
h : b ∈ {a | coeff ((fun b => if h : b ∈ Set.range ↑f then ↑s (Classical.choose h) else 0) a) g ≠ 0}
hb : ¬b ∈ Set.range ↑f
⊢ b ∈ ↑f '' Function.support fun a => coeff (↑s a) g
[PROOFSTEP]
contrapose! h
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
g : Γ
b : β
hb : ¬b ∈ Set.range ↑f
h : ¬b ∈ (fun a => ↑f a) '' Function.support fun a => coeff (↑s a) g
⊢ ¬b ∈ {a | coeff (if h : a ∈ Set.range ↑f then ↑s (Classical.choose (_ : a ∈ Set.range ↑f)) else 0) g ≠ 0}
[PROOFSTEP]
simp only [Ne.def, Set.mem_setOf_eq, dif_neg hb, Classical.not_not, zero_coeff]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
a : α
b : β
⊢ ↑(embDomain s f) (↑f a) = ↑s a
[PROOFSTEP]
rw [embDomain_apply, dif_pos (Set.mem_range_self a)]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
a : α
b : β
⊢ ↑s (Classical.choose (_ : ↑f a ∈ Set.range ↑f)) = ↑s a
[PROOFSTEP]
exact congr rfl (f.injective (Classical.choose_spec (Set.mem_range_self a)))
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
a : α
b : β
h : ¬b ∈ Set.range ↑f
⊢ ↑(embDomain s f) b = 0
[PROOFSTEP]
rw [embDomain_apply, dif_neg h]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
a : α
b : β
⊢ hsum (embDomain s f) = hsum s
[PROOFSTEP]
ext g
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
a : α
b : β
g : Γ
⊢ coeff (hsum (embDomain s f)) g = coeff (hsum s) g
[PROOFSTEP]
simp only [hsum_coeff, embDomain_apply, apply_dite HahnSeries.coeff, dite_apply, zero_coeff]
[GOAL]
case coeff.h
Γ : Type u_1
R : Type u_2
inst✝¹ : PartialOrder Γ
inst✝ : AddCommMonoid R
α : Type u_3
β : Type u_4
s : SummableFamily Γ R α
f : α ↪ β
a : α
b : β
g : Γ
⊢ (∑ᶠ (i : β), if h : i ∈ Set.range ↑f then coeff (↑s (Classical.choose (_ : i ∈ Set.range ↑f))) g else 0) =
    ∑ᶠ (i : α), coeff (↑s i) g
[PROOFSTEP]
exact finsum_emb_domain f fun a => (s a).coeff g
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) g ≠ 0}
[PROOFSTEP]
have hpwo := isPwo_iUnion_support_powers hx
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) g ≠ 0}
[PROOFSTEP]
by_cases hg : g ∈ ⋃ n : ℕ, {g | (x ^ n).coeff g ≠ 0}
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) g ≠ 0}
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : ¬g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) g ≠ 0}
[PROOFSTEP]
swap
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : ¬g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) g ≠ 0}
[PROOFSTEP]
exact Set.finite_empty.subset fun n hn => hg (Set.mem_iUnion.2 ⟨n, hn⟩)
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) g ≠ 0}
[PROOFSTEP]
apply hpwo.isWf.induction hg
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
⊢ ∀ (y : Γ),
    y ∈ ⋃ (n : ℕ), support (x ^ n) →
      (∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}) →
        Set.Finite {a | coeff ((fun n => x ^ n) a) y ≠ 0}
[PROOFSTEP]
intro y ys hy
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
y : Γ
ys : y ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
⊢ Set.Finite {a | coeff ((fun n => x ^ n) a) y ≠ 0}
[PROOFSTEP]
refine'
  ((((addAntidiagonal x.isPwo_support hpwo y).finite_toSet.biUnion fun ij hij => hy ij.snd _ _).image Nat.succ).union
        (Set.finite_singleton 0)).subset
    _
[GOAL]
case pos.refine'_1
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
y : Γ
ys : y ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
ij : Γ × Γ
hij : ij ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo y)
⊢ ij.snd ∈ ⋃ (n : ℕ), support (x ^ n)
[PROOFSTEP]
exact (mem_addAntidiagonal.1 (mem_coe.1 hij)).2.1
[GOAL]
case pos.refine'_2
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
y : Γ
ys : y ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
ij : Γ × Γ
hij : ij ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo y)
⊢ ij.snd < y
[PROOFSTEP]
obtain ⟨hi, _, rfl⟩ := mem_addAntidiagonal.1 (mem_coe.1 hij)
[GOAL]
case pos.refine'_2.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
ij : Γ × Γ
hi : ij.fst ∈ support x
left✝ : ij.snd ∈ ⋃ (n : ℕ), support (x ^ n)
ys : ij.fst + ij.snd ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < ij.fst + ij.snd → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
hij : ij ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo (ij.fst + ij.snd))
⊢ ij.snd < ij.fst + ij.snd
[PROOFSTEP]
rw [← zero_add ij.snd, ← add_assoc, add_zero]
[GOAL]
case pos.refine'_2.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
ij : Γ × Γ
hi : ij.fst ∈ support x
left✝ : ij.snd ∈ ⋃ (n : ℕ), support (x ^ n)
ys : ij.fst + ij.snd ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < ij.fst + ij.snd → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
hij : ij ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo (ij.fst + ij.snd))
⊢ 0 + ij.snd < ij.fst + ij.snd
[PROOFSTEP]
exact add_lt_add_right (WithTop.coe_lt_coe.1 (lt_of_lt_of_le hx (addVal_le_of_coeff_ne_zero hi))) _
[GOAL]
case pos.refine'_3
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
y : Γ
ys : y ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
⊢ {a | coeff ((fun n => x ^ n) a) y ≠ 0} ⊆
    (Nat.succ ''
        ⋃ (i : Γ × Γ) (_ : i ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo y)),
          {a | coeff ((fun n => x ^ n) a) i.snd ≠ 0}) ∪
      {0}
[PROOFSTEP]
rintro (_ | n) hn
[GOAL]
case pos.refine'_3.zero
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
y : Γ
ys : y ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
hn : Nat.zero ∈ {a | coeff ((fun n => x ^ n) a) y ≠ 0}
⊢ Nat.zero ∈
    (Nat.succ ''
        ⋃ (i : Γ × Γ) (_ : i ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo y)),
          {a | coeff ((fun n => x ^ n) a) i.snd ≠ 0}) ∪
      {0}
[PROOFSTEP]
exact Set.mem_union_right _ (Set.mem_singleton 0)
[GOAL]
case pos.refine'_3.succ
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
y : Γ
ys : y ∈ ⋃ (n : ℕ), support (x ^ n)
hy : ∀ (z : Γ), z ∈ ⋃ (n : ℕ), support (x ^ n) → z < y → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
n : ℕ
hn : Nat.succ n ∈ {a | coeff ((fun n => x ^ n) a) y ≠ 0}
⊢ Nat.succ n ∈
    (Nat.succ ''
        ⋃ (i : Γ × Γ) (_ : i ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo y)),
          {a | coeff ((fun n => x ^ n) a) i.snd ≠ 0}) ∪
      {0}
[PROOFSTEP]
obtain ⟨i, j, hi, hj, rfl⟩ := support_mul_subset_add_support hn
[GOAL]
case pos.refine'_3.succ.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
n : ℕ
i j : Γ
hi : i ∈ support x
hj : j ∈ support (npowRec n x)
ys : (fun x x_1 => x + x_1) i j ∈ ⋃ (n : ℕ), support (x ^ n)
hy :
  ∀ (z : Γ),
    z ∈ ⋃ (n : ℕ), support (x ^ n) → z < (fun x x_1 => x + x_1) i j → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
hn : Nat.succ n ∈ {a | coeff ((fun n => x ^ n) a) ((fun x x_1 => x + x_1) i j) ≠ 0}
⊢ Nat.succ n ∈
    (Nat.succ ''
        ⋃ (i_1 : Γ × Γ) (_ : i_1 ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo ((fun x x_1 => x + x_1) i j))),
          {a | coeff ((fun n => x ^ n) a) i_1.snd ≠ 0}) ∪
      {0}
[PROOFSTEP]
refine' Set.mem_union_left _ ⟨n, Set.mem_iUnion.2 ⟨⟨i, j⟩, Set.mem_iUnion.2 ⟨_, hj⟩⟩, rfl⟩
[GOAL]
case pos.refine'_3.succ.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
n : ℕ
i j : Γ
hi : i ∈ support x
hj : j ∈ support (npowRec n x)
ys : (fun x x_1 => x + x_1) i j ∈ ⋃ (n : ℕ), support (x ^ n)
hy :
  ∀ (z : Γ),
    z ∈ ⋃ (n : ℕ), support (x ^ n) → z < (fun x x_1 => x + x_1) i j → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
hn : Nat.succ n ∈ {a | coeff ((fun n => x ^ n) a) ((fun x x_1 => x + x_1) i j) ≠ 0}
⊢ (i, j) ∈ ↑(addAntidiagonal (_ : Set.IsPwo (support x)) hpwo ((fun x x_1 => x + x_1) i j))
[PROOFSTEP]
simp only [and_true_iff, Set.mem_iUnion, mem_addAntidiagonal, mem_coe, eq_self_iff_true, Ne.def, mem_support,
  Set.mem_setOf_eq]
[GOAL]
case pos.refine'_3.succ.intro.intro.intro.intro
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
g : Γ
hpwo : Set.IsPwo (⋃ (n : ℕ), support (x ^ n))
hg : g ∈ ⋃ (n : ℕ), {g | coeff (x ^ n) g ≠ 0}
n : ℕ
i j : Γ
hi : i ∈ support x
hj : j ∈ support (npowRec n x)
ys : (fun x x_1 => x + x_1) i j ∈ ⋃ (n : ℕ), support (x ^ n)
hy :
  ∀ (z : Γ),
    z ∈ ⋃ (n : ℕ), support (x ^ n) → z < (fun x x_1 => x + x_1) i j → Set.Finite {a | coeff ((fun n => x ^ n) a) z ≠ 0}
hn : Nat.succ n ∈ {a | coeff ((fun n => x ^ n) a) ((fun x x_1 => x + x_1) i j) ≠ 0}
⊢ ¬coeff x i = 0 ∧ ∃ i, ¬coeff (x ^ i) j = 0
[PROOFSTEP]
exact ⟨hi, n, hj⟩
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ embDomain (x • powers x hx) { toFun := Nat.succ, inj' := Nat.succ_injective } =
    powers x hx - ofFinsupp (Finsupp.single 0 1)
[PROOFSTEP]
apply SummableFamily.ext
[GOAL]
case h
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ ∀ (a : ℕ),
    ↑(embDomain (x • powers x hx) { toFun := Nat.succ, inj' := Nat.succ_injective }) a =
      ↑(powers x hx - ofFinsupp (Finsupp.single 0 1)) a
[PROOFSTEP]
rintro (_ | n)
[GOAL]
case h.zero
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ ↑(embDomain (x • powers x hx) { toFun := Nat.succ, inj' := Nat.succ_injective }) Nat.zero =
    ↑(powers x hx - ofFinsupp (Finsupp.single 0 1)) Nat.zero
[PROOFSTEP]
rw [embDomain_notin_range, sub_apply, coe_powers, pow_zero, coe_ofFinsupp, Finsupp.single_eq_same, sub_self]
[GOAL]
case h.zero.h
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ ¬Nat.zero ∈ Set.range ↑{ toFun := Nat.succ, inj' := Nat.succ_injective }
[PROOFSTEP]
rw [Set.mem_range, not_exists]
[GOAL]
case h.zero.h
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ ∀ (x : ℕ), ¬↑{ toFun := Nat.succ, inj' := Nat.succ_injective } x = Nat.zero
[PROOFSTEP]
exact Nat.succ_ne_zero
[GOAL]
case h.succ
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
⊢ ↑(embDomain (x • powers x hx) { toFun := Nat.succ, inj' := Nat.succ_injective }) (Nat.succ n) =
    ↑(powers x hx - ofFinsupp (Finsupp.single 0 1)) (Nat.succ n)
[PROOFSTEP]
refine' Eq.trans (embDomain_image _ ⟨Nat.succ, Nat.succ_injective⟩) _
[GOAL]
case h.succ
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
⊢ ↑(x • powers x hx) n = ↑(powers x hx - ofFinsupp (Finsupp.single 0 1)) (Nat.succ n)
[PROOFSTEP]
simp only [pow_succ, coe_powers, coe_sub, smul_apply, coe_ofFinsupp, Pi.sub_apply]
[GOAL]
case h.succ
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
n : ℕ
⊢ x * x ^ n = x * x ^ n - ↑(Finsupp.single 0 1) (Nat.succ n)
[PROOFSTEP]
rw [Finsupp.single_eq_of_ne n.succ_ne_zero.symm, sub_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ (1 - x) * hsum (powers x hx) = 1
[PROOFSTEP]
rw [← hsum_smul, sub_smul 1 x (powers x hx), one_smul, hsum_sub, ←
  hsum_embDomain (x • powers x hx) ⟨Nat.succ, Nat.succ_injective⟩, embDomain_succ_smul_powers]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedCancelAddCommMonoid Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
hx : 0 < ↑(addVal Γ R) x
⊢ hsum (powers x hx) - hsum (powers x hx - ofFinsupp (Finsupp.single 0 1)) = 1
[PROOFSTEP]
simp
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
⊢ 0 < ↑(addVal Γ R) (1 - ↑C r * ↑(single (-order x)) 1 * x)
[PROOFSTEP]
have h10 : (1 : R) ≠ 0 := one_ne_zero
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
⊢ 0 < ↑(addVal Γ R) (1 - ↑C r * ↑(single (-order x)) 1 * x)
[PROOFSTEP]
have x0 : x ≠ 0 := ne_zero_of_coeff_ne_zero (right_ne_zero_of_mul_eq_one hr)
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
⊢ 0 < ↑(addVal Γ R) (1 - ↑C r * ↑(single (-order x)) 1 * x)
[PROOFSTEP]
refine' lt_of_le_of_ne ((addVal Γ R).map_le_sub (ge_of_eq (addVal Γ R).map_one) _) _
[GOAL]
case refine'_1
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
⊢ 0 ≤ ↑(addVal Γ R) (↑C r * ↑(single (-order x)) 1 * x)
[PROOFSTEP]
simp only [AddValuation.map_mul]
[GOAL]
case refine'_1
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
⊢ 0 ≤ ↑(addVal Γ R) (↑C r) + ↑(addVal Γ R) (↑(single (-order x)) 1) + ↑(addVal Γ R) x
[PROOFSTEP]
rw [addVal_apply_of_ne x0, addVal_apply_of_ne (single_ne_zero h10), addVal_apply_of_ne _, order_C, order_single h10,
  WithTop.coe_zero, zero_add, ← WithTop.coe_add, neg_add_self, WithTop.coe_zero]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
⊢ ↑C r ≠ 0
[PROOFSTEP]
exact C_ne_zero (left_ne_zero_of_mul_eq_one hr)
[GOAL]
case refine'_2
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
⊢ 0 ≠ ↑(addVal Γ R) (1 - ↑C r * ↑(single (-order x)) 1 * x)
[PROOFSTEP]
rw [addVal_apply, ← WithTop.coe_zero]
[GOAL]
case refine'_2
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
⊢ ↑0 ≠ if 1 - ↑C r * ↑(single (-order x)) 1 * x = 0 then ⊤ else ↑(order (1 - ↑C r * ↑(single (-order x)) 1 * x))
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
h : 1 - ↑C r * ↑(single (-order x)) 1 * x = 0
⊢ ↑0 ≠ ⊤
[PROOFSTEP]
apply WithTop.coe_ne_top
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
h : ¬1 - ↑C r * ↑(single (-order x)) 1 * x = 0
⊢ ↑0 ≠ ↑(order (1 - ↑C r * ↑(single (-order x)) 1 * x))
[PROOFSTEP]
rw [Ne.def, WithTop.coe_eq_coe]
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
h : ¬1 - ↑C r * ↑(single (-order x)) 1 * x = 0
⊢ ¬0 = order (1 - ↑C r * ↑(single (-order x)) 1 * x)
[PROOFSTEP]
intro con
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
h : ¬1 - ↑C r * ↑(single (-order x)) 1 * x = 0
con : 0 = order (1 - ↑C r * ↑(single (-order x)) 1 * x)
⊢ False
[PROOFSTEP]
apply coeff_order_ne_zero h
[GOAL]
case neg
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
r : R
hr : r * coeff x (order x) = 1
h10 : 1 ≠ 0
x0 : x ≠ 0
h : ¬1 - ↑C r * ↑(single (-order x)) 1 * x = 0
con : 0 = order (1 - ↑C r * ↑(single (-order x)) 1 * x)
⊢ coeff (1 - ↑C r * ↑(single (-order x)) 1 * x) (order (1 - ↑C r * ↑(single (-order x)) 1 * x)) = 0
[PROOFSTEP]
rw [← con, mul_assoc, sub_coeff, one_coeff, if_pos rfl, C_mul_eq_smul, smul_coeff, smul_eq_mul, ← add_neg_self x.order,
  single_mul_coeff_add, one_mul, hr, sub_self]
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
⊢ IsUnit x ↔ IsUnit (coeff x (order x))
[PROOFSTEP]
constructor
[GOAL]
case mp
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
⊢ IsUnit x → IsUnit (coeff x (order x))
[PROOFSTEP]
rintro ⟨⟨u, i, ui, iu⟩, rfl⟩
[GOAL]
case mp.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
u i : HahnSeries Γ R
ui : u * i = 1
iu : i * u = 1
⊢ IsUnit
    (coeff (↑{ val := u, inv := i, val_inv := ui, inv_val := iu })
      (order ↑{ val := u, inv := i, val_inv := ui, inv_val := iu }))
[PROOFSTEP]
refine' isUnit_of_mul_eq_one (u.coeff u.order) (i.coeff i.order) ((mul_coeff_order_add_order u i).symm.trans _)
[GOAL]
case mp.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
u i : HahnSeries Γ R
ui : u * i = 1
iu : i * u = 1
⊢ coeff (u * i) (order u + order i) = 1
[PROOFSTEP]
rw [ui, one_coeff, if_pos]
[GOAL]
case mp.intro.mk.hc
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
u i : HahnSeries Γ R
ui : u * i = 1
iu : i * u = 1
⊢ order u + order i = 0
[PROOFSTEP]
rw [← order_mul (left_ne_zero_of_mul_eq_one ui) (right_ne_zero_of_mul_eq_one ui), ui, order_one]
[GOAL]
case mpr
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
⊢ IsUnit (coeff x (order x)) → IsUnit x
[PROOFSTEP]
rintro ⟨⟨u, i, ui, iu⟩, h⟩
[GOAL]
case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * u = 1
h : ↑{ val := u, inv := i, val_inv := ui, inv_val := iu } = coeff x (order x)
⊢ IsUnit x
[PROOFSTEP]
rw [Units.val_mk] at h 
[GOAL]
case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * u = 1
h : u = coeff x (order x)
⊢ IsUnit x
[PROOFSTEP]
rw [h] at iu 
[GOAL]
case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * coeff x (order x) = 1
h : u = coeff x (order x)
⊢ IsUnit x
[PROOFSTEP]
have h := SummableFamily.one_sub_self_mul_hsum_powers (unit_aux x iu)
[GOAL]
case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * coeff x (order x) = 1
h✝ : u = coeff x (order x)
h :
  (1 - (1 - ↑C i * ↑(single (-order x)) 1 * x)) *
      SummableFamily.hsum
        (SummableFamily.powers (1 - ↑C i * ↑(single (-order x)) 1 * x)
          (_ : 0 < ↑(addVal Γ R) (1 - ↑C i * ↑(single (-order x)) 1 * x))) =
    1
⊢ IsUnit x
[PROOFSTEP]
rw [sub_sub_cancel] at h 
[GOAL]
case mpr.intro.mk
Γ : Type u_1
R : Type u_2
inst✝² : LinearOrderedAddCommGroup Γ
inst✝¹ : CommRing R
inst✝ : IsDomain R
x : HahnSeries Γ R
u i : R
ui : u * i = 1
iu : i * coeff x (order x) = 1
h✝ : u = coeff x (order x)
h :
  ↑C i * ↑(single (-order x)) 1 * x *
      SummableFamily.hsum
        (SummableFamily.powers (1 - ↑C i * ↑(single (-order x)) 1 * x)
          (_ : 0 < ↑(addVal Γ R) (1 - ↑C i * ↑(single (-order x)) 1 * x))) =
    1
⊢ IsUnit x
[PROOFSTEP]
exact isUnit_of_mul_isUnit_right (isUnit_of_mul_eq_one _ _ h)
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : LinearOrderedAddCommGroup Γ
inst✝ : Field R
src✝¹ : IsDomain (HahnSeries Γ R) := inferInstanceAs (IsDomain (HahnSeries Γ R))
src✝ : CommRing (HahnSeries Γ R) := inferInstanceAs (CommRing (HahnSeries Γ R))
x : HahnSeries Γ R
x0 : x ≠ 0
⊢ x * x⁻¹ = 1
[PROOFSTEP]
refine' (congr rfl (dif_neg x0)).trans _
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : LinearOrderedAddCommGroup Γ
inst✝ : Field R
src✝¹ : IsDomain (HahnSeries Γ R) := inferInstanceAs (IsDomain (HahnSeries Γ R))
src✝ : CommRing (HahnSeries Γ R) := inferInstanceAs (CommRing (HahnSeries Γ R))
x : HahnSeries Γ R
x0 : x ≠ 0
⊢ x *
      (↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 *
        SummableFamily.hsum
          (SummableFamily.powers (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)
            (_ : 0 < ↑(addVal Γ R) (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)))) =
    1
[PROOFSTEP]
have h := SummableFamily.one_sub_self_mul_hsum_powers (unit_aux x (inv_mul_cancel (coeff_order_ne_zero x0)))
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : LinearOrderedAddCommGroup Γ
inst✝ : Field R
src✝¹ : IsDomain (HahnSeries Γ R) := inferInstanceAs (IsDomain (HahnSeries Γ R))
src✝ : CommRing (HahnSeries Γ R) := inferInstanceAs (CommRing (HahnSeries Γ R))
x : HahnSeries Γ R
x0 : x ≠ 0
h :
  (1 - (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)) *
      SummableFamily.hsum
        (SummableFamily.powers (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)
          (_ : 0 < ↑(addVal Γ R) (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x))) =
    1
⊢ x *
      (↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 *
        SummableFamily.hsum
          (SummableFamily.powers (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)
            (_ : 0 < ↑(addVal Γ R) (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)))) =
    1
[PROOFSTEP]
rw [sub_sub_cancel] at h 
[GOAL]
Γ : Type u_1
R : Type u_2
inst✝¹ : LinearOrderedAddCommGroup Γ
inst✝ : Field R
src✝¹ : IsDomain (HahnSeries Γ R) := inferInstanceAs (IsDomain (HahnSeries Γ R))
src✝ : CommRing (HahnSeries Γ R) := inferInstanceAs (CommRing (HahnSeries Γ R))
x : HahnSeries Γ R
x0 : x ≠ 0
h :
  ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x *
      SummableFamily.hsum
        (SummableFamily.powers (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)
          (_ : 0 < ↑(addVal Γ R) (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x))) =
    1
⊢ x *
      (↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 *
        SummableFamily.hsum
          (SummableFamily.powers (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)
            (_ : 0 < ↑(addVal Γ R) (1 - ↑C (coeff x (order x))⁻¹ * ↑(single (-order x)) 1 * x)))) =
    1
[PROOFSTEP]
rw [← mul_assoc, mul_comm x, h]
