Theorem: MvPolynomial.monomial_dvd_monomial
File: Mathlib/Data/MvPolynomial/Division.lean

tactic: constructor
state_before: σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
⊢ ↑(monomial i) r ∣ ↑(monomial j) s ↔ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: rintro ⟨x, hx⟩
state_before: case mp
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
⊢ ↑(monomial i) r ∣ ↑(monomial j) s → (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: rw [MvPolynomial.ext_iff] at hx
state_before: case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ↑(monomial j) s = ↑(monomial i) r * x
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: have hj := hx j
state_before: case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: have hi := hx i
state_before: case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hj : coeff j (↑(monomial j) s) = coeff j (↑(monomial i) r * x)
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: simp_rw [coeff_monomial, if_pos] at hj hi
state_before: case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hj : coeff j (↑(monomial j) s) = coeff j (↑(monomial i) r * x)
hi : coeff i (↑(monomial j) s) = coeff i (↑(monomial i) r * x)
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: simp_rw [coeff_monomial_mul'] at hi hj
state_before: case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hi : (if j = i then s else 0) = coeff i (↑(monomial i) r * x)
hj : s = coeff j (↑(monomial i) r * x)
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: split_ifs  at hi hj with hi hi
state_before: case mp.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hi : (if j = i then s else 0) = if i ≤ i then r * coeff (i - i) x else 0
hj : s = if i ≤ j then r * coeff (j - i) x else 0
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: exact ⟨Or.inr hi, _, hj⟩
state_before: case mp.intro.inl.inl
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hi✝¹ : (if j = i then s else 0) = if i ≤ i then r * coeff (i - i) x else 0
hi✝ : j = i
hi : i ≤ j
hj : s = r * coeff (j - i) x
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: exact ⟨Or.inl hj, hj.symm ▸ dvd_zero _⟩
state_before: case mp.intro.inl.inr
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hi✝¹ : (if j = i then s else 0) = if i ≤ i then r * coeff (i - i) x else 0
hi✝ : j = i
hi : ¬i ≤ j
hj : s = 0
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: simp_all only [or_true, dvd_mul_right]
state_before: case mp.intro.inr.inl
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hi✝ : (if j = i then s else 0) = if i ≤ i then r * coeff (i - i) x else 0
hi : ¬j = i
h✝ : i ≤ j
hj : s = r * coeff (j - i) x
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: simp_all only [ite_self, le_refl, ite_true, dvd_mul_right]
state_before: case mp.intro.inr.inr
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
x : MvPolynomial σ R
hx : ∀ (m : σ →₀ ℕ), coeff m (↑(monomial j) s) = coeff m (↑(monomial i) r * x)
hi✝ : (if j = i then s else 0) = if i ≤ i then r * coeff (i - i) x else 0
hi : ¬j = i
h✝ : ¬i ≤ j
hj : s = 0
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s

tactic: rintro ⟨h | hij, d, rfl⟩
state_before: case mpr
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r s : R
i j : σ →₀ ℕ
⊢ (s = 0 ∨ i ≤ j) ∧ r ∣ s → ↑(monomial i) r ∣ ↑(monomial j) s

tactic: simp_rw [h, monomial_zero, dvd_zero]
state_before: case mpr.intro.inl.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r : R
i j : σ →₀ ℕ
d : R
h : r * d = 0
⊢ ↑(monomial i) r ∣ ↑(monomial j) (r * d)

tactic: refine' ⟨monomial (j - i) d, _⟩
state_before: case mpr.intro.inr.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r : R
i j : σ →₀ ℕ
hij : i ≤ j
d : R
⊢ ↑(monomial i) r ∣ ↑(monomial j) (r * d)

tactic: rw [monomial_mul, add_tsub_cancel_of_le hij]
state_before: case mpr.intro.inr.intro
σ : Type u_1
R : Type u_2
inst✝ : CommSemiring R
r : R
i j : σ →₀ ℕ
hij : i ≤ j
d : R
⊢ ↑(monomial j) (r * d) = ↑(monomial i) r * ↑(monomial (j - i)) d