Theorem: PowerSeries.trunc_coe_eq_self
File: Mathlib/RingTheory/PowerSeries/Trunc.lean

tactic: rw [← Polynomial.coe_inj]
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
⊢ trunc n ↑f = f
state_after: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
⊢ ↑(trunc n ↑f) = ↑f

tactic: ext m
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
⊢ ↑(trunc n ↑f) = ↑f
state_after: case h
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
⊢ (coeff R m) ↑(trunc n ↑f) = (coeff R m) ↑f

tactic: rw [coeff_coe, coeff_trunc]
state_before: case h
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
⊢ (coeff R m) ↑(trunc n ↑f) = (coeff R m) ↑f
state_after: case h
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
⊢ (if m < n then (coeff R m) ↑f else 0) = (coeff R m) ↑f

tactic: split
state_before: case h
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
⊢ (if m < n then (coeff R m) ↑f else 0) = (coeff R m) ↑f
state_after: case h.isTrue
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h✝ : m < n
⊢ (coeff R m) ↑f = (coeff R m) ↑f

case h.isFalse
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h✝ : ¬m < n
⊢ 0 = (coeff R m) ↑f

tactic: case isTrue h => rfl
state_before: case h.isTrue
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h✝ : m < n
⊢ (coeff R m) ↑f = (coeff R m) ↑f

case h.isFalse
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h✝ : ¬m < n
⊢ 0 = (coeff R m) ↑f
state_after: case h.isFalse
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h✝ : ¬m < n
⊢ 0 = (coeff R m) ↑f

tactic: case isFalse h =>
  rw [not_lt] at h
  rw [coeff_coe]; symm
  exact coeff_eq_zero_of_natDegree_lt <| lt_of_lt_of_le hn h
state_before: case h.isFalse
R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h✝ : ¬m < n
⊢ 0 = (coeff R m) ↑f
state_after: no goals

tactic: rfl
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : m < n
⊢ (coeff R m) ↑f = (coeff R m) ↑f
state_after: no goals

tactic: rw [not_lt] at h
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : ¬m < n
⊢ 0 = (coeff R m) ↑f
state_after: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : n ≤ m
⊢ 0 = (coeff R m) ↑f

tactic: rw [coeff_coe]
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : n ≤ m
⊢ 0 = (coeff R m) ↑f
state_after: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : n ≤ m
⊢ 0 = f.coeff m

tactic: symm
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : n ≤ m
⊢ 0 = f.coeff m
state_after: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : n ≤ m
⊢ f.coeff m = 0

tactic: exact coeff_eq_zero_of_natDegree_lt <| lt_of_lt_of_le hn h
state_before: R✝ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
n : ℕ
f : R[X]
hn : f.natDegree < n
m : ℕ
h : n ≤ m
⊢ f.coeff m = 0
state_after: no goals