[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c (a + b) ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
rw [coeff_add] at hc 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
obtain h | h : coeff c a ≠ 0 ∨ coeff c b ≠ 0 := by
  contrapose! hc
  simp only [hc, add_zero]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ coeff c a ≠ 0 ∨ coeff c b ≠ 0
[PROOFSTEP]
contrapose! hc
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a = 0 ∧ coeff c b = 0
⊢ coeff c a + coeff c b = 0
[PROOFSTEP]
simp only [hc, add_zero]
[GOAL]
case inl
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
h : coeff c a ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
exact ha h
[GOAL]
case inr
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
a b : MvPolynomial σ R
ha : a ∈ {x | IsHomogeneous x n}
hb : b ∈ {x | IsHomogeneous x n}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
h : coeff c b ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
exact hb h
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsHomogeneous x n},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsHomogeneous x n} →
                      b ∈ {x | IsHomogeneous x n} → ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ∑ i in c.support, ↑c i = n) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ∑ i in d.support, ↑d i = n) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : coeff c (r • a) ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
rw [coeff_smul] at hc 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsHomogeneous x n},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsHomogeneous x n} →
                      b ∈ {x | IsHomogeneous x n} → ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ∑ i in c.support, ↑c i = n) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ∑ i in d.support, ↑d i = n) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
apply ha
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsHomogeneous x n},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsHomogeneous x n} →
                      b ∈ {x | IsHomogeneous x n} → ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ∑ i in c.support, ↑c i = n) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ∑ i in d.support, ↑d i = n) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
⊢ coeff c a ≠ 0
[PROOFSTEP]
intro h
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsHomogeneous x n},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsHomogeneous x n} →
                      b ∈ {x | IsHomogeneous x n} → ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ∑ i in c.support, ↑c i = n) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ∑ i in d.support, ↑d i = n) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
h : coeff c a = 0
⊢ False
[PROOFSTEP]
apply hc
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsHomogeneous x n},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsHomogeneous x n} →
                      b ∈ {x | IsHomogeneous x n} → ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ∑ i in c.support, ↑c i = n) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ∑ i in d.support, ↑d i = n) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
h : coeff c a = 0
⊢ r • coeff c a = 0
[PROOFSTEP]
rw [h]
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsHomogeneous x n},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsHomogeneous x n} →
                      b ∈ {x | IsHomogeneous x n} → ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ∑ i in c.support, ↑c i = n) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ∑ i in d.support, ↑d i = n) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
h : coeff c a = 0
⊢ r • 0 = 0
[PROOFSTEP]
exact smul_zero r
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
⊢ homogeneousSubmodule σ R n = Finsupp.supported R R {d | ∑ i in d.support, ↑d i = n}
[PROOFSTEP]
ext
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
x✝ : MvPolynomial σ R
⊢ x✝ ∈ homogeneousSubmodule σ R n ↔ x✝ ∈ Finsupp.supported R R {d | ∑ i in d.support, ↑d i = n}
[PROOFSTEP]
rw [Finsupp.mem_supported, Set.subset_def]
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
x✝ : MvPolynomial σ R
⊢ x✝ ∈ homogeneousSubmodule σ R n ↔ ∀ (x : σ →₀ ℕ), x ∈ ↑x✝.support → x ∈ {d | ∑ i in d.support, ↑d i = n}
[PROOFSTEP]
simp only [Finsupp.mem_support_iff, Finset.mem_coe]
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
x✝ : MvPolynomial σ R
⊢ x✝ ∈ homogeneousSubmodule σ R n ↔ ∀ (x : σ →₀ ℕ), ↑x✝ x ≠ 0 → x ∈ {d | ∑ x in d.support, ↑d x = n}
[PROOFSTEP]
rfl
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
⊢ homogeneousSubmodule σ R m * homogeneousSubmodule σ R n ≤ homogeneousSubmodule σ R (m + n)
[PROOFSTEP]
rw [Submodule.mul_le]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
⊢ ∀ (m_1 : MvPolynomial σ R),
    m_1 ∈ homogeneousSubmodule σ R m →
      ∀ (n_1 : MvPolynomial σ R), n_1 ∈ homogeneousSubmodule σ R n → m_1 * n_1 ∈ homogeneousSubmodule σ R (m + n)
[PROOFSTEP]
intro φ hφ ψ hψ c hc
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc : coeff c (φ * ψ) ≠ 0
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
classical
rw [coeff_mul] at hc 
obtain ⟨⟨d, e⟩, hde, H⟩ := Finset.exists_ne_zero_of_sum_ne_zero hc
have aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0 := by
  contrapose! H
  by_cases h : coeff d φ = 0 <;> simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
specialize hφ aux.1
specialize hψ aux.2
rw [Finsupp.mem_antidiagonal] at hde 
classical
have hd' : d.support ⊆ d.support ∪ e.support := Finset.subset_union_left _ _
have he' : e.support ⊆ d.support ∪ e.support := Finset.subset_union_right _ _
rw [← hde, ← hφ, ← hψ, Finset.sum_subset Finsupp.support_add, Finset.sum_subset hd', Finset.sum_subset he', ←
  Finset.sum_add_distrib]
· congr
all_goals intro i hi; apply Finsupp.not_mem_support_iff.mp
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc : coeff c (φ * ψ) ≠ 0
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
rw [coeff_mul] at hc 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
obtain ⟨⟨d, e⟩, hde, H⟩ := Finset.exists_ne_zero_of_sum_ne_zero hc
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
have aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0 := by
  contrapose! H
  by_cases h : coeff d φ = 0 <;> simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
⊢ coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
[PROOFSTEP]
contrapose! H
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
by_cases h : coeff d φ = 0
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
h : coeff d φ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
h : ¬coeff d φ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
simp_all only [Ne.def, not_false_iff, zero_mul, mul_zero]
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ : MvPolynomial σ R
hφ : φ ∈ homogeneousSubmodule σ R m
ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
specialize hφ aux.1
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
hψ : ψ ∈ homogeneousSubmodule σ R n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
specialize hψ aux.2
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ Finsupp.antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
rw [Finsupp.mem_antidiagonal] at hde 
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
classical
have hd' : d.support ⊆ d.support ∪ e.support := Finset.subset_union_left _ _
have he' : e.support ⊆ d.support ∪ e.support := Finset.subset_union_right _ _
rw [← hde, ← hφ, ← hψ, Finset.sum_subset Finsupp.support_add, Finset.sum_subset hd', Finset.sum_subset he', ←
  Finset.sum_add_distrib]
· congr
all_goals intro i hi; apply Finsupp.not_mem_support_iff.mp
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
have hd' : d.support ⊆ d.support ∪ e.support := Finset.subset_union_left _ _
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
have he' : e.support ⊆ d.support ∪ e.support := Finset.subset_union_right _ _
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∑ i in c.support, ↑c i = m + n
[PROOFSTEP]
rw [← hde, ← hφ, ← hψ, Finset.sum_subset Finsupp.support_add, Finset.sum_subset hd', Finset.sum_subset he', ←
  Finset.sum_add_distrib]
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∑ x in (d, e).fst.support ∪ (d, e).snd.support, ↑((d, e).fst + (d, e).snd) x =
    ∑ x in d.support ∪ e.support, (↑d x + ↑e x)
[PROOFSTEP]
congr
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∀ (x : σ), x ∈ d.support ∪ e.support → ¬x ∈ e.support → ↑e x = 0
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∀ (x : σ), x ∈ d.support ∪ e.support → ¬x ∈ d.support → ↑d x = 0
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∀ (x : σ),
    x ∈ (d, e).fst.support ∪ (d, e).snd.support →
      ¬x ∈ ((d, e).fst + (d, e).snd).support → ↑((d, e).fst + (d, e).snd) x = 0
[PROOFSTEP]
all_goals intro i hi; apply Finsupp.not_mem_support_iff.mp
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∀ (x : σ), x ∈ d.support ∪ e.support → ¬x ∈ e.support → ↑e x = 0
[PROOFSTEP]
intro i hi
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
i : σ
hi : i ∈ d.support ∪ e.support
⊢ ¬i ∈ e.support → ↑e i = 0
[PROOFSTEP]
apply Finsupp.not_mem_support_iff.mp
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∀ (x : σ), x ∈ d.support ∪ e.support → ¬x ∈ d.support → ↑d x = 0
[PROOFSTEP]
intro i hi
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
i : σ
hi : i ∈ d.support ∪ e.support
⊢ ¬i ∈ d.support → ↑d i = 0
[PROOFSTEP]
apply Finsupp.not_mem_support_iff.mp
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
⊢ ∀ (x : σ),
    x ∈ (d, e).fst.support ∪ (d, e).snd.support →
      ¬x ∈ ((d, e).fst + (d, e).snd).support → ↑((d, e).fst + (d, e).snd) x = 0
[PROOFSTEP]
intro i hi
[GOAL]
case intro.mk.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
m n : ℕ
φ ψ : MvPolynomial σ R
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in Finsupp.antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e).fst + (d, e).snd = c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
hφ : ∑ i in d.support, ↑d i = m
hψ : ∑ i in e.support, ↑e i = n
hd' : d.support ⊆ d.support ∪ e.support
he' : e.support ⊆ d.support ∪ e.support
i : σ
hi : i ∈ (d, e).fst.support ∪ (d, e).snd.support
⊢ ¬i ∈ ((d, e).fst + (d, e).snd).support → ↑((d, e).fst + (d, e).snd) i = 0
[PROOFSTEP]
apply Finsupp.not_mem_support_iff.mp
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
⊢ IsHomogeneous (↑(monomial d) r) n
[PROOFSTEP]
intro c hc
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
c : σ →₀ ℕ
hc : coeff c (↑(monomial d) r) ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
classical
rw [coeff_monomial] at hc 
split_ifs at hc  with h
· subst c
  exact hn
· contradiction
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
c : σ →₀ ℕ
hc : coeff c (↑(monomial d) r) ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
rw [coeff_monomial] at hc 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
hc : (if d = c then r else 0) ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
split_ifs at hc  with h
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
h : d = c
hc : r ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
subst c
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
hc✝ : r ≠ 0
hc : coeff d (↑(monomial d) r) ≠ 0
⊢ ∑ i in d.support, ↑d i = n
[PROOFSTEP]
exact hn
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
d : σ →₀ ℕ
r : R
n : ℕ
hn : ∑ i in d.support, ↑d i = n
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
h : ¬d = c
hc : 0 ≠ 0
⊢ ∑ i in c.support, ↑c i = n
[PROOFSTEP]
contradiction
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
p : MvPolynomial σ R
hp : totalDegree p = 0
⊢ IsHomogeneous p 0
[PROOFSTEP]
erw [totalDegree, Finset.sup_eq_bot_iff] at hp 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
p : MvPolynomial σ R
hp : ∀ (s : σ →₀ ℕ), s ∈ support p → (Finsupp.sum s fun x e => e) = ⊥
⊢ IsHomogeneous p 0
[PROOFSTEP]
simp_rw [mem_support_iff] at hp 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
p : MvPolynomial σ R
hp : ∀ (s : σ →₀ ℕ), coeff s p ≠ 0 → (Finsupp.sum s fun x e => e) = ⊥
⊢ IsHomogeneous p 0
[PROOFSTEP]
exact hp
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
r : R
⊢ IsHomogeneous (↑C r) 0
[PROOFSTEP]
apply isHomogeneous_monomial
[GOAL]
case hn
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
r : R
⊢ ∑ i in 0.support, ↑0 i = 0
[PROOFSTEP]
simp only [Finsupp.zero_apply, Finset.sum_const_zero]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
i : σ
⊢ IsHomogeneous (X i) 1
[PROOFSTEP]
apply isHomogeneous_monomial
[GOAL]
case hn
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
i : σ
⊢ ∑ i_1 in (Finsupp.single i 1).support, ↑(Finsupp.single i 1) i_1 = 1
[PROOFSTEP]
rw [Finsupp.support_single_ne_zero _ one_ne_zero, Finset.sum_singleton]
[GOAL]
case hn
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
i : σ
⊢ ↑(Finsupp.single i 1) i = 1
[PROOFSTEP]
exact Finsupp.single_eq_same
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
d : σ →₀ ℕ
hd : ∑ i in d.support, ↑d i ≠ n
⊢ coeff d φ = 0
[PROOFSTEP]
have aux := mt (@hφ d) hd
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
d : σ →₀ ℕ
hd : ∑ i in d.support, ↑d i ≠ n
aux : ¬coeff d φ ≠ 0
⊢ coeff d φ = 0
[PROOFSTEP]
classical rwa [Classical.not_not] at aux 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
d : σ →₀ ℕ
hd : ∑ i in d.support, ↑d i ≠ n
aux : ¬coeff d φ ≠ 0
⊢ coeff d φ = 0
[PROOFSTEP]
rwa [Classical.not_not] at aux 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hm : IsHomogeneous φ m
hn : IsHomogeneous φ n
hφ : φ ≠ 0
⊢ m = n
[PROOFSTEP]
obtain ⟨d, hd⟩ : ∃ d, coeff d φ ≠ 0 := exists_coeff_ne_zero hφ
[GOAL]
case intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hm : IsHomogeneous φ m
hn : IsHomogeneous φ n
hφ : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ m = n
[PROOFSTEP]
rw [← hm hd, ← hn hd]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
h : ∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)
⊢ IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
classical
revert h
refine' Finset.induction_on s _ _
· intro
  simp only [isHomogeneous_one, Finset.sum_empty, Finset.prod_empty]
· intro i s his IH h
  simp only [his, Finset.prod_insert, Finset.sum_insert, not_false_iff]
  apply (h i (Finset.mem_insert_self _ _)).mul (IH _)
  intro j hjs
  exact h j (Finset.mem_insert_of_mem hjs)
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
h : ∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)
⊢ IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
revert h
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
⊢ (∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
refine' Finset.induction_on s _ _
[GOAL]
case refine'_1
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
⊢ (∀ (i : ι), i ∈ ∅ → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in ∅, φ i) (∑ i in ∅, n i)
[PROOFSTEP]
intro
[GOAL]
case refine'_1
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
h✝ : ∀ (i : ι), i ∈ ∅ → IsHomogeneous (φ i) (n i)
⊢ IsHomogeneous (∏ i in ∅, φ i) (∑ i in ∅, n i)
[PROOFSTEP]
simp only [isHomogeneous_one, Finset.sum_empty, Finset.prod_empty]
[GOAL]
case refine'_2
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
⊢ ∀ ⦃a : ι⦄ {s : Finset ι},
    ¬a ∈ s →
      ((∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)) →
        (∀ (i : ι), i ∈ insert a s → IsHomogeneous (φ i) (n i)) →
          IsHomogeneous (∏ i in insert a s, φ i) (∑ i in insert a s, n i)
[PROOFSTEP]
intro i s his IH h
[GOAL]
case refine'_2
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsHomogeneous (φ i_1) (n i_1)
⊢ IsHomogeneous (∏ i in insert i s, φ i) (∑ i in insert i s, n i)
[PROOFSTEP]
simp only [his, Finset.prod_insert, Finset.sum_insert, not_false_iff]
[GOAL]
case refine'_2
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsHomogeneous (φ i_1) (n i_1)
⊢ IsHomogeneous (φ i * ∏ i in s, φ i) (n i + ∑ i in s, n i)
[PROOFSTEP]
apply (h i (Finset.mem_insert_self _ _)).mul (IH _)
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsHomogeneous (φ i_1) (n i_1)
⊢ ∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)
[PROOFSTEP]
intro j hjs
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ✝ ψ : MvPolynomial σ R
m n✝ : ℕ
ι : Type u_5
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → ℕ
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsHomogeneous (φ i) (n i)) → IsHomogeneous (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsHomogeneous (φ i_1) (n i_1)
j : ι
hjs : j ∈ s
⊢ IsHomogeneous (φ j) (n j)
[PROOFSTEP]
exact h j (Finset.mem_insert_of_mem hjs)
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
⊢ MvPolynomial.totalDegree φ = n
[PROOFSTEP]
rw [totalDegree]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
⊢ (Finset.sup (support φ) fun s => Finsupp.sum s fun x e => e) = n
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
⊢ (Finset.sup (support φ) fun s => Finsupp.sum s fun x e => e) ≤ n
[PROOFSTEP]
apply Finset.sup_le
[GOAL]
case a.a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
⊢ ∀ (b : σ →₀ ℕ), b ∈ support φ → (Finsupp.sum b fun x e => e) ≤ n
[PROOFSTEP]
intro d hd
[GOAL]
case a.a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : d ∈ support φ
⊢ (Finsupp.sum d fun x e => e) ≤ n
[PROOFSTEP]
rw [mem_support_iff] at hd 
[GOAL]
case a.a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ (Finsupp.sum d fun x e => e) ≤ n
[PROOFSTEP]
rw [Finsupp.sum, hφ hd]
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
⊢ n ≤ Finset.sup (support φ) fun s => Finsupp.sum s fun x e => e
[PROOFSTEP]
obtain ⟨d, hd⟩ : ∃ d, coeff d φ ≠ 0 := exists_coeff_ne_zero h
[GOAL]
case a.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ n ≤ Finset.sup (support φ) fun s => Finsupp.sum s fun x e => e
[PROOFSTEP]
simp only [← hφ hd, Finsupp.sum]
[GOAL]
case a.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ ∑ x in d.support, ↑d x ≤ Finset.sup (support φ) fun s => ∑ x in s.support, ↑s x
[PROOFSTEP]
replace hd := Finsupp.mem_support_iff.mpr hd
[GOAL]
case a.intro
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
φ ψ : MvPolynomial σ R
m n : ℕ
hφ : IsHomogeneous φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : d ∈ φ.support
⊢ ∑ x in d.support, ↑d x ≤ Finset.sup (support φ) fun s => ∑ x in s.support, ↑s x
[PROOFSTEP]
exact Finset.le_sup (f := fun s ↦ ∑ x in s.support, (⇑s) x) hd
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
⊢ IsHomogeneous (↑(homogeneousComponent n) φ) n
[PROOFSTEP]
intro d hd
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d (↑(homogeneousComponent n) φ) ≠ 0
⊢ ∑ i in d.support, ↑d i = n
[PROOFSTEP]
contrapose! hd
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ∑ x in d.support, ↑d x ≠ n
⊢ coeff d (↑(homogeneousComponent n) φ) = 0
[PROOFSTEP]
rw [coeff_homogeneousComponent, if_neg hd]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
⊢ ↑(homogeneousComponent 0) φ = ↑C (coeff 0 φ)
[PROOFSTEP]
ext1 d
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ coeff d (↑(homogeneousComponent 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
rcases em (d = 0) with (rfl | hd)
[GOAL]
case a.inl
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
⊢ coeff 0 (↑(homogeneousComponent 0) φ) = coeff 0 (↑C (coeff 0 φ))
case a.inr
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ¬d = 0
⊢ coeff d (↑(homogeneousComponent 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
classical
·
  simp only [coeff_homogeneousComponent, sum_eq_zero_iff, Finsupp.zero_apply, if_true, coeff_C, eq_self_iff_true,
    forall_true_iff]
· rw [coeff_homogeneousComponent, if_neg, coeff_C, if_neg (Ne.symm hd)]
  simp only [FunLike.ext_iff, Finsupp.zero_apply] at hd 
  simp [hd]
[GOAL]
case a.inl
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
⊢ coeff 0 (↑(homogeneousComponent 0) φ) = coeff 0 (↑C (coeff 0 φ))
[PROOFSTEP]
simp only [coeff_homogeneousComponent, sum_eq_zero_iff, Finsupp.zero_apply, if_true, coeff_C, eq_self_iff_true,
  forall_true_iff]
[GOAL]
case a.inr
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ¬d = 0
⊢ coeff d (↑(homogeneousComponent 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
rw [coeff_homogeneousComponent, if_neg, coeff_C, if_neg (Ne.symm hd)]
[GOAL]
case a.inr.hnc
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ¬d = 0
⊢ ¬∑ i in d.support, ↑d i = 0
[PROOFSTEP]
simp only [FunLike.ext_iff, Finsupp.zero_apply] at hd 
[GOAL]
case a.inr.hnc
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ¬∀ (x : σ), ↑d x = 0
⊢ ¬∑ i in d.support, ↑d i = 0
[PROOFSTEP]
simp [hd]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n✝ : ℕ
φ ψ : MvPolynomial σ R
n : ℕ
r : R
⊢ ↑(homogeneousComponent n) (↑C r * φ) = ↑C r * ↑(homogeneousComponent n) φ
[PROOFSTEP]
simp only [C_mul', LinearMap.map_smul]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
⊢ ↑(homogeneousComponent n) φ = 0
[PROOFSTEP]
rw [homogeneousComponent_apply, sum_eq_zero]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
⊢ ∀ (x : σ →₀ ℕ), x ∈ filter (fun d => ∑ i in d.support, ↑d i = n) (support φ) → ↑(monomial x) (coeff x φ) = 0
[PROOFSTEP]
intro d hd
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
d : σ →₀ ℕ
hd : d ∈ filter (fun d => ∑ i in d.support, ↑d i = n) (support φ)
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
rw [mem_filter] at hd 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ∑ i in d.support, ↑d i = n
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ∑ i in d.support, ↑d i = n
⊢ False
[PROOFSTEP]
exact h _ hd.1 hd.2
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : totalDegree φ < n
⊢ ↑(homogeneousComponent n) φ = 0
[PROOFSTEP]
apply homogeneousComponent_eq_zero'
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : totalDegree φ < n
⊢ ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
[PROOFSTEP]
rw [totalDegree, Finset.sup_lt_iff] at h 
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (b : σ →₀ ℕ), b ∈ support φ → (Finsupp.sum b fun x e => e) < n
⊢ ∀ (d : σ →₀ ℕ), d ∈ support φ → ∑ i in d.support, ↑d i ≠ n
[PROOFSTEP]
intro d hd
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : ∀ (b : σ →₀ ℕ), b ∈ support φ → (Finsupp.sum b fun x e => e) < n
d : σ →₀ ℕ
hd : d ∈ support φ
⊢ ∑ i in d.support, ↑d i ≠ n
[PROOFSTEP]
exact ne_of_lt (h d hd)
[GOAL]
case h
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
h : (sup (support φ) fun s => Finsupp.sum s fun x e => e) < n
⊢ ⊥ < n
[PROOFSTEP]
exact lt_of_le_of_lt (Nat.zero_le _) h
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
⊢ ∑ i in range (totalDegree φ + 1), ↑(homogeneousComponent i) φ = φ
[PROOFSTEP]
ext1 d
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ coeff d (∑ i in range (totalDegree φ + 1), ↑(homogeneousComponent i) φ) = coeff d φ
[PROOFSTEP]
suffices φ.totalDegree < d.support.sum d → 0 = coeff d φ by simpa [coeff_sum, coeff_homogeneousComponent]
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
this : totalDegree φ < Finset.sum d.support ↑d → 0 = coeff d φ
⊢ coeff d (∑ i in range (totalDegree φ + 1), ↑(homogeneousComponent i) φ) = coeff d φ
[PROOFSTEP]
simpa [coeff_sum, coeff_homogeneousComponent]
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
inst✝ : CommSemiring R
n : ℕ
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ totalDegree φ < Finset.sum d.support ↑d → 0 = coeff d φ
[PROOFSTEP]
exact fun h => (coeff_eq_zero_of_totalDegree_lt h).symm
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
simp only [mem_homogeneousSubmodule] at h 
[GOAL]
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
ext x
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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)
[PROOFSTEP]
rw [coeff_homogeneousComponent]
[GOAL]
case a
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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)
[PROOFSTEP]
by_cases zero_coeff : coeff x p = 0
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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 neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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 neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
all_goals simp only [zero_coeff, coeff_zero]
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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)
[PROOFSTEP]
rw [h zero_coeff]
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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)
[PROOFSTEP]
simp only [show n = m ↔ m = n from eq_comm]
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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)
[PROOFSTEP]
split_ifs with h1
[GOAL]
case pos
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
rfl
[GOAL]
case neg
σ : Type u_1
τ : Type u_2
R : Type u_3
S : Type u_4
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
[PROOFSTEP]
simp only [coeff_zero]
