Theorem: MvPolynomial.degreeOf_sub_lt
File: Mathlib/Data/MvPolynomial/CommRing.lean

tactic: rw [degreeOf_lt_iff h]
state_before: R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
⊢ degreeOf x (f - g) < k

tactic: intro m hm
state_before: R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
⊢ ∀ (m : σ →₀ ℕ), m ∈ support (f - g) → ↑m x < k

tactic: by_contra' hc
state_before: R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m✝ : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
m : σ →₀ ℕ
hm : m ∈ support (f - g)
⊢ ↑m x < k

tactic: have h := support_sub σ f g hm
state_before: R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m✝ : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
m : σ →₀ ℕ
hm : m ∈ support (f - g)
hc : k ≤ ↑m x
⊢ False

tactic: simp only [mem_support_iff, Ne.def, coeff_sub, sub_eq_zero] at hm
state_before: R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m✝ : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h✝ : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
m : σ →₀ ℕ
hm : m ∈ support (f - g)
hc : k ≤ ↑m x
h : m ∈ support f ∪ support g
⊢ False

tactic: cases' Finset.mem_union.1 h with cf cg
state_before: R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m✝ : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h✝ : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
m : σ →₀ ℕ
hc : k ≤ ↑m x
h : m ∈ support f ∪ support g
hm : ¬coeff m f = coeff m g
⊢ False

tactic: exact hm (hf m cf hc)
state_before: case inl
R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m✝ : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h✝ : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
m : σ →₀ ℕ
hc : k ≤ ↑m x
h : m ∈ support f ∪ support g
hm : ¬coeff m f = coeff m g
cf : m ∈ support f
⊢ False

tactic: exact hm (hg m cg hc)
state_before: case inr
R : Type u
S : Type v
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m✝ : σ
s : σ →₀ ℕ
inst✝ : CommRing R
p q : MvPolynomial σ R
x : σ
f g : MvPolynomial σ R
k : ℕ
h✝ : 0 < k
hf : ∀ (m : σ →₀ ℕ), m ∈ support f → k ≤ ↑m x → coeff m f = coeff m g
hg : ∀ (m : σ →₀ ℕ), m ∈ support g → k ≤ ↑m x → coeff m f = coeff m g
m : σ →₀ ℕ
hc : k ≤ ↑m x
h : m ∈ support f ∪ support g
hm : ¬coeff m f = coeff m g
cg : m ∈ support g
⊢ False