Theorem: Mathlib.Tactic.ComputeDegree.coeff_mul_add_of_le_natDegree_of_eq_ite
File: Mathlib/Tactic/ComputeDegree.lean

tactic: split_ifs with h
state_before: R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
⊢ (f * g).coeff d = if d = df + dg then a * b else 0
state_after: case pos
R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : d = df + dg
⊢ (f * g).coeff d = a * b

case neg
R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ (f * g).coeff d = 0

tactic: subst h_mul_left h_mul_right h
state_before: case pos
R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : d = df + dg
⊢ (f * g).coeff d = a * b
state_after: case pos
R : Type u_1
inst✝ : Semiring R
df dg : ℕ
f g : R[X]
h_mul_left : f.natDegree ≤ df
h_mul_right : g.natDegree ≤ dg
ddf : df + dg ≤ df + dg
⊢ (f * g).coeff (df + dg) = f.coeff df * g.coeff dg

tactic: exact coeff_mul_of_natDegree_le ‹_› ‹_›
state_before: case pos
R : Type u_1
inst✝ : Semiring R
df dg : ℕ
f g : R[X]
h_mul_left : f.natDegree ≤ df
h_mul_right : g.natDegree ≤ dg
ddf : df + dg ≤ df + dg
⊢ (f * g).coeff (df + dg) = f.coeff df * g.coeff dg
state_after: no goals

tactic: apply coeff_eq_zero_of_natDegree_lt
state_before: case neg
R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ (f * g).coeff d = 0
state_after: case neg.h
R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ (f * g).natDegree < d

tactic: apply lt_of_le_of_lt ?_ (lt_of_le_of_ne ddf ?_)
state_before: case neg.h
R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ (f * g).natDegree < d
state_after: R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ (f * g).natDegree ≤ df + dg

R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ df + dg ≠ d

tactic: exact natDegree_mul_le_of_le ‹_› ‹_›
state_before: R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ (f * g).natDegree ≤ df + dg
state_after: no goals

tactic: exact ne_comm.mp h
state_before: R : Type u_1
inst✝ : Semiring R
d df dg : ℕ
a b : R
f g : R[X]
h_mul_left✝ : f.natDegree ≤ df
h_mul_right✝ : g.natDegree ≤ dg
h_mul_left : f.coeff df = a
h_mul_right : g.coeff dg = b
ddf : df + dg ≤ d
h : ¬d = df + dg
⊢ df + dg ≠ d
state_after: no goals