[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
n : σ →₀ ℕ
⊢ monomial R n = LinearMap.stdBasis R (fun x => R) n
[PROOFSTEP]
rw [monomial]
  -- unify the `Decidable` arguments
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
n : σ →₀ ℕ
⊢ LinearMap.stdBasis R (fun x => R) n = LinearMap.stdBasis R (fun x => R) n
[PROOFSTEP]
convert rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
m n : σ →₀ ℕ
a : R
⊢ ↑(coeff R m) (↑(monomial R n) a) = if m = n then a else 0
[PROOFSTEP]
rw [coeff, monomial_def, LinearMap.proj_apply]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
m n : σ →₀ ℕ
a : R
⊢ ↑(LinearMap.stdBasis R (fun x => R) n) a m = if m = n then a else 0
[PROOFSTEP]
dsimp only
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
m n : σ →₀ ℕ
a : R
⊢ ↑(LinearMap.stdBasis R (fun x => R) n) a m = if m = n then a else 0
[PROOFSTEP]
rw [LinearMap.stdBasis_apply, Function.update_apply, Pi.zero_apply]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
n : σ →₀ ℕ
a : R
⊢ ↑(coeff R n) (↑(monomial R n) a) = a
[PROOFSTEP]
rw [monomial_def]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
n : σ →₀ ℕ
a : R
⊢ ↑(coeff R n) (↑(LinearMap.stdBasis R (fun x => R) n) a) = a
[PROOFSTEP]
exact LinearMap.stdBasis_same R (fun _ ↦ R) n a
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
h : m ≠ n
a : R
⊢ ↑(coeff R m) (↑(monomial R n) a) = 0
[PROOFSTEP]
rw [monomial_def]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
h : m ≠ n
a : R
⊢ ↑(coeff R m) (↑(LinearMap.stdBasis R (fun x => R) n) a) = 0
[PROOFSTEP]
exact LinearMap.stdBasis_ne R (fun _ ↦ R) _ _ h a
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
⊢ AddMonoid (MvPowerSeries σ R)
[PROOFSTEP]
infer_instance
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
src✝ : AddMonoid (MvPowerSeries σ R) :=
  let_fun this := inferInstance;
  this
⊢ NatCast.natCast 0 = 0
[PROOFSTEP]
simp [Nat.cast]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
src✝ : AddMonoid (MvPowerSeries σ R) :=
  let_fun this := inferInstance;
  this
⊢ ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1
[PROOFSTEP]
simp [Nat.cast, monomial_zero_one]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
inst✝ : DecidableEq σ
⊢ ↑(coeff R n) (φ * ψ) = ∑ p in antidiagonal n, ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ
[PROOFSTEP]
refine Finset.sum_congr ?_ fun _ _ => rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
inst✝ : DecidableEq σ
⊢ antidiagonal n = antidiagonal n
[PROOFSTEP]
rw [Subsingleton.elim (fun a b => propDecidable (a = b)) ‹DecidableEq σ›]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (0 * φ) = ↑(coeff R n) 0
[PROOFSTEP]
simp [coeff_mul]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (φ * 0) = ↑(coeff R n) 0
[PROOFSTEP]
simp [coeff_mul]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
⊢ ↑(coeff R m) (↑(monomial R n) a * φ) = if n ≤ m then a * ↑(coeff R (m - n)) φ else 0
[PROOFSTEP]
have : ∀ p ∈ antidiagonal m, coeff R (p : (σ →₀ ℕ) × (σ →₀ ℕ)).1 (monomial R n a) * coeff R p.2 φ ≠ 0 → p.1 = n :=
  fun p _ hp => eq_of_coeff_monomial_ne_zero (left_ne_zero_of_mul hp)
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
this :
  ∀ (p : (σ →₀ ℕ) × (σ →₀ ℕ)),
    p ∈ antidiagonal m → ↑(coeff R p.fst) (↑(monomial R n) a) * ↑(coeff R p.snd) φ ≠ 0 → p.fst = n
⊢ ↑(coeff R m) (↑(monomial R n) a * φ) = if n ≤ m then a * ↑(coeff R (m - n)) φ else 0
[PROOFSTEP]
rw [coeff_mul, ← Finset.sum_filter_of_ne this, antidiagonal_filter_fst_eq, Finset.sum_ite_index]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
this :
  ∀ (p : (σ →₀ ℕ) × (σ →₀ ℕ)),
    p ∈ antidiagonal m → ↑(coeff R p.fst) (↑(monomial R n) a) * ↑(coeff R p.snd) φ ≠ 0 → p.fst = n
⊢ (if n ≤ m then ∑ x in {(n, m - n)}, ↑(coeff R x.fst) (↑(monomial R n) a) * ↑(coeff R x.snd) φ
    else ∑ x in ∅, ↑(coeff R x.fst) (↑(monomial R n) a) * ↑(coeff R x.snd) φ) =
    if n ≤ m then a * ↑(coeff R (m - n)) φ else 0
[PROOFSTEP]
simp only [Finset.sum_singleton, coeff_monomial_same, Finset.sum_empty]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
⊢ ↑(coeff R m) (φ * ↑(monomial R n) a) = if n ≤ m then ↑(coeff R (m - n)) φ * a else 0
[PROOFSTEP]
have : ∀ p ∈ antidiagonal m, coeff R (p : (σ →₀ ℕ) × (σ →₀ ℕ)).1 φ * coeff R p.2 (monomial R n a) ≠ 0 → p.2 = n :=
  fun p _ hp => eq_of_coeff_monomial_ne_zero (right_ne_zero_of_mul hp)
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
this :
  ∀ (p : (σ →₀ ℕ) × (σ →₀ ℕ)),
    p ∈ antidiagonal m → ↑(coeff R p.fst) φ * ↑(coeff R p.snd) (↑(monomial R n) a) ≠ 0 → p.snd = n
⊢ ↑(coeff R m) (φ * ↑(monomial R n) a) = if n ≤ m then ↑(coeff R (m - n)) φ * a else 0
[PROOFSTEP]
rw [coeff_mul, ← Finset.sum_filter_of_ne this, antidiagonal_filter_snd_eq, Finset.sum_ite_index]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
this :
  ∀ (p : (σ →₀ ℕ) × (σ →₀ ℕ)),
    p ∈ antidiagonal m → ↑(coeff R p.fst) φ * ↑(coeff R p.snd) (↑(monomial R n) a) ≠ 0 → p.snd = n
⊢ (if n ≤ m then ∑ x in {(m - n, n)}, ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (↑(monomial R n) a)
    else ∑ x in ∅, ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (↑(monomial R n) a)) =
    if n ≤ m then ↑(coeff R (m - n)) φ * a else 0
[PROOFSTEP]
simp only [Finset.sum_singleton, coeff_monomial_same, Finset.sum_empty]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
⊢ ↑(coeff R (m + n)) (↑(monomial R m) a * φ) = a * ↑(coeff R n) φ
[PROOFSTEP]
rw [coeff_monomial_mul, if_pos, add_tsub_cancel_left]
[GOAL]
case hc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
⊢ m ≤ m + n
[PROOFSTEP]
exact le_add_right le_rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
⊢ ↑(coeff R (m + n)) (φ * ↑(monomial R n) a) = ↑(coeff R m) φ * a
[PROOFSTEP]
rw [coeff_mul_monomial, if_pos, add_tsub_cancel_right]
[GOAL]
case hc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
⊢ n ≤ m + n
[PROOFSTEP]
exact le_add_left le_rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
⊢ Commute φ (↑(monomial R n) a) ↔ ∀ (m : σ →₀ ℕ), Commute (↑(coeff R m) φ) a
[PROOFSTEP]
refine' ext_iff.trans ⟨fun h m => _, fun h m => _⟩
[GOAL]
case refine'_1
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (n_1 : σ →₀ ℕ), ↑(coeff R n_1) (φ * ↑(monomial R n) a) = ↑(coeff R n_1) (↑(monomial R n) a * φ)
m : σ →₀ ℕ
⊢ Commute (↑(coeff R m) φ) a
[PROOFSTEP]
have := h (m + n)
[GOAL]
case refine'_1
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (n_1 : σ →₀ ℕ), ↑(coeff R n_1) (φ * ↑(monomial R n) a) = ↑(coeff R n_1) (↑(monomial R n) a * φ)
m : σ →₀ ℕ
this : ↑(coeff R (m + n)) (φ * ↑(monomial R n) a) = ↑(coeff R (m + n)) (↑(monomial R n) a * φ)
⊢ Commute (↑(coeff R m) φ) a
[PROOFSTEP]
rwa [coeff_add_mul_monomial, add_comm, coeff_add_monomial_mul] at this 
[GOAL]
case refine'_2
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (m : σ →₀ ℕ), Commute (↑(coeff R m) φ) a
m : σ →₀ ℕ
⊢ ↑(coeff R m) (φ * ↑(monomial R n) a) = ↑(coeff R m) (↑(monomial R n) a * φ)
[PROOFSTEP]
rw [coeff_mul_monomial, coeff_monomial_mul]
[GOAL]
case refine'_2
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (m : σ →₀ ℕ), Commute (↑(coeff R m) φ) a
m : σ →₀ ℕ
⊢ (if n ≤ m then ↑(coeff R (m - n)) φ * a else 0) = if n ≤ m then a * ↑(coeff R (m - n)) φ else 0
[PROOFSTEP]
split_ifs <;> [apply h; rfl]
[GOAL]
case refine'_2
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (m : σ →₀ ℕ), Commute (↑(coeff R m) φ) a
m : σ →₀ ℕ
⊢ (if n ≤ m then ↑(coeff R (m - n)) φ * a else 0) = if n ≤ m then a * ↑(coeff R (m - n)) φ else 0
[PROOFSTEP]
split_ifs
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (m : σ →₀ ℕ), Commute (↑(coeff R m) φ) a
m : σ →₀ ℕ
h✝ : n ≤ m
⊢ ↑(coeff R (m - n)) φ * a = a * ↑(coeff R (m - n)) φ
[PROOFSTEP]
apply h
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m✝ n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
a : R
n : σ →₀ ℕ
h : ∀ (m : σ →₀ ℕ), Commute (↑(coeff R m) φ) a
m : σ →₀ ℕ
h✝ : ¬n ≤ m
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (1 * φ) = ↑(coeff R n) φ
[PROOFSTEP]
simpa using coeff_add_monomial_mul 0 n φ 1
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (φ * 1) = ↑(coeff R n) φ
[PROOFSTEP]
simpa using coeff_add_mul_monomial n 0 φ 1
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (φ₁ * (φ₂ + φ₃)) = ↑(coeff R n) (φ₁ * φ₂ + φ₁ * φ₃)
[PROOFSTEP]
simp only [coeff_mul, mul_add, Finset.sum_add_distrib, LinearMap.map_add]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) ((φ₁ + φ₂) * φ₃) = ↑(coeff R n) (φ₁ * φ₃ + φ₂ * φ₃)
[PROOFSTEP]
simp only [coeff_mul, add_mul, Finset.sum_add_distrib, LinearMap.map_add]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
⊢ φ₁ * φ₂ * φ₃ = φ₁ * (φ₂ * φ₃)
[PROOFSTEP]
ext1 n
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (φ₁ * φ₂ * φ₃) = ↑(coeff R n) (φ₁ * (φ₂ * φ₃))
[PROOFSTEP]
simp only [coeff_mul, Finset.sum_mul, Finset.mul_sum, Finset.sum_sigma']
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∑ x in Finset.sigma (antidiagonal n) fun a => antidiagonal a.fst,
      ↑(coeff R x.snd.fst) φ₁ * ↑(coeff R x.snd.snd) φ₂ * ↑(coeff R x.fst.snd) φ₃ =
    ∑ x in Finset.sigma (antidiagonal n) fun a => antidiagonal a.snd,
      ↑(coeff R x.fst.fst) φ₁ * (↑(coeff R x.snd.fst) φ₂ * ↑(coeff R x.snd.snd) φ₃)
[PROOFSTEP]
refine' Finset.sum_bij (fun p _ => ⟨(p.2.1, p.2.2 + p.1.2), (p.2.2, p.1.2)⟩) _ _ _ _
[GOAL]
case h.refine'_1
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (a : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ))
    (ha : a ∈ Finset.sigma (antidiagonal n) fun a => antidiagonal a.fst),
    (fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a ha ∈
      Finset.sigma (antidiagonal n) fun a => antidiagonal a.snd
[PROOFSTEP]
simp only [mem_antidiagonal, Finset.mem_sigma, heq_iff_eq, Prod.mk.inj_iff, and_imp, exists_prop]
[GOAL]
case h.refine'_2
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (a : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ))
    (ha : a ∈ Finset.sigma (antidiagonal n) fun a => antidiagonal a.fst),
    ↑(coeff R a.snd.fst) φ₁ * ↑(coeff R a.snd.snd) φ₂ * ↑(coeff R a.fst.snd) φ₃ =
      ↑(coeff R
              ((fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a ha).fst.fst)
          φ₁ *
        (↑(coeff R
                ((fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a
                      ha).snd.fst)
            φ₂ *
          ↑(coeff R
                ((fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a
                      ha).snd.snd)
            φ₃)
[PROOFSTEP]
simp only [mem_antidiagonal, Finset.mem_sigma, heq_iff_eq, Prod.mk.inj_iff, and_imp, exists_prop]
[GOAL]
case h.refine'_3
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (a₁ a₂ : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ))
    (ha₁ : a₁ ∈ Finset.sigma (antidiagonal n) fun a => antidiagonal a.fst)
    (ha₂ : a₂ ∈ Finset.sigma (antidiagonal n) fun a => antidiagonal a.fst),
    (fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a₁ ha₁ =
        (fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a₂ ha₂ →
      a₁ = a₂
[PROOFSTEP]
simp only [mem_antidiagonal, Finset.mem_sigma, heq_iff_eq, Prod.mk.inj_iff, and_imp, exists_prop]
[GOAL]
case h.refine'_4
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (b : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ)),
    (b ∈ Finset.sigma (antidiagonal n) fun a => antidiagonal a.snd) →
      ∃ a ha, b = (fun p x => { fst := (p.snd.fst, p.snd.snd + p.fst.snd), snd := (p.snd.snd, p.fst.snd) }) a ha
[PROOFSTEP]
simp only [mem_antidiagonal, Finset.mem_sigma, heq_iff_eq, Prod.mk.inj_iff, and_imp, exists_prop]
[GOAL]
case h.refine'_1
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (a : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ)),
    a.fst.fst + a.fst.snd = n → a.snd.fst + a.snd.snd = a.fst.fst → a.snd.fst + (a.snd.snd + a.fst.snd) = n ∧ True
[PROOFSTEP]
rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩
[GOAL]
case h.refine'_1.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n i j k l : σ →₀ ℕ
⊢ { fst := (i, j), snd := (k, l) }.fst.fst + { fst := (i, j), snd := (k, l) }.fst.snd = n →
    { fst := (i, j), snd := (k, l) }.snd.fst + { fst := (i, j), snd := (k, l) }.snd.snd =
        { fst := (i, j), snd := (k, l) }.fst.fst →
      { fst := (i, j), snd := (k, l) }.snd.fst +
            ({ fst := (i, j), snd := (k, l) }.snd.snd + { fst := (i, j), snd := (k, l) }.fst.snd) =
          n ∧
        True
[PROOFSTEP]
dsimp only
[GOAL]
case h.refine'_1.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n i j k l : σ →₀ ℕ
⊢ i + j = n → k + l = i → k + (l + j) = n ∧ True
[PROOFSTEP]
rintro rfl rfl
[GOAL]
case h.refine'_1.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
j k l : σ →₀ ℕ
⊢ k + (l + j) = k + l + j ∧ True
[PROOFSTEP]
simp [add_assoc]
[GOAL]
case h.refine'_2
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (a : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ)),
    a.fst.fst + a.fst.snd = n →
      a.snd.fst + a.snd.snd = a.fst.fst →
        ↑(coeff R a.snd.fst) φ₁ * ↑(coeff R a.snd.snd) φ₂ * ↑(coeff R a.fst.snd) φ₃ =
          ↑(coeff R a.snd.fst) φ₁ * (↑(coeff R a.snd.snd) φ₂ * ↑(coeff R a.fst.snd) φ₃)
[PROOFSTEP]
rintro ⟨⟨a, b⟩, ⟨c, d⟩⟩
[GOAL]
case h.refine'_2.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n a b c d : σ →₀ ℕ
⊢ { fst := (a, b), snd := (c, d) }.fst.fst + { fst := (a, b), snd := (c, d) }.fst.snd = n →
    { fst := (a, b), snd := (c, d) }.snd.fst + { fst := (a, b), snd := (c, d) }.snd.snd =
        { fst := (a, b), snd := (c, d) }.fst.fst →
      ↑(coeff R { fst := (a, b), snd := (c, d) }.snd.fst) φ₁ * ↑(coeff R { fst := (a, b), snd := (c, d) }.snd.snd) φ₂ *
          ↑(coeff R { fst := (a, b), snd := (c, d) }.fst.snd) φ₃ =
        ↑(coeff R { fst := (a, b), snd := (c, d) }.snd.fst) φ₁ *
          (↑(coeff R { fst := (a, b), snd := (c, d) }.snd.snd) φ₂ *
            ↑(coeff R { fst := (a, b), snd := (c, d) }.fst.snd) φ₃)
[PROOFSTEP]
dsimp only
[GOAL]
case h.refine'_2.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n a b c d : σ →₀ ℕ
⊢ a + b = n →
    c + d = a →
      ↑(coeff R c) φ₁ * ↑(coeff R d) φ₂ * ↑(coeff R b) φ₃ = ↑(coeff R c) φ₁ * (↑(coeff R d) φ₂ * ↑(coeff R b) φ₃)
[PROOFSTEP]
rintro rfl rfl
[GOAL]
case h.refine'_2.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
b c d : σ →₀ ℕ
⊢ ↑(coeff R c) φ₁ * ↑(coeff R d) φ₂ * ↑(coeff R b) φ₃ = ↑(coeff R c) φ₁ * (↑(coeff R d) φ₂ * ↑(coeff R b) φ₃)
[PROOFSTEP]
apply mul_assoc
[GOAL]
case h.refine'_3
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (a₁ a₂ : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ)),
    a₁.fst.fst + a₁.fst.snd = n →
      a₁.snd.fst + a₁.snd.snd = a₁.fst.fst →
        a₂.fst.fst + a₂.fst.snd = n →
          a₂.snd.fst + a₂.snd.snd = a₂.fst.fst →
            { fst := (a₁.snd.fst, a₁.snd.snd + a₁.fst.snd), snd := (a₁.snd.snd, a₁.fst.snd) } =
                { fst := (a₂.snd.fst, a₂.snd.snd + a₂.fst.snd), snd := (a₂.snd.snd, a₂.fst.snd) } →
              a₁ = a₂
[PROOFSTEP]
rintro ⟨⟨a, b⟩, ⟨c, d⟩⟩ ⟨⟨i, j⟩, ⟨k, l⟩⟩
[GOAL]
case h.refine'_3.mk.mk.mk.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n a b c d i j k l : σ →₀ ℕ
⊢ { fst := (a, b), snd := (c, d) }.fst.fst + { fst := (a, b), snd := (c, d) }.fst.snd = n →
    { fst := (a, b), snd := (c, d) }.snd.fst + { fst := (a, b), snd := (c, d) }.snd.snd =
        { fst := (a, b), snd := (c, d) }.fst.fst →
      { fst := (i, j), snd := (k, l) }.fst.fst + { fst := (i, j), snd := (k, l) }.fst.snd = n →
        { fst := (i, j), snd := (k, l) }.snd.fst + { fst := (i, j), snd := (k, l) }.snd.snd =
            { fst := (i, j), snd := (k, l) }.fst.fst →
          {
                fst :=
                  ({ fst := (a, b), snd := (c, d) }.snd.fst,
                    { fst := (a, b), snd := (c, d) }.snd.snd + { fst := (a, b), snd := (c, d) }.fst.snd),
                snd := ({ fst := (a, b), snd := (c, d) }.snd.snd, { fst := (a, b), snd := (c, d) }.fst.snd) } =
              {
                fst :=
                  ({ fst := (i, j), snd := (k, l) }.snd.fst,
                    { fst := (i, j), snd := (k, l) }.snd.snd + { fst := (i, j), snd := (k, l) }.fst.snd),
                snd := ({ fst := (i, j), snd := (k, l) }.snd.snd, { fst := (i, j), snd := (k, l) }.fst.snd) } →
            { fst := (a, b), snd := (c, d) } = { fst := (i, j), snd := (k, l) }
[PROOFSTEP]
dsimp only
[GOAL]
case h.refine'_3.mk.mk.mk.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n a b c d i j k l : σ →₀ ℕ
⊢ a + b = n →
    c + d = a →
      i + j = n →
        k + l = i →
          { fst := (c, d + b), snd := (d, b) } = { fst := (k, l + j), snd := (l, j) } →
            { fst := (a, b), snd := (c, d) } = { fst := (i, j), snd := (k, l) }
[PROOFSTEP]
rintro rfl rfl - rfl
[GOAL]
case h.refine'_3.mk.mk.mk.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
b c d j k l : σ →₀ ℕ
⊢ { fst := (c, d + b), snd := (d, b) } = { fst := (k, l + j), snd := (l, j) } →
    { fst := (c + d, b), snd := (c, d) } = { fst := (k + l, j), snd := (k, l) }
[PROOFSTEP]
simp only [Sigma.mk.inj_iff, Prod.mk.injEq, heq_iff_eq, and_imp]
[GOAL]
case h.refine'_3.mk.mk.mk.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
b c d j k l : σ →₀ ℕ
⊢ c = k → d + b = l + j → d = l → b = j → (c + d = k + l ∧ b = j) ∧ c = k ∧ d = l
[PROOFSTEP]
rintro rfl - rfl rfl
[GOAL]
case h.refine'_3.mk.mk.mk.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
b c d : σ →₀ ℕ
⊢ (c + d = c + d ∧ b = b) ∧ c = c ∧ d = d
[PROOFSTEP]
simp only [and_self]
[GOAL]
case h.refine'_4
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (b : (_ : (σ →₀ ℕ) × (σ →₀ ℕ)) × (σ →₀ ℕ) × (σ →₀ ℕ)),
    b.fst.fst + b.fst.snd = n →
      b.snd.fst + b.snd.snd = b.fst.snd →
        ∃ a,
          (a.fst.fst + a.fst.snd = n ∧ a.snd.fst + a.snd.snd = a.fst.fst) ∧
            b = { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }
[PROOFSTEP]
rintro ⟨⟨i, j⟩, ⟨k, l⟩⟩
[GOAL]
case h.refine'_4.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n i j k l : σ →₀ ℕ
⊢ { fst := (i, j), snd := (k, l) }.fst.fst + { fst := (i, j), snd := (k, l) }.fst.snd = n →
    { fst := (i, j), snd := (k, l) }.snd.fst + { fst := (i, j), snd := (k, l) }.snd.snd =
        { fst := (i, j), snd := (k, l) }.fst.snd →
      ∃ a,
        (a.fst.fst + a.fst.snd = n ∧ a.snd.fst + a.snd.snd = a.fst.fst) ∧
          { fst := (i, j), snd := (k, l) } =
            { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }
[PROOFSTEP]
dsimp only
[GOAL]
case h.refine'_4.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n✝ : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
n i j k l : σ →₀ ℕ
⊢ i + j = n →
    k + l = j →
      ∃ a,
        (a.fst.fst + a.fst.snd = n ∧ a.snd.fst + a.snd.snd = a.fst.fst) ∧
          { fst := (i, j), snd := (k, l) } =
            { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }
[PROOFSTEP]
rintro rfl rfl
[GOAL]
case h.refine'_4.mk.mk.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
i k l : σ →₀ ℕ
⊢ ∃ a,
    (a.fst.fst + a.fst.snd = i + (k + l) ∧ a.snd.fst + a.snd.snd = a.fst.fst) ∧
      { fst := (i, k + l), snd := (k, l) } =
        { fst := (a.snd.fst, a.snd.snd + a.fst.snd), snd := (a.snd.snd, a.fst.snd) }
[PROOFSTEP]
refine' ⟨⟨(i + k, l), (i, k)⟩, _, _⟩
[GOAL]
case h.refine'_4.mk.mk.mk.refine'_1
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
i k l : σ →₀ ℕ
⊢ { fst := (i + k, l), snd := (i, k) }.fst.fst + { fst := (i + k, l), snd := (i, k) }.fst.snd = i + (k + l) ∧
    { fst := (i + k, l), snd := (i, k) }.snd.fst + { fst := (i + k, l), snd := (i, k) }.snd.snd =
      { fst := (i + k, l), snd := (i, k) }.fst.fst
[PROOFSTEP]
simp [add_assoc]
[GOAL]
case h.refine'_4.mk.mk.mk.refine'_2
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
φ ψ φ₁ φ₂ φ₃ : MvPowerSeries σ R
i k l : σ →₀ ℕ
⊢ { fst := (i, k + l), snd := (k, l) } =
    {
      fst :=
        ({ fst := (i + k, l), snd := (i, k) }.snd.fst,
          { fst := (i + k, l), snd := (i, k) }.snd.snd + { fst := (i + k, l), snd := (i, k) }.fst.snd),
      snd := ({ fst := (i + k, l), snd := (i, k) }.snd.snd, { fst := (i + k, l), snd := (i, k) }.fst.snd) }
[PROOFSTEP]
simp [add_assoc]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
⊢ Semiring (MvPowerSeries σ R)
[PROOFSTEP]
infer_instance
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
src✝ : Semiring (MvPowerSeries σ R) :=
  let_fun this := inferInstance;
  this
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑(coeff R n) (φ * ψ) = ↑(coeff R n) (ψ * φ)
[PROOFSTEP]
simpa only [coeff_mul, mul_comm] using sum_antidiagonal_swap n fun a b => coeff R a φ * coeff R b ψ
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
⊢ ↑(monomial R m) a * ↑(monomial R n) b = ↑(monomial R (m + n)) (a * b)
[PROOFSTEP]
ext k
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
⊢ ↑(coeff R k) (↑(monomial R m) a * ↑(monomial R n) b) = ↑(coeff R k) (↑(monomial R (m + n)) (a * b))
[PROOFSTEP]
simp only [coeff_mul_monomial, coeff_monomial]
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
⊢ (if n ≤ k then (if k - n = m then a else 0) * b else 0) = if k = m + n then a * b else 0
[PROOFSTEP]
split_ifs with h₁ h₂ h₃ h₃ h₂
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : k - n = m
h₃ : k = m + n
⊢ a * b = a * b
[PROOFSTEP]
try rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : k - n = m
h₃ : k = m + n
⊢ a * b = a * b
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : k - n = m
h₃ : ¬k = m + n
⊢ a * b = 0
[PROOFSTEP]
try rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : k - n = m
h₃ : ¬k = m + n
⊢ a * b = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬k - n = m
h₃ : k = m + n
⊢ 0 * b = a * b
[PROOFSTEP]
try rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬k - n = m
h₃ : k = m + n
⊢ 0 * b = a * b
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬k - n = m
h₃ : ¬k = m + n
⊢ 0 * b = 0
[PROOFSTEP]
try rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬k - n = m
h₃ : ¬k = m + n
⊢ 0 * b = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : ¬n ≤ k
h₂ : k = m + n
⊢ 0 = a * b
[PROOFSTEP]
try rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : ¬n ≤ k
h₂ : k = m + n
⊢ 0 = a * b
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : ¬n ≤ k
h₂ : ¬k = m + n
⊢ 0 = 0
[PROOFSTEP]
try rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : ¬n ≤ k
h₂ : ¬k = m + n
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : k - n = m
h₃ : ¬k = m + n
⊢ a * b = 0
[PROOFSTEP]
rw [← h₂, tsub_add_cancel_of_le h₁] at h₃ 
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : k - n = m
h₃ : ¬k = k
⊢ a * b = 0
[PROOFSTEP]
exact (h₃ rfl).elim
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬k - n = m
h₃ : k = m + n
⊢ 0 * b = a * b
[PROOFSTEP]
rw [h₃, add_tsub_cancel_right] at h₂ 
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬m = m
h₃ : k = m + n
⊢ 0 * b = a * b
[PROOFSTEP]
exact (h₂ rfl).elim
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : n ≤ k
h₂ : ¬k - n = m
h₃ : ¬k = m + n
⊢ 0 * b = 0
[PROOFSTEP]
exact zero_mul b
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : ¬n ≤ k
h₂ : k = m + n
⊢ 0 = a * b
[PROOFSTEP]
rw [h₂] at h₁ 
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
m n : σ →₀ ℕ
a b : R
k : σ →₀ ℕ
h₁ : ¬n ≤ m + n
h₂ : k = m + n
⊢ 0 = a * b
[PROOFSTEP]
exact (h₁ <| le_add_left le_rfl).elim
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
s t : σ
⊢ ↑(coeff R (single t 1)) (X s) = if t = s then 1 else 0
[PROOFSTEP]
simp only [coeff_X, single_left_inj (one_ne_zero : (1 : ℕ) ≠ 0)]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
⊢ ↑(coeff R 0) (X s) = 0
[PROOFSTEP]
rw [coeff_X, if_neg]
[GOAL]
case hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
⊢ ¬0 = single s 1
[PROOFSTEP]
intro h
[GOAL]
case hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
h : 0 = single s 1
⊢ False
[PROOFSTEP]
exact one_ne_zero (single_eq_zero.mp h.symm)
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
⊢ X s ^ n = ↑(monomial R (single s n)) 1
[PROOFSTEP]
induction' n with n ih
[GOAL]
case zero
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
⊢ X s ^ Nat.zero = ↑(monomial R (single s Nat.zero)) 1
[PROOFSTEP]
simp
[GOAL]
case succ
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
ih : X s ^ n = ↑(monomial R (single s n)) 1
⊢ X s ^ Nat.succ n = ↑(monomial R (single s (Nat.succ n))) 1
[PROOFSTEP]
rw [pow_succ', ih, Nat.succ_eq_add_one, Finsupp.single_add, X, monomial_mul_monomial, one_mul]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : DecidableEq σ
m : σ →₀ ℕ
s : σ
n : ℕ
⊢ ↑(coeff R m) (X s ^ n) = if m = single s n then 1 else 0
[PROOFSTEP]
rw [X_pow_eq s n, coeff_monomial]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
n : σ →₀ ℕ
φ : MvPowerSeries σ R
a : R
⊢ ↑(coeff R n) (φ * ↑(C σ R) a) = ↑(coeff R n) φ * a
[PROOFSTEP]
simpa using coeff_add_mul_monomial n 0 φ a
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
n : σ →₀ ℕ
φ : MvPowerSeries σ R
a : R
⊢ ↑(coeff R n) (↑(C σ R) a * φ) = a * ↑(coeff R n) φ
[PROOFSTEP]
simpa using coeff_add_monomial_mul 0 n φ a
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
φ : MvPowerSeries σ R
s : σ
⊢ ↑(coeff R 0) (φ * X s) = 0
[PROOFSTEP]
have : ¬single s 1 ≤ 0 := fun h => by simpa using h s
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
φ : MvPowerSeries σ R
s : σ
h : single s 1 ≤ 0
⊢ False
[PROOFSTEP]
simpa using h s
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
φ : MvPowerSeries σ R
s : σ
this : ¬single s 1 ≤ 0
⊢ ↑(coeff R 0) (φ * X s) = 0
[PROOFSTEP]
simp only [X, coeff_mul_monomial, if_neg this]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
φ : MvPowerSeries σ R
s : σ
⊢ ↑(coeff R 0) (X s * φ) = 0
[PROOFSTEP]
rw [← (φ.commute_X s).eq, coeff_zero_mul_X]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
src✝ : MvPowerSeries σ R →ₗ[R] R := coeff R 0
φ ψ : MvPowerSeries σ R
⊢ OneHom.toFun { toFun := ↑(coeff R 0), map_one' := (_ : ↑(coeff R 0) 1 = 1) } (φ * ψ) =
    OneHom.toFun { toFun := ↑(coeff R 0), map_one' := (_ : ↑(coeff R 0) 1 = 1) } φ *
      OneHom.toFun { toFun := ↑(coeff R 0), map_one' := (_ : ↑(coeff R 0) 1 = 1) } ψ
[PROOFSTEP]
simp [coeff_mul, support_single_ne_zero]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : MvPowerSeries σ R
a : R
⊢ a • f = ↑(C σ R) a * f
[PROOFSTEP]
ext
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
f : MvPowerSeries σ R
a : R
n✝ : σ →₀ ℕ
⊢ ↑(coeff R n✝) (a • f) = ↑(coeff R n✝) (↑(C σ R) a * f)
[PROOFSTEP]
simp
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
⊢ X s = X t → s = t
[PROOFSTEP]
intro h
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h : X s = X t
⊢ s = t
[PROOFSTEP]
replace h := congr_arg (coeff R (single s 1)) h
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
⊢ s = t
[PROOFSTEP]
rw [coeff_X, if_pos rfl, coeff_X] at h 
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
h : 1 = if single s 1 = single t 1 then 1 else 0
⊢ s = t
[PROOFSTEP]
split_ifs at h  with H
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
H : single s 1 = single t 1
h : 1 = 1
⊢ s = t
[PROOFSTEP]
rw [Finsupp.single_eq_single_iff] at H 
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
H : s = t ∧ 1 = 1 ∨ 1 = 0 ∧ 1 = 0
h : 1 = 1
⊢ s = t
[PROOFSTEP]
cases' H with H H
[GOAL]
case pos.inl
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
h : 1 = 1
H : s = t ∧ 1 = 1
⊢ s = t
[PROOFSTEP]
exact H.1
[GOAL]
case pos.inr
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
h : 1 = 1
H : 1 = 0 ∧ 1 = 0
⊢ s = t
[PROOFSTEP]
exfalso
[GOAL]
case pos.inr.h
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
h : 1 = 1
H : 1 = 0 ∧ 1 = 0
⊢ False
[PROOFSTEP]
exact one_ne_zero H.1
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
H : ¬single s 1 = single t 1
h : 1 = 0
⊢ s = t
[PROOFSTEP]
exfalso
[GOAL]
case neg.h
σ : Type u_1
R : Type u_2
inst✝¹ : Semiring R
inst✝ : Nontrivial R
s t : σ
h✝¹ : ↑(coeff R (single s 1)) (X s) = ↑(coeff R (single s 1)) (X t)
h✝ : 1 = ↑(coeff R (single s 1)) (X t)
H : ¬single s 1 = single t 1
h : 1 = 0
⊢ False
[PROOFSTEP]
exact one_ne_zero h
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n : σ →₀ ℕ
⊢ ↑f (↑(coeff R n) 1) = ↑(coeff S n) 1
[PROOFSTEP]
rw [coeff_one, coeff_one]
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n : σ →₀ ℕ
⊢ ↑f (if n = 0 then 1 else 0) = if n = 0 then 1 else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n : σ →₀ ℕ
h : n = 0
⊢ ↑f (if n = 0 then 1 else 0) = 1
[PROOFSTEP]
simp only [RingHom.map_ite_one_zero, ite_true, map_one, h]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n : σ →₀ ℕ
h : ¬n = 0
⊢ ↑f (if n = 0 then 1 else 0) = 0
[PROOFSTEP]
simp only [RingHom.map_ite_one_zero, ite_false, map_zero, h]
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑f (↑(coeff R n) (φ * ψ)) =
    ↑(coeff S n)
      (OneHom.toFun
          { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } φ *
        OneHom.toFun
          { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } ψ)
[PROOFSTEP]
rw [coeff_mul, map_sum, coeff_mul]
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∑ x in antidiagonal n, ↑f (↑(coeff R x.fst) φ * ↑(coeff R x.snd) ψ) =
    ∑ p in antidiagonal n,
      ↑(coeff S p.fst)
          (OneHom.toFun
            { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } φ) *
        ↑(coeff S p.snd)
          (OneHom.toFun
            { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } ψ)
[PROOFSTEP]
apply Finset.sum_congr rfl
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ∀ (x : (σ →₀ ℕ) × (σ →₀ ℕ)),
    x ∈ antidiagonal n →
      ↑f (↑(coeff R x.fst) φ * ↑(coeff R x.snd) ψ) =
        ↑(coeff S x.fst)
            (OneHom.toFun
              { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } φ) *
          ↑(coeff S x.snd)
            (OneHom.toFun
              { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } ψ)
[PROOFSTEP]
rintro ⟨i, j⟩ _
[GOAL]
case mk
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
φ ψ : MvPowerSeries σ R
n i j : σ →₀ ℕ
a✝ : (i, j) ∈ antidiagonal n
⊢ ↑f (↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ) =
    ↑(coeff S (i, j).fst)
        (OneHom.toFun
          { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } φ) *
      ↑(coeff S (i, j).snd)
        (OneHom.toFun
          { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } ψ)
[PROOFSTEP]
rw [f.map_mul]
[GOAL]
case mk
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
φ ψ : MvPowerSeries σ R
n i j : σ →₀ ℕ
a✝ : (i, j) ∈ antidiagonal n
⊢ ↑f (↑(coeff R (i, j).fst) φ) * ↑f (↑(coeff R (i, j).snd) ψ) =
    ↑(coeff S (i, j).fst)
        (OneHom.toFun
          { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } φ) *
      ↑(coeff S (i, j).snd)
        (OneHom.toFun
          { toFun := fun φ n => ↑f (↑(coeff R n) φ), map_one' := (_ : (fun φ n => ↑f (↑(coeff R n) φ)) 1 = 1) } ψ)
[PROOFSTEP]
rfl
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
φ ψ : MvPowerSeries σ R
n : σ →₀ ℕ
⊢ ↑f (↑(coeff R n) (φ + ψ)) = ↑f (↑(coeff R n) φ) + ↑f (↑(coeff R n) ψ)
[PROOFSTEP]
simp
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n : σ →₀ ℕ
a : R
⊢ ↑(map σ f) (↑(monomial R n) a) = ↑(monomial S n) (↑f a)
[PROOFSTEP]
ext m
[GOAL]
case h
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
⊢ ↑(coeff S m) (↑(map σ f) (↑(monomial R n) a)) = ↑(coeff S m) (↑(monomial S n) (↑f a))
[PROOFSTEP]
simp [coeff_monomial, apply_ite f]
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
T : Type u_4
inst✝² : Semiring R
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
s : σ
⊢ ↑(map σ f) (X s) = X s
[PROOFSTEP]
simp [MvPowerSeries.X]
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
⊢ Module R (MvPowerSeries σ A)
[PROOFSTEP]
infer_instance
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : Module R (MvPowerSeries σ A) :=
  let_fun this := inferInstance;
  this
a : R
φ : (fun x => MvPowerSeries σ A) a
⊢ ↑(RingHom.comp (map σ (algebraMap R A)) (C σ R)) a * φ = φ * ↑(RingHom.comp (map σ (algebraMap R A)) (C σ R)) a
[PROOFSTEP]
ext n
[GOAL]
case h
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : Module R (MvPowerSeries σ A) :=
  let_fun this := inferInstance;
  this
a : R
φ : (fun x => MvPowerSeries σ A) a
n : σ →₀ ℕ
⊢ ↑(coeff A n) (↑(RingHom.comp (map σ (algebraMap R A)) (C σ R)) a * φ) =
    ↑(coeff A n) (φ * ↑(RingHom.comp (map σ (algebraMap R A)) (C σ R)) a)
[PROOFSTEP]
simp [Algebra.commutes]
[GOAL]
σ✝ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : Module R (MvPowerSeries σ✝ A) :=
  let_fun this := inferInstance;
  this
a : R
σ : (fun x => MvPowerSeries σ✝ A) a
⊢ a • σ = ↑(RingHom.comp (map σ✝ (algebraMap R A)) (C σ✝ R)) a * σ
[PROOFSTEP]
ext n
[GOAL]
case h
σ✝ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : Module R (MvPowerSeries σ✝ A) :=
  let_fun this := inferInstance;
  this
a : R
σ : (fun x => MvPowerSeries σ✝ A) a
n : σ✝ →₀ ℕ
⊢ ↑(coeff A n) (a • σ) = ↑(coeff A n) (↑(RingHom.comp (map σ✝ (algebraMap R A)) (C σ✝ R)) a * σ)
[PROOFSTEP]
simp [(coeff A n).map_smul_of_tower a, Algebra.smul_def]
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
⊢ ↑(algebraMap R (MvPowerSeries σ A)) r = ↑(C σ A) (↑(algebraMap R A) r)
[PROOFSTEP]
change (MvPowerSeries.map σ (algebraMap R A)).comp (C σ R) r = _
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝² : CommSemiring R
inst✝¹ : Semiring A
inst✝ : Algebra R A
r : R
⊢ ↑(RingHom.comp (map σ (algebraMap R A)) (C σ R)) r = ↑(C σ A) (↑(algebraMap R A) r)
[PROOFSTEP]
simp
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
⊢ ⊥ ≠ ⊤
[PROOFSTEP]
rw [Ne.def, SetLike.ext_iff, not_forall]
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
⊢ ∃ x, ¬(x ∈ ⊥ ↔ x ∈ ⊤)
[PROOFSTEP]
inhabit σ
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
inhabited_h : Inhabited σ
⊢ ∃ x, ¬(x ∈ ⊥ ↔ x ∈ ⊤)
[PROOFSTEP]
refine' ⟨X default, _⟩
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
inhabited_h : Inhabited σ
⊢ ¬(X default ∈ ⊥ ↔ X default ∈ ⊤)
[PROOFSTEP]
simp only [Algebra.mem_bot, not_exists, Set.mem_range, iff_true_iff, Algebra.mem_top]
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
inhabited_h : Inhabited σ
⊢ ∀ (x : R), ¬↑(algebraMap R (MvPowerSeries σ R)) x = X default
[PROOFSTEP]
intro x
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
inhabited_h : Inhabited σ
x : R
⊢ ¬↑(algebraMap R (MvPowerSeries σ R)) x = X default
[PROOFSTEP]
rw [ext_iff, not_forall]
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
inhabited_h : Inhabited σ
x : R
⊢ ∃ x_1, ¬↑(coeff R x_1) (↑(algebraMap R (MvPowerSeries σ R)) x) = ↑(coeff R x_1) (X default)
[PROOFSTEP]
refine' ⟨Finsupp.single default 1, _⟩
[GOAL]
σ : Type u_1
R : Type u_2
A : Type u_3
inst✝⁴ : CommSemiring R
inst✝³ : Semiring A
inst✝² : Algebra R A
inst✝¹ : Nonempty σ
inst✝ : Nontrivial R
inhabited_h : Inhabited σ
x : R
⊢ ¬↑(coeff R (single default 1)) (↑(algebraMap R (MvPowerSeries σ R)) x) = ↑(coeff R (single default 1)) (X default)
[PROOFSTEP]
simp [algebraMap_apply, coeff_C]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n m : σ →₀ ℕ
φ : MvPowerSeries σ R
⊢ MvPolynomial.coeff m (truncFun n φ) = if m < n then ↑(coeff R m) φ else 0
[PROOFSTEP]
simp [truncFun, MvPolynomial.coeff_sum]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
⊢ truncFun n 0 = 0
[PROOFSTEP]
ext
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n m✝ : σ →₀ ℕ
⊢ MvPolynomial.coeff m✝ (truncFun n 0) = MvPolynomial.coeff m✝ 0
[PROOFSTEP]
simp [coeff_truncFun]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
⊢ ∀ (x y : MvPowerSeries σ R),
    ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } (x + y) =
      ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } x +
        ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } y
[PROOFSTEP]
intros x y
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
x y : MvPowerSeries σ R
⊢ ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } (x + y) =
    ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } x +
      ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } y
[PROOFSTEP]
ext m
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
x y : MvPowerSeries σ R
m : σ →₀ ℕ
⊢ MvPolynomial.coeff m (ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } (x + y)) =
    MvPolynomial.coeff m
      (ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } x +
        ZeroHom.toFun { toFun := truncFun n, map_zero' := (_ : truncFun n 0 = 0) } y)
[PROOFSTEP]
simp only [coeff_truncFun, MvPolynomial.coeff_add]
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
x y : MvPowerSeries σ R
m : σ →₀ ℕ
⊢ (if m < n then ↑(coeff R m) (x + y) else 0) =
    (if m < n then ↑(coeff R m) x else 0) + if m < n then ↑(coeff R m) y else 0
[PROOFSTEP]
split_ifs
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
x y : MvPowerSeries σ R
m : σ →₀ ℕ
h✝ : m < n
⊢ ↑(coeff R m) (x + y) = ↑(coeff R m) x + ↑(coeff R m) y
[PROOFSTEP]
rw [map_add]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : σ →₀ ℕ
x y : MvPowerSeries σ R
m : σ →₀ ℕ
h✝ : ¬m < n
⊢ 0 = 0 + 0
[PROOFSTEP]
rw [zero_add]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n m : σ →₀ ℕ
φ : MvPowerSeries σ R
⊢ MvPolynomial.coeff m (↑(trunc R n) φ) = if m < n then ↑(coeff R m) φ else 0
[PROOFSTEP]
simp [trunc, coeff_truncFun]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
⊢ MvPolynomial.coeff m (↑(trunc R n) 1) = MvPolynomial.coeff m 1
[PROOFSTEP]
rw [coeff_trunc, coeff_one]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
⊢ (if m < n then if m = 0 then 1 else 0 else 0) = MvPolynomial.coeff m 1
[PROOFSTEP]
split_ifs with H H'
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : m < n
H' : m = 0
⊢ 1 = MvPolynomial.coeff m 1
[PROOFSTEP]
subst m
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
H : 0 < n
⊢ 1 = MvPolynomial.coeff 0 1
[PROOFSTEP]
simp
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : m < n
H' : ¬m = 0
⊢ 0 = MvPolynomial.coeff m 1
[PROOFSTEP]
symm
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : m < n
H' : ¬m = 0
⊢ MvPolynomial.coeff m 1 = 0
[PROOFSTEP]
rw [MvPolynomial.coeff_one]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : m < n
H' : ¬m = 0
⊢ (if 0 = m then 1 else 0) = 0
[PROOFSTEP]
exact if_neg (Ne.symm H')
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : ¬m < n
⊢ 0 = MvPolynomial.coeff m 1
[PROOFSTEP]
symm
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : ¬m < n
⊢ MvPolynomial.coeff m 1 = 0
[PROOFSTEP]
rw [MvPolynomial.coeff_one]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : ¬m < n
⊢ (if 0 = m then 1 else 0) = 0
[PROOFSTEP]
refine' if_neg _
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
m : σ →₀ ℕ
H : ¬m < n
⊢ ¬0 = m
[PROOFSTEP]
rintro rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
H : ¬0 < n
⊢ False
[PROOFSTEP]
apply H
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
H : ¬0 < n
⊢ 0 < n
[PROOFSTEP]
exact Ne.bot_lt hnn
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
⊢ MvPolynomial.coeff m (↑(trunc R n) (↑(C σ R) a)) = MvPolynomial.coeff m (↑MvPolynomial.C a)
[PROOFSTEP]
rw [coeff_trunc, coeff_C, MvPolynomial.coeff_C]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
⊢ (if m < n then if m = 0 then a else 0 else 0) = if 0 = m then a else 0
[PROOFSTEP]
split_ifs with H
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : m = 0
h✝ : 0 = m
⊢ a = a
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : m = 0
h✝ : 0 = m
⊢ a = a
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : m = 0
h✝ : ¬0 = m
⊢ a = 0
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : m = 0
h✝ : ¬0 = m
⊢ a = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : m = 0
h✝ : ¬0 = m
⊢ a = 0
[PROOFSTEP]
try simp_all
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : m = 0
h✝ : ¬0 = m
⊢ a = 0
[PROOFSTEP]
simp_all
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : ¬m = 0
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : ¬m = 0
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : ¬m = 0
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
try simp_all
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : ¬m = 0
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
simp_all
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : ¬m = 0
h✝ : ¬0 = m
⊢ 0 = 0
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : m < n
h✝¹ : ¬m = 0
h✝ : ¬0 = m
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : ¬m < n
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : ¬m < n
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : ¬m < n
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
try simp_all
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : ¬m < n
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
simp_all
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : ¬m < n
h✝ : ¬0 = m
⊢ 0 = 0
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
hnn : n ≠ 0
a : R
m : σ →₀ ℕ
H : ¬m < n
h✝ : ¬0 = m
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
hnn : ¬n = m
H : ¬m < n
h✝ : 0 = m
⊢ 0 = a
[PROOFSTEP]
exfalso
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
hnn : ¬n = m
H : ¬m < n
h✝ : 0 = m
⊢ False
[PROOFSTEP]
apply H
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
hnn : ¬n = m
H : ¬m < n
h✝ : 0 = m
⊢ m < n
[PROOFSTEP]
subst m
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n✝ n : σ →₀ ℕ
a : R
hnn : ¬n = 0
H : ¬0 < n
⊢ 0 < n
[PROOFSTEP]
exact Ne.bot_lt hnn
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
⊢ X s ^ n ∣ φ ↔ ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
⊢ X s ^ n ∣ φ → ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
[PROOFSTEP]
rintro ⟨φ, rfl⟩ m h
[GOAL]
case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m : σ →₀ ℕ
h : ↑m s < n
⊢ ↑(coeff R m) (X s ^ n * φ) = 0
[PROOFSTEP]
rw [coeff_mul, Finset.sum_eq_zero]
[GOAL]
case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m : σ →₀ ℕ
h : ↑m s < n
⊢ ∀ (x : (σ →₀ ℕ) × (σ →₀ ℕ)), x ∈ antidiagonal m → ↑(coeff R x.fst) (X s ^ n) * ↑(coeff R x.snd) φ = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case mp.intro.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m : σ →₀ ℕ
h : ↑m s < n
i j : σ →₀ ℕ
hij : (i, j) ∈ antidiagonal m
⊢ ↑(coeff R (i, j).fst) (X s ^ n) * ↑(coeff R (i, j).snd) φ = 0
[PROOFSTEP]
rw [coeff_X_pow, if_neg, zero_mul]
[GOAL]
case mp.intro.mk.hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m : σ →₀ ℕ
h : ↑m s < n
i j : σ →₀ ℕ
hij : (i, j) ∈ antidiagonal m
⊢ ¬(i, j).fst = single s n
[PROOFSTEP]
contrapose! h
[GOAL]
case mp.intro.mk.hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m i j : σ →₀ ℕ
hij : (i, j) ∈ antidiagonal m
h : i = single s n
⊢ n ≤ ↑m s
[PROOFSTEP]
subst i
[GOAL]
case mp.intro.mk.hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m j : σ →₀ ℕ
hij : (single s n, j) ∈ antidiagonal m
⊢ n ≤ ↑m s
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal] at hij 
[GOAL]
case mp.intro.mk.hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m j : σ →₀ ℕ
hij : (single s n, j).fst + (single s n, j).snd = m
⊢ n ≤ ↑m s
[PROOFSTEP]
rw [← hij, Finsupp.add_apply, Finsupp.single_eq_same]
[GOAL]
case mp.intro.mk.hnc
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
m j : σ →₀ ℕ
hij : (single s n, j).fst + (single s n, j).snd = m
⊢ n ≤ n + ↑(single s n, j).snd s
[PROOFSTEP]
exact Nat.le_add_right n _
[GOAL]
case mpr
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
⊢ (∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0) → X s ^ n ∣ φ
[PROOFSTEP]
intro h
[GOAL]
case mpr
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
⊢ X s ^ n ∣ φ
[PROOFSTEP]
refine' ⟨fun m => coeff R (m + single s n) φ, _⟩
[GOAL]
case mpr
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
⊢ φ = X s ^ n * fun m => ↑(coeff R (m + single s n)) φ
[PROOFSTEP]
ext m
[GOAL]
case mpr.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
⊢ ↑(coeff R m) φ = ↑(coeff R m) (X s ^ n * fun m => ↑(coeff R (m + single s n)) φ)
[PROOFSTEP]
by_cases H : m - single s n + single s n = m
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
⊢ ↑(coeff R m) φ = ↑(coeff R m) (X s ^ n * fun m => ↑(coeff R (m + single s n)) φ)
[PROOFSTEP]
rw [coeff_mul, Finset.sum_eq_single (single s n, m - single s n)]
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
⊢ ↑(coeff R m) φ =
    ↑(coeff R (single s n, m - single s n).fst) (X s ^ n) *
      ↑(coeff R (single s n, m - single s n).snd) fun m => ↑(coeff R (m + single s n)) φ
[PROOFSTEP]
rw [coeff_X_pow, if_pos rfl, one_mul]
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
⊢ ↑(coeff R m) φ = ↑(coeff R (single s n, m - single s n).snd) fun m => ↑(coeff R (m + single s n)) φ
[PROOFSTEP]
simpa using congr_arg (fun m : σ →₀ ℕ => coeff R m φ) H.symm
[GOAL]
case pos.h₀
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
⊢ ∀ (b : (σ →₀ ℕ) × (σ →₀ ℕ)),
    b ∈ antidiagonal m →
      b ≠ (single s n, m - single s n) →
        (↑(coeff R b.fst) (X s ^ n) * ↑(coeff R b.snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hij hne
[GOAL]
case pos.h₀.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j) ∈ antidiagonal m
hne : (i, j) ≠ (single s n, m - single s n)
⊢ (↑(coeff R (i, j).fst) (X s ^ n) * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal] at hij 
[GOAL]
case pos.h₀.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
⊢ (↑(coeff R (i, j).fst) (X s ^ n) * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
rw [coeff_X_pow]
[GOAL]
case pos.h₀.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
⊢ ((if (i, j).fst = single s n then 1 else 0) * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
split_ifs with hi
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : (i, j).fst = single s n
⊢ (1 * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : (i, j).fst = single s n
⊢ False
[PROOFSTEP]
apply hne
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : (i, j).fst = single s n
⊢ (i, j) = (single s n, m - single s n)
[PROOFSTEP]
rw [← hij, ← hi, Prod.mk.inj_iff]
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : (i, j).fst = single s n
⊢ i = (i, j).fst ∧ j = (i, j).fst + (i, j).snd - (i, j).fst
[PROOFSTEP]
refine' ⟨rfl, _⟩
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : (i, j).fst = single s n
⊢ j = (i, j).fst + (i, j).snd - (i, j).fst
[PROOFSTEP]
ext t
[GOAL]
case pos.h.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : (i, j).fst = single s n
t : σ
⊢ ↑j t = ↑((i, j).fst + (i, j).snd - (i, j).fst) t
[PROOFSTEP]
simp only [add_tsub_cancel_left, Finsupp.add_apply, Finsupp.tsub_apply]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hne : (i, j) ≠ (single s n, m - single s n)
hi : ¬(i, j).fst = single s n
⊢ (0 * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
exact zero_mul _
[GOAL]
case pos.h₁
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
⊢ ¬(single s n, m - single s n) ∈ antidiagonal m →
    (↑(coeff R (single s n, m - single s n).fst) (X s ^ n) *
        ↑(coeff R (single s n, m - single s n).snd) fun m => ↑(coeff R (m + single s n)) φ) =
      0
[PROOFSTEP]
intro hni
[GOAL]
case pos.h₁
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
hni : ¬(single s n, m - single s n) ∈ antidiagonal m
⊢ (↑(coeff R (single s n, m - single s n).fst) (X s ^ n) *
      ↑(coeff R (single s n, m - single s n).snd) fun m => ↑(coeff R (m + single s n)) φ) =
    0
[PROOFSTEP]
exfalso
[GOAL]
case pos.h₁.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
hni : ¬(single s n, m - single s n) ∈ antidiagonal m
⊢ False
[PROOFSTEP]
apply hni
[GOAL]
case pos.h₁.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : m - single s n + single s n = m
hni : ¬(single s n, m - single s n) ∈ antidiagonal m
⊢ (single s n, m - single s n) ∈ antidiagonal m
[PROOFSTEP]
rwa [Finsupp.mem_antidiagonal, add_comm]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
⊢ ↑(coeff R m) φ = ↑(coeff R m) (X s ^ n * fun m => ↑(coeff R (m + single s n)) φ)
[PROOFSTEP]
rw [h, coeff_mul, Finset.sum_eq_zero]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
⊢ ∀ (x : (σ →₀ ℕ) × (σ →₀ ℕ)),
    x ∈ antidiagonal m → (↑(coeff R x.fst) (X s ^ n) * ↑(coeff R x.snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case neg.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j) ∈ antidiagonal m
⊢ (↑(coeff R (i, j).fst) (X s ^ n) * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal] at hij 
[GOAL]
case neg.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
⊢ (↑(coeff R (i, j).fst) (X s ^ n) * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
rw [coeff_X_pow]
[GOAL]
case neg.mk
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
⊢ ((if (i, j).fst = single s n then 1 else 0) * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
split_ifs with hi
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hi : (i, j).fst = single s n
⊢ (1 * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hi : (i, j).fst = single s n
⊢ False
[PROOFSTEP]
apply H
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hi : (i, j).fst = single s n
⊢ m - single s n + single s n = m
[PROOFSTEP]
rw [← hij, hi]
[GOAL]
case pos.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hi : (i, j).fst = single s n
⊢ single s n + (i, j).snd - single s n + single s n = single s n + (i, j).snd
[PROOFSTEP]
ext
[GOAL]
case pos.h.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hi : (i, j).fst = single s n
a✝ : σ
⊢ ↑(single s n + (i, j).snd - single s n + single s n) a✝ = ↑(single s n + (i, j).snd) a✝
[PROOFSTEP]
rw [coe_add, coe_add, Pi.add_apply, Pi.add_apply, add_tsub_cancel_left, add_comm]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
i j : σ →₀ ℕ
hij : (i, j).fst + (i, j).snd = m
hi : ¬(i, j).fst = single s n
⊢ (0 * ↑(coeff R (i, j).snd) fun m => ↑(coeff R (m + single s n)) φ) = 0
[PROOFSTEP]
exact zero_mul _
[GOAL]
case neg.a
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : ¬m - single s n + single s n = m
⊢ ↑m s < n
[PROOFSTEP]
contrapose! H
[GOAL]
case neg.a
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : n ≤ ↑m s
⊢ m - single s n + single s n = m
[PROOFSTEP]
ext t
[GOAL]
case neg.a.h
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : n ≤ ↑m s
t : σ
⊢ ↑(m - single s n + single s n) t = ↑m t
[PROOFSTEP]
by_cases hst : s = t
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : n ≤ ↑m s
t : σ
hst : s = t
⊢ ↑(m - single s n + single s n) t = ↑m t
[PROOFSTEP]
subst t
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : n ≤ ↑m s
⊢ ↑(m - single s n + single s n) s = ↑m s
[PROOFSTEP]
simpa using tsub_add_cancel_of_le H
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
n : ℕ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < n → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
H : n ≤ ↑m s
t : σ
hst : ¬s = t
⊢ ↑(m - single s n + single s n) t = ↑m t
[PROOFSTEP]
simp [Finsupp.single_apply, hst]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
φ : MvPowerSeries σ R
⊢ X s ∣ φ ↔ ∀ (m : σ →₀ ℕ), ↑m s = 0 → ↑(coeff R m) φ = 0
[PROOFSTEP]
rw [← pow_one (X s : MvPowerSeries σ R), X_pow_dvd_iff]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
φ : MvPowerSeries σ R
⊢ (∀ (m : σ →₀ ℕ), ↑m s < 1 → ↑(coeff R m) φ = 0) ↔ ∀ (m : σ →₀ ℕ), ↑m s = 0 → ↑(coeff R m) φ = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
φ : MvPowerSeries σ R
⊢ (∀ (m : σ →₀ ℕ), ↑m s < 1 → ↑(coeff R m) φ = 0) → ∀ (m : σ →₀ ℕ), ↑m s = 0 → ↑(coeff R m) φ = 0
[PROOFSTEP]
intro h m hm
[GOAL]
case mpr
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
φ : MvPowerSeries σ R
⊢ (∀ (m : σ →₀ ℕ), ↑m s = 0 → ↑(coeff R m) φ = 0) → ∀ (m : σ →₀ ℕ), ↑m s < 1 → ↑(coeff R m) φ = 0
[PROOFSTEP]
intro h m hm
[GOAL]
case mp
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s < 1 → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
hm : ↑m s = 0
⊢ ↑(coeff R m) φ = 0
[PROOFSTEP]
exact h m (hm.symm ▸ zero_lt_one)
[GOAL]
case mpr
σ : Type u_1
R : Type u_2
inst✝ : Semiring R
s : σ
φ : MvPowerSeries σ R
h : ∀ (m : σ →₀ ℕ), ↑m s = 0 → ↑(coeff R m) φ = 0
m : σ →₀ ℕ
hm : ↑m s < 1
⊢ ↑(coeff R m) φ = 0
[PROOFSTEP]
exact h m (Nat.eq_zero_of_le_zero <| Nat.le_of_succ_le_succ hm)
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Ring R
inst✝ : DecidableEq σ
n : σ →₀ ℕ
a : R
φ : MvPowerSeries σ R
⊢ inv.aux a φ n =
    if n = 0 then a
    else -a * ∑ x in antidiagonal n, if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (inv.aux a φ) else 0
[PROOFSTEP]
rw [inv.aux]
  -- unify `Decidable` instances
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Ring R
inst✝ : DecidableEq σ
n : σ →₀ ℕ
a : R
φ : MvPowerSeries σ R
⊢ (if n = 0 then a
    else -a * ∑ x in antidiagonal n, if x_1 : x.snd < n then ↑(coeff R x.fst) φ * inv.aux a φ x.snd else 0) =
    if n = 0 then a
    else -a * ∑ x in antidiagonal n, if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (inv.aux a φ) else 0
[PROOFSTEP]
convert rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : Ring R
inst✝ : DecidableEq σ
n : σ →₀ ℕ
φ : MvPowerSeries σ R
u : Rˣ
⊢ ↑(coeff R n) (invOfUnit φ u) =
    if n = 0 then ↑u⁻¹
    else -↑u⁻¹ * ∑ x in antidiagonal n, if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (invOfUnit φ u) else 0
[PROOFSTEP]
convert coeff_inv_aux n (↑u⁻¹) φ
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
⊢ ↑(constantCoeff σ R) (invOfUnit φ u) = ↑u⁻¹
[PROOFSTEP]
rw [← coeff_zero_eq_constantCoeff_apply, coeff_invOfUnit, if_pos rfl]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : n = 0
⊢ ↑(coeff R n) (φ * invOfUnit φ u) = ↑(coeff R n) 1
[PROOFSTEP]
rw [H]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : n = 0
⊢ ↑(coeff R 0) (φ * invOfUnit φ u) = ↑(coeff R 0) 1
[PROOFSTEP]
simp [coeff_mul, support_single_ne_zero, h]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
⊢ ↑(coeff R n) (φ * invOfUnit φ u) = ↑(coeff R n) 1
[PROOFSTEP]
have : ((0 : σ →₀ ℕ), n) ∈ n.antidiagonal := by rw [Finsupp.mem_antidiagonal, zero_add]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
⊢ (0, n) ∈ antidiagonal n
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal, zero_add]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
this : (0, n) ∈ antidiagonal n
⊢ ↑(coeff R n) (φ * invOfUnit φ u) = ↑(coeff R n) 1
[PROOFSTEP]
rw [coeff_one, if_neg H, coeff_mul, ← Finset.insert_erase this, Finset.sum_insert (Finset.not_mem_erase _ _),
  coeff_zero_eq_constantCoeff_apply, h, coeff_invOfUnit, if_neg H, neg_mul, mul_neg, Units.mul_inv_cancel_left, ←
  Finset.insert_erase this, Finset.sum_insert (Finset.not_mem_erase _ _), Finset.insert_erase this,
  if_neg (not_lt_of_ge <| le_rfl), zero_add, add_comm, ← sub_eq_add_neg, sub_eq_zero, Finset.sum_congr rfl]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
this : (0, n) ∈ antidiagonal n
⊢ ∀ (x : (σ →₀ ℕ) × (σ →₀ ℕ)),
    x ∈ Finset.erase (antidiagonal n) (0, n) →
      ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (invOfUnit φ u) =
        if x.snd < (0, n).snd then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (invOfUnit φ u) else 0
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case mk
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
this : (0, n) ∈ antidiagonal n
i j : σ →₀ ℕ
hij : (i, j) ∈ Finset.erase (antidiagonal n) (0, n)
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) =
    if (i, j).snd < (0, n).snd then ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) else 0
[PROOFSTEP]
rw [Finset.mem_erase, Finsupp.mem_antidiagonal] at hij 
[GOAL]
case mk
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
this : (0, n) ∈ antidiagonal n
i j : σ →₀ ℕ
hij : (i, j) ≠ (0, n) ∧ (i, j).fst + (i, j).snd = n
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) =
    if (i, j).snd < (0, n).snd then ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) else 0
[PROOFSTEP]
cases' hij with h₁ h₂
[GOAL]
case mk.intro
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
n : σ →₀ ℕ
H : ¬n = 0
this : (0, n) ∈ antidiagonal n
i j : σ →₀ ℕ
h₁ : (i, j) ≠ (0, n)
h₂ : (i, j).fst + (i, j).snd = n
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) =
    if (i, j).snd < (0, n).snd then ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) else 0
[PROOFSTEP]
subst n
[GOAL]
case mk.intro
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u) =
    if (i, j).snd < (0, (i, j).fst + (i, j).snd).snd then
      ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (invOfUnit φ u)
    else 0
[PROOFSTEP]
rw [if_pos]
[GOAL]
case mk.intro.hc
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
⊢ (i, j).snd < (0, (i, j).fst + (i, j).snd).snd
[PROOFSTEP]
suffices (0 : _) + j < i + j by simpa
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this✝ : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
this : 0 + j < i + j
⊢ (i, j).snd < (0, (i, j).fst + (i, j).snd).snd
[PROOFSTEP]
simpa
[GOAL]
case mk.intro.hc
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
⊢ 0 + j < i + j
[PROOFSTEP]
apply add_lt_add_right
[GOAL]
case mk.intro.hc.bc
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
⊢ 0 < i
[PROOFSTEP]
constructor
[GOAL]
case mk.intro.hc.bc.left
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
⊢ ∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑0 i_1) (↑i i_1)
[PROOFSTEP]
intro s
[GOAL]
case mk.intro.hc.bc.left
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
s : σ
⊢ PartialOrder.toPreorder.1.1 (↑0 s) (↑i s)
[PROOFSTEP]
exact Nat.zero_le _
[GOAL]
case mk.intro.hc.bc.right
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
⊢ ¬∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑i i_1) (↑0 i_1)
[PROOFSTEP]
intro H
[GOAL]
case mk.intro.hc.bc.right
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H✝ : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
H : ∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑i i_1) (↑0 i_1)
⊢ False
[PROOFSTEP]
apply h₁
[GOAL]
case mk.intro.hc.bc.right
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H✝ : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
H : ∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑i i_1) (↑0 i_1)
⊢ (i, j) = (0, (i, j).fst + (i, j).snd)
[PROOFSTEP]
suffices i = 0 by simp [this]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H✝ : ¬(i, j).fst + (i, j).snd = 0
this✝ : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
H : ∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑i i_1) (↑0 i_1)
this : i = 0
⊢ (i, j) = (0, (i, j).fst + (i, j).snd)
[PROOFSTEP]
simp [this]
[GOAL]
case mk.intro.hc.bc.right
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H✝ : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
H : ∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑i i_1) (↑0 i_1)
⊢ i = 0
[PROOFSTEP]
ext1 s
[GOAL]
case mk.intro.hc.bc.right.h
σ : Type u_1
R : Type u_2
inst✝ : Ring R
φ : MvPowerSeries σ R
u : Rˣ
h : ↑(constantCoeff σ R) φ = ↑u
i j : σ →₀ ℕ
H✝ : ¬(i, j).fst + (i, j).snd = 0
this : (0, (i, j).fst + (i, j).snd) ∈ antidiagonal ((i, j).fst + (i, j).snd)
h₁ : (i, j) ≠ (0, (i, j).fst + (i, j).snd)
H : ∀ (i_1 : σ), PartialOrder.toPreorder.1.1 (↑i i_1) (↑0 i_1)
s : σ
⊢ ↑i s = ↑0 s
[PROOFSTEP]
exact Nat.eq_zero_of_le_zero (H s)
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
⊢ ∀ (a : MvPowerSeries σ R), IsUnit a ∨ IsUnit (1 - a)
[PROOFSTEP]
intro φ
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
⊢ IsUnit φ ∨ IsUnit (1 - φ)
[PROOFSTEP]
rcases LocalRing.isUnit_or_isUnit_one_sub_self (constantCoeff σ R φ) with (⟨u, h⟩ | ⟨u, h⟩) <;> [left; right]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
⊢ IsUnit φ ∨ IsUnit (1 - φ)
[PROOFSTEP]
rcases LocalRing.isUnit_or_isUnit_one_sub_self (constantCoeff σ R φ) with (⟨u, h⟩ | ⟨u, h⟩)
[GOAL]
case inl.intro
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
u : ((fun x => R) φ)ˣ
h : ↑u = ↑(constantCoeff σ R) φ
⊢ IsUnit φ ∨ IsUnit (1 - φ)
[PROOFSTEP]
left
[GOAL]
case inr.intro
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
u : ((fun x => R) φ)ˣ
h : ↑u = 1 - ↑(constantCoeff σ R) φ
⊢ IsUnit φ ∨ IsUnit (1 - φ)
[PROOFSTEP]
right
[GOAL]
case inl.intro.h
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
u : ((fun x => R) φ)ˣ
h : ↑u = ↑(constantCoeff σ R) φ
⊢ IsUnit φ
[PROOFSTEP]
refine' isUnit_of_mul_eq_one _ _ (mul_invOfUnit _ u _)
[GOAL]
case inl.intro.h
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
u : ((fun x => R) φ)ˣ
h : ↑u = ↑(constantCoeff σ R) φ
⊢ ↑(constantCoeff σ ((fun x => R) φ)) φ = ↑u
[PROOFSTEP]
simpa using h.symm
[GOAL]
case inr.intro.h
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
u : ((fun x => R) φ)ˣ
h : ↑u = 1 - ↑(constantCoeff σ R) φ
⊢ IsUnit (1 - φ)
[PROOFSTEP]
refine' isUnit_of_mul_eq_one _ _ (mul_invOfUnit _ u _)
[GOAL]
case inr.intro.h
σ : Type u_1
R : Type u_2
inst✝¹ : CommRing R
inst✝ : LocalRing R
φ : MvPowerSeries σ R
u : ((fun x => R) φ)ˣ
h : ↑u = 1 - ↑(constantCoeff σ R) φ
⊢ ↑(constantCoeff σ ((fun x => R) φ)) (1 - φ) = ↑u
[PROOFSTEP]
simpa using h.symm
[GOAL]
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
⊢ ∀ (a : MvPowerSeries σ R), IsUnit (↑(map σ f) a) → IsUnit a
[PROOFSTEP]
rintro φ ⟨ψ, h⟩
[GOAL]
case intro
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
φ : MvPowerSeries σ R
ψ : ((fun x => MvPowerSeries σ S) φ)ˣ
h : ↑ψ = ↑(map σ f) φ
⊢ IsUnit φ
[PROOFSTEP]
replace h := congr_arg (constantCoeff σ S) h
[GOAL]
case intro
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
φ : MvPowerSeries σ R
ψ : ((fun x => MvPowerSeries σ S) φ)ˣ
h : ↑(constantCoeff σ S) ↑ψ = ↑(constantCoeff σ S) (↑(map σ f) φ)
⊢ IsUnit φ
[PROOFSTEP]
rw [constantCoeff_map] at h 
[GOAL]
case intro
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
φ : MvPowerSeries σ R
ψ : ((fun x => MvPowerSeries σ S) φ)ˣ
h : ↑(constantCoeff σ S) ↑ψ = ↑f (↑(constantCoeff σ R) φ)
⊢ IsUnit φ
[PROOFSTEP]
have : IsUnit (constantCoeff σ S ↑ψ) := isUnit_constantCoeff (↑ψ) ψ.isUnit
[GOAL]
case intro
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
φ : MvPowerSeries σ R
ψ : ((fun x => MvPowerSeries σ S) φ)ˣ
h : ↑(constantCoeff σ S) ↑ψ = ↑f (↑(constantCoeff σ R) φ)
this : IsUnit (↑(constantCoeff σ S) ↑ψ)
⊢ IsUnit φ
[PROOFSTEP]
rw [h] at this 
[GOAL]
case intro
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
φ : MvPowerSeries σ R
ψ : ((fun x => MvPowerSeries σ S) φ)ˣ
h : ↑(constantCoeff σ S) ↑ψ = ↑f (↑(constantCoeff σ R) φ)
this : IsUnit (↑f (↑(constantCoeff σ R) φ))
⊢ IsUnit φ
[PROOFSTEP]
rcases isUnit_of_map_unit f _ this with ⟨c, hc⟩
[GOAL]
case intro.intro
σ : Type u_1
R : Type u_2
S : Type u_3
inst✝² : CommRing R
inst✝¹ : CommRing S
f : R →+* S
inst✝ : IsLocalRingHom f
φ : MvPowerSeries σ R
ψ : ((fun x => MvPowerSeries σ S) φ)ˣ
h : ↑(constantCoeff σ S) ↑ψ = ↑f (↑(constantCoeff σ R) φ)
this : IsUnit (↑f (↑(constantCoeff σ R) φ))
c : Rˣ
hc : ↑c = ↑(constantCoeff σ R) φ
⊢ IsUnit φ
[PROOFSTEP]
exact isUnit_of_mul_eq_one φ (invOfUnit φ c) (mul_invOfUnit φ c hc.symm)
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
⊢ ↑(constantCoeff σ k) φ⁻¹ = (↑(constantCoeff σ k) φ)⁻¹
[PROOFSTEP]
rw [← coeff_zero_eq_constantCoeff_apply, coeff_inv, if_pos rfl]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : φ⁻¹ = 0
⊢ ↑(constantCoeff σ k) φ = 0
[PROOFSTEP]
simpa using congr_arg (constantCoeff σ k) h
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ = 0
n : σ →₀ ℕ
⊢ ↑(coeff k n) φ⁻¹ = ↑(coeff k n) 0
[PROOFSTEP]
rw [coeff_inv]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ = 0
n : σ →₀ ℕ
⊢ (if n = 0 then (↑(constantCoeff σ k) φ)⁻¹
    else
      -(↑(constantCoeff σ k) φ)⁻¹ *
        ∑ x in antidiagonal n, if x.snd < n then ↑(coeff k x.fst) φ * ↑(coeff k x.snd) φ⁻¹ else 0) =
    ↑(coeff k n) 0
[PROOFSTEP]
split_ifs
[GOAL]
case pos
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ = 0
n : σ →₀ ℕ
h✝ : n = 0
⊢ (↑(constantCoeff σ k) φ)⁻¹ = ↑(coeff k n) 0
[PROOFSTEP]
simp only [h, map_zero, zero_mul, inv_zero, neg_zero]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ = 0
n : σ →₀ ℕ
h✝ : ¬n = 0
⊢ (-(↑(constantCoeff σ k) φ)⁻¹ *
      ∑ x in antidiagonal n, if x.snd < n then ↑(coeff k x.fst) φ * ↑(coeff k x.snd) φ⁻¹ else 0) =
    ↑(coeff k n) 0
[PROOFSTEP]
simp only [h, map_zero, zero_mul, inv_zero, neg_zero]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
⊢ 0⁻¹ = 0
[PROOFSTEP]
rw [inv_eq_zero, constantCoeff_zero]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
u : kˣ
h : ↑(constantCoeff σ k) φ = ↑u
⊢ invOfUnit φ u = φ⁻¹
[PROOFSTEP]
rw [← invOfUnit_eq φ (h.symm ▸ u.ne_zero)]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
u : kˣ
h : ↑(constantCoeff σ k) φ = ↑u
⊢ invOfUnit φ u = invOfUnit φ (Units.mk0 (↑(constantCoeff σ k) φ) (_ : ↑(constantCoeff σ k) φ ≠ 0))
[PROOFSTEP]
apply congrArg (invOfUnit φ)
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
u : kˣ
h : ↑(constantCoeff σ k) φ = ↑u
⊢ u = Units.mk0 (↑(constantCoeff σ k) φ) (_ : ↑(constantCoeff σ k) φ ≠ 0)
[PROOFSTEP]
rw [Units.ext_iff]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
u : kˣ
h : ↑(constantCoeff σ k) φ = ↑u
⊢ ↑u = ↑(Units.mk0 (↑(constantCoeff σ k) φ) (_ : ↑(constantCoeff σ k) φ ≠ 0))
[PROOFSTEP]
exact h.symm
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ ≠ 0
⊢ φ * φ⁻¹ = 1
[PROOFSTEP]
rw [← invOfUnit_eq φ h, mul_invOfUnit φ (Units.mk0 _ h) rfl]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ ≠ 0
⊢ φ⁻¹ * φ = 1
[PROOFSTEP]
rw [mul_comm, φ.mul_inv_cancel h]
[GOAL]
σ : Type u_1
R : Type u_2
k✝ : Type u_3
inst✝ : Field k✝
φ₁ φ₂ φ₃ : MvPowerSeries σ k✝
h : ↑(constantCoeff σ k✝) φ₃ ≠ 0
k : φ₁ = φ₂ * φ₃⁻¹
⊢ φ₁ * φ₃ = φ₂
[PROOFSTEP]
simp [k, mul_assoc, MvPowerSeries.inv_mul_cancel _ h]
[GOAL]
σ : Type u_1
R : Type u_2
k✝ : Type u_3
inst✝ : Field k✝
φ₁ φ₂ φ₃ : MvPowerSeries σ k✝
h : ↑(constantCoeff σ k✝) φ₃ ≠ 0
k : φ₁ * φ₃ = φ₂
⊢ φ₁ = φ₂ * φ₃⁻¹
[PROOFSTEP]
simp [← k, mul_assoc, MvPowerSeries.mul_inv_cancel _ h]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) ψ ≠ 0
⊢ φ = ψ⁻¹ ↔ φ * ψ = 1
[PROOFSTEP]
rw [← MvPowerSeries.eq_mul_inv_iff_mul_eq h, one_mul]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) ψ ≠ 0
⊢ ψ⁻¹ = φ ↔ φ * ψ = 1
[PROOFSTEP]
rw [eq_comm, MvPowerSeries.eq_inv_iff_mul_eq_one h]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
⊢ (φ * ψ)⁻¹ = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
by_cases h : constantCoeff σ k (φ * ψ) = 0
[GOAL]
case pos
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) (φ * ψ) = 0
⊢ (φ * ψ)⁻¹ = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
rw [inv_eq_zero.mpr h]
[GOAL]
case pos
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) (φ * ψ) = 0
⊢ 0 = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
simp only [map_mul, mul_eq_zero] at h 
[GOAL]
case pos
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ = 0 ∨ ↑(constantCoeff σ k) ψ = 0
⊢ 0 = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
cases' h with h h
[GOAL]
case pos.inl
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) φ = 0
⊢ 0 = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
simp [inv_eq_zero.mpr h]
[GOAL]
case pos.inr
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ↑(constantCoeff σ k) ψ = 0
⊢ 0 = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
simp [inv_eq_zero.mpr h]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ¬↑(constantCoeff σ k) (φ * ψ) = 0
⊢ (φ * ψ)⁻¹ = ψ⁻¹ * φ⁻¹
[PROOFSTEP]
rw [MvPowerSeries.inv_eq_iff_mul_eq_one h]
[GOAL]
case neg
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ¬↑(constantCoeff σ k) (φ * ψ) = 0
⊢ ψ⁻¹ * φ⁻¹ * (φ * ψ) = 1
[PROOFSTEP]
simp only [not_or, map_mul, mul_eq_zero] at h 
[GOAL]
case neg
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
φ ψ : MvPowerSeries σ k
h : ¬↑(constantCoeff σ k) φ = 0 ∧ ¬↑(constantCoeff σ k) ψ = 0
⊢ ψ⁻¹ * φ⁻¹ * (φ * ψ) = 1
[PROOFSTEP]
rw [← mul_assoc, mul_assoc _⁻¹, MvPowerSeries.inv_mul_cancel _ h.left, mul_one, MvPowerSeries.inv_mul_cancel _ h.right]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
src✝¹ : One (MvPowerSeries σ k) := inferInstanceAs (One (MvPowerSeries σ k))
src✝ : Inv (MvPowerSeries σ k) := inferInstanceAs (Inv (MvPowerSeries σ k))
⊢ 1⁻¹ = 1
[PROOFSTEP]
rw [MvPowerSeries.inv_eq_iff_mul_eq_one, mul_one]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
src✝¹ : One (MvPowerSeries σ k) := inferInstanceAs (One (MvPowerSeries σ k))
src✝ : Inv (MvPowerSeries σ k) := inferInstanceAs (Inv (MvPowerSeries σ k))
⊢ ↑(constantCoeff σ k) 1 ≠ 0
[PROOFSTEP]
simp
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
r : k
⊢ (↑(C σ k) r)⁻¹ = ↑(C σ k) r⁻¹
[PROOFSTEP]
rcases eq_or_ne r 0 with (rfl | hr)
[GOAL]
case inl
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
⊢ (↑(C σ k) 0)⁻¹ = ↑(C σ k) 0⁻¹
[PROOFSTEP]
simp
[GOAL]
case inr
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
r : k
hr : r ≠ 0
⊢ (↑(C σ k) r)⁻¹ = ↑(C σ k) r⁻¹
[PROOFSTEP]
rw [MvPowerSeries.inv_eq_iff_mul_eq_one, ← map_mul, inv_mul_cancel hr, map_one]
[GOAL]
case inr
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
r : k
hr : r ≠ 0
⊢ ↑(constantCoeff σ k) (↑(C σ k) r) ≠ 0
[PROOFSTEP]
simpa using hr
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
s : σ
⊢ (X s)⁻¹ = 0
[PROOFSTEP]
rw [inv_eq_zero, constantCoeff_X]
[GOAL]
σ : Type u_1
R : Type u_2
k : Type u_3
inst✝ : Field k
r : k
φ : MvPowerSeries σ k
⊢ (r • φ)⁻¹ = r⁻¹ • φ⁻¹
[PROOFSTEP]
simp [smul_eq_C_mul, mul_comm]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R m) ↑(↑(monomial n) a) = ↑(MvPowerSeries.coeff R m) (↑(MvPowerSeries.monomial R n) a)
[PROOFSTEP]
rw [coeff_coe, coeff_monomial, MvPowerSeries.coeff_monomial]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
⊢ (if n = m then a else 0) = if m = n then a else 0
[PROOFSTEP]
split_ifs with h₁ h₂
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : n = m
h₂ : m = n
⊢ a = a
[PROOFSTEP]
first
| rfl
| subst m; contradiction
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : n = m
h₂ : m = n
⊢ a = a
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : n = m
h₂ : ¬m = n
⊢ a = 0
[PROOFSTEP]
first
| rfl
| subst m; contradiction
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : n = m
h₂ : ¬m = n
⊢ a = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : n = m
h₂ : ¬m = n
⊢ a = 0
[PROOFSTEP]
subst m
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
h₂ : ¬n = n
⊢ a = 0
[PROOFSTEP]
contradiction
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : ¬n = m
h✝ : m = n
⊢ 0 = a
[PROOFSTEP]
first
| rfl
| subst m; contradiction
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : ¬n = m
h✝ : m = n
⊢ 0 = a
[PROOFSTEP]
rfl
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : ¬n = m
h✝ : m = n
⊢ 0 = a
[PROOFSTEP]
subst m
[GOAL]
case pos
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
h₁ : ¬n = n
⊢ 0 = a
[PROOFSTEP]
contradiction
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : ¬n = m
h✝ : ¬m = n
⊢ 0 = 0
[PROOFSTEP]
first
| rfl
| subst m; contradiction
[GOAL]
case neg
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
a : R
m : σ →₀ ℕ
h₁ : ¬n = m
h✝ : ¬m = n
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
n : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n) ↑(φ * ψ) = ↑(MvPowerSeries.coeff R n) (↑φ * ↑ψ)
[PROOFSTEP]
simp only [coeff_coe, MvPowerSeries.coeff_mul, coeff_mul]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
⊢ ↑(bit1 φ) = bit1 ↑φ
[PROOFSTEP]
rw [bit1, bit1, coe_add, coe_one, coe_bit0]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ x y : MvPolynomial σ R
h : Coe.coe x = Coe.coe y
⊢ x = y
[PROOFSTEP]
ext
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ x y : MvPolynomial σ R
h : Coe.coe x = Coe.coe y
m✝ : σ →₀ ℕ
⊢ coeff m✝ x = coeff m✝ y
[PROOFSTEP]
simp_rw [← coeff_coe]
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ x y : MvPolynomial σ R
h : Coe.coe x = Coe.coe y
m✝ : σ →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R m✝) ↑x = ↑(MvPowerSeries.coeff R m✝) ↑y
[PROOFSTEP]
congr
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
⊢ ↑φ = 0 ↔ φ = 0
[PROOFSTEP]
rw [← coe_zero, coe_inj]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
⊢ ↑φ = 1 ↔ φ = 1
[PROOFSTEP]
rw [← coe_one, coe_inj]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
φ ψ : MvPolynomial σ R
A : Type u_3
inst✝¹ : CommSemiring A
inst✝ : Algebra R A
src✝ : MvPolynomial σ R →+* MvPowerSeries σ A := RingHom.comp (MvPowerSeries.map σ (algebraMap R A)) ringHom
r : R
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : MvPolynomial σ R),
                  OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      (↑(algebraMap R (MvPolynomial σ R)) r) =
    ↑(algebraMap R (MvPowerSeries σ A)) r
[PROOFSTEP]
simp [algebraMap_apply, MvPowerSeries.algebraMap_apply]
[GOAL]
R : Type u_1
inst✝ : Inhabited R
⊢ Inhabited (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : Inhabited R
⊢ Inhabited (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : Zero R
⊢ Zero (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : Zero R
⊢ Zero (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : AddMonoid R
⊢ AddMonoid (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : AddMonoid R
⊢ AddMonoid (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : AddGroup R
⊢ AddGroup (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : AddGroup R
⊢ AddGroup (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : AddCommMonoid R
⊢ AddCommMonoid (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : AddCommMonoid R
⊢ AddCommMonoid (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : AddCommGroup R
⊢ AddCommGroup (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : AddCommGroup R
⊢ AddCommGroup (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ Semiring (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ Semiring (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
⊢ CommSemiring (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
⊢ CommSemiring (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : Ring R
⊢ Ring (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : Ring R
⊢ Ring (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : CommRing R
⊢ CommRing (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : CommRing R
⊢ CommRing (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : Nontrivial R
⊢ Nontrivial (PowerSeries R)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
inst✝ : Nontrivial R
⊢ Nontrivial (MvPowerSeries Unit R)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
A : Type ?u.2330286
inst✝² : Semiring R
inst✝¹ : AddCommMonoid A
inst✝ : Module R A
⊢ Module R (PowerSeries A)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
A : Type ?u.2330286
inst✝² : Semiring R
inst✝¹ : AddCommMonoid A
inst✝ : Module R A
⊢ Module R (MvPowerSeries Unit A)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
A : Type ?u.2336032
inst✝² : Semiring A
inst✝¹ : CommSemiring R
inst✝ : Algebra R A
⊢ Algebra R (PowerSeries A)
[PROOFSTEP]
dsimp only [PowerSeries]
[GOAL]
R : Type u_1
A : Type ?u.2336032
inst✝² : Semiring A
inst✝¹ : CommSemiring R
inst✝ : Algebra R A
⊢ Algebra R (MvPowerSeries Unit A)
[PROOFSTEP]
infer_instance
[GOAL]
R : Type u_1
inst✝ : Semiring R
s : Unit →₀ ℕ
n : ℕ
h : ↑s () = n
⊢ coeff R n = MvPowerSeries.coeff R s
[PROOFSTEP]
erw [coeff, ← h, ← Finsupp.unique_single s]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ ψ : PowerSeries R
h : ∀ (n : ℕ), ↑(coeff R n) φ = ↑(coeff R n) ψ
n : Unit →₀ ℕ
⊢ ↑(MvPowerSeries.coeff R n) φ = ↑(MvPowerSeries.coeff R n) ψ
[PROOFSTEP]
rw [← coeff_def]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ ψ : PowerSeries R
h : ∀ (n : ℕ), ↑(coeff R n) φ = ↑(coeff R n) ψ
n : Unit →₀ ℕ
⊢ ↑(coeff R ?m.2338627) φ = ↑(coeff R ?m.2338627) ψ
[PROOFSTEP]
apply h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ ψ : PowerSeries R
h : ∀ (n : ℕ), ↑(coeff R n) φ = ↑(coeff R n) ψ
n : Unit →₀ ℕ
⊢ ↑n () = ?m.2338627
R : Type u_1 inst✝ : Semiring R φ ψ : PowerSeries R h : ∀ (n : ℕ), ↑(coeff R n) φ = ↑(coeff R n) ψ n : Unit →₀ ℕ ⊢ ℕ
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝ : Semiring R
m n : ℕ
a : R
⊢ (if single () m = single () n then a else 0) = if m = n then a else 0
[PROOFSTEP]
simp only [Finsupp.unique_single_eq_iff]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
m : ℕ
⊢ ↑(coeff R m) (↑(monomial R n) a) = ↑(coeff R m) (mk fun m => if m = n then a else 0)
[PROOFSTEP]
rw [coeff_monomial, coeff_mk]
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ ↑(coeff R 0) = ↑(constantCoeff R)
[PROOFSTEP]
rw [coeff, Finsupp.single_zero]
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ ↑(MvPowerSeries.coeff R 0) = ↑(constantCoeff R)
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ↑(coeff R 0) φ = ↑(constantCoeff R) φ
[PROOFSTEP]
rw [coeff_zero_eq_constantCoeff]
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ ↑(monomial R 0) = ↑(C R)
[PROOFSTEP]
rw [monomial, Finsupp.single_zero, MvPowerSeries.monomial_zero_eq_C, C]
[GOAL]
R : Type u_1
inst✝ : Semiring R
a : R
⊢ ↑(monomial R 0) a = ↑(C R) a
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
a : R
⊢ ↑(coeff R n) (↑(C R) a) = if n = 0 then a else 0
[PROOFSTEP]
rw [← monomial_zero_eq_C_apply, coeff_monomial]
[GOAL]
R : Type u_1
inst✝ : Semiring R
a : R
⊢ ↑(coeff R 0) (↑(C R) a) = a
[PROOFSTEP]
rw [← monomial_zero_eq_C_apply, coeff_monomial_same 0 a]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ ↑(coeff R n) X = if n = 1 then 1 else 0
[PROOFSTEP]
rw [X_eq, coeff_monomial]
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ ↑(coeff R 0) X = 0
[PROOFSTEP]
rw [coeff, Finsupp.single_zero, X, MvPowerSeries.coeff_zero_X]
[GOAL]
R : Type u_1
inst✝ : Semiring R
⊢ ↑(coeff R 1) X = 1
[PROOFSTEP]
rw [coeff_X, if_pos rfl]
[GOAL]
R : Type u_1
inst✝¹ : Semiring R
inst✝ : Nontrivial R
H : X = 0
⊢ False
[PROOFSTEP]
simpa only [coeff_one_X, one_ne_zero, map_zero] using congr_arg (coeff R 1) H
[GOAL]
R : Type u_1
inst✝ : Semiring R
m n : ℕ
⊢ ↑(coeff R m) (X ^ n) = if m = n then 1 else 0
[PROOFSTEP]
rw [X_pow_eq, coeff_monomial]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
⊢ ↑(coeff R n) (X ^ n) = 1
[PROOFSTEP]
rw [coeff_X_pow, if_pos rfl]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ ψ : PowerSeries R
⊢ ↑(coeff R n) (φ * ψ) = ∑ p in Finset.Nat.antidiagonal n, ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ
[PROOFSTEP]
refine (MvPowerSeries.coeff_mul _ φ ψ).trans ?_
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ ψ : PowerSeries R
⊢ ∑ p in Finsupp.antidiagonal (single () n), ↑(MvPowerSeries.coeff R p.fst) φ * ↑(MvPowerSeries.coeff R p.snd) ψ =
    ∑ p in Finset.Nat.antidiagonal n, ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ
[PROOFSTEP]
rw [Finsupp.antidiagonal_single, Finset.sum_map]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ ψ : PowerSeries R
⊢ ∑ x in Finset.Nat.antidiagonal n,
      ↑(MvPowerSeries.coeff R
              (↑(Function.Embedding.prodMap { toFun := single (), inj' := (_ : Function.Injective (single ())) }
                      { toFun := single (), inj' := (_ : Function.Injective (single ())) })
                  x).fst)
          φ *
        ↑(MvPowerSeries.coeff R
              (↑(Function.Embedding.prodMap { toFun := single (), inj' := (_ : Function.Injective (single ())) }
                      { toFun := single (), inj' := (_ : Function.Injective (single ())) })
                  x).snd)
          ψ =
    ∑ p in Finset.Nat.antidiagonal n, ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝ : Semiring R
f : PowerSeries R
a : R
⊢ a • f = ↑(C R) a * f
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝ : Semiring R
f : PowerSeries R
a : R
n✝ : ℕ
⊢ ↑(coeff R n✝) (a • f) = ↑(coeff R n✝) (↑(C R) a * f)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ ↑(coeff R (n + 1)) (φ * X) = ↑(coeff R n) φ
[PROOFSTEP]
simp only [coeff, Finsupp.single_add]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ ↑(MvPowerSeries.coeff R (single () n + single () 1)) (φ * X) = ↑(MvPowerSeries.coeff R (single () n)) φ
[PROOFSTEP]
convert φ.coeff_add_mul_monomial (single () n) (single () 1) _
[GOAL]
case h.e'_3
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ ↑(MvPowerSeries.coeff R (single () n)) φ = ↑(MvPowerSeries.coeff R (single () n)) φ * 1
[PROOFSTEP]
rw [mul_one]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ ↑(coeff R (n + 1)) (X * φ) = ↑(coeff R n) φ
[PROOFSTEP]
simp only [coeff, Finsupp.single_add, add_comm n 1]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ ↑(MvPowerSeries.coeff R (single () 1 + single () n)) (X * φ) = ↑(MvPowerSeries.coeff R (single () n)) φ
[PROOFSTEP]
convert φ.coeff_add_monomial_mul (single () 1) (single () n) _
[GOAL]
case h.e'_3
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ ↑(MvPowerSeries.coeff R (single () n)) φ = 1 * ↑(MvPowerSeries.coeff R (single () n)) φ
[PROOFSTEP]
rw [one_mul]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ↑(coeff R 0) (φ * X) = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ↑(coeff R 0) (X * φ) = 0
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝ : Semiring R
x : R
k n : ℕ
⊢ ↑(coeff R n) (↑(C R) x * X ^ k) = if n = k then x else 0
[PROOFSTEP]
simp [X_pow_eq, coeff_monomial]
[GOAL]
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ↑(coeff R (d + n)) (p * X ^ n) = ↑(coeff R d) p
[PROOFSTEP]
rw [coeff_mul, Finset.sum_eq_single (d, n), coeff_X_pow, if_pos rfl, mul_one]
[GOAL]
case h₀
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ∀ (b : ℕ × ℕ), b ∈ Finset.Nat.antidiagonal (d + n) → b ≠ (d, n) → ↑(coeff R b.fst) p * ↑(coeff R b.snd) (X ^ n) = 0
[PROOFSTEP]
rintro ⟨i, j⟩ h1 h2
[GOAL]
case h₀.mk
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + n)
h2 : (i, j) ≠ (d, n)
⊢ ↑(coeff R (i, j).fst) p * ↑(coeff R (i, j).snd) (X ^ n) = 0
[PROOFSTEP]
rw [coeff_X_pow, if_neg, mul_zero]
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + n)
h2 : (i, j) ≠ (d, n)
⊢ ¬(i, j).snd = n
[PROOFSTEP]
rintro rfl
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + (i, j).snd)
h2 : (i, j) ≠ (d, (i, j).snd)
⊢ False
[PROOFSTEP]
apply h2
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + (i, j).snd)
h2 : (i, j) ≠ (d, (i, j).snd)
⊢ (i, j) = (d, (i, j).snd)
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal, add_right_cancel_iff] at h1 
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j).fst = d
h2 : (i, j) ≠ (d, (i, j).snd)
⊢ (i, j) = (d, (i, j).snd)
[PROOFSTEP]
subst h1
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
i j : ℕ
h2 : (i, j) ≠ ((i, j).fst, (i, j).snd)
⊢ (i, j) = ((i, j).fst, (i, j).snd)
[PROOFSTEP]
rfl
[GOAL]
case h₁
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ¬(d, n) ∈ Finset.Nat.antidiagonal (d + n) → ↑(coeff R (d, n).fst) p * ↑(coeff R (d, n).snd) (X ^ n) = 0
[PROOFSTEP]
exact fun h1 => (h1 (Finset.Nat.mem_antidiagonal.2 rfl)).elim
[GOAL]
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ↑(coeff R (d + n)) (X ^ n * p) = ↑(coeff R d) p
[PROOFSTEP]
rw [coeff_mul, Finset.sum_eq_single (n, d), coeff_X_pow, if_pos rfl, one_mul]
[GOAL]
case h₀
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ∀ (b : ℕ × ℕ), b ∈ Finset.Nat.antidiagonal (d + n) → b ≠ (n, d) → ↑(coeff R b.fst) (X ^ n) * ↑(coeff R b.snd) p = 0
[PROOFSTEP]
rintro ⟨i, j⟩ h1 h2
[GOAL]
case h₀.mk
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + n)
h2 : (i, j) ≠ (n, d)
⊢ ↑(coeff R (i, j).fst) (X ^ n) * ↑(coeff R (i, j).snd) p = 0
[PROOFSTEP]
rw [coeff_X_pow, if_neg, zero_mul]
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + n)
h2 : (i, j) ≠ (n, d)
⊢ ¬(i, j).fst = n
[PROOFSTEP]
rintro rfl
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + (i, j).fst)
h2 : (i, j) ≠ ((i, j).fst, d)
⊢ False
[PROOFSTEP]
apply h2
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j) ∈ Finset.Nat.antidiagonal (d + (i, j).fst)
h2 : (i, j) ≠ ((i, j).fst, d)
⊢ (i, j) = ((i, j).fst, d)
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal, add_comm, add_right_cancel_iff] at h1 
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
d i j : ℕ
h1 : (i, j).snd = d
h2 : (i, j) ≠ ((i, j).fst, d)
⊢ (i, j) = ((i, j).fst, d)
[PROOFSTEP]
subst h1
[GOAL]
case h₀.mk.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
i j : ℕ
h2 : (i, j) ≠ ((i, j).fst, (i, j).snd)
⊢ (i, j) = ((i, j).fst, (i, j).snd)
[PROOFSTEP]
rfl
[GOAL]
case h₁
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ¬(n, d) ∈ Finset.Nat.antidiagonal (d + n) → ↑(coeff R (n, d).fst) (X ^ n) * ↑(coeff R (n, d).snd) p = 0
[PROOFSTEP]
rw [add_comm]
[GOAL]
case h₁
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ¬(n, d) ∈ Finset.Nat.antidiagonal (n + d) → ↑(coeff R (n, d).fst) (X ^ n) * ↑(coeff R (n, d).snd) p = 0
[PROOFSTEP]
exact fun h1 => (h1 (Finset.Nat.mem_antidiagonal.2 rfl)).elim
[GOAL]
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ↑(coeff R d) (p * X ^ n) = if n ≤ d then ↑(coeff R (d - n)) p else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : n ≤ d
⊢ ↑(coeff R d) (p * X ^ n) = ↑(coeff R (d - n)) p
[PROOFSTEP]
rw [← tsub_add_cancel_of_le h, coeff_mul_X_pow, add_tsub_cancel_right]
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
⊢ ↑(coeff R d) (p * X ^ n) = 0
[PROOFSTEP]
refine' (coeff_mul _ _ _).trans (Finset.sum_eq_zero fun x hx => _)
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal d
⊢ ↑(coeff R x.fst) p * ↑(coeff R x.snd) (X ^ n) = 0
[PROOFSTEP]
rw [coeff_X_pow, if_neg, mul_zero]
[GOAL]
case neg.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal d
⊢ ¬x.snd = n
[PROOFSTEP]
exact ((le_of_add_le_right (Finset.Nat.mem_antidiagonal.mp hx).le).trans_lt <| not_le.mp h).ne
[GOAL]
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
⊢ ↑(coeff R d) (X ^ n * p) = if n ≤ d then ↑(coeff R (d - n)) p else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : n ≤ d
⊢ ↑(coeff R d) (X ^ n * p) = ↑(coeff R (d - n)) p
[PROOFSTEP]
rw [← tsub_add_cancel_of_le h, coeff_X_pow_mul]
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : n ≤ d
⊢ ↑(coeff R (d - n)) p = ↑(coeff R (d - n + n - n)) p
[PROOFSTEP]
simp
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
⊢ ↑(coeff R d) (X ^ n * p) = 0
[PROOFSTEP]
refine' (coeff_mul _ _ _).trans (Finset.sum_eq_zero fun x hx => _)
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal d
⊢ ↑(coeff R x.fst) (X ^ n) * ↑(coeff R x.snd) p = 0
[PROOFSTEP]
rw [coeff_X_pow, if_neg, zero_mul]
[GOAL]
case neg.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal d
⊢ ¬x.fst = n
[PROOFSTEP]
have := Finset.Nat.mem_antidiagonal.mp hx
[GOAL]
case neg.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal d
this : x.fst + x.snd = d
⊢ ¬x.fst = n
[PROOFSTEP]
rw [add_comm] at this 
[GOAL]
case neg.hnc
R : Type u_1
inst✝ : Semiring R
p : PowerSeries R
n d : ℕ
h : ¬n ≤ d
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal d
this : x.snd + x.fst = d
⊢ ¬x.fst = n
[PROOFSTEP]
exact ((le_of_add_le_right this.le).trans_lt <| not_le.mp h).ne
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ φ = (mk fun p => ↑(coeff R (p + 1)) φ) * X + ↑(C R) (↑(constantCoeff R) φ)
[PROOFSTEP]
ext (_ | n)
[GOAL]
case h.zero
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ↑(coeff R Nat.zero) φ = ↑(coeff R Nat.zero) ((mk fun p => ↑(coeff R (p + 1)) φ) * X + ↑(C R) (↑(constantCoeff R) φ))
[PROOFSTEP]
simp only [Nat.zero_eq, coeff_zero_eq_constantCoeff, map_add, map_mul, constantCoeff_X, mul_zero, coeff_zero_C,
  zero_add]
[GOAL]
case h.succ
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
⊢ ↑(coeff R (Nat.succ n)) φ =
    ↑(coeff R (Nat.succ n)) ((mk fun p => ↑(coeff R (p + 1)) φ) * X + ↑(C R) (↑(constantCoeff R) φ))
[PROOFSTEP]
simp only [coeff_succ_mul_X, coeff_mk, LinearMap.map_add, coeff_C, n.succ_ne_zero, sub_zero, if_false, add_zero]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ φ = (X * mk fun p => ↑(coeff R (p + 1)) φ) + ↑(C R) (↑(constantCoeff R) φ)
[PROOFSTEP]
ext (_ | n)
[GOAL]
case h.zero
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ↑(coeff R Nat.zero) φ = ↑(coeff R Nat.zero) ((X * mk fun p => ↑(coeff R (p + 1)) φ) + ↑(C R) (↑(constantCoeff R) φ))
[PROOFSTEP]
simp only [Nat.zero_eq, coeff_zero_eq_constantCoeff, map_add, map_mul, constantCoeff_X, zero_mul, coeff_zero_C,
  zero_add]
[GOAL]
case h.succ
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
⊢ ↑(coeff R (Nat.succ n)) φ =
    ↑(coeff R (Nat.succ n)) ((X * mk fun p => ↑(coeff R (p + 1)) φ) + ↑(C R) (↑(constantCoeff R) φ))
[PROOFSTEP]
simp only [coeff_succ_X_mul, coeff_mk, LinearMap.map_add, coeff_C, n.succ_ne_zero, sub_zero, if_false, add_zero]
[GOAL]
R : Type u_1
inst✝² : Semiring R
S : Type u_2
T : Type u_3
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
r : R
⊢ ↑(map f) (↑(C R) r) = ↑(C ((fun x => S) r)) (↑f r)
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝² : Semiring R
S : Type u_2
T : Type u_3
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
r : R
n✝ : ℕ
⊢ ↑(coeff S n✝) (↑(map f) (↑(C R) r)) = ↑(coeff S n✝) (↑(C ((fun x => S) r)) (↑f r))
[PROOFSTEP]
simp [coeff_C, apply_ite f]
[GOAL]
R : Type u_1
inst✝² : Semiring R
S : Type u_2
T : Type u_3
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
⊢ ↑(map f) X = X
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝² : Semiring R
S : Type u_2
T : Type u_3
inst✝¹ : Semiring S
inst✝ : Semiring T
f : R →+* S
g : S →+* T
n✝ : ℕ
⊢ ↑(coeff S n✝) (↑(map f) X) = ↑(coeff S n✝) X
[PROOFSTEP]
simp [coeff_X, apply_ite f]
[GOAL]
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ X ^ n ∣ φ ↔ ∀ (m : ℕ), m < n → ↑(coeff R m) φ = 0
[PROOFSTEP]
convert @MvPowerSeries.X_pow_dvd_iff Unit R _ () n φ
[GOAL]
case h.e'_2.a
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ (∀ (m : ℕ), m < n → ↑(coeff R m) φ = 0) ↔ ∀ (m : Unit →₀ ℕ), ↑m () < n → ↑(MvPowerSeries.coeff R m) φ = 0
[PROOFSTEP]
constructor
[GOAL]
case h.e'_2.a.mp
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ (∀ (m : ℕ), m < n → ↑(coeff R m) φ = 0) → ∀ (m : Unit →₀ ℕ), ↑m () < n → ↑(MvPowerSeries.coeff R m) φ = 0
[PROOFSTEP]
intro h m hm
[GOAL]
case h.e'_2.a.mpr
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
⊢ (∀ (m : Unit →₀ ℕ), ↑m () < n → ↑(MvPowerSeries.coeff R m) φ = 0) → ∀ (m : ℕ), m < n → ↑(coeff R m) φ = 0
[PROOFSTEP]
intro h m hm
[GOAL]
case h.e'_2.a.mp
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
h : ∀ (m : ℕ), m < n → ↑(coeff R m) φ = 0
m : Unit →₀ ℕ
hm : ↑m () < n
⊢ ↑(MvPowerSeries.coeff R m) φ = 0
[PROOFSTEP]
rw [Finsupp.unique_single m]
[GOAL]
case h.e'_2.a.mp
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
h : ∀ (m : ℕ), m < n → ↑(coeff R m) φ = 0
m : Unit →₀ ℕ
hm : ↑m () < n
⊢ ↑(MvPowerSeries.coeff R (single default (↑m default))) φ = 0
[PROOFSTEP]
convert h _ hm
[GOAL]
case h.e'_2.a.mpr
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
h : ∀ (m : Unit →₀ ℕ), ↑m () < n → ↑(MvPowerSeries.coeff R m) φ = 0
m : ℕ
hm : m < n
⊢ ↑(coeff R m) φ = 0
[PROOFSTEP]
apply h
[GOAL]
case h.e'_2.a.mpr.a
R : Type u_1
inst✝ : Semiring R
n : ℕ
φ : PowerSeries R
h : ∀ (m : Unit →₀ ℕ), ↑m () < n → ↑(MvPowerSeries.coeff R m) φ = 0
m : ℕ
hm : m < n
⊢ ↑(single () m) () < n
[PROOFSTEP]
simpa only [Finsupp.single_eq_same] using hm
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ X ∣ φ ↔ ↑(constantCoeff R) φ = 0
[PROOFSTEP]
rw [← pow_one (X : PowerSeries R), X_pow_dvd_iff, ← coeff_zero_eq_constantCoeff_apply]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (∀ (m : ℕ), m < 1 → ↑(coeff R m) φ = 0) ↔ ↑(coeff R 0) φ = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (∀ (m : ℕ), m < 1 → ↑(coeff R m) φ = 0) → ↑(coeff R 0) φ = 0
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ↑(coeff R 0) φ = 0 → ∀ (m : ℕ), m < 1 → ↑(coeff R m) φ = 0
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : ∀ (m : ℕ), m < 1 → ↑(coeff R m) φ = 0
⊢ ↑(coeff R 0) φ = 0
[PROOFSTEP]
exact h 0 zero_lt_one
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : ↑(coeff R 0) φ = 0
⊢ ∀ (m : ℕ), m < 1 → ↑(coeff R m) φ = 0
[PROOFSTEP]
intro m hm
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : ↑(coeff R 0) φ = 0
m : ℕ
hm : m < 1
⊢ ↑(coeff R m) φ = 0
[PROOFSTEP]
rwa [Nat.eq_zero_of_le_zero (Nat.le_of_succ_le_succ hm)]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
a : R
⊢ (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1
[PROOFSTEP]
ext1
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
n✝ : ℕ
⊢ ↑(coeff R n✝) ((fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1) = ↑(coeff R n✝) 1
[PROOFSTEP]
simp only [mul_boole, PowerSeries.coeff_mk, PowerSeries.coeff_one]
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
n✝ : ℕ
⊢ (if n✝ = 0 then a ^ n✝ else 0) = if n✝ = 0 then 1 else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
a : R
n✝ : ℕ
h : n✝ = 0
⊢ a ^ n✝ = 1
[PROOFSTEP]
rw [h, pow_zero a]
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
a : R
n✝ : ℕ
h : ¬n✝ = 0
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : PowerSeries R
⊢ OneHom.toFun
      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
      (f * g) =
    OneHom.toFun
        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
        f *
      OneHom.toFun
        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
        g
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : PowerSeries R
n✝ : ℕ
⊢ ↑(coeff R n✝)
      (OneHom.toFun
        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
        (f * g)) =
    ↑(coeff R n✝)
      (OneHom.toFun
          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
          f *
        OneHom.toFun
          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
          g)
[PROOFSTEP]
rw [PowerSeries.coeff_mul, PowerSeries.coeff_mk, PowerSeries.coeff_mul, Finset.mul_sum]
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : PowerSeries R
n✝ : ℕ
⊢ ∑ x in antidiagonal n✝, a ^ n✝ * (↑(coeff R x.fst) f * ↑(coeff R x.snd) g) =
    ∑ p in antidiagonal n✝,
      ↑(coeff R p.fst)
          (OneHom.toFun
            { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
            f) *
        ↑(coeff R p.snd)
          (OneHom.toFun
            { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
            g)
[PROOFSTEP]
apply sum_congr rfl
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : PowerSeries R
n✝ : ℕ
⊢ ∀ (x : ℕ × ℕ),
    x ∈ antidiagonal n✝ →
      a ^ n✝ * (↑(coeff R x.fst) f * ↑(coeff R x.snd) g) =
        ↑(coeff R x.fst)
            (OneHom.toFun
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
              f) *
          ↑(coeff R x.snd)
            (OneHom.toFun
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
              g)
[PROOFSTEP]
simp only [coeff_mk, Prod.forall, Nat.mem_antidiagonal]
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : PowerSeries R
n✝ : ℕ
⊢ ∀ (a_1 b : ℕ),
    a_1 + b = n✝ → a ^ n✝ * (↑(coeff R a_1) f * ↑(coeff R b) g) = a ^ a_1 * ↑(coeff R a_1) f * (a ^ b * ↑(coeff R b) g)
[PROOFSTEP]
intro b c H
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
f g : PowerSeries R
n✝ b c : ℕ
H : b + c = n✝
⊢ a ^ n✝ * (↑(coeff R b) f * ↑(coeff R c) g) = a ^ b * ↑(coeff R b) f * (a ^ c * ↑(coeff R c) g)
[PROOFSTEP]
rw [← H, pow_add, mul_mul_mul_comm]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
a : R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (f g : PowerSeries R),
                OneHom.toFun
                    { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                      map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                    (f * g) =
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      f *
                    OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      g) })
      0 =
    0
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
n✝ : ℕ
⊢ ↑(coeff R n✝)
      (OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) })
        0) =
    ↑(coeff R n✝) 0
[PROOFSTEP]
simp only [LinearMap.map_zero, PowerSeries.coeff_mk, mul_zero]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
a : R
⊢ ∀ (x y : PowerSeries R),
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) })
        (x + y) =
      OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                  map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (f g : PowerSeries R),
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        (f * g) =
                      OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          f *
                        OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          g) })
          x +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                  map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (f g : PowerSeries R),
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        (f * g) =
                      OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          f *
                        OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          g) })
          y
[PROOFSTEP]
intros
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
a : R
x✝ y✝ : PowerSeries R
⊢ OneHom.toFun
      (↑{
          toOneHom :=
            { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
              map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
          map_mul' :=
            (_ :
              ∀ (f g : PowerSeries R),
                OneHom.toFun
                    { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                      map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                    (f * g) =
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      f *
                    OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      g) })
      (x✝ + y✝) =
    OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) })
        x✝ +
      OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) })
        y✝
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
x✝ y✝ : PowerSeries R
n✝ : ℕ
⊢ ↑(coeff R n✝)
      (OneHom.toFun
        (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) })
        (x✝ + y✝)) =
    ↑(coeff R n✝)
      (OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                  map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (f g : PowerSeries R),
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        (f * g) =
                      OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          f *
                        OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          g) })
          x✝ +
        OneHom.toFun
          (↑{
              toOneHom :=
                { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                  map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) },
              map_mul' :=
                (_ :
                  ∀ (f g : PowerSeries R),
                    OneHom.toFun
                        { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                        (f * g) =
                      OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          f *
                        OneHom.toFun
                          { toFun := fun f => mk fun n => a ^ n * ↑(coeff R n) f,
                            map_one' := (_ : (fun f => mk fun n => a ^ n * ↑(coeff R n) f) 1 = 1) }
                          g) })
          y✝)
[PROOFSTEP]
dsimp only
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
a : R
x✝ y✝ : PowerSeries R
n✝ : ℕ
⊢ ↑(coeff R n✝) (mk fun n => a ^ n * ↑(coeff R n) (x✝ + y✝)) =
    ↑(coeff R n✝) ((mk fun n => a ^ n * ↑(coeff R n) x✝) + mk fun n => a ^ n * ↑(coeff R n) y✝)
[PROOFSTEP]
exact mul_add _ _ _
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
⊢ rescale 0 = RingHom.comp (C R) (constantCoeff R)
[PROOFSTEP]
ext x n
[GOAL]
case a.h
R : Type u_1
inst✝ : CommSemiring R
x : PowerSeries R
n : ℕ
⊢ ↑(coeff R n) (↑(rescale 0) x) = ↑(coeff R n) (↑(RingHom.comp (C R) (constantCoeff R)) x)
[PROOFSTEP]
simp only [Function.comp_apply, RingHom.coe_comp, rescale, RingHom.coe_mk, PowerSeries.coeff_mk _ _, coeff_C]
[GOAL]
case a.h
R : Type u_1
inst✝ : CommSemiring R
x : PowerSeries R
n : ℕ
⊢ ↑(coeff R n)
      (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) }
        x) =
    if n = 0 then ↑(constantCoeff R) x else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
x : PowerSeries R
n : ℕ
h : n = 0
⊢ ↑(coeff R n)
      (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) }
        x) =
    ↑(constantCoeff R) x
[PROOFSTEP]
simp [h]
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
x : PowerSeries R
n : ℕ
h : ¬n = 0
⊢ ↑(coeff R n)
      (↑{
            toOneHom :=
              { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) },
            map_mul' :=
              (_ :
                ∀ (f g : PowerSeries R),
                  OneHom.toFun
                      { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                        map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                      (f * g) =
                    OneHom.toFun
                        { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                        f *
                      OneHom.toFun
                        { toFun := fun f => mk fun n => 0 ^ n * ↑(coeff R n) f,
                          map_one' := (_ : (fun f => mk fun n => 0 ^ n * ↑(coeff R n) f) 1 = 1) }
                        g) }
        x) =
    0
[PROOFSTEP]
simp [h]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
⊢ ↑(rescale 0) X = ↑(C R) (↑(constantCoeff R) X)
[PROOFSTEP]
simp
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
⊢ rescale 1 = RingHom.id (PowerSeries R)
[PROOFSTEP]
ext
[GOAL]
case a.h
R : Type u_1
inst✝ : CommSemiring R
x✝ : PowerSeries R
n✝ : ℕ
⊢ ↑(coeff R n✝) (↑(rescale 1) x✝) = ↑(coeff R n✝) (↑(RingHom.id (PowerSeries R)) x✝)
[PROOFSTEP]
simp only [coeff_rescale, one_pow, one_mul, RingHom.id_apply]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
f : ℕ → R
a : R
⊢ ↑(rescale a) (mk f) = mk fun n => a ^ n * f n
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
f : ℕ → R
a : R
n✝ : ℕ
⊢ ↑(coeff R n✝) (↑(rescale a) (mk f)) = ↑(coeff R n✝) (mk fun n => a ^ n * f n)
[PROOFSTEP]
rw [coeff_rescale, coeff_mk, coeff_mk]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
f : PowerSeries R
a b : R
⊢ ↑(rescale b) (↑(rescale a) f) = ↑(rescale (a * b)) f
[PROOFSTEP]
ext n
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
f : PowerSeries R
a b : R
n : ℕ
⊢ ↑(coeff R n) (↑(rescale b) (↑(rescale a) f)) = ↑(coeff R n) (↑(rescale (a * b)) f)
[PROOFSTEP]
simp_rw [coeff_rescale]
[GOAL]
case h
R : Type u_1
inst✝ : CommSemiring R
f : PowerSeries R
a b : R
n : ℕ
⊢ b ^ n * (a ^ n * ↑(coeff R n) f) = (a * b) ^ n * ↑(coeff R n) f
[PROOFSTEP]
rw [mul_pow, mul_comm _ (b ^ n), mul_assoc]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
a b : R
⊢ rescale (a * b) = RingHom.comp (rescale b) (rescale a)
[PROOFSTEP]
ext
[GOAL]
case a.h
R : Type u_1
inst✝ : CommSemiring R
a b : R
x✝ : PowerSeries R
n✝ : ℕ
⊢ ↑(coeff R n✝) (↑(rescale (a * b)) x✝) = ↑(coeff R n✝) (↑(RingHom.comp (rescale b) (rescale a)) x✝)
[PROOFSTEP]
simp [← rescale_rescale]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
m n : ℕ
φ : PowerSeries R
⊢ Polynomial.coeff (trunc n φ) m = if m < n then ↑(coeff R m) φ else 0
[PROOFSTEP]
simp [trunc, Polynomial.coeff_sum, Polynomial.coeff_monomial, Nat.lt_succ_iff]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
⊢ Polynomial.coeff (trunc n 0) m = Polynomial.coeff 0 m
[PROOFSTEP]
rw [coeff_trunc, LinearMap.map_zero, Polynomial.coeff_zero]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
⊢ (if m < n then 0 else 0) = 0
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
h✝ : m < n
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
h✝ : ¬m < n
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
⊢ Polynomial.coeff (trunc (n + 1) 1) m = Polynomial.coeff 1 m
[PROOFSTEP]
rw [coeff_trunc, coeff_one]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
⊢ (if m < n + 1 then if m = 0 then 1 else 0 else 0) = Polynomial.coeff 1 m
[PROOFSTEP]
split_ifs with H H'
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : m < n + 1
H' : m = 0
⊢ 1 = Polynomial.coeff 1 m
[PROOFSTEP]
rw [Polynomial.coeff_one]
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : m < n + 1
H' : ¬m = 0
⊢ 0 = Polynomial.coeff 1 m
[PROOFSTEP]
rw [Polynomial.coeff_one]
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : ¬m < n + 1
⊢ 0 = Polynomial.coeff 1 m
[PROOFSTEP]
rw [Polynomial.coeff_one]
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : m < n + 1
H' : m = 0
⊢ 1 = if 0 = m then 1 else 0
[PROOFSTEP]
subst m
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
H : 0 < n + 1
⊢ 1 = if 0 = 0 then 1 else 0
[PROOFSTEP]
rw [if_pos rfl]
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : m < n + 1
H' : ¬m = 0
⊢ 0 = if 0 = m then 1 else 0
[PROOFSTEP]
symm
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : m < n + 1
H' : ¬m = 0
⊢ (if 0 = m then 1 else 0) = 0
[PROOFSTEP]
exact if_neg (Ne.elim (Ne.symm H'))
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : ¬m < n + 1
⊢ 0 = if 0 = m then 1 else 0
[PROOFSTEP]
symm
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : ¬m < n + 1
⊢ (if 0 = m then 1 else 0) = 0
[PROOFSTEP]
refine' if_neg _
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n m : ℕ
H : ¬m < n + 1
⊢ ¬0 = m
[PROOFSTEP]
rintro rfl
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
H : ¬0 < n + 1
⊢ False
[PROOFSTEP]
apply H
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
H : ¬0 < n + 1
⊢ 0 < n + 1
[PROOFSTEP]
exact Nat.zero_lt_succ _
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
⊢ Polynomial.coeff (trunc (n + 1) (↑(C R) a)) m = Polynomial.coeff (↑Polynomial.C a) m
[PROOFSTEP]
rw [coeff_trunc, coeff_C, Polynomial.coeff_C]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
⊢ (if m < n + 1 then if m = 0 then a else 0 else 0) = if m = 0 then a else 0
[PROOFSTEP]
split_ifs with H
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : m = 0
⊢ a = a
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : m = 0
⊢ a = a
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : ¬m = 0
⊢ 0 = 0
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : m < n + 1
h✝ : ¬m = 0
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a
[PROOFSTEP]
rfl
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a
[PROOFSTEP]
try simp_all
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : m = 0
⊢ 0 = a
[PROOFSTEP]
simp_all
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : ¬m = 0
⊢ 0 = 0
[PROOFSTEP]
first
| rfl
| try simp_all
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
a : R
m : ℕ
H : ¬m < n + 1
h✝ : ¬m = 0
⊢ 0 = 0
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
φ ψ : PowerSeries R
m : ℕ
⊢ Polynomial.coeff (trunc n (φ + ψ)) m = Polynomial.coeff (trunc n φ + trunc n ψ) m
[PROOFSTEP]
simp only [coeff_trunc, AddMonoidHom.map_add, Polynomial.coeff_add]
[GOAL]
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
φ ψ : PowerSeries R
m : ℕ
⊢ (if m < n then ↑(coeff R m) (φ + ψ) else 0) =
    (if m < n then ↑(coeff R m) φ else 0) + if m < n then ↑(coeff R m) ψ else 0
[PROOFSTEP]
split_ifs with H
[GOAL]
case pos
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
φ ψ : PowerSeries R
m : ℕ
H : m < n
⊢ ↑(coeff R m) (φ + ψ) = ↑(coeff R m) φ + ↑(coeff R m) ψ
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
inst✝ : CommSemiring R
n : ℕ
φ ψ : PowerSeries R
m : ℕ
H : ¬m < n
⊢ 0 = 0 + 0
[PROOFSTEP]
rw [zero_add]
[GOAL]
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
⊢ ↑(coeff R n) (inv.aux a φ) =
    if n = 0 then a
    else
      -a *
        ∑ x in Finset.Nat.antidiagonal n, if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (inv.aux a φ) else 0
[PROOFSTEP]
rw [coeff, inv.aux, MvPowerSeries.coeff_inv_aux]
[GOAL]
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
⊢ (if single () n = 0 then a
    else
      -a *
        ∑ x in Finsupp.antidiagonal (single () n),
          if x.snd < single () n then
            ↑(MvPowerSeries.coeff R x.fst) φ * ↑(MvPowerSeries.coeff R x.snd) (MvPowerSeries.inv.aux a φ)
          else 0) =
    if n = 0 then a
    else
      -a *
        ∑ x in Finset.Nat.antidiagonal n,
          if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (MvPowerSeries.inv.aux a φ) else 0
[PROOFSTEP]
simp only [Finsupp.single_eq_zero]
[GOAL]
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
⊢ (if n = 0 then a
    else
      -a *
        ∑ x in Finsupp.antidiagonal (single () n),
          if x.snd < single () n then
            ↑(MvPowerSeries.coeff R x.fst) φ * ↑(MvPowerSeries.coeff R x.snd) (MvPowerSeries.inv.aux a φ)
          else 0) =
    if n = 0 then a
    else
      -a *
        ∑ x in Finset.Nat.antidiagonal n,
          if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (MvPowerSeries.inv.aux a φ) else 0
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : n = 0
⊢ a = a
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ (-a *
      ∑ x in Finsupp.antidiagonal (single () n),
        if x.snd < single () n then
          ↑(MvPowerSeries.coeff R x.fst) φ * ↑(MvPowerSeries.coeff R x.snd) (MvPowerSeries.inv.aux a φ)
        else 0) =
    -a *
      ∑ x in Finset.Nat.antidiagonal n,
        if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (MvPowerSeries.inv.aux a φ) else 0
[PROOFSTEP]
congr 1
[GOAL]
case neg.e_a
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ (∑ x in Finsupp.antidiagonal (single () n),
      if x.snd < single () n then
        ↑(MvPowerSeries.coeff R x.fst) φ * ↑(MvPowerSeries.coeff R x.snd) (MvPowerSeries.inv.aux a φ)
      else 0) =
    ∑ x in Finset.Nat.antidiagonal n,
      if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (MvPowerSeries.inv.aux a φ) else 0
[PROOFSTEP]
symm
[GOAL]
case neg.e_a
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ (∑ x in Finset.Nat.antidiagonal n,
      if x.snd < n then ↑(coeff R x.fst) φ * ↑(coeff R x.snd) (MvPowerSeries.inv.aux a φ) else 0) =
    ∑ x in Finsupp.antidiagonal (single () n),
      if x.snd < single () n then
        ↑(MvPowerSeries.coeff R x.fst) φ * ↑(MvPowerSeries.coeff R x.snd) (MvPowerSeries.inv.aux a φ)
      else 0
[PROOFSTEP]
apply Finset.sum_bij fun (p : ℕ × ℕ) _h => (single () p.1, single () p.2)
[GOAL]
case neg.e_a.hi
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ ∀ (a : ℕ × ℕ), a ∈ Finset.Nat.antidiagonal n → (single () a.fst, single () a.snd) ∈ Finsupp.antidiagonal (single () n)
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case neg.e_a.hi.mk
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
⊢ (single () (i, j).fst, single () (i, j).snd) ∈ Finsupp.antidiagonal (single () n)
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal] at hij 
[GOAL]
case neg.e_a.hi.mk
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = n
⊢ (single () (i, j).fst, single () (i, j).snd) ∈ Finsupp.antidiagonal (single () n)
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal, ← Finsupp.single_add, hij]
[GOAL]
case neg.e_a.h
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ ∀ (a_1 : ℕ × ℕ),
    a_1 ∈ Finset.Nat.antidiagonal n →
      (if a_1.snd < n then ↑(coeff R a_1.fst) φ * ↑(coeff R a_1.snd) (MvPowerSeries.inv.aux a φ) else 0) =
        if (single () a_1.fst, single () a_1.snd).snd < single () n then
          ↑(MvPowerSeries.coeff R (single () a_1.fst, single () a_1.snd).fst) φ *
            ↑(MvPowerSeries.coeff R (single () a_1.fst, single () a_1.snd).snd) (MvPowerSeries.inv.aux a φ)
        else 0
[PROOFSTEP]
rintro ⟨i, j⟩ _hij
[GOAL]
case neg.e_a.h.mk
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
⊢ (if (i, j).snd < n then ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (MvPowerSeries.inv.aux a φ) else 0) =
    if (single () (i, j).fst, single () (i, j).snd).snd < single () n then
      ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).fst) φ *
        ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).snd) (MvPowerSeries.inv.aux a φ)
    else 0
[PROOFSTEP]
by_cases H : j < n
[GOAL]
case pos
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
⊢ (if (i, j).snd < n then ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (MvPowerSeries.inv.aux a φ) else 0) =
    if (single () (i, j).fst, single () (i, j).snd).snd < single () n then
      ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).fst) φ *
        ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).snd) (MvPowerSeries.inv.aux a φ)
    else 0
[PROOFSTEP]
rw [if_pos H, if_pos]
[GOAL]
case pos
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (MvPowerSeries.inv.aux a φ) =
    ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).fst) φ *
      ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).snd) (MvPowerSeries.inv.aux a φ)
[PROOFSTEP]
rfl
[GOAL]
case pos.hc
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
⊢ (single () (i, j).fst, single () (i, j).snd).snd < single () n
[PROOFSTEP]
constructor
[GOAL]
case pos.hc.left
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
⊢ ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () (i, j).fst, single () (i, j).snd).snd i_1) (↑(single () n) i_1)
[PROOFSTEP]
rintro ⟨⟩
[GOAL]
case pos.hc.left.unit
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
⊢ PartialOrder.toPreorder.1.1 (↑(single () (i, j).fst, single () (i, j).snd).snd PUnit.unit) (↑(single () n) PUnit.unit)
[PROOFSTEP]
simpa [Finsupp.single_eq_same] using le_of_lt H
[GOAL]
case pos.hc.right
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
⊢ ¬∀ (i_1 : Unit),
      PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
[PROOFSTEP]
intro hh
[GOAL]
case pos.hc.right
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : j < n
hh :
  ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
⊢ False
[PROOFSTEP]
rw [lt_iff_not_ge] at H 
[GOAL]
case pos.hc.right
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j ≥ n
hh :
  ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
⊢ False
[PROOFSTEP]
apply H
[GOAL]
case pos.hc.right
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j ≥ n
hh :
  ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
⊢ j ≥ n
[PROOFSTEP]
simpa [Finsupp.single_eq_same] using hh ()
[GOAL]
case neg
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j < n
⊢ (if (i, j).snd < n then ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) (MvPowerSeries.inv.aux a φ) else 0) =
    if (single () (i, j).fst, single () (i, j).snd).snd < single () n then
      ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).fst) φ *
        ↑(MvPowerSeries.coeff R (single () (i, j).fst, single () (i, j).snd).snd) (MvPowerSeries.inv.aux a φ)
    else 0
[PROOFSTEP]
rw [if_neg H, if_neg]
[GOAL]
case neg.hnc
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j < n
⊢ ¬(single () (i, j).fst, single () (i, j).snd).snd < single () n
[PROOFSTEP]
rintro ⟨_h₁, h₂⟩
[GOAL]
case neg.hnc.intro
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j < n
_h₁ :
  ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () (i, j).fst, single () (i, j).snd).snd i_1) (↑(single () n) i_1)
h₂ :
  ¬∀ (i_1 : Unit),
      PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
⊢ False
[PROOFSTEP]
apply h₂
[GOAL]
case neg.hnc.intro
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j < n
_h₁ :
  ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () (i, j).fst, single () (i, j).snd).snd i_1) (↑(single () n) i_1)
h₂ :
  ¬∀ (i_1 : Unit),
      PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
⊢ ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
[PROOFSTEP]
rintro ⟨⟩
[GOAL]
case neg.hnc.intro.unit
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
H : ¬j < n
_h₁ :
  ∀ (i_1 : Unit),
    PartialOrder.toPreorder.1.1 (↑(single () (i, j).fst, single () (i, j).snd).snd i_1) (↑(single () n) i_1)
h₂ :
  ¬∀ (i_1 : Unit),
      PartialOrder.toPreorder.1.1 (↑(single () n) i_1) (↑(single () (i, j).fst, single () (i, j).snd).snd i_1)
⊢ PartialOrder.toPreorder.1.1 (↑(single () n) PUnit.unit) (↑(single () (i, j).fst, single () (i, j).snd).snd PUnit.unit)
[PROOFSTEP]
simpa [Finsupp.single_eq_same] using not_lt.1 H
[GOAL]
case neg.e_a.i_inj
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ ∀ (a₁ a₂ : ℕ × ℕ),
    a₁ ∈ Finset.Nat.antidiagonal n →
      a₂ ∈ Finset.Nat.antidiagonal n →
        (single () a₁.fst, single () a₁.snd) = (single () a₂.fst, single () a₂.snd) → a₁ = a₂
[PROOFSTEP]
rintro ⟨i, j⟩ ⟨k, l⟩ _hij _hkl
[GOAL]
case neg.e_a.i_inj.mk.mk
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
i j k l : ℕ
_hij : (i, j) ∈ Finset.Nat.antidiagonal n
_hkl : (k, l) ∈ Finset.Nat.antidiagonal n
⊢ (single () (i, j).fst, single () (i, j).snd) = (single () (k, l).fst, single () (k, l).snd) → (i, j) = (k, l)
[PROOFSTEP]
simpa only [Prod.mk.inj_iff, Finsupp.unique_single_eq_iff] using id
[GOAL]
case neg.e_a.i_surj
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
⊢ ∀ (b : (Unit →₀ ℕ) × (Unit →₀ ℕ)),
    b ∈ Finsupp.antidiagonal (single () n) → ∃ a ha, b = (single () a.fst, single () a.snd)
[PROOFSTEP]
rintro ⟨f, g⟩ hfg
[GOAL]
case neg.e_a.i_surj.mk
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
f g : Unit →₀ ℕ
hfg : (f, g) ∈ Finsupp.antidiagonal (single () n)
⊢ ∃ a ha, (f, g) = (single () a.fst, single () a.snd)
[PROOFSTEP]
refine' ⟨(f (), g ()), _, _⟩
[GOAL]
case neg.e_a.i_surj.mk.refine'_1
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
f g : Unit →₀ ℕ
hfg : (f, g) ∈ Finsupp.antidiagonal (single () n)
⊢ (↑f (), ↑g ()) ∈ Finset.Nat.antidiagonal n
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal] at hfg 
[GOAL]
case neg.e_a.i_surj.mk.refine'_1
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
f g : Unit →₀ ℕ
hfg : (f, g).fst + (f, g).snd = single () n
⊢ (↑f (), ↑g ()) ∈ Finset.Nat.antidiagonal n
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal, ← Finsupp.add_apply, hfg, Finsupp.single_eq_same]
[GOAL]
case neg.e_a.i_surj.mk.refine'_2
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
f g : Unit →₀ ℕ
hfg : (f, g) ∈ Finsupp.antidiagonal (single () n)
⊢ (f, g) = (single () (↑f (), ↑g ()).fst, single () (↑f (), ↑g ()).snd)
[PROOFSTEP]
rw [Prod.mk.inj_iff]
[GOAL]
case neg.e_a.i_surj.mk.refine'_2
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
f g : Unit →₀ ℕ
hfg : (f, g) ∈ Finsupp.antidiagonal (single () n)
⊢ f = single () (↑f (), ↑g ()).fst ∧ g = single () (↑f (), ↑g ()).snd
[PROOFSTEP]
dsimp
[GOAL]
case neg.e_a.i_surj.mk.refine'_2
R : Type u_1
inst✝ : Ring R
n : ℕ
a : R
φ : PowerSeries R
h✝ : ¬n = 0
f g : Unit →₀ ℕ
hfg : (f, g) ∈ Finsupp.antidiagonal (single () n)
⊢ f = single () (↑f ()) ∧ g = single () (↑g ())
[PROOFSTEP]
exact ⟨Finsupp.unique_single f, Finsupp.unique_single g⟩
[GOAL]
R : Type u_1
inst✝ : Ring R
φ : PowerSeries R
u : Rˣ
⊢ ↑(constantCoeff R) (invOfUnit φ u) = ↑u⁻¹
[PROOFSTEP]
rw [← coeff_zero_eq_constantCoeff_apply, coeff_invOfUnit, if_pos rfl]
[GOAL]
R : Type u_1
A : Type u_2
inst✝ : CommRing A
a : A
⊢ ↑(rescale a) X = ↑(C A) a * X
[PROOFSTEP]
ext
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝ : CommRing A
a : A
n✝ : ℕ
⊢ ↑(coeff A n✝) (↑(rescale a) X) = ↑(coeff A n✝) (↑(C A) a * X)
[PROOFSTEP]
simp only [coeff_rescale, coeff_C_mul, coeff_X]
[GOAL]
case h
R : Type u_1
A : Type u_2
inst✝ : CommRing A
a : A
n✝ : ℕ
⊢ (a ^ n✝ * if n✝ = 1 then 1 else 0) = a * if n✝ = 1 then 1 else 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
A : Type u_2
inst✝ : CommRing A
a : A
n✝ : ℕ
h : n✝ = 1
⊢ a ^ n✝ * 1 = a * 1
[PROOFSTEP]
simp [h]
[GOAL]
case neg
R : Type u_1
A : Type u_2
inst✝ : CommRing A
a : A
n✝ : ℕ
h : ¬n✝ = 1
⊢ a ^ n✝ * 0 = a * 0
[PROOFSTEP]
simp [h]
[GOAL]
R : Type u_1
A : Type u_2
inst✝ : CommRing A
⊢ ↑(rescale (-1)) X = -X
[PROOFSTEP]
rw [rescale_X, map_neg, map_one, neg_one_mul]
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
⊢ φ = 0 ∨ ψ = 0
[PROOFSTEP]
rw [or_iff_not_imp_left]
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
⊢ ¬φ = 0 → ψ = 0
[PROOFSTEP]
intro H
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
⊢ ψ = 0
[PROOFSTEP]
have ex : ∃ m, coeff R m φ ≠ 0 := by
  contrapose! H
  exact ext H
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
⊢ ∃ m, ↑(coeff R m) φ ≠ 0
[PROOFSTEP]
contrapose! H
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ∀ (m : ℕ), ↑(coeff R m) φ = 0
⊢ φ = 0
[PROOFSTEP]
exact ext H
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
⊢ ψ = 0
[PROOFSTEP]
let m := Nat.find ex
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
⊢ ψ = 0
[PROOFSTEP]
have hm₁ : coeff R m φ ≠ 0 := Nat.find_spec ex
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
⊢ ψ = 0
[PROOFSTEP]
have hm₂ : ∀ k < m, ¬coeff R k φ ≠ 0 := fun k => Nat.find_min ex
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
⊢ ψ = 0
[PROOFSTEP]
ext n
[GOAL]
case h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
⊢ ↑(coeff R n) ψ = ↑(coeff R n) 0
[PROOFSTEP]
rw [(coeff R n).map_zero]
[GOAL]
case h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
⊢ ↑(coeff R n) ψ = 0
[PROOFSTEP]
induction' n using Nat.strong_induction_on with n ih
[GOAL]
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
h : φ * ψ = 0
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
⊢ ↑(coeff R n) ψ = 0
[PROOFSTEP]
replace h := congr_arg (coeff R (m + n)) h
[GOAL]
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ↑(coeff R (m + n)) (φ * ψ) = ↑(coeff R (m + n)) 0
⊢ ↑(coeff R n) ψ = 0
[PROOFSTEP]
rw [LinearMap.map_zero, coeff_mul, Finset.sum_eq_single (m, n)] at h 
[GOAL]
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ↑(coeff R (m, n).fst) φ * ↑(coeff R (m, n).snd) ψ = 0
⊢ ↑(coeff R n) ψ = 0
[PROOFSTEP]
replace h := NoZeroDivisors.eq_zero_or_eq_zero_of_mul_eq_zero h
[GOAL]
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ↑(coeff R (m, n).fst) φ = 0 ∨ ↑(coeff R (m, n).snd) ψ = 0
⊢ ↑(coeff R n) ψ = 0
[PROOFSTEP]
rw [or_iff_not_imp_left] at h 
[GOAL]
case h.h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ¬↑(coeff R (m, n).fst) φ = 0 → ↑(coeff R (m, n).snd) ψ = 0
⊢ ↑(coeff R n) ψ = 0
[PROOFSTEP]
exact h hm₁
[GOAL]
case h.h.h₀
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
⊢ ∀ (b : ℕ × ℕ), b ∈ Finset.Nat.antidiagonal (m + n) → b ≠ (m, n) → ↑(coeff R b.fst) φ * ↑(coeff R b.snd) ψ = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hij hne
[GOAL]
case h.h.h₀.mk
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
by_cases hj : j < n
[GOAL]
case pos
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : j < n
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [ih j hj, mul_zero]
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
by_cases hi : i < m
[GOAL]
case pos
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : i < m
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
specialize hm₂ _ hi
[GOAL]
case pos
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : i < m
hm₂ : ¬↑(coeff R i) φ ≠ 0
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
push_neg at hm₂ 
[GOAL]
case pos
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : i < m
hm₂ : ↑(coeff R i) φ = 0
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [hm₂, zero_mul]
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal (m + n)
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : ¬i < m
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal] at hij 
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hne : (i, j) ≠ (m, n)
hj : ¬j < n
hi : ¬i < m
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
push_neg at hi hj 
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hne : (i, j) ≠ (m, n)
hi : Nat.find ex ≤ i
hj : n ≤ j
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
suffices m < i by
  have : m + n < i + j := add_lt_add_of_lt_of_le this hj
  exfalso
  exact ne_of_lt this hij.symm
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hne : (i, j) ≠ (m, n)
hi : Nat.find ex ≤ i
hj : n ≤ j
this : m < i
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
have : m + n < i + j := add_lt_add_of_lt_of_le this hj
[GOAL]
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hne : (i, j) ≠ (m, n)
hi : Nat.find ex ≤ i
hj : n ≤ j
this✝ : m < i
this : m + n < i + j
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
exfalso
[GOAL]
case h
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hne : (i, j) ≠ (m, n)
hi : Nat.find ex ≤ i
hj : n ≤ j
this✝ : m < i
this : m + n < i + j
⊢ False
[PROOFSTEP]
exact ne_of_lt this hij.symm
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hne : (i, j) ≠ (m, n)
hi : Nat.find ex ≤ i
hj : n ≤ j
⊢ m < i
[PROOFSTEP]
contrapose! hne
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
i j : ℕ
hij : (i, j).fst + (i, j).snd = m + n
hi : Nat.find ex ≤ i
hj : n ≤ j
hne : i ≤ Nat.find ex
⊢ (i, j) = (Nat.find ex, n)
[PROOFSTEP]
obtain rfl := le_antisymm hi hne
[GOAL]
case neg
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
j : ℕ
hj : n ≤ j
hij : (Nat.find ex, j).fst + (Nat.find ex, j).snd = m + n
hi hne : Nat.find ex ≤ Nat.find ex
⊢ (Nat.find ex, j) = (Nat.find ex, n)
[PROOFSTEP]
simpa [Ne.def, Prod.mk.inj_iff] using (add_right_inj m).mp hij
[GOAL]
case h.h.h₁
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
⊢ ¬(m, n) ∈ Finset.Nat.antidiagonal (m + n) → ↑(coeff R (m, n).fst) φ * ↑(coeff R (m, n).snd) ψ = 0
[PROOFSTEP]
contrapose!
[GOAL]
case h.h.h₁
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
⊢ ↑(coeff R (Nat.find ex)) φ * ↑(coeff R n) ψ ≠ 0 → (Nat.find ex, n) ∈ Finset.Nat.antidiagonal (Nat.find ex + n)
[PROOFSTEP]
intro
[GOAL]
case h.h.h₁
R : Type u_1
inst✝¹ : Ring R
inst✝ : NoZeroDivisors R
φ ψ : PowerSeries R
H : ¬φ = 0
ex : ∃ m, ↑(coeff R m) φ ≠ 0
m : ℕ := Nat.find ex
hm₁ : ↑(coeff R m) φ ≠ 0
hm₂ : ∀ (k : ℕ), k < m → ¬↑(coeff R k) φ ≠ 0
n : ℕ
ih : ∀ (m : ℕ), m < n → ↑(coeff R m) ψ = 0
h : ∑ p in Finset.Nat.antidiagonal (m + n), ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = 0
a✝ : ↑(coeff R (Nat.find ex)) φ * ↑(coeff R n) ψ ≠ 0
⊢ (Nat.find ex, n) ∈ Finset.Nat.antidiagonal (Nat.find ex + n)
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ Ideal.IsPrime (Ideal.span {X})
[PROOFSTEP]
suffices Ideal.span ({ X } : Set (PowerSeries R)) = RingHom.ker (constantCoeff R)
  by
  rw [this]
  exact RingHom.ker_isPrime _
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
this : Ideal.span {X} = RingHom.ker (constantCoeff R)
⊢ Ideal.IsPrime (Ideal.span {X})
[PROOFSTEP]
rw [this]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
this : Ideal.span {X} = RingHom.ker (constantCoeff R)
⊢ Ideal.IsPrime (RingHom.ker (constantCoeff R))
[PROOFSTEP]
exact RingHom.ker_isPrime _
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ Ideal.span {X} = RingHom.ker (constantCoeff R)
[PROOFSTEP]
apply Ideal.ext
[GOAL]
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ ∀ (x : PowerSeries R), x ∈ Ideal.span {X} ↔ x ∈ RingHom.ker (constantCoeff R)
[PROOFSTEP]
intro φ
[GOAL]
case h
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
φ : PowerSeries R
⊢ φ ∈ Ideal.span {X} ↔ φ ∈ RingHom.ker (constantCoeff R)
[PROOFSTEP]
rw [RingHom.mem_ker, Ideal.mem_span_singleton, X_dvd_iff]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ Prime X
[PROOFSTEP]
rw [← Ideal.span_singleton_prime]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ Ideal.IsPrime (Ideal.span {X})
[PROOFSTEP]
exact span_X_isPrime
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
⊢ X ≠ 0
[PROOFSTEP]
intro h
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
h : X = 0
⊢ False
[PROOFSTEP]
simpa [map_zero (coeff R 1)] using congr_arg (coeff R 1) h
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
⊢ Function.Injective ↑(rescale a)
[PROOFSTEP]
intro p q h
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h : ↑(rescale a) p = ↑(rescale a) q
⊢ p = q
[PROOFSTEP]
rw [PowerSeries.ext_iff] at *
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h✝ : ↑(rescale a) p = ↑(rescale a) q
h : ∀ (n : ℕ), ↑(coeff R n) (↑(rescale a) p) = ↑(coeff R n) (↑(rescale a) q)
⊢ ∀ (n : ℕ), ↑(coeff R n) p = ↑(coeff R n) q
[PROOFSTEP]
intro n
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h✝ : ↑(rescale a) p = ↑(rescale a) q
h : ∀ (n : ℕ), ↑(coeff R n) (↑(rescale a) p) = ↑(coeff R n) (↑(rescale a) q)
n : ℕ
⊢ ↑(coeff R n) p = ↑(coeff R n) q
[PROOFSTEP]
specialize h n
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h✝ : ↑(rescale a) p = ↑(rescale a) q
n : ℕ
h : ↑(coeff R n) (↑(rescale a) p) = ↑(coeff R n) (↑(rescale a) q)
⊢ ↑(coeff R n) p = ↑(coeff R n) q
[PROOFSTEP]
rw [coeff_rescale, coeff_rescale, mul_eq_mul_left_iff] at h 
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h✝ : ↑(rescale a) p = ↑(rescale a) q
n : ℕ
h : ↑(coeff R n) p = ↑(coeff R n) q ∨ a ^ n = 0
⊢ ↑(coeff R n) p = ↑(coeff R n) q
[PROOFSTEP]
apply h.resolve_right
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h✝ : ↑(rescale a) p = ↑(rescale a) q
n : ℕ
h : ↑(coeff R n) p = ↑(coeff R n) q ∨ a ^ n = 0
⊢ ¬a ^ n = 0
[PROOFSTEP]
intro h'
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
a : R
ha : a ≠ 0
p q : PowerSeries R
h✝ : ↑(rescale a) p = ↑(rescale a) q
n : ℕ
h : ↑(coeff R n) p = ↑(coeff R n) q ∨ a ^ n = 0
h' : a ^ n = 0
⊢ False
[PROOFSTEP]
exact ha (pow_eq_zero h')
[GOAL]
R : Type u_1
k : Type u_2
inst✝ : Field k
n : ℕ
φ : PowerSeries k
⊢ ↑(coeff k n) φ⁻¹ =
    if n = 0 then (↑(constantCoeff k) φ)⁻¹
    else
      -(↑(constantCoeff k) φ)⁻¹ *
        ∑ x in Finset.Nat.antidiagonal n, if x.snd < n then ↑(coeff k x.fst) φ * ↑(coeff k x.snd) φ⁻¹ else 0
[PROOFSTEP]
rw [inv_eq_inv_aux, coeff_inv_aux n (constantCoeff k φ)⁻¹ φ]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (∃ n, ↑(coeff R n) φ ≠ 0) ↔ φ ≠ 0
[PROOFSTEP]
refine' not_iff_not.mp _
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (¬∃ n, ↑(coeff R n) φ ≠ 0) ↔ ¬φ ≠ 0
[PROOFSTEP]
push_neg
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (∀ (n : ℕ), ↑(coeff R n) φ = 0) ↔ φ = 0
[PROOFSTEP]
simp [PowerSeries.ext_iff]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (order φ).Dom ↔ φ ≠ 0
[PROOFSTEP]
simp only [order]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (if h : φ = 0 then ⊤ else ↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))).Dom ↔ φ ≠ 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (if h : φ = 0 then ⊤ else ↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))).Dom → φ ≠ 0
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : φ = 0
⊢ ⊤.Dom → φ ≠ 0
[PROOFSTEP]
intro H
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : ¬φ = 0
⊢ (↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))).Dom → φ ≠ 0
[PROOFSTEP]
intro H
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : φ = 0
H : ⊤.Dom
⊢ φ ≠ 0
[PROOFSTEP]
contrapose! H
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h H : φ = 0
⊢ ¬⊤.Dom
[PROOFSTEP]
simp only [← Part.eq_none_iff']
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h H : φ = 0
⊢ ⊤ = Part.none
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : ¬φ = 0
H : (↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))).Dom
⊢ φ ≠ 0
[PROOFSTEP]
exact h
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ φ ≠ 0 → (if h : φ = 0 then ⊤ else ↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))).Dom
[PROOFSTEP]
intro h
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : φ ≠ 0
⊢ (if h : φ = 0 then ⊤ else ↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))).Dom
[PROOFSTEP]
simp [h]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
⊢ ↑(coeff R (Part.get (order φ) h)) φ ≠ 0
[PROOFSTEP]
simp only [order, order_finite_iff_ne_zero.mp h, not_false_iff, dif_neg, PartENat.get_natCast']
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
⊢ ↑(coeff R (Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0))) φ ≠ 0
[PROOFSTEP]
generalize_proofs h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h✝ : (order φ).Dom
h : ∃ n, ↑(coeff R n) φ ≠ 0
⊢ ↑(coeff R (Nat.find h)) φ ≠ 0
[PROOFSTEP]
exact Nat.find_spec h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑(coeff R n) φ ≠ 0
⊢ order φ ≤ ↑n
[PROOFSTEP]
have _ : ∃ n, coeff R n φ ≠ 0 := Exists.intro n h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑(coeff R n) φ ≠ 0
x✝ : ∃ n, ↑(coeff R n) φ ≠ 0
⊢ order φ ≤ ↑n
[PROOFSTEP]
rw [order, dif_neg]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑(coeff R n) φ ≠ 0
x✝ : ∃ n, ↑(coeff R n) φ ≠ 0
⊢ ↑(Nat.find (_ : ∃ n, ↑(coeff R n) φ ≠ 0)) ≤ ↑n
[PROOFSTEP]
simp only [PartENat.coe_le_coe, Nat.find_le_iff]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑(coeff R n) φ ≠ 0
x✝ : ∃ n, ↑(coeff R n) φ ≠ 0
⊢ ∃ m, m ≤ n ∧ ↑(coeff R m) φ ≠ 0
[PROOFSTEP]
exact ⟨n, le_rfl, h⟩
[GOAL]
case hnc
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑(coeff R n) φ ≠ 0
x✝ : ∃ n, ↑(coeff R n) φ ≠ 0
⊢ ¬φ = 0
[PROOFSTEP]
exact exists_coeff_ne_zero_iff_ne_zero.mp ⟨n, h⟩
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑n < order φ
⊢ ↑(coeff R n) φ = 0
[PROOFSTEP]
contrapose! h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
h : ↑(coeff R n) φ ≠ 0
⊢ order φ ≤ ↑n
[PROOFSTEP]
exact order_le _ h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ order φ = ⊤ ↔ φ = 0
[PROOFSTEP]
constructor
[GOAL]
case mp
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ order φ = ⊤ → φ = 0
[PROOFSTEP]
intro h
[GOAL]
case mp
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : order φ = ⊤
⊢ φ = 0
[PROOFSTEP]
ext n
[GOAL]
case mp.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : order φ = ⊤
n : ℕ
⊢ ↑(coeff R n) φ = ↑(coeff R n) 0
[PROOFSTEP]
rw [(coeff R n).map_zero, coeff_of_lt_order]
[GOAL]
case mp.h.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : order φ = ⊤
n : ℕ
⊢ ↑n < order φ
[PROOFSTEP]
simp [h]
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ φ = 0 → order φ = ⊤
[PROOFSTEP]
rintro rfl
[GOAL]
case mpr
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ order 0 = ⊤
[PROOFSTEP]
exact order_zero
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
h : ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
⊢ ↑n ≤ order φ
[PROOFSTEP]
by_contra H
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
h : ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
H : ¬↑n ≤ order φ
⊢ False
[PROOFSTEP]
rw [not_le] at H 
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
h : ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
H : order φ < ↑n
⊢ False
[PROOFSTEP]
have : (order φ).Dom := PartENat.dom_of_le_natCast H.le
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
h : ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
H : order φ < ↑n
this : (order φ).Dom
⊢ False
[PROOFSTEP]
rw [← PartENat.natCast_get this, PartENat.coe_lt_coe] at H 
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
h : ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
this : (order φ).Dom
H : Part.get (order φ) this < n
⊢ False
[PROOFSTEP]
exact coeff_order this (h _ H)
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : PartENat
h : ∀ (i : ℕ), ↑i < n → ↑(coeff R i) φ = 0
⊢ n ≤ order φ
[PROOFSTEP]
induction n using PartENat.casesOn
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
⊢ ⊤ ≤ order φ
[PROOFSTEP]
show _ ≤ _
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
⊢ ⊤ ≤ order φ
[PROOFSTEP]
rw [top_le_iff, order_eq_top]
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
⊢ φ = 0
[PROOFSTEP]
ext i
[GOAL]
case a.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
h : ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
i : ℕ
⊢ ↑(coeff R i) φ = ↑(coeff R i) 0
[PROOFSTEP]
exact h _ (PartENat.natCast_lt_top i)
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n✝ : ℕ
h : ∀ (i : ℕ), ↑i < ↑n✝ → ↑(coeff R i) φ = 0
⊢ ↑n✝ ≤ order φ
[PROOFSTEP]
apply nat_le_order
[GOAL]
case a.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n✝ : ℕ
h : ∀ (i : ℕ), ↑i < ↑n✝ → ↑(coeff R i) φ = 0
⊢ ∀ (i : ℕ), i < n✝ → ↑(coeff R i) φ = 0
[PROOFSTEP]
simpa only [PartENat.coe_lt_coe] using h
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
⊢ order φ = ↑n ↔ ↑(coeff R n) φ ≠ 0 ∧ ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
[PROOFSTEP]
rcases eq_or_ne φ 0 with (rfl | hφ)
[GOAL]
case inl
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
⊢ order 0 = ↑n ↔ ↑(coeff R n) 0 ≠ 0 ∧ ∀ (i : ℕ), i < n → ↑(coeff R i) 0 = 0
[PROOFSTEP]
simpa using (PartENat.natCast_ne_top _).symm
[GOAL]
case inr
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : ℕ
hφ : φ ≠ 0
⊢ order φ = ↑n ↔ ↑(coeff R n) φ ≠ 0 ∧ ∀ (i : ℕ), i < n → ↑(coeff R i) φ = 0
[PROOFSTEP]
simp [order, dif_neg hφ, Nat.find_eq_iff]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n : PartENat
⊢ order φ = n ↔ (∀ (i : ℕ), ↑i = n → ↑(coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < n → ↑(coeff R i) φ = 0
[PROOFSTEP]
induction n using PartENat.casesOn
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ order φ = ⊤ ↔ (∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
[PROOFSTEP]
rw [order_eq_top]
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ φ = 0 ↔ (∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
[PROOFSTEP]
constructor
[GOAL]
case a.mp
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ φ = 0 → (∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
[PROOFSTEP]
rintro rfl
[GOAL]
case a.mp
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ (∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) 0 ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) 0 = 0
[PROOFSTEP]
constructor
[GOAL]
case a.mp.left
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) 0 ≠ 0
[PROOFSTEP]
intros
[GOAL]
case a.mp.right
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
⊢ ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) 0 = 0
[PROOFSTEP]
intros
[GOAL]
case a.mp.left
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
i✝ : ℕ
a✝ : ↑i✝ = ⊤
⊢ ↑(coeff R i✝) 0 ≠ 0
[PROOFSTEP]
exfalso
[GOAL]
case a.mp.left.h
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
i✝ : ℕ
a✝ : ↑i✝ = ⊤
⊢ False
[PROOFSTEP]
exact PartENat.natCast_ne_top ‹_› ‹_›
[GOAL]
case a.mp.right
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
i✝ : ℕ
a✝ : ↑i✝ < ⊤
⊢ ↑(coeff R i✝) 0 = 0
[PROOFSTEP]
exact (coeff _ _).map_zero
[GOAL]
case a.mpr
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
⊢ ((∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0) → φ = 0
[PROOFSTEP]
rintro ⟨_h₁, h₂⟩
[GOAL]
case a.mpr.intro
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
_h₁ : ∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) φ ≠ 0
h₂ : ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
⊢ φ = 0
[PROOFSTEP]
ext i
[GOAL]
case a.mpr.intro.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
_h₁ : ∀ (i : ℕ), ↑i = ⊤ → ↑(coeff R i) φ ≠ 0
h₂ : ∀ (i : ℕ), ↑i < ⊤ → ↑(coeff R i) φ = 0
i : ℕ
⊢ ↑(coeff R i) φ = ↑(coeff R i) 0
[PROOFSTEP]
exact h₂ i (PartENat.natCast_lt_top i)
[GOAL]
case a
R : Type u_1
inst✝ : Semiring R
φ✝ φ : PowerSeries R
n✝ : ℕ
⊢ order φ = ↑n✝ ↔ (∀ (i : ℕ), ↑i = ↑n✝ → ↑(coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < ↑n✝ → ↑(coeff R i) φ = 0
[PROOFSTEP]
simpa [PartENat.natCast_inj] using order_eq_nat
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
⊢ min (order φ) (order ψ) ≤ order (φ + ψ)
[PROOFSTEP]
refine' le_order _ _ _
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
⊢ ∀ (i : ℕ), ↑i < min (order φ) (order ψ) → ↑(coeff R i) (φ + ψ) = 0
[PROOFSTEP]
simp (config := { contextual := true }) [coeff_of_lt_order]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
suffices order (φ + ψ) = order φ by
  rw [le_inf_iff, this]
  exact ⟨le_rfl, le_of_lt H⟩
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
this : order (φ + ψ) = order φ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
rw [le_inf_iff, this]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
this : order (φ + ψ) = order φ
⊢ order φ ≤ order φ ∧ order φ ≤ order ψ
[PROOFSTEP]
exact ⟨le_rfl, le_of_lt H⟩
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
⊢ order (φ + ψ) = order φ
[PROOFSTEP]
rw [order_eq]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
⊢ (∀ (i : ℕ), ↑i = order φ → ↑(coeff R i) (φ + ψ) ≠ 0) ∧ ∀ (i : ℕ), ↑i < order φ → ↑(coeff R i) (φ + ψ) = 0
[PROOFSTEP]
constructor
[GOAL]
case left
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
⊢ ∀ (i : ℕ), ↑i = order φ → ↑(coeff R i) (φ + ψ) ≠ 0
[PROOFSTEP]
intro i hi
[GOAL]
case left
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
i : ℕ
hi : ↑i = order φ
⊢ ↑(coeff R i) (φ + ψ) ≠ 0
[PROOFSTEP]
rw [← hi] at H 
[GOAL]
case left
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
i : ℕ
H : ↑i < order ψ
hi : ↑i = order φ
⊢ ↑(coeff R i) (φ + ψ) ≠ 0
[PROOFSTEP]
rw [(coeff _ _).map_add, coeff_of_lt_order i H, add_zero]
[GOAL]
case left
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
i : ℕ
H : ↑i < order ψ
hi : ↑i = order φ
⊢ ↑(coeff R i) φ ≠ 0
[PROOFSTEP]
exact (order_eq_nat.1 hi.symm).1
[GOAL]
case right
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
⊢ ∀ (i : ℕ), ↑i < order φ → ↑(coeff R i) (φ + ψ) = 0
[PROOFSTEP]
intro i hi
[GOAL]
case right
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
_h : order φ ≠ order ψ
H : order φ < order ψ
i : ℕ
hi : ↑i < order φ
⊢ ↑(coeff R i) (φ + ψ) = 0
[PROOFSTEP]
rw [(coeff _ _).map_add, coeff_of_lt_order i hi, coeff_of_lt_order i (lt_trans hi H), zero_add]
  -- #align power_series.order_add_of_order_eq.aux power_series.order_add_of_order_eq.aux
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
⊢ order (φ + ψ) = order φ ⊓ order ψ
[PROOFSTEP]
refine' le_antisymm _ (le_order_add _ _)
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
by_cases H₁ : order φ < order ψ
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
H₁ : order φ < order ψ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
apply order_add_of_order_eq.aux _ _ h H₁
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
H₁ : ¬order φ < order ψ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
by_cases H₂ : order ψ < order φ
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
H₁ : ¬order φ < order ψ
H₂ : order ψ < order φ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
simpa only [add_comm, inf_comm] using order_add_of_order_eq.aux _ _ h.symm H₂
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
H₁ : ¬order φ < order ψ
H₂ : ¬order ψ < order φ
⊢ order (φ + ψ) ≤ order φ ⊓ order ψ
[PROOFSTEP]
exfalso
[GOAL]
case neg.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
h : order φ ≠ order ψ
H₁ : ¬order φ < order ψ
H₂ : ¬order ψ < order φ
⊢ False
[PROOFSTEP]
exact h (le_antisymm (not_lt.1 H₂) (not_lt.1 H₁))
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
⊢ order φ + order ψ ≤ order (φ * ψ)
[PROOFSTEP]
apply le_order
[GOAL]
case h
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
⊢ ∀ (i : ℕ), ↑i < order φ + order ψ → ↑(coeff R i) (φ * ψ) = 0
[PROOFSTEP]
intro n hn
[GOAL]
case h
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
⊢ ↑(coeff R n) (φ * ψ) = 0
[PROOFSTEP]
rw [coeff_mul, Finset.sum_eq_zero]
[GOAL]
case h
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
⊢ ∀ (x : ℕ × ℕ), x ∈ Finset.Nat.antidiagonal n → ↑(coeff R x.fst) φ * ↑(coeff R x.snd) ψ = 0
[PROOFSTEP]
rintro ⟨i, j⟩ hij
[GOAL]
case h.mk
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
by_cases hi : ↑i < order φ
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
hi : ↑i < order φ
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [coeff_of_lt_order i hi, zero_mul]
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
hi : ¬↑i < order φ
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
by_cases hj : ↑j < order ψ
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
hi : ¬↑i < order φ
hj : ↑j < order ψ
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [coeff_of_lt_order j hj, mul_zero]
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
hi : ¬↑i < order φ
hj : ¬↑j < order ψ
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [not_lt] at hi hj 
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j) ∈ Finset.Nat.antidiagonal n
hi : order φ ≤ ↑i
hj : order ψ ≤ ↑j
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal] at hij 
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j).fst + (i, j).snd = n
hi : order φ ≤ ↑i
hj : order ψ ≤ ↑j
⊢ ↑(coeff R (i, j).fst) φ * ↑(coeff R (i, j).snd) ψ = 0
[PROOFSTEP]
exfalso
[GOAL]
case neg.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j).fst + (i, j).snd = n
hi : order φ ≤ ↑i
hj : order ψ ≤ ↑j
⊢ False
[PROOFSTEP]
apply ne_of_lt (lt_of_lt_of_le hn <| add_le_add hi hj)
[GOAL]
case neg.h
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
hn : ↑n < order φ + order ψ
i j : ℕ
hij : (i, j).fst + (i, j).snd = n
hi : order φ ≤ ↑i
hj : order ψ ≤ ↑j
⊢ ↑n = ↑i + ↑j
[PROOFSTEP]
rw [← Nat.cast_add, hij]
[GOAL]
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
⊢ order (↑(monomial R n) a) = if a = 0 then ⊤ else ↑n
[PROOFSTEP]
split_ifs with h
[GOAL]
case pos
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : a = 0
⊢ order (↑(monomial R n) a) = ⊤
[PROOFSTEP]
rw [h, order_eq_top, LinearMap.map_zero]
[GOAL]
case neg
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
⊢ order (↑(monomial R n) a) = ↑n
[PROOFSTEP]
rw [order_eq]
[GOAL]
case neg
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
⊢ (∀ (i : ℕ), ↑i = ↑n → ↑(coeff R i) (↑(monomial R n) a) ≠ 0) ∧
    ∀ (i : ℕ), ↑i < ↑n → ↑(coeff R i) (↑(monomial R n) a) = 0
[PROOFSTEP]
constructor
[GOAL]
case neg.left
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
⊢ ∀ (i : ℕ), ↑i = ↑n → ↑(coeff R i) (↑(monomial R n) a) ≠ 0
[PROOFSTEP]
intro i hi
[GOAL]
case neg.right
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
⊢ ∀ (i : ℕ), ↑i < ↑n → ↑(coeff R i) (↑(monomial R n) a) = 0
[PROOFSTEP]
intro i hi
[GOAL]
case neg.left
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
i : ℕ
hi : ↑i = ↑n
⊢ ↑(coeff R i) (↑(monomial R n) a) ≠ 0
[PROOFSTEP]
rw [PartENat.natCast_inj] at hi 
[GOAL]
case neg.left
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
i : ℕ
hi : i = n
⊢ ↑(coeff R i) (↑(monomial R n) a) ≠ 0
[PROOFSTEP]
rwa [hi, coeff_monomial_same]
[GOAL]
case neg.right
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
i : ℕ
hi : ↑i < ↑n
⊢ ↑(coeff R i) (↑(monomial R n) a) = 0
[PROOFSTEP]
rw [PartENat.coe_lt_coe] at hi 
[GOAL]
case neg.right
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
i : ℕ
hi : i < n
⊢ ↑(coeff R i) (↑(monomial R n) a) = 0
[PROOFSTEP]
rw [coeff_monomial, if_neg]
[GOAL]
case neg.right.hnc
R : Type u_1
inst✝¹ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
inst✝ : Decidable (a = 0)
h : ¬a = 0
i : ℕ
hi : i < n
⊢ ¬i = n
[PROOFSTEP]
exact ne_of_lt hi
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
n : ℕ
a : R
h : a ≠ 0
⊢ order (↑(monomial R n) a) = ↑n
[PROOFSTEP]
rw [order_monomial, if_neg h]
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
⊢ ↑(coeff R n) (φ * ψ) = 0
[PROOFSTEP]
suffices : coeff R n (φ * ψ) = ∑ p in Finset.Nat.antidiagonal n, 0
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
this : ↑(coeff R n) (φ * ψ) = ∑ p in Finset.Nat.antidiagonal n, 0
⊢ ↑(coeff R n) (φ * ψ) = 0
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
⊢ ↑(coeff R n) (φ * ψ) = ∑ p in Finset.Nat.antidiagonal n, 0
[PROOFSTEP]
rw [this, Finset.sum_const_zero]
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
⊢ ↑(coeff R n) (φ * ψ) = ∑ p in Finset.Nat.antidiagonal n, 0
[PROOFSTEP]
rw [coeff_mul]
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
⊢ ∑ p in Finset.Nat.antidiagonal n, ↑(coeff R p.fst) φ * ↑(coeff R p.snd) ψ = ∑ p in Finset.Nat.antidiagonal n, 0
[PROOFSTEP]
apply Finset.sum_congr rfl
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
⊢ ∀ (x : ℕ × ℕ), x ∈ Finset.Nat.antidiagonal n → ↑(coeff R x.fst) φ * ↑(coeff R x.snd) ψ = 0
[PROOFSTEP]
intro x hx
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal n
⊢ ↑(coeff R x.fst) φ * ↑(coeff R x.snd) ψ = 0
[PROOFSTEP]
refine' mul_eq_zero_of_right (coeff R x.fst φ) (coeff_of_lt_order x.snd (lt_of_le_of_lt _ h))
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
x : ℕ × ℕ
hx : x ∈ Finset.Nat.antidiagonal n
⊢ ↑x.snd ≤ ↑n
[PROOFSTEP]
rw [Finset.Nat.mem_antidiagonal] at hx 
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
x : ℕ × ℕ
hx : x.fst + x.snd = n
⊢ ↑x.snd ≤ ↑n
[PROOFSTEP]
norm_cast
[GOAL]
case this
R : Type u_1
inst✝ : Semiring R
φ✝ φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
x : ℕ × ℕ
hx : x.fst + x.snd = n
⊢ x.snd ≤ n
[PROOFSTEP]
linarith
[GOAL]
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : CommRing R
φ ψ : PowerSeries R
n : ℕ
h : ↑n < order ψ
⊢ ↑(coeff R n) (φ * (1 - ψ)) = ↑(coeff R n) φ
[PROOFSTEP]
simp [coeff_mul_of_lt_order h, mul_sub]
[GOAL]
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
ι : Type u_3
inst✝ : CommRing R
k : ℕ
s : Finset ι
φ : PowerSeries R
f : ι → PowerSeries R
⊢ (∀ (i : ι), i ∈ s → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in s, (1 - f i)) = ↑(coeff R k) φ
[PROOFSTEP]
induction' s using Finset.induction_on with a s ha ih t
[GOAL]
case empty
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
ι : Type u_3
inst✝ : CommRing R
k : ℕ
φ : PowerSeries R
f : ι → PowerSeries R
⊢ (∀ (i : ι), i ∈ ∅ → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in ∅, (1 - f i)) = ↑(coeff R k) φ
[PROOFSTEP]
simp
[GOAL]
case insert
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
ι : Type u_3
inst✝ : CommRing R
k : ℕ
φ : PowerSeries R
f : ι → PowerSeries R
a : ι
s : Finset ι
ha : ¬a ∈ s
ih : (∀ (i : ι), i ∈ s → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in s, (1 - f i)) = ↑(coeff R k) φ
⊢ (∀ (i : ι), i ∈ insert a s → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in insert a s, (1 - f i)) = ↑(coeff R k) φ
[PROOFSTEP]
intro t
[GOAL]
case insert
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
ι : Type u_3
inst✝ : CommRing R
k : ℕ
φ : PowerSeries R
f : ι → PowerSeries R
a : ι
s : Finset ι
ha : ¬a ∈ s
ih : (∀ (i : ι), i ∈ s → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in s, (1 - f i)) = ↑(coeff R k) φ
t : ∀ (i : ι), i ∈ insert a s → ↑k < order (f i)
⊢ ↑(coeff R k) (φ * ∏ i in insert a s, (1 - f i)) = ↑(coeff R k) φ
[PROOFSTEP]
simp only [Finset.mem_insert, forall_eq_or_imp] at t 
[GOAL]
case insert
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
ι : Type u_3
inst✝ : CommRing R
k : ℕ
φ : PowerSeries R
f : ι → PowerSeries R
a : ι
s : Finset ι
ha : ¬a ∈ s
ih : (∀ (i : ι), i ∈ s → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in s, (1 - f i)) = ↑(coeff R k) φ
t : ↑k < order (f a) ∧ ∀ (a : ι), a ∈ s → ↑k < order (f a)
⊢ ↑(coeff R k) (φ * ∏ i in insert a s, (1 - f i)) = ↑(coeff R k) φ
[PROOFSTEP]
rw [Finset.prod_insert ha, ← mul_assoc, mul_right_comm, coeff_mul_one_sub_of_lt_order _ t.1]
[GOAL]
case insert
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
ι : Type u_3
inst✝ : CommRing R
k : ℕ
φ : PowerSeries R
f : ι → PowerSeries R
a : ι
s : Finset ι
ha : ¬a ∈ s
ih : (∀ (i : ι), i ∈ s → ↑k < order (f i)) → ↑(coeff R k) (φ * ∏ i in s, (1 - f i)) = ↑(coeff R k) φ
t : ↑k < order (f a) ∧ ∀ (a : ι), a ∈ s → ↑k < order (f a)
⊢ ↑(coeff R k) (φ * ∏ x in s, (1 - f x)) = ↑(coeff R k) φ
[PROOFSTEP]
exact ih t.2
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
⊢ X ^ Part.get (order φ) h ∣ φ
[PROOFSTEP]
refine' ⟨PowerSeries.mk fun n => coeff R (n + (order φ).get h) φ, _⟩
[GOAL]
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
⊢ φ = X ^ Part.get (order φ) h * mk fun n => ↑(coeff R (n + Part.get (order φ) h)) φ
[PROOFSTEP]
ext n
[GOAL]
case h
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
n : ℕ
⊢ ↑(coeff R n) φ = ↑(coeff R n) (X ^ Part.get (order φ) h * mk fun n => ↑(coeff R (n + Part.get (order φ) h)) φ)
[PROOFSTEP]
simp only [coeff_mul, coeff_X_pow, coeff_mk, boole_mul, Finset.sum_ite, Finset.Nat.filter_fst_eq_antidiagonal,
  Finset.sum_const_zero, add_zero]
[GOAL]
case h
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
n : ℕ
⊢ ↑(coeff R n) φ =
    ∑ x in if Part.get (order φ) h ≤ n then {(Part.get (order φ) h, n - Part.get (order φ) h)} else ∅,
      ↑(coeff R (x.snd + Part.get (order φ) h)) φ
[PROOFSTEP]
split_ifs with hn
[GOAL]
case pos
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
n : ℕ
hn : Part.get (order φ) h ≤ n
⊢ ↑(coeff R n) φ =
    ∑ x in {(Part.get (order φ) h, n - Part.get (order φ) h)}, ↑(coeff R (x.snd + Part.get (order φ) h)) φ
[PROOFSTEP]
simp [tsub_add_cancel_of_le hn]
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
n : ℕ
hn : ¬Part.get (order φ) h ≤ n
⊢ ↑(coeff R n) φ = ∑ x in ∅, ↑(coeff R (x.snd + Part.get (order φ) h)) φ
[PROOFSTEP]
simp only [Finset.sum_empty]
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
n : ℕ
hn : ¬Part.get (order φ) h ≤ n
⊢ ↑(coeff R n) φ = 0
[PROOFSTEP]
refine' coeff_of_lt_order _ _
[GOAL]
case neg
R : Type u_1
inst✝ : Semiring R
φ : PowerSeries R
h : (order φ).Dom
n : ℕ
hn : ¬Part.get (order φ) h ≤ n
⊢ ↑n < order φ
[PROOFSTEP]
simpa [PartENat.coe_lt_iff] using fun _ => hn
[GOAL]
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
⊢ order φ = multiplicity X φ
[PROOFSTEP]
rcases eq_or_ne φ 0 with (rfl | hφ)
[GOAL]
case inl
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
⊢ order 0 = multiplicity X 0
[PROOFSTEP]
simp
[GOAL]
case inr
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
⊢ order φ = multiplicity X φ
[PROOFSTEP]
induction' ho : order φ using PartENat.casesOn with n
[GOAL]
case inr.a
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
ho : order φ = ⊤
⊢ ⊤ = multiplicity X φ
[PROOFSTEP]
simp [hφ] at ho 
[GOAL]
case inr.a
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
⊢ ↑n = multiplicity X φ
[PROOFSTEP]
have hn : φ.order.get (order_finite_iff_ne_zero.mpr hφ) = n := by simp [ho]
[GOAL]
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
⊢ Part.get (order φ) (_ : (order φ).Dom) = n
[PROOFSTEP]
simp [ho]
[GOAL]
case inr.a
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
⊢ ↑n = multiplicity X φ
[PROOFSTEP]
rw [← hn]
[GOAL]
case inr.a
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
⊢ ↑(Part.get (order φ) (_ : (order φ).Dom)) = multiplicity X φ
[PROOFSTEP]
refine'
  le_antisymm (le_multiplicity_of_pow_dvd <| X_pow_order_dvd (order_finite_iff_ne_zero.mpr hφ)) (PartENat.find_le _ _ _)
[GOAL]
case inr.a
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
⊢ ¬X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) ∣ φ
[PROOFSTEP]
rintro ⟨ψ, H⟩
[GOAL]
case inr.a.intro
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
⊢ False
[PROOFSTEP]
have := congr_arg (coeff R n) H
[GOAL]
case inr.a.intro
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ)
⊢ False
[PROOFSTEP]
rw [← (ψ.commute_X.pow_right _).eq, coeff_mul_of_lt_order, ← hn] at this 
[GOAL]
case inr.a.intro
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R (Part.get (order φ) (_ : (order φ).Dom))) φ = 0
⊢ False
[PROOFSTEP]
exact coeff_order _ this
[GOAL]
case inr.a.intro
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
⊢ ↑n < order (X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
[PROOFSTEP]
rw [X_pow_eq, order_monomial]
[GOAL]
case inr.a.intro
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
⊢ ↑n < if 1 = 0 then ⊤ else ↑(Part.get (order φ) (_ : (order φ).Dom) + 1)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
h✝ : 1 = 0
⊢ ↑n < ⊤
[PROOFSTEP]
exact PartENat.natCast_lt_top _
[GOAL]
case neg
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
h✝ : ¬1 = 0
⊢ ↑n < ↑(Part.get (order φ) (_ : (order φ).Dom) + 1)
[PROOFSTEP]
rw [← hn, PartENat.coe_lt_coe]
[GOAL]
case neg
R✝ : Type u_1
inst✝¹ : Semiring R✝
φ✝ : PowerSeries R✝
R : Type u_2
inst✝ : Semiring R
φ : PowerSeries R
hφ : φ ≠ 0
x✝ : PartENat
ho✝ : order φ = x✝
n : ℕ
ho : order φ = ↑n
hn : Part.get (order φ) (_ : (order φ).Dom) = n
ψ : PowerSeries R
H : φ = X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1) * ψ
this : ↑(coeff R n) φ = ↑(coeff R n) (ψ * X ^ (Part.get (order φ) (_ : (order φ).Dom) + 1))
h✝ : ¬1 = 0
⊢ Part.get (order φ) (_ : (order φ).Dom) < Part.get (order φ) (_ : (order φ).Dom) + 1
[PROOFSTEP]
exact Nat.lt_succ_self _
[GOAL]
R : Type u_1
inst✝¹ : Semiring R
inst✝ : Nontrivial R
⊢ order 1 = 0
[PROOFSTEP]
simpa using order_monomial_of_ne_zero 0 (1 : R) one_ne_zero
[GOAL]
R : Type u_1
inst✝¹ : Semiring R
inst✝ : Nontrivial R
⊢ order X = 1
[PROOFSTEP]
simpa only [Nat.cast_one] using order_monomial_of_ne_zero 1 (1 : R) one_ne_zero
[GOAL]
R : Type u_1
inst✝¹ : Semiring R
inst✝ : Nontrivial R
n : ℕ
⊢ order (X ^ n) = ↑n
[PROOFSTEP]
rw [X_pow_eq, order_monomial_of_ne_zero]
[GOAL]
case h
R : Type u_1
inst✝¹ : Semiring R
inst✝ : Nontrivial R
n : ℕ
⊢ 1 ≠ 0
[PROOFSTEP]
exact one_ne_zero
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
φ ψ : PowerSeries R
⊢ order (φ * ψ) = order φ + order ψ
[PROOFSTEP]
simp_rw [order_eq_multiplicity_X]
[GOAL]
R : Type u_1
inst✝¹ : CommRing R
inst✝ : IsDomain R
φ ψ : PowerSeries R
⊢ multiplicity X (φ * ψ) = multiplicity X φ + multiplicity X ψ
[PROOFSTEP]
exact multiplicity.mul X_prime
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
n : ℕ
a : R
⊢ ↑(↑(monomial n) a) = ↑(PowerSeries.monomial R n) a
[PROOFSTEP]
ext
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
n : ℕ
a : R
n✝ : ℕ
⊢ ↑(PowerSeries.coeff R n✝) ↑(↑(monomial n) a) = ↑(PowerSeries.coeff R n✝) (↑(PowerSeries.monomial R n) a)
[PROOFSTEP]
simp [coeff_coe, PowerSeries.coeff_monomial, Polynomial.coeff_monomial, eq_comm]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
⊢ ↑1 = 1
[PROOFSTEP]
have := coe_monomial 0 (1 : R)
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
this : ↑(↑(monomial 0) 1) = ↑(PowerSeries.monomial R 0) 1
⊢ ↑1 = 1
[PROOFSTEP]
rwa [PowerSeries.monomial_zero_eq_C_apply] at this 
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
⊢ ↑(φ + ψ) = ↑φ + ↑ψ
[PROOFSTEP]
ext
[GOAL]
case h
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
n✝ : ℕ
⊢ ↑(PowerSeries.coeff R n✝) ↑(φ + ψ) = ↑(PowerSeries.coeff R n✝) (↑φ + ↑ψ)
[PROOFSTEP]
simp
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
n : ℕ
⊢ ↑(PowerSeries.coeff R n) ↑(φ * ψ) = ↑(PowerSeries.coeff R n) (↑φ * ↑ψ)
[PROOFSTEP]
simp only [coeff_coe, PowerSeries.coeff_mul, coeff_mul]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
a : R
⊢ ↑(↑C a) = ↑(PowerSeries.C R) a
[PROOFSTEP]
have := coe_monomial 0 a
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
a : R
this : ↑(↑(monomial 0) a) = ↑(PowerSeries.monomial R 0) a
⊢ ↑(↑C a) = ↑(PowerSeries.C R) a
[PROOFSTEP]
rwa [PowerSeries.monomial_zero_eq_C_apply] at this 
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
⊢ ↑(bit1 φ) = bit1 ↑φ
[PROOFSTEP]
rw [bit1, bit1, coe_add, coe_one, coe_bit0]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ x y : R[X]
h : Coe.coe x = Coe.coe y
⊢ x = y
[PROOFSTEP]
ext
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ x y : R[X]
h : Coe.coe x = Coe.coe y
n✝ : ℕ
⊢ coeff x n✝ = coeff y n✝
[PROOFSTEP]
simp_rw [← coeff_coe]
[GOAL]
case a
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ x y : R[X]
h : Coe.coe x = Coe.coe y
n✝ : ℕ
⊢ ↑(PowerSeries.coeff R n✝) ↑x = ↑(PowerSeries.coeff R n✝) ↑y
[PROOFSTEP]
congr
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
⊢ ↑φ = 0 ↔ φ = 0
[PROOFSTEP]
rw [← coe_zero, coe_inj]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
φ ψ : R[X]
⊢ ↑φ = 1 ↔ φ = 1
[PROOFSTEP]
rw [← coe_one, coe_inj]
[GOAL]
σ : Type u_1
R : Type u_2
inst✝² : CommSemiring R
φ ψ : R[X]
A : Type u_3
inst✝¹ : Semiring A
inst✝ : Algebra R A
src✝ : R[X] →+* PowerSeries A := RingHom.comp (PowerSeries.map (algebraMap R A)) ringHom
r : R
⊢ OneHom.toFun
      (↑↑{ toMonoidHom := ↑src✝, map_zero' := (_ : OneHom.toFun (↑↑src✝) 0 = 0),
            map_add' :=
              (_ : ∀ (x y : R[X]), OneHom.toFun (↑↑src✝) (x + y) = OneHom.toFun (↑↑src✝) x + OneHom.toFun (↑↑src✝) y) })
      (↑(algebraMap R R[X]) r) =
    ↑(algebraMap R (PowerSeries A)) r
[PROOFSTEP]
simp [algebraMap_apply, PowerSeries.algebraMap_apply]
