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

tactic: classical
intro i
rw [mem_degrees, Multiset.mem_map]
rintro ⟨d, hd, hi⟩
obtain ⟨x, rfl, hx⟩ := coeff_rename_ne_zero _ _ _ hd
simp only [Finsupp.mapDomain, Finsupp.mem_support_iff] at hi
rw [sum_apply, Finsupp.sum] at hi
contrapose! hi
rw [Finset.sum_eq_zero]
intro j hj
simp only [exists_prop, mem_degrees] at hi
specialize hi j ⟨x, hx, hj⟩
rw [Finsupp.single_apply, if_neg hi]
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
⊢ degrees (↑(rename f) φ) ⊆ Multiset.map f (degrees φ)

tactic: intro i
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
⊢ degrees (↑(rename f) φ) ⊆ Multiset.map f (degrees φ)

tactic: rw [mem_degrees, Multiset.mem_map]
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
⊢ i ∈ degrees (↑(rename f) φ) → i ∈ Multiset.map f (degrees φ)

tactic: rintro ⟨d, hd, hi⟩
state_before: R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
⊢ (∃ d, coeff d (↑(rename f) φ) ≠ 0 ∧ i ∈ d.support) → ∃ a, a ∈ degrees φ ∧ f a = i

tactic: obtain ⟨x, rfl, hx⟩ := coeff_rename_ne_zero _ _ _ hd
state_before: case intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
d : τ →₀ ℕ
hd : coeff d (↑(rename f) φ) ≠ 0
hi : i ∈ d.support
⊢ ∃ a, a ∈ degrees φ ∧ f a = i

tactic: simp only [Finsupp.mapDomain, Finsupp.mem_support_iff] at hi
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
hi : i ∈ (Finsupp.mapDomain f x).support
⊢ ∃ a, a ∈ degrees φ ∧ f a = i

tactic: rw [sum_apply, Finsupp.sum] at hi
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
hi : ↑(sum x fun a => Finsupp.single (f a)) i ≠ 0
⊢ ∃ a, a ∈ degrees φ ∧ f a = i

tactic: contrapose! hi
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
hi : ∑ a in x.support, ↑(Finsupp.single (f a) (↑x a)) i ≠ 0
⊢ ∃ a, a ∈ degrees φ ∧ f a = i

tactic: rw [Finset.sum_eq_zero]
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
hi : ∀ (a : σ), a ∈ degrees φ → f a ≠ i
⊢ ∑ x_1 in x.support, ↑(Finsupp.single (f x_1) (↑x x_1)) i = 0

tactic: intro j hj
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
hi : ∀ (a : σ), a ∈ degrees φ → f a ≠ i
⊢ ∀ (x_1 : σ), x_1 ∈ x.support → ↑(Finsupp.single (f x_1) (↑x x_1)) i = 0

tactic: simp only [exists_prop, mem_degrees] at hi
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
hi : ∀ (a : σ), a ∈ degrees φ → f a ≠ i
j : σ
hj : j ∈ x.support
⊢ ↑(Finsupp.single (f j) (↑x j)) i = 0

tactic: specialize hi j ⟨x, hx, hj⟩
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
j : σ
hj : j ∈ x.support
hi : ∀ (a : σ), (∃ d, coeff d φ ≠ 0 ∧ a ∈ d.support) → f a ≠ i
⊢ ↑(Finsupp.single (f j) (↑x j)) i = 0

tactic: rw [Finsupp.single_apply, if_neg hi]
state_before: case intro.intro.intro.intro
R : Type u
S : Type v
σ : Type u_1
τ : Type u_2
r : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommSemiring R
p q : MvPolynomial σ R
f : σ → τ
φ : MvPolynomial σ R
i : τ
x : σ →₀ ℕ
hx : coeff x φ ≠ 0
hd : coeff (Finsupp.mapDomain f x) (↑(rename f) φ) ≠ 0
j : σ
hj : j ∈ x.support
hi : f j ≠ i
⊢ ↑(Finsupp.single (f j) (↑x j)) i = 0