[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : SemilatticeSup M
w : σ → M
p : MvPolynomial σ R
⊢ weightedTotalDegree' w p = ⊥ ↔ p = 0
[PROOFSTEP]
simp only [weightedTotalDegree', Finset.sup_eq_bot_iff, mem_support_iff, WithBot.coe_ne_bot, MvPolynomial.eq_zero_iff]
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : SemilatticeSup M
w : σ → M
p : MvPolynomial σ R
⊢ (∀ (s : σ →₀ ℕ), coeff s p ≠ 0 → False) ↔ ∀ (d : σ →₀ ℕ), coeff d p = 0
[PROOFSTEP]
exact forall_congr' fun _ => Classical.not_not
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
inst✝ : SemilatticeSup M
w : σ → M
⊢ weightedTotalDegree' w 0 = ⊥
[PROOFSTEP]
simp only [weightedTotalDegree', support_zero, Finset.sup_empty]
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : p ≠ 0
⊢ weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
[PROOFSTEP]
rw [Ne.def, ← weightedTotalDegree'_eq_bot_iff w p, ← Ne.def, WithBot.ne_bot_iff_exists] at hp 
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : ∃ a, ↑a = weightedTotalDegree' w p
⊢ weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
[PROOFSTEP]
obtain ⟨m, hm⟩ := hp
[GOAL]
case intro
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
[PROOFSTEP]
apply le_antisymm
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ weightedTotalDegree' w p ≤ ↑(weightedTotalDegree w p)
[PROOFSTEP]
simp only [weightedTotalDegree, weightedTotalDegree', Finset.sup_le_iff, WithBot.coe_le_coe]
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ ∀ (b : σ →₀ ℕ), b ∈ support p → ↑(weightedDegree' w) b ≤ sup (support p) fun s => ↑(weightedDegree' w) s
[PROOFSTEP]
intro b
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
b : σ →₀ ℕ
⊢ b ∈ support p → ↑(weightedDegree' w) b ≤ sup (support p) fun s => ↑(weightedDegree' w) s
[PROOFSTEP]
exact Finset.le_sup
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ ↑(weightedTotalDegree w p) ≤ weightedTotalDegree' w p
[PROOFSTEP]
simp only [weightedTotalDegree]
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
⊢ ↑(sup (support p) fun s => ↑(weightedDegree' w) s) ≤ weightedTotalDegree' w p
[PROOFSTEP]
have hm' : weightedTotalDegree' w p ≤ m := le_of_eq hm.symm
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
hm' : weightedTotalDegree' w p ≤ ↑m
⊢ ↑(sup (support p) fun s => ↑(weightedDegree' w) s) ≤ weightedTotalDegree' w p
[PROOFSTEP]
rw [← hm]
[GOAL]
case intro.a
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
m : M
hm : ↑m = weightedTotalDegree' w p
hm' : weightedTotalDegree' w p ≤ ↑m
⊢ ↑(sup (support p) fun s => ↑(weightedDegree' w) s) ≤ ↑m
[PROOFSTEP]
simpa [weightedTotalDegree'] using hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
⊢ weightedTotalDegree w 0 = ⊥
[PROOFSTEP]
simp only [weightedTotalDegree, support_zero, Finset.sup_empty]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c (a + b) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
rw [coeff_add] at hc 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
obtain h | h : coeff c a ≠ 0 ∨ coeff c b ≠ 0 := by
  contrapose! hc
  simp only [hc, add_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
⊢ coeff c a ≠ 0 ∨ coeff c b ≠ 0
[PROOFSTEP]
contrapose! hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
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
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
h : coeff c a ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
exact ha h
[GOAL]
case inr
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
a b : MvPolynomial σ R
ha : a ∈ {x | IsWeightedHomogeneous w x m}
hb : b ∈ {x | IsWeightedHomogeneous w x m}
c : σ →₀ ℕ
hc : coeff c a + coeff c b ≠ 0
h : coeff c b ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
exact hb h
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsWeightedHomogeneous w x m},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsWeightedHomogeneous w x m} →
                      b ∈ {x | IsWeightedHomogeneous w x m} →
                        ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ↑(weightedDegree' w) c = m) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ↑(weightedDegree' w) d = m) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : coeff c (r • a) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
rw [coeff_smul] at hc 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
r : R
a : MvPolynomial σ R
ha :
  a ∈
    {
          toAddSubsemigroup :=
            { carrier := {x | IsWeightedHomogeneous w x m},
              add_mem' :=
                (_ :
                  ∀ {a b : MvPolynomial σ R},
                    a ∈ {x | IsWeightedHomogeneous w x m} →
                      b ∈ {x | IsWeightedHomogeneous w x m} →
                        ∀ (c : σ →₀ ℕ), coeff c (a + b) ≠ 0 → ↑(weightedDegree' w) c = m) },
          zero_mem' := (_ : ∀ (d : σ →₀ ℕ), coeff d 0 ≠ 0 → ↑(weightedDegree' w) d = m) }.toAddSubsemigroup.carrier
c : σ →₀ ℕ
hc : r • coeff c a ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
exact ha (right_ne_zero_of_mul hc)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
⊢ weightedHomogeneousSubmodule R w m = supported R R {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
ext x
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
x : MvPolynomial σ R
⊢ x ∈ weightedHomogeneousSubmodule R w m ↔ x ∈ supported R R {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
rw [mem_supported, Set.subset_def]
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
x : MvPolynomial σ R
⊢ x ∈ weightedHomogeneousSubmodule R w m ↔ ∀ (x_1 : σ →₀ ℕ), x_1 ∈ ↑x.support → x_1 ∈ {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
simp only [Finsupp.mem_support_iff, mem_coe]
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m : M
x : MvPolynomial σ R
⊢ x ∈ weightedHomogeneousSubmodule R w m ↔ ∀ (x_1 : σ →₀ ℕ), ↑x x_1 ≠ 0 → x_1 ∈ {d | ↑(weightedDegree' w) d = m}
[PROOFSTEP]
rfl
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
⊢ weightedHomogeneousSubmodule R w m * weightedHomogeneousSubmodule R w n ≤ weightedHomogeneousSubmodule R w (m + n)
[PROOFSTEP]
classical
rw [Submodule.mul_le]
intro φ hφ ψ hψ c hc
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]
rw [← Finsupp.mem_antidiagonal.mp hde, ← hφ aux.1, ← hψ aux.2, map_add]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
⊢ weightedHomogeneousSubmodule R w m * weightedHomogeneousSubmodule R w n ≤ weightedHomogeneousSubmodule R w (m + n)
[PROOFSTEP]
rw [Submodule.mul_le]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
⊢ ∀ (m_1 : MvPolynomial σ R),
    m_1 ∈ weightedHomogeneousSubmodule R w m →
      ∀ (n_1 : MvPolynomial σ R),
        n_1 ∈ weightedHomogeneousSubmodule R w n → m_1 * n_1 ∈ weightedHomogeneousSubmodule R w (m + n)
[PROOFSTEP]
intro φ hφ ψ hψ c hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc : coeff c (φ * ψ) ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
rw [coeff_mul] at hc 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
obtain ⟨⟨d, e⟩, hde, H⟩ := Finset.exists_ne_zero_of_sum_ne_zero hc
[GOAL]
case intro.mk.intro
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
⊢ ↑(weightedDegree' w) c = 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]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
⊢ coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
[PROOFSTEP]
contrapose! H
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff d φ ≠ 0 → coeff e ψ = 0
⊢ coeff d φ * coeff e ψ = 0
[PROOFSTEP]
by_cases h : coeff d φ = 0
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ 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
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ 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
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
m n : M
φ : MvPolynomial σ R
hφ : φ ∈ weightedHomogeneousSubmodule R w m
ψ : MvPolynomial σ R
hψ : ψ ∈ weightedHomogeneousSubmodule R w n
c : σ →₀ ℕ
hc✝ : coeff c (φ * ψ) ≠ 0
hc : ∑ x in antidiagonal c, coeff x.fst φ * coeff x.snd ψ ≠ 0
d e : σ →₀ ℕ
hde : (d, e) ∈ antidiagonal c
H : coeff (d, e).fst φ * coeff (d, e).snd ψ ≠ 0
aux : coeff d φ ≠ 0 ∧ coeff e ψ ≠ 0
⊢ ↑(weightedDegree' w) c = m + n
[PROOFSTEP]
rw [← Finsupp.mem_antidiagonal.mp hde, ← hφ aux.1, ← hψ aux.2, map_add]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
⊢ IsWeightedHomogeneous w (↑(monomial d) r) m
[PROOFSTEP]
classical
intro c hc
rw [coeff_monomial] at hc 
split_ifs at hc  with h
· subst c
  exact hm
· contradiction
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
⊢ IsWeightedHomogeneous w (↑(monomial d) r) m
[PROOFSTEP]
intro c hc
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc : coeff c (↑(monomial d) r) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
rw [coeff_monomial] at hc 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
hc : (if d = c then r else 0) ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
split_ifs at hc  with h
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
h : d = c
hc : r ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
subst c
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
hc✝ : r ≠ 0
hc : coeff d (↑(monomial d) r) ≠ 0
⊢ ↑(weightedDegree' w) d = m
[PROOFSTEP]
exact hm
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
d : σ →₀ ℕ
r : R
m : M
hm : ↑(weightedDegree' w) d = m
c : σ →₀ ℕ
hc✝ : coeff c (↑(monomial d) r) ≠ 0
h : ¬d = c
hc : 0 ≠ 0
⊢ ↑(weightedDegree' w) c = m
[PROOFSTEP]
contradiction
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
⊢ IsWeightedHomogeneous w p ⊥
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
⊢ ↑(weightedDegree' w) d = ⊥
[PROOFSTEP]
have h := weightedTotalDegree_coe w p (MvPolynomial.ne_zero_iff.mpr ⟨d, hd⟩)
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
h : weightedTotalDegree' w p = ↑(weightedTotalDegree w p)
⊢ ↑(weightedDegree' w) d = ⊥
[PROOFSTEP]
simp only [weightedTotalDegree', hp] at h 
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
h : (sup (support p) fun s => ↑(↑(weightedDegree' w) s)) = ↑⊥
⊢ ↑(weightedDegree' w) d = ⊥
[PROOFSTEP]
rw [eq_bot_iff, ← WithBot.coe_le_coe, ← h]
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
w : σ → M
p : MvPolynomial σ R
hp : weightedTotalDegree w p = ⊥
d : σ →₀ ℕ
hd : coeff d p ≠ 0
h : (sup (support p) fun s => ↑(↑(weightedDegree' w) s)) = ↑⊥
⊢ ↑(↑(weightedDegree' w) d) ≤ sup (support p) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
apply Finset.le_sup (mem_support_iff.mpr hd)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
i : σ
⊢ IsWeightedHomogeneous w (X i) (w i)
[PROOFSTEP]
apply isWeightedHomogeneous_monomial
[GOAL]
case hm
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
i : σ
⊢ ↑(weightedDegree' w) (Finsupp.single i 1) = w i
[PROOFSTEP]
simp only [weightedDegree', LinearMap.toAddMonoidHom_coe, total_single, one_nsmul]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
d : σ →₀ ℕ
hd : ↑(weightedDegree' w) d ≠ n
⊢ coeff d φ = 0
[PROOFSTEP]
have aux := mt (@hφ d) hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
d : σ →₀ ℕ
hd : ↑(weightedDegree' w) d ≠ n
aux : ¬coeff d φ ≠ 0
⊢ coeff d φ = 0
[PROOFSTEP]
rwa [Classical.not_not] at aux 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : φ ≠ 0
hm : IsWeightedHomogeneous w φ m
hn : IsWeightedHomogeneous w φ n
⊢ m = n
[PROOFSTEP]
obtain ⟨d, hd⟩ : ∃ d, coeff d φ ≠ 0 := exists_coeff_ne_zero hφ
[GOAL]
case intro
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
w : σ → M
hφ : φ ≠ 0
hm : IsWeightedHomogeneous w φ m
hn : IsWeightedHomogeneous w φ n
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ m = n
[PROOFSTEP]
rw [← hm hd, ← hn hd]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
classical
refine Finset.induction_on s ?_ ?_
· intro
  simp only [isWeightedHomogeneous_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]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
[PROOFSTEP]
refine Finset.induction_on s ?_ ?_
[GOAL]
case refine_1
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ (∀ (i : ι), i ∈ ∅ → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in ∅, φ i) (∑ i in ∅, n i)
[PROOFSTEP]
intro
[GOAL]
case refine_1
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
a✝ : ∀ (i : ι), i ∈ ∅ → IsWeightedHomogeneous w (φ i) (n i)
⊢ IsWeightedHomogeneous w (∏ i in ∅, φ i) (∑ i in ∅, n i)
[PROOFSTEP]
simp only [isWeightedHomogeneous_one, Finset.sum_empty, Finset.prod_empty]
[GOAL]
case refine_2
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
⊢ ∀ ⦃a : ι⦄ {s : Finset ι},
    ¬a ∈ s →
      ((∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) →
          IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)) →
        (∀ (i : ι), i ∈ insert a s → IsWeightedHomogeneous w (φ i) (n i)) →
          IsWeightedHomogeneous w (∏ i in insert a s, φ i) (∑ i in insert a s, n i)
[PROOFSTEP]
intro i s his IH h
[GOAL]
case refine_2
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
⊢ IsWeightedHomogeneous w (∏ 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
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
⊢ IsWeightedHomogeneous w (φ i * ∏ i in s, φ i) (n i + ∑ i in s, n i)
[PROOFSTEP]
apply (h i (Finset.mem_insert_self _ _)).mul (IH _)
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
⊢ ∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)
[PROOFSTEP]
intro j hjs
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
φ✝ ψ : MvPolynomial σ R
m n✝ : M
ι : Type u_4
s✝ : Finset ι
φ : ι → MvPolynomial σ R
n : ι → M
w : σ → M
i : ι
s : Finset ι
his : ¬i ∈ s
IH : (∀ (i : ι), i ∈ s → IsWeightedHomogeneous w (φ i) (n i)) → IsWeightedHomogeneous w (∏ i in s, φ i) (∑ i in s, n i)
h : ∀ (i_1 : ι), i_1 ∈ insert i s → IsWeightedHomogeneous w (φ i_1) (n i_1)
j : ι
hjs : j ∈ s
⊢ IsWeightedHomogeneous w (φ j) (n j)
[PROOFSTEP]
exact h j (Finset.mem_insert_of_mem hjs)
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ weightedTotalDegree' w φ = ↑n
[PROOFSTEP]
simp only [weightedTotalDegree']
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ (sup (support φ) fun s => ↑(↑(weightedDegree' w) s)) = ↑n
[PROOFSTEP]
apply le_antisymm
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ (sup (support φ) fun s => ↑(↑(weightedDegree' w) s)) ≤ ↑n
[PROOFSTEP]
simp only [Finset.sup_le_iff, mem_support_iff, WithBot.coe_le_coe]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ ∀ (b : σ →₀ ℕ), coeff b φ ≠ 0 → ↑(weightedDegree' w) b ≤ n
[PROOFSTEP]
exact fun d hd => le_of_eq (hφ hd)
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
⊢ ↑n ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
obtain ⟨d, hd⟩ : ∃ d, coeff d φ ≠ 0 := exists_coeff_ne_zero h
[GOAL]
case a.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ ↑n ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
simp only [← hφ hd, Finsupp.sum]
[GOAL]
case a.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : coeff d φ ≠ 0
⊢ ↑(↑(weightedDegree' w) d) ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
replace hd := Finsupp.mem_support_iff.mpr hd
[GOAL]
case a.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
φ ψ : MvPolynomial σ R
m n : M
inst✝ : SemilatticeSup M
w : σ → M
hφ : IsWeightedHomogeneous w φ n
h : φ ≠ 0
d : σ →₀ ℕ
hd : d ∈ φ.support
⊢ ↑(↑(weightedDegree' w) d) ≤ sup (support φ) fun s => ↑(↑(weightedDegree' w) s)
[PROOFSTEP]
apply Finset.le_sup hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ IsWeightedHomogeneous w (↑(weightedHomogeneousComponent w n) φ) n
[PROOFSTEP]
classical
intro d hd
contrapose! hd
rw [coeff_weightedHomogeneousComponent, if_neg hd]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ IsWeightedHomogeneous w (↑(weightedHomogeneousComponent w n) φ) n
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d (↑(weightedHomogeneousComponent w n) φ) ≠ 0
⊢ ↑(weightedDegree' w) d = n
[PROOFSTEP]
contrapose! hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hd : ↑(weightedDegree' w) d ≠ n
⊢ coeff d (↑(weightedHomogeneousComponent w n) φ) = 0
[PROOFSTEP]
rw [coeff_weightedHomogeneousComponent, if_neg hd]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
n : M
r : R
⊢ ↑(weightedHomogeneousComponent w n) (↑C r * φ) = ↑C r * ↑(weightedHomogeneousComponent w n) φ
[PROOFSTEP]
simp only [C_mul', LinearMap.map_smul]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
classical
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
intro d hd; rw [mem_filter] at hd 
exfalso; exact h _ hd.1 hd.2
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
⊢ ∀ (x : σ →₀ ℕ), x ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ) → ↑(monomial x) (coeff x φ) = 0
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
d : σ →₀ ℕ
hd : d ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ)
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
rw [mem_filter] at hd 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
h : ∀ (d : σ →₀ ℕ), d ∈ support φ → ↑(weightedDegree' w) d ≠ n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ False
[PROOFSTEP]
exact h _ hd.1 hd.2
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
classical
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
intro d hd
rw [Finset.mem_filter] at hd 
exfalso
apply lt_irrefl n
nth_rw 1 [← hd.2]
exact lt_of_le_of_lt (le_weightedTotalDegree w hd.1) h
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
⊢ ↑(weightedHomogeneousComponent w n) φ = 0
[PROOFSTEP]
rw [weightedHomogeneousComponent_apply, sum_eq_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
⊢ ∀ (x : σ →₀ ℕ), x ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ) → ↑(monomial x) (coeff x φ) = 0
[PROOFSTEP]
intro d hd
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ Finset.filter (fun d => ↑(weightedDegree' w) d = n) (support φ)
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
rw [Finset.mem_filter] at hd 
[GOAL]
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ ↑(monomial d) (coeff d φ) = 0
[PROOFSTEP]
exfalso
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ False
[PROOFSTEP]
apply lt_irrefl n
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ n < n
[PROOFSTEP]
nth_rw 1 [← hd.2]
[GOAL]
case h
R : Type u_1
M : Type u_2
inst✝³ : CommSemiring R
σ : Type u_3
inst✝² : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
inst✝¹ : SemilatticeSup M
inst✝ : OrderBot M
h : weightedTotalDegree w φ < n
d : σ →₀ ℕ
hd : d ∈ support φ ∧ ↑(weightedDegree' w) d = n
⊢ ↑(weightedDegree' w) d < n
[PROOFSTEP]
exact lt_of_le_of_lt (le_weightedTotalDegree w hd.1) h
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)
[PROOFSTEP]
suffices (Function.support fun m => weightedHomogeneousComponent w m φ) ⊆ (fun d => weightedDegree' w d) '' φ.support by
  exact Finite.subset ((fun d : σ →₀ ℕ => (weightedDegree' w) d) '' ↑(support φ)).toFinite this
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
this :
  (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ) ⊆ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
⊢ Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)
[PROOFSTEP]
exact Finite.subset ((fun d : σ →₀ ℕ => (weightedDegree' w) d) '' ↑(support φ)).toFinite this
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ) ⊆ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
[PROOFSTEP]
intro m hm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : m ∈ Function.support fun m => ↑(weightedHomogeneousComponent w m) φ
⊢ m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
[PROOFSTEP]
by_contra hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : m ∈ Function.support fun m => ↑(weightedHomogeneousComponent w m) φ
hm' : ¬m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
⊢ False
[PROOFSTEP]
apply hm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : m ∈ Function.support fun m => ↑(weightedHomogeneousComponent w m) φ
hm' : ¬m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
⊢ (fun m => ↑(weightedHomogeneousComponent w m) φ) m = 0
[PROOFSTEP]
simp only [mem_support, Ne.def] at hm 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm' : ¬m ∈ (fun d => ↑(weightedDegree' w) d) '' ↑(support φ)
hm : ¬↑(weightedHomogeneousComponent w m) φ = 0
⊢ (fun m => ↑(weightedHomogeneousComponent w m) φ) m = 0
[PROOFSTEP]
simp only [Set.mem_image, not_exists, not_and] at hm' 
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
m : M
hm : ¬↑(weightedHomogeneousComponent w m) φ = 0
hm' : ∀ (x : σ →₀ ℕ), x ∈ ↑(support φ) → ¬↑(weightedDegree' w) x = m
⊢ (fun m => ↑(weightedHomogeneousComponent w m) φ) m = 0
[PROOFSTEP]
exact weightedHomogeneousComponent_eq_zero' m φ hm'
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ᶠ (m : M), ↑(weightedHomogeneousComponent w m) φ = φ
[PROOFSTEP]
classical
rw [finsum_eq_sum _ (weightedHomogeneousComponent_finsupp φ)]
ext1 d
simp only [coeff_sum, coeff_weightedHomogeneousComponent]
rw [Finset.sum_eq_single (weightedDegree' w d)]
· rw [if_pos rfl]
· intro m _ hm'
  rw [if_neg hm'.symm]
· intro hm
  rw [if_pos rfl]
  simp only [Finite.mem_toFinset, mem_support, Ne.def, Classical.not_not] at hm 
  have := coeff_weightedHomogeneousComponent (w := w) (weightedDegree' w d) φ d
  rw [hm, if_pos rfl, coeff_zero] at this 
  exact this.symm
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ᶠ (m : M), ↑(weightedHomogeneousComponent w m) φ = φ
[PROOFSTEP]
rw [finsum_eq_sum _ (weightedHomogeneousComponent_finsupp φ)]
[GOAL]
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
⊢ ∑ i in Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)),
      ↑(weightedHomogeneousComponent w i) φ =
    φ
[PROOFSTEP]
ext1 d
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ coeff d
      (∑ i in Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)),
        ↑(weightedHomogeneousComponent w i) φ) =
    coeff d φ
[PROOFSTEP]
simp only [coeff_sum, coeff_weightedHomogeneousComponent]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (∑ x in Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)),
      if ↑(weightedDegree' w) d = x then coeff d φ else 0) =
    coeff d φ
[PROOFSTEP]
rw [Finset.sum_eq_single (weightedDegree' w d)]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ (if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0) = coeff d φ
[PROOFSTEP]
rw [if_pos rfl]
[GOAL]
case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ ∀ (b : (fun x => M) d),
    b ∈ Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)) →
      b ≠ ↑(weightedDegree' w) d → (if ↑(weightedDegree' w) d = b then coeff d φ else 0) = 0
[PROOFSTEP]
intro m _ hm'
[GOAL]
case a.h₀
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
m : M
a✝ : m ∈ Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ))
hm' : m ≠ ↑(weightedDegree' w) d
⊢ (if ↑(weightedDegree' w) d = m then coeff d φ else 0) = 0
[PROOFSTEP]
rw [if_neg hm'.symm]
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
⊢ ¬↑(weightedDegree' w) d ∈
        Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ)) →
    (if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0) = 0
[PROOFSTEP]
intro hm
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm :
  ¬↑(weightedDegree' w) d ∈
      Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ))
⊢ (if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0) = 0
[PROOFSTEP]
rw [if_pos rfl]
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm :
  ¬↑(weightedDegree' w) d ∈
      Finite.toFinset (_ : Set.Finite (Function.support fun m => ↑(weightedHomogeneousComponent w m) φ))
⊢ coeff d φ = 0
[PROOFSTEP]
simp only [Finite.mem_toFinset, mem_support, Ne.def, Classical.not_not] at hm 
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : ↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ = 0
⊢ coeff d φ = 0
[PROOFSTEP]
have := coeff_weightedHomogeneousComponent (w := w) (weightedDegree' w d) φ d
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : ↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ = 0
this :
  coeff d (↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ) =
    if ↑(weightedDegree' w) d = ↑(weightedDegree' w) d then coeff d φ else 0
⊢ coeff d φ = 0
[PROOFSTEP]
rw [hm, if_pos rfl, coeff_zero] at this 
[GOAL]
case a.h₁
R : Type u_1
M : Type u_2
inst✝¹ : CommSemiring R
σ : Type u_3
inst✝ : AddCommMonoid M
w : σ → M
n : M
φ ψ : MvPolynomial σ R
d : σ →₀ ℕ
hm : ↑(weightedHomogeneousComponent w (↑(weightedDegree' w) d)) φ = 0
this : 0 = coeff d φ
⊢ coeff d φ = 0
[PROOFSTEP]
exact this.symm
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : p ∈ weightedHomogeneousSubmodule R w n
⊢ ↑(weightedHomogeneousComponent w m) p = if m = n then p else 0
[PROOFSTEP]
simp only [mem_weightedHomogeneousSubmodule] at h 
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
⊢ ↑(weightedHomogeneousComponent w m) p = if m = n then p else 0
[PROOFSTEP]
ext x
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
⊢ coeff x (↑(weightedHomogeneousComponent w m) p) = coeff x (if m = n then p else 0)
[PROOFSTEP]
rw [coeff_weightedHomogeneousComponent]
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
⊢ (if ↑(weightedDegree' w) x = 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
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
⊢ (if ↑(weightedDegree' w) x = m then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
split_ifs
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : m = n
⊢ coeff x p = coeff x p
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ coeff x p = coeff x 0
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : m = n
⊢ 0 = coeff x p
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ 0 = coeff x 0
[PROOFSTEP]
all_goals simp only [zero_coeff, coeff_zero]
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : m = n
⊢ coeff x p = coeff x p
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ coeff x p = coeff x 0
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case pos
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : m = n
⊢ 0 = coeff x p
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : coeff x p = 0
h✝¹ : ¬↑(weightedDegree' w) x = m
h✝ : ¬m = n
⊢ 0 = coeff x 0
[PROOFSTEP]
simp only [zero_coeff, coeff_zero]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
⊢ (if ↑(weightedDegree' w) x = m then coeff x p else 0) = coeff x (if m = n then p else 0)
[PROOFSTEP]
rw [h zero_coeff]
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w 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
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w 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
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
h1 : m = n
⊢ coeff x p = coeff x p
[PROOFSTEP]
rfl
[GOAL]
case neg
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : AddCommMonoid M
w : σ → M
n✝ : M
φ ψ : MvPolynomial σ R
inst✝ : DecidableEq M
m n : M
p : MvPolynomial σ R
h : IsWeightedHomogeneous w p n
x : σ →₀ ℕ
zero_coeff : ¬coeff x p = 0
h1 : ¬m = n
⊢ 0 = coeff x 0
[PROOFSTEP]
simp only [coeff_zero]
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
⊢ ↑(weightedHomogeneousComponent w 0) φ = ↑C (coeff 0 φ)
[PROOFSTEP]
classical
ext1 d
rcases Classical.em (d = 0) with (rfl | hd)
· simp only [coeff_weightedHomogeneousComponent, if_pos, map_zero, coeff_zero_C]
· rw [coeff_weightedHomogeneousComponent, if_neg, coeff_C, if_neg (Ne.symm hd)]
  simp only [weightedDegree', LinearMap.toAddMonoidHom_coe, Finsupp.total_apply, Finsupp.sum, sum_eq_zero_iff,
    Finsupp.mem_support_iff, Ne.def, smul_eq_zero, not_forall, not_or, and_self_left, exists_prop]
  simp only [FunLike.ext_iff, Finsupp.coe_zero, Pi.zero_apply, not_forall] at hd 
  obtain ⟨i, hi⟩ := hd
  exact ⟨i, hi, hw i⟩
[GOAL]
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
⊢ ↑(weightedHomogeneousComponent w 0) φ = ↑C (coeff 0 φ)
[PROOFSTEP]
ext1 d
[GOAL]
case a
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
⊢ coeff d (↑(weightedHomogeneousComponent w 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
rcases Classical.em (d = 0) with (rfl | hd)
[GOAL]
case a.inl
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
⊢ coeff 0 (↑(weightedHomogeneousComponent w 0) φ) = coeff 0 (↑C (coeff 0 φ))
[PROOFSTEP]
simp only [coeff_weightedHomogeneousComponent, if_pos, map_zero, coeff_zero_C]
[GOAL]
case a.inr
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ¬d = 0
⊢ coeff d (↑(weightedHomogeneousComponent w 0) φ) = coeff d (↑C (coeff 0 φ))
[PROOFSTEP]
rw [coeff_weightedHomogeneousComponent, if_neg, coeff_C, if_neg (Ne.symm hd)]
[GOAL]
case a.inr.hnc
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ¬d = 0
⊢ ¬↑(weightedDegree' w) d = 0
[PROOFSTEP]
simp only [weightedDegree', LinearMap.toAddMonoidHom_coe, Finsupp.total_apply, Finsupp.sum, sum_eq_zero_iff,
  Finsupp.mem_support_iff, Ne.def, smul_eq_zero, not_forall, not_or, and_self_left, exists_prop]
[GOAL]
case a.inr.hnc
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ¬d = 0
⊢ ∃ x, ¬↑d x = 0 ∧ ¬w x = 0
[PROOFSTEP]
simp only [FunLike.ext_iff, Finsupp.coe_zero, Pi.zero_apply, not_forall] at hd 
[GOAL]
case a.inr.hnc
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
hd : ∃ x, ¬↑d x = 0
⊢ ∃ x, ¬↑d x = 0 ∧ ¬w x = 0
[PROOFSTEP]
obtain ⟨i, hi⟩ := hd
[GOAL]
case a.inr.hnc.intro
R : Type u_1
M : Type u_2
inst✝² : CommSemiring R
σ : Type u_3
inst✝¹ : CanonicallyOrderedAddMonoid M
w : σ → M
φ : MvPolynomial σ R
inst✝ : NoZeroSMulDivisors ℕ M
hw : ∀ (i : σ), w i ≠ 0
d : σ →₀ ℕ
i : σ
hi : ¬↑d i = 0
⊢ ∃ x, ¬↑d x = 0 ∧ ¬w x = 0
[PROOFSTEP]
exact ⟨i, hi, hw i⟩
