Theorem: PowerSeries.X_pow_order_dvd
File: Mathlib/RingTheory/PowerSeries/Order.lean

tactic: refine ⟨PowerSeries.mk fun n => coeff R (n + (order φ).get h) φ, ?_⟩
state_before: R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
⊢ X ^ φ.order.get h ∣ φ
state_after: R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
⊢ φ = X ^ φ.order.get h * mk fun n => (coeff R (n + φ.order.get h)) φ

tactic: ext n
state_before: R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
⊢ φ = X ^ φ.order.get h * mk fun n => (coeff R (n + φ.order.get h)) φ
state_after: case h
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
⊢ (coeff R n) φ = (coeff R n) (X ^ φ.order.get h * mk fun n => (coeff R (n + φ.order.get h)) φ)

tactic: simp only [coeff_mul, coeff_X_pow, coeff_mk, boole_mul, Finset.sum_ite,
  Finset.sum_const_zero, add_zero]
state_before: case h
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
⊢ (coeff R n) φ = (coeff R n) (X ^ φ.order.get h * mk fun n => (coeff R (n + φ.order.get h)) φ)
state_after: case h
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
⊢ (coeff R n) φ = ∑ x ∈ Finset.filter (fun x => x.1 = φ.order.get h) (antidiagonal n), (coeff R (x.2 + φ.order.get h)) φ

tactic: rw [Finset.filter_fst_eq_antidiagonal n (Part.get (order φ) h)]
state_before: case h
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
⊢ (coeff R n) φ = ∑ x ∈ Finset.filter (fun x => x.1 = φ.order.get h) (antidiagonal n), (coeff R (x.2 + φ.order.get h)) φ
state_after: case h
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
⊢ (coeff R n) φ =
    ∑ x ∈ if φ.order.get h ≤ n then {(φ.order.get h, n - φ.order.get h)} else ∅, (coeff R (x.2 + φ.order.get h)) φ

tactic: split_ifs with hn
state_before: case h
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
⊢ (coeff R n) φ =
    ∑ x ∈ if φ.order.get h ≤ n then {(φ.order.get h, n - φ.order.get h)} else ∅, (coeff R (x.2 + φ.order.get h)) φ
state_after: case pos
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : φ.order.get h ≤ n
⊢ (coeff R n) φ = ∑ x ∈ {(φ.order.get h, n - φ.order.get h)}, (coeff R (x.2 + φ.order.get h)) φ

case neg
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : ¬φ.order.get h ≤ n
⊢ (coeff R n) φ = ∑ x ∈ ∅, (coeff R (x.2 + φ.order.get h)) φ

tactic: simp [tsub_add_cancel_of_le hn]
state_before: case pos
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : φ.order.get h ≤ n
⊢ (coeff R n) φ = ∑ x ∈ {(φ.order.get h, n - φ.order.get h)}, (coeff R (x.2 + φ.order.get h)) φ
state_after: no goals

tactic: simp only [Finset.sum_empty]
state_before: case neg
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : ¬φ.order.get h ≤ n
⊢ (coeff R n) φ = ∑ x ∈ ∅, (coeff R (x.2 + φ.order.get h)) φ
state_after: case neg
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : ¬φ.order.get h ≤ n
⊢ (coeff R n) φ = 0

tactic: refine coeff_of_lt_order _ ?_
state_before: case neg
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : ¬φ.order.get h ≤ n
⊢ (coeff R n) φ = 0
state_after: case neg
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : ¬φ.order.get h ≤ n
⊢ ↑n < φ.order

tactic: simpa [PartENat.coe_lt_iff] using fun _ => hn
state_before: case neg
R : Type u_1
inst✝ : Semiring R
φ : R⟦X⟧
h : φ.order.Dom
n : ℕ
hn : ¬φ.order.get h ≤ n
⊢ ↑n < φ.order
state_after: no goals