Theorem: MvPolynomial.homogeneousComponent_homogeneous_polynomial
File: Mathlib/RingTheory/MvPolynomial/Homogeneous.lean

tactic: simp only [mem_homogeneousSubmodule] at h
state_before: σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : p ∈ homogeneousSubmodule σ R n
⊢ ↑(homogeneousComponent m) p = if m = n then p else 0

tactic: ext x
state_before: σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
⊢ ↑(homogeneousComponent m) p = if m = n then p else 0

tactic: rw [coeff_homogeneousComponent]
state_before: case a
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
⊢ coeff x (↑(homogeneousComponent m) p) = coeff x (if m = n then p else 0)

tactic: by_cases zero_coeff : coeff x p = 0
state_before: case a
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
⊢ (if ∑ i in x.support, ↑x i = m then coeff x p else 0) = coeff x (if m = n then p else 0)

tactic: split_ifs
state_before: case pos
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
⊢ (if ∑ i in x.support, ↑x i = m then coeff x p else 0) = coeff x (if m = n then p else 0)

tactic: all_goals simp only [zero_coeff, coeff_zero]
state_before: case pos.inl.inl
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ∑ i in x.support, ↑x i = m
h✝ : m = n
⊢ coeff x p = coeff x p

case pos.inl.inr
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ∑ i in x.support, ↑x i = m
h✝ : ¬m = n
⊢ coeff x p = coeff x 0

case pos.inr.inl
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬∑ i in x.support, ↑x i = m
h✝ : m = n
⊢ 0 = coeff x p

case pos.inr.inr
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬∑ i in x.support, ↑x i = m
h✝ : ¬m = n
⊢ 0 = coeff x 0

tactic: simp only [zero_coeff, coeff_zero]
state_before: case pos.inr.inr
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬∑ i in x.support, ↑x i = m
h✝ : ¬m = n
⊢ 0 = coeff x 0

tactic: rw [h zero_coeff]
state_before: case neg
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if ∑ i in x.support, ↑x i = m then coeff x p else 0) = coeff x (if m = n then p else 0)

tactic: simp only [show n = m ↔ m = n from eq_comm]
state_before: case neg
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if n = m then coeff x p else 0) = coeff x (if m = n then p else 0)

tactic: split_ifs with h1
state_before: case neg
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if m = n then coeff x p else 0) = coeff x (if m = n then p else 0)

tactic: rfl
state_before: case neg.inl
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
h1 : m = n
⊢ coeff x p = coeff x p

tactic: simp only [coeff_zero]
state_before: case neg.inr
σ : Type u_1
τ : Type ?u.368740
R : Type u_2
S : Type ?u.368746
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
m n : ℕ
p : MvPolynomial σ R
h : IsHomogeneous p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
h1 : ¬m = n
⊢ 0 = coeff x 0