l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem ofPowerSeries_X : ofPowerSeries Γ R PowerSeries.X = single 1 1 := by
  ext n
  simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
  split_ifs with hn
  · rw [hn]
    convert @embDomain_coeff ℕ R _ _ Γ _ _ _ 1 <;> simp
  · 

Proof state:
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

Next tactic:
rw [embDomain_notin_image_support]
@[simp]
theorem ofPowerSeries_X : ofPowerSeries Γ R PowerSeries.X = single 1 1 := by
  ext n
  simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
  split_ifs with hn
  · rw [hn]
    convert @embDomain_coeff ℕ R _ _ Γ _ _ _ 1 <;> simp
  · rw [embDomain_notin_image_support]
    

Proof state:
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)

Next tactic:
simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
      PowerSeries.coeff_X]
@[simp]
theorem ofPowerSeries_X : ofPowerSeries Γ R PowerSeries.X = single 1 1 := by
  ext n
  simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
  split_ifs with hn
  · rw [hn]
    convert @embDomain_coeff ℕ R _ _ Γ _ _ _ 1 <;> simp
  · rw [embDomain_notin_image_support]
    simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
      PowerSeries.coeff_X]
    

Proof state:
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)

Next tactic:
intro
@[simp]
theorem ofPowerSeries_X : ofPowerSeries Γ R PowerSeries.X = single 1 1 := by
  ext n
  simp only [single_coeff, ofPowerSeries_apply, RingHom.coe_mk]
  split_ifs with hn
  · rw [hn]
    convert @embDomain_coeff ℕ R _ _ Γ _ _ _ 1 <;> simp
  · rw [embDomain_notin_image_support]
    simp only [not_exists, Set.mem_image, toPowerSeries_symm_apply_coeff, mem_support,
      PowerSeries.coeff_X]
    intro
    

Proof state:
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)

Next tactic:
simp (config := { contextual := true }) [Ne.symm hn]
@[simp]
theorem ofPowerSeries_X_pow {R} [CommSemiring R] (n : ℕ) :
    ofPowerSeries Γ R (PowerSeries.X ^ n) = single (n : Γ) 1 := by
  

Proof state:
Γ : 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

Next tactic:
rw [RingHom.map_pow]
@[simp]
theorem ofPowerSeries_X_pow {R} [CommSemiring R] (n : ℕ) :
    ofPowerSeries Γ R (PowerSeries.X ^ n) = single (n : Γ) 1 := by
  rw [RingHom.map_pow]
  

Proof state:
Γ : 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

Next tactic:
induction' n with n ih
@[simp]
theorem ofPowerSeries_X_pow {R} [CommSemiring R] (n : ℕ) :
    ofPowerSeries Γ R (PowerSeries.X ^ n) = single (n : Γ) 1 := by
  rw [RingHom.map_pow]
  induction' n with n ih
  · 

Proof state:
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

Next tactic:
simp
@[simp]
theorem ofPowerSeries_X_pow {R} [CommSemiring R] (n : ℕ) :
    ofPowerSeries Γ R (PowerSeries.X ^ n) = single (n : Γ) 1 := by
  rw [RingHom.map_pow]
  induction' n with n ih
  · simp
    

Proof state:
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

Next tactic:
rfl
@[simp]
theorem ofPowerSeries_X_pow {R} [CommSemiring R] (n : ℕ) :
    ofPowerSeries Γ R (PowerSeries.X ^ n) = single (n : Γ) 1 := by
  rw [RingHom.map_pow]
  induction' n with n ih
  · simp
    rfl
  · 

Proof state:
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

Next tactic:
rw [pow_succ, ih, ofPowerSeries_X, mul_comm, single_mul_single, one_mul,
      Nat.cast_succ, add_comm]
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    

Proof state:
Γ : 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

Next tactic:
ext
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    

Proof state:
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✝

Next tactic:
simp
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    

Proof state:
Γ : 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

Next tactic:
ext
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    

Proof state:
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

Next tactic:
simp
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    

Proof state:
Γ : 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

Next tactic:
ext n
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    

Proof state:
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)

Next tactic:
simp only [MvPowerSeries.coeff_mul]
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    

Proof state:
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 =
    ∑ p in antidiagonal n, (MvPowerSeries.coeff R p.1) f.coeff * (MvPowerSeries.coeff R p.2) g.coeff

Next tactic:
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,
        Finset.mem_antidiagonal]
      rintro h
      rw [and_iff_right (left_ne_zero_of_mul h), and_iff_right (right_ne_zero_of_mul h)]
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    classical
      

Proof state:
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 =
    ∑ p in antidiagonal n, (MvPowerSeries.coeff R p.1) f.coeff * (MvPowerSeries.coeff R p.2) g.coeff

Next tactic:
change (f * g).coeff n = _
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    classical
      change (f * g).coeff n = _
      

Proof state:
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 = ∑ p in antidiagonal n, (MvPowerSeries.coeff R p.1) f.coeff * (MvPowerSeries.coeff R p.2) g.coeff

Next tactic:
simp_rw [mul_coeff]
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    classical
      change (f * g).coeff n = _
      simp_rw [mul_coeff]
      

Proof state:
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.1 * coeff g ij.2 =
    ∑ p in antidiagonal n, (MvPowerSeries.coeff R p.1) f.coeff * (MvPowerSeries.coeff R p.2) g.coeff

Next tactic:
refine' (sum_filter_ne_zero _).symm.trans $ (sum_congr _ fun _ _ ↦ rfl).trans $
        sum_filter_ne_zero _
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    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 _
      

Proof state:
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.1 * coeff g x.2 ≠ 0)
      (addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n) =
    filter (fun x => coeff f x.1 * coeff g x.2 ≠ 0) (antidiagonal n)

Next tactic:
ext m
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    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
      

Proof state:
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.1 * coeff g x.2 ≠ 0)
        (addAntidiagonal (_ : Set.IsPwo (support f)) (_ : Set.IsPwo (support g)) n) ↔
    m ∈ filter (fun x => coeff f x.1 * coeff g x.2 ≠ 0) (antidiagonal n)

Next tactic:
simp only [and_congr_left_iff, mem_addAntidiagonal, mem_filter, mem_support,
        Finset.mem_antidiagonal]
/-- The ring `HahnSeries (σ →₀ ℕ) R` is isomorphic to `MvPowerSeries σ R` for a `Fintype` `σ`.
We take the index set of the hahn series to be `Finsupp` rather than `pi`,
even though we assume `Fintype σ` as this is more natural for alignment with `MvPowerSeries`.
After importing `Algebra.Order.Pi` the ring `HahnSeries (σ → ℕ) R` could be constructed instead.
 -/
@[simps]
def toMvPowerSeries {σ : Type*} [Fintype σ] : HahnSeries (σ →₀ ℕ) R ≃+* MvPowerSeries σ R where
  toFun f := f.coeff
  invFun f := ⟨(f : (σ →₀ ℕ) → R), Finsupp.isPwo _⟩
  left_inv f := by
    ext
    simp
  right_inv f := by
    ext
    simp
  map_add' f g := by
    ext
    simp
  map_mul' f g := by
    ext n
    simp only [MvPowerSeries.coeff_mul]
    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,
        Finset.mem_antidiagonal]
      

Proof state:
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.1 * coeff g m.2 ≠ 0 → (coeff f m.1 ≠ 0 ∧ coeff g m.2 ≠ 0 ∧ m.1 + m.2 = n ↔ m.1 + m.2 = n)

Next tactic:
rintro h