Theorem: MvPolynomial.le_degrees_add
File: Mathlib/Data/MvPolynomial/Variables.lean

tactic: apply Finset.sup_le
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : Multiset.Disjoint (degrees p) (degrees q)
⊢ degrees p ≤ degrees (p + q)

tactic: intro d hd
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : Multiset.Disjoint (degrees p) (degrees q)
⊢ ∀ (b : σ →₀ ℕ), b ∈ support p → ↑toMultiset b ≤ degrees (p + q)

tactic: rw [Multiset.disjoint_iff_ne] at h
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : Multiset.Disjoint (degrees p) (degrees q)
d : σ →₀ ℕ
hd : d ∈ support p
⊢ ↑toMultiset d ≤ degrees (p + q)

tactic: rw [Multiset.le_iff_count]
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
⊢ ↑toMultiset d ≤ degrees (p + q)

tactic: intro i
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
⊢ ∀ (a : σ), Multiset.count a (↑toMultiset d) ≤ Multiset.count a (degrees (p + q))

tactic: rw [degrees, Multiset.count_finset_sup]
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
⊢ Multiset.count i (↑toMultiset d) ≤ Multiset.count i (degrees (p + q))

tactic: simp only [Finsupp.count_toMultiset]
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
⊢ Multiset.count i (↑toMultiset d) ≤ Finset.sup (support (p + q)) fun a => Multiset.count i (↑toMultiset a)

tactic: by_cases h0 : d = 0
state_before: case a
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
⊢ ↑d i ≤ Finset.sup (support (p + q)) fun a => ↑a i

tactic: simp only [h0, zero_le, Finsupp.zero_apply]
state_before: case pos
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : d = 0
⊢ ↑d i ≤ Finset.sup (support (p + q)) fun a => ↑a i

tactic: refine' @Finset.le_sup _ _ _ _ (p + q).support (fun a => a i) d _
state_before: case neg
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : ¬d = 0
⊢ ↑d i ≤ Finset.sup (support (p + q)) fun a => ↑a i

tactic: rw [mem_support_iff, coeff_add]
state_before: case neg
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : ¬d = 0
⊢ d ∈ support (p + q)

tactic: suffices q.coeff d = 0 by rwa [this, add_zero, coeff, ← Finsupp.mem_support_iff]
state_before: case neg
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : ¬d = 0
⊢ coeff d p + coeff d q ≠ 0

tactic: rw [← Finsupp.support_eq_empty, ← Ne.def, ← Finset.nonempty_iff_ne_empty] at h0
state_before: case neg
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : ¬d = 0
⊢ coeff d q = 0

tactic: obtain ⟨j, hj⟩ := h0
state_before: case neg
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : Finset.Nonempty d.support
⊢ coeff d q = 0

tactic: contrapose! h
state_before: case neg.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i j : σ
hj : j ∈ d.support
⊢ coeff d q = 0

tactic: rw [mem_support_iff] at hd
state_before: case neg.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : d ∈ support p
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ ∃ a, a ∈ degrees p ∧ ∃ b, b ∈ degrees q ∧ a = b

tactic: refine' ⟨j, _, j, _, rfl⟩
state_before: case neg.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d p ≠ 0
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ ∃ a, a ∈ degrees p ∧ ∃ b, b ∈ degrees q ∧ a = b

tactic: all_goals rw [mem_degrees]; refine' ⟨d, _, hj⟩; assumption
state_before: case neg.intro.refine'_1
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d p ≠ 0
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ j ∈ degrees p

case neg.intro.refine'_2
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d p ≠ 0
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ j ∈ degrees q

tactic: rwa [this, add_zero, coeff, ← Finsupp.mem_support_iff]
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
h : ∀ (a : σ), a ∈ degrees p → ∀ (b : σ), b ∈ degrees q → a ≠ b
d : σ →₀ ℕ
hd : d ∈ support p
i : σ
h0 : ¬d = 0
this : coeff d q = 0
⊢ coeff d p + coeff d q ≠ 0

tactic: rw [mem_degrees]
state_before: case neg.intro.refine'_2
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d p ≠ 0
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ j ∈ degrees q

tactic: refine' ⟨d, _, hj⟩
state_before: case neg.intro.refine'_2
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d p ≠ 0
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ ∃ d, coeff d q ≠ 0 ∧ j ∈ d.support

tactic: assumption
state_before: case neg.intro.refine'_2
R : Type u
S : Type v
σ : Type u_1
τ : Type ?u.45634
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p✝ q✝ p q : MvPolynomial σ R
d : σ →₀ ℕ
hd : coeff d p ≠ 0
i j : σ
hj : j ∈ d.support
h : coeff d q ≠ 0
⊢ coeff d q ≠ 0