[GOAL]
α : Type u_1
a b c d x y z : α
inst✝⁶ : LinearOrderedCommMonoidWithZero α
β : Type u_2
inst✝⁵ : Zero β
inst✝⁴ : One β
inst✝³ : Mul β
inst✝² : Pow β ℕ
inst✝¹ : Sup β
inst✝ : Inf β
f : β → α
hf : Injective f
zero : f 0 = 0
one : f 1 = 1
mul : ∀ (x y : β), f (x * y) = f x * f y
npow : ∀ (x : β) (n : ℕ), f (x ^ n) = f x ^ n
hsup : ∀ (x y : β), f (x ⊔ y) = max (f x) (f y)
hinf : ∀ (x y : β), f (x ⊓ y) = min (f x) (f y)
src✝² : LinearOrder β := LinearOrder.lift f hf hsup hinf
src✝¹ : OrderedCommMonoid β := orderedCommMonoid f hf one mul npow
src✝ : CommMonoidWithZero β := Injective.commMonoidWithZero f hf zero one mul npow
⊢ f 0 ≤ f 1
[PROOFSTEP]
simp only [zero, one, LinearOrderedCommMonoidWithZero.zero_le_one]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommMonoidWithZero α
⊢ 0 ≤ a
[PROOFSTEP]
simpa only [mul_zero, mul_one] using mul_le_mul_left' zero_le_one a
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : c ≠ 0
hab : a * c ≤ b * c
⊢ a ≤ b
[PROOFSTEP]
simpa only [mul_inv_cancel_right₀ h] using mul_le_mul_right' hab c⁻¹
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : c ≠ 0
hab : a * c ≤ b
⊢ a * c ≤ b * c⁻¹ * c
[PROOFSTEP]
simpa [h] using hab
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
⊢ a * c⁻¹ ≤ b
[PROOFSTEP]
by_cases h : c = 0
[GOAL]
case pos
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
h : c = 0
⊢ a * c⁻¹ ≤ b
[PROOFSTEP]
simp [h]
[GOAL]
case neg
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
h : ¬c = 0
⊢ a * c⁻¹ ≤ b
[PROOFSTEP]
exact le_of_le_mul_right h (by simpa [h] using hab)
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b * c
h : ¬c = 0
⊢ a * c⁻¹ * c ≤ b * c
[PROOFSTEP]
simpa [h] using hab
[GOAL]
α : Type u_1
a✝ b✝ c✝ d✝ x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a b c d : α
hb : b ≠ 0
hd : d ≠ 0
⊢ a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b
[PROOFSTEP]
rw [mul_inv_le_iff₀ hb, mul_right_comm, le_mul_inv_iff₀ hd]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : a = 0
⊢ a * c < b * d
[PROOFSTEP]
rw [ha, zero_mul, zero_lt_iff]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : a = 0
⊢ b * d ≠ 0
[PROOFSTEP]
exact mul_ne_zero hb hd
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : ¬a = 0
hc : c = 0
⊢ a * c < b * d
[PROOFSTEP]
rw [hc, mul_zero, zero_lt_iff]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hab : a ≤ b
hb : b ≠ 0
hcd : c < d
hd : d ≠ 0
ha : ¬a = 0
hc : c = 0
⊢ b * d ≠ 0
[PROOFSTEP]
exact mul_ne_zero hb hd
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : x < y * z
⊢ x * z⁻¹ < y
[PROOFSTEP]
contrapose! h
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : y ≤ x * z⁻¹
⊢ y * z ≤ x
[PROOFSTEP]
simpa only [inv_inv] using mul_inv_le_of_le_mul h
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : x < y * z
⊢ y⁻¹ * x < z
[PROOFSTEP]
rw [mul_comm] at *
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : x < z * y
⊢ x * y⁻¹ < z
[PROOFSTEP]
exact mul_inv_lt_of_lt_mul₀ h
[GOAL]
α : Type u_1
a b c✝ d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
c : α
h : a < b
hc : c ≠ 0
⊢ a * c < b * c
[PROOFSTEP]
contrapose! h
[GOAL]
α : Type u_1
a b c✝ d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
c : α
hc : c ≠ 0
h : b * c ≤ a * c
⊢ b ≤ a
[PROOFSTEP]
exact le_of_le_mul_right hc h
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
hh : c ≤ a
⊢ b < d
[PROOFSTEP]
have ha : a ≠ 0 := ne_of_gt (lt_of_lt_of_le hc hh)
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
hh : c ≤ a
ha : a ≠ 0
⊢ b < d
[PROOFSTEP]
simp_rw [← inv_le_inv₀ ha (ne_of_gt hc)] at hh
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
ha : a ≠ 0
hh : a⁻¹ ≤ c⁻¹
⊢ b < d
[PROOFSTEP]
have := mul_lt_mul_of_lt_of_le₀ hh (inv_ne_zero (ne_of_gt hc)) h
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
h : a * b < c * d
hc : 0 < c
ha : a ≠ 0
hh : a⁻¹ ≤ c⁻¹
this : a⁻¹ * (a * b) < c⁻¹ * (c * d)
⊢ b < d
[PROOFSTEP]
simpa [inv_mul_cancel_left₀ ha, inv_mul_cancel_left₀ (ne_of_gt hc)] using this
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
ha : a ≠ 0
⊢ a * b ≤ a * c ↔ b ≤ c
[PROOFSTEP]
simp only [mul_comm a]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
ha : a ≠ 0
⊢ b * a ≤ c * a ↔ b ≤ c
[PROOFSTEP]
exact mul_le_mul_right₀ ha
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hc : c ≠ 0
⊢ a / c ≤ b / c ↔ a ≤ b
[PROOFSTEP]
rw [div_eq_mul_inv, div_eq_mul_inv, mul_le_mul_right₀ (inv_ne_zero hc)]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
ha : a ≠ 0
hb : b ≠ 0
hc : c ≠ 0
⊢ a / b ≤ a / c ↔ c ≤ b
[PROOFSTEP]
simp only [div_eq_mul_inv, mul_le_mul_left₀ ha, inv_le_inv₀ hb hc]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hc : c ≠ 0
⊢ a ≤ b / c ↔ a * c ≤ b
[PROOFSTEP]
rw [div_eq_mul_inv, le_mul_inv_iff₀ hc]
[GOAL]
α : Type u_1
a b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
hc : c ≠ 0
⊢ a / c ≤ b ↔ a ≤ b * c
[PROOFSTEP]
rw [div_eq_mul_inv, mul_inv_le_iff₀ hc]
[GOAL]
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
⊢ symm (mulLeft₀' ha) = mulLeft₀' (_ : a⁻¹ ≠ 0)
[PROOFSTEP]
ext
[GOAL]
case h.h
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
x✝ : α
⊢ ↑(symm (mulLeft₀' ha)) x✝ = ↑(mulLeft₀' (_ : a⁻¹ ≠ 0)) x✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
⊢ symm (mulRight₀' ha) = mulRight₀' (_ : a⁻¹ ≠ 0)
[PROOFSTEP]
ext
[GOAL]
case h.h
α : Type u_1
a✝ b c d x y z : α
inst✝ : LinearOrderedCommGroupWithZero α
a : α
ha : a ≠ 0
x✝ : α
⊢ ↑(symm (mulRight₀' ha)) x✝ = ↑(mulRight₀' (_ : a⁻¹ ≠ 0)) x✝
[PROOFSTEP]
rfl


[GOAL]
α : Type u
β : Type u_1
x y : ULift α
inst✝ : MulOneClass α
⊢ ∀ (x y : ULift α), ↑Equiv.ulift (x * y) = ↑Equiv.ulift x * ↑Equiv.ulift y
[PROOFSTEP]
intros
[GOAL]
α : Type u
β : Type u_1
x y : ULift α
inst✝ : MulOneClass α
x✝ y✝ : ULift α
⊢ ↑Equiv.ulift (x✝ * y✝) = ↑Equiv.ulift x✝ * ↑Equiv.ulift y✝
[PROOFSTEP]
rfl
[GOAL]
α : Type u
β : Type u_1
x y : ULift α
inst✝ : MulZeroOneClass α
⊢ ∀ (a b : ULift α), ↑Equiv.ulift (a * b) = ↑Equiv.ulift a * ↑Equiv.ulift b
[PROOFSTEP]
intros
[GOAL]
α : Type u
β : Type u_1
x y : ULift α
inst✝ : MulZeroOneClass α
a✝ b✝ : ULift α
⊢ ↑Equiv.ulift (a✝ * b✝) = ↑Equiv.ulift a✝ * ↑Equiv.ulift b✝
[PROOFSTEP]
rfl


[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ∈ (fun s t => filter ((fun x x_1 => x ⊆ x_1) s) (powerset t)) s t ↔ s ≤ u ∧ u ≤ t
[PROOFSTEP]
rw [mem_filter, mem_powerset]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ⊆ t ∧ (fun x x_1 => x ⊆ x_1) s u ↔ s ≤ u ∧ u ≤ t
[PROOFSTEP]
exact and_comm
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ∈ (fun s t => filter ((fun x x_1 => x ⊆ x_1) s) (ssubsets t)) s t ↔ s ≤ u ∧ u < t
[PROOFSTEP]
rw [mem_filter, mem_ssubsets]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ⊂ t ∧ (fun x x_1 => x ⊆ x_1) s u ↔ s ≤ u ∧ u < t
[PROOFSTEP]
exact and_comm
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ∈ (fun s t => filter ((fun x x_1 => x ⊂ x_1) s) (powerset t)) s t ↔ s < u ∧ u ≤ t
[PROOFSTEP]
rw [mem_filter, mem_powerset]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ⊆ t ∧ (fun x x_1 => x ⊂ x_1) s u ↔ s < u ∧ u ≤ t
[PROOFSTEP]
exact and_comm
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ∈ (fun s t => filter ((fun x x_1 => x ⊂ x_1) s) (ssubsets t)) s t ↔ s < u ∧ u < t
[PROOFSTEP]
rw [mem_filter, mem_ssubsets]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s✝ t✝ s t u : Finset α
⊢ u ⊂ t ∧ (fun x x_1 => x ⊂ x_1) s u ↔ s < u ∧ u < t
[PROOFSTEP]
exact and_comm
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ Icc s t = image ((fun x x_1 => x ∪ x_1) s) (powerset (t \ s))
[PROOFSTEP]
ext u
[GOAL]
case a
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ u ∈ Icc s t ↔ u ∈ image ((fun x x_1 => x ∪ x_1) s) (powerset (t \ s))
[PROOFSTEP]
simp_rw [mem_Icc, mem_image, mem_powerset]
[GOAL]
case a
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ s ≤ u ∧ u ≤ t ↔ ∃ a, a ⊆ t \ s ∧ s ∪ a = u
[PROOFSTEP]
constructor
[GOAL]
case a.mp
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ s ≤ u ∧ u ≤ t → ∃ a, a ⊆ t \ s ∧ s ∪ a = u
[PROOFSTEP]
rintro ⟨hs, ht⟩
[GOAL]
case a.mp.intro
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
hs : s ≤ u
ht : u ≤ t
⊢ ∃ a, a ⊆ t \ s ∧ s ∪ a = u
[PROOFSTEP]
exact ⟨u \ s, sdiff_le_sdiff_right ht, sup_sdiff_cancel_right hs⟩
[GOAL]
case a.mpr
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ (∃ a, a ⊆ t \ s ∧ s ∪ a = u) → s ≤ u ∧ u ≤ t
[PROOFSTEP]
rintro ⟨v, hv, rfl⟩
[GOAL]
case a.mpr.intro.intro
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
v : Finset α
hv : v ⊆ t \ s
⊢ s ≤ s ∪ v ∧ s ∪ v ≤ t
[PROOFSTEP]
exact ⟨le_sup_left, union_subset h <| hv.trans <| sdiff_subset _ _⟩
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ Ico s t = image ((fun x x_1 => x ∪ x_1) s) (ssubsets (t \ s))
[PROOFSTEP]
ext u
[GOAL]
case a
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ u ∈ Ico s t ↔ u ∈ image ((fun x x_1 => x ∪ x_1) s) (ssubsets (t \ s))
[PROOFSTEP]
simp_rw [mem_Ico, mem_image, mem_ssubsets]
[GOAL]
case a
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ s ≤ u ∧ u < t ↔ ∃ a, a ⊂ t \ s ∧ s ∪ a = u
[PROOFSTEP]
constructor
[GOAL]
case a.mp
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ s ≤ u ∧ u < t → ∃ a, a ⊂ t \ s ∧ s ∪ a = u
[PROOFSTEP]
rintro ⟨hs, ht⟩
[GOAL]
case a.mp.intro
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
hs : s ≤ u
ht : u < t
⊢ ∃ a, a ⊂ t \ s ∧ s ∪ a = u
[PROOFSTEP]
exact ⟨u \ s, sdiff_lt_sdiff_right ht hs, sup_sdiff_cancel_right hs⟩
[GOAL]
case a.mpr
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
⊢ (∃ a, a ⊂ t \ s ∧ s ∪ a = u) → s ≤ u ∧ u < t
[PROOFSTEP]
rintro ⟨v, hv, rfl⟩
[GOAL]
case a.mpr.intro.intro
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
v : Finset α
hv : v ⊂ t \ s
⊢ s ≤ s ∪ v ∧ s ∪ v < t
[PROOFSTEP]
exact ⟨le_sup_left, sup_lt_of_lt_sdiff_left hv h⟩
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ card (Icc s t) = 2 ^ (card t - card s)
[PROOFSTEP]
rw [← card_sdiff h, ← card_powerset, Icc_eq_image_powerset h, Finset.card_image_iff]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ Set.InjOn ((fun x x_1 => x ∪ x_1) s) ↑(powerset (t \ s))
[PROOFSTEP]
rintro u hu v hv (huv : s ⊔ u = s ⊔ v)
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
hu : u ∈ ↑(powerset (t \ s))
v : Finset α
hv : v ∈ ↑(powerset (t \ s))
huv : s ⊔ u = s ⊔ v
⊢ u = v
[PROOFSTEP]
rw [mem_coe, mem_powerset] at hu hv
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
u : Finset α
hu : u ⊆ t \ s
v : Finset α
hv : v ⊆ t \ s
huv : s ⊔ u = s ⊔ v
⊢ u = v
[PROOFSTEP]
rw [← (disjoint_sdiff.mono_right hu : Disjoint s u).sup_sdiff_cancel_left, ←
  (disjoint_sdiff.mono_right hv : Disjoint s v).sup_sdiff_cancel_left, huv]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ card (Ico s t) = 2 ^ (card t - card s) - 1
[PROOFSTEP]
rw [card_Ico_eq_card_Icc_sub_one, card_Icc_finset h]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ card (Ioc s t) = 2 ^ (card t - card s) - 1
[PROOFSTEP]
rw [card_Ioc_eq_card_Icc_sub_one, card_Icc_finset h]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
h : s ⊆ t
⊢ card (Ioo s t) = 2 ^ (card t - card s) - 2
[PROOFSTEP]
rw [card_Ioo_eq_card_Icc_sub_two, card_Icc_finset h]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
⊢ card (Iic s) = 2 ^ card s
[PROOFSTEP]
rw [Iic_eq_powerset, card_powerset]
[GOAL]
α : Type u_1
inst✝ : DecidableEq α
s t : Finset α
⊢ card (Iio s) = 2 ^ card s - 1
[PROOFSTEP]
rw [Iio_eq_ssubsets, ssubsets, card_erase_of_mem (mem_powerset_self _), card_powerset]


[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⟩