Theorem: HahnSeries.toPowerSeries_apply
File: Mathlib/RingTheory/HahnSeries/PowerSeries.lean

Proof steps:
state_before: Γ : 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' := ⋯ })
      ((fun f => PowerSeries.mk f.coeff) f) =
    f
state_after: case coeff.h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : HahnSeries ℕ R
x✝ : ℕ
⊢ ((fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ })
          ((fun f => PowerSeries.mk f.coeff) f)).coeff
      x✝ =
    f.coeff x✝
tactic: ext
state_before: case coeff.h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : HahnSeries ℕ R
x✝ : ℕ
⊢ ((fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ })
          ((fun f => PowerSeries.mk f.coeff) f)).coeff
      x✝ =
    f.coeff x✝
state_after: no goals
tactic: simp
state_before: Γ : 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' := ⋯ }) f) =
    f
state_after: 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' := ⋯ }) f)) =
    (PowerSeries.coeff R n✝) f
tactic: ext
state_before: 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' := ⋯ }) f)) =
    (PowerSeries.coeff R n✝) f
state_after: no goals
tactic: simp
state_before: Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
⊢ { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
          right_inv := ⋯ }.toFun
      (f + g) =
    { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        f +
      { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        g
state_after: case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n✝ : ℕ
⊢ (PowerSeries.coeff R n✝)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        (f + g)) =
    (PowerSeries.coeff R n✝)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          f +
        { toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          g)
tactic: ext
state_before: case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n✝ : ℕ
⊢ (PowerSeries.coeff R n✝)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        (f + g)) =
    (PowerSeries.coeff R n✝)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          f +
        { toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          g)
state_after: no goals
tactic: simp
state_before: Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
⊢ { toFun := fun f => PowerSeries.mk f.coeff,
          invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
          right_inv := ⋯ }.toFun
      (f * g) =
    { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        f *
      { toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        g
state_after: case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ (PowerSeries.coeff R n)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        (f * g)) =
    (PowerSeries.coeff R n)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          f *
        { toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          g)
tactic: ext n
state_before: case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ (PowerSeries.coeff R n)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
            invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
            right_inv := ⋯ }.toFun
        (f * g)) =
    (PowerSeries.coeff R n)
      ({ toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          f *
        { toFun := fun f => PowerSeries.mk f.coeff,
              invFun := fun f => { coeff := fun n => (PowerSeries.coeff R n) f, isPWO_support' := ⋯ }, left_inv := ⋯,
              right_inv := ⋯ }.toFun
          g)
state_after: case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ ∑ ij ∈ addAntidiagonal ⋯ ⋯ n, f.coeff ij.1 * g.coeff ij.2 = ∑ x ∈ antidiagonal n, f.coeff x.1 * g.coeff x.2
tactic: simp only [PowerSeries.coeff_mul, PowerSeries.coeff_mk, mul_coeff, isPWO_support]
state_before: case h
Γ : Type u_1
R : Type u_2
inst✝ : Semiring R
f g : HahnSeries ℕ R
n : ℕ
⊢ ∑ ij ∈ addAntidiagonal ⋯ ⋯ n, f.coeff ij.1 * g.coeff ij.2 = ∑ x ∈ antidiagonal n, f.coeff x.1 * g.coeff x.2
state_after: no goals
tactic: classical
    refine (sum_filter_ne_zero _).symm.trans <| (sum_congr ?_ fun _ _ ↦ rfl).trans <|
      sum_filter_ne_zero _
    ext m
    simp only [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)]