Theorem: MvPolynomial.C_dvd_iff_dvd_coeff
File: Mathlib/Data/MvPolynomial/Basic.lean

tactic: constructor
state_before: R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
⊢ ↑C r ∣ φ ↔ ∀ (i : σ →₀ ℕ), r ∣ coeff i φ

tactic: rintro ⟨φ, rfl⟩ c
state_before: case mp
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
⊢ ↑C r ∣ φ → ∀ (i : σ →₀ ℕ), r ∣ coeff i φ

tactic: rw [coeff_C_mul]
state_before: case mp.intro
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
c : σ →₀ ℕ
⊢ r ∣ coeff c (↑C r * φ)

tactic: apply dvd_mul_right
state_before: case mp.intro
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
c : σ →₀ ℕ
⊢ r ∣ r * coeff c φ

tactic: intro h
state_before: case mpr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
⊢ (∀ (i : σ →₀ ℕ), r ∣ coeff i φ) → ↑C r ∣ φ

tactic: choose C hc using h
state_before: case mpr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
h : ∀ (i : σ →₀ ℕ), r ∣ coeff i φ
⊢ ↑C r ∣ φ

tactic: let c' : (σ →₀ ℕ) → R := fun i => if i ∈ φ.support then C i else 0
state_before: case mpr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
⊢ ↑MvPolynomial.C r ∣ φ

tactic: let ψ : MvPolynomial σ R := ∑ i in φ.support, monomial i (c' i)
state_before: case mpr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
⊢ ↑MvPolynomial.C r ∣ φ

tactic: use ψ
state_before: case mpr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
⊢ ↑MvPolynomial.C r ∣ φ

tactic: apply MvPolynomial.ext
state_before: case mpr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
⊢ φ = ↑MvPolynomial.C r * ψ

tactic: intro i
state_before: case mpr.a
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
⊢ ∀ (m : σ →₀ ℕ), coeff m φ = coeff m (↑MvPolynomial.C r * ψ)

tactic: simp only [coeff_C_mul, coeff_sum, coeff_monomial, Finset.sum_ite_eq']
state_before: case mpr.a
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
i : σ →₀ ℕ
⊢ coeff i φ = coeff i (↑MvPolynomial.C r * ψ)

tactic: split_ifs with hi
state_before: case mpr.a
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
i : σ →₀ ℕ
⊢ coeff i φ = r * if i ∈ support φ then if i ∈ support φ then C i else 0 else 0

tactic: rw [hc]
state_before: case mpr.a.inl
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
i : σ →₀ ℕ
hi : i ∈ support φ
⊢ coeff i φ = r * C i

tactic: rw [not_mem_support_iff] at hi
state_before: case mpr.a.inr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
i : σ →₀ ℕ
hi : ¬i ∈ support φ
⊢ coeff i φ = r * 0

tactic: rwa [MulZeroClass.mul_zero]
state_before: case mpr.a.inr
R : Type u
S₁ : Type v
S₂ : Type w
S₃ : Type x
σ : Type u_1
a a' a₁ a₂ : R
e : ℕ
n m : σ
s : σ →₀ ℕ
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S₁
p q : MvPolynomial σ R
r : R
φ : MvPolynomial σ R
C : (σ →₀ ℕ) → R
hc : ∀ (i : σ →₀ ℕ), coeff i φ = r * C i
c' : (σ →₀ ℕ) → R := fun i => if i ∈ support φ then C i else 0
ψ : MvPolynomial σ R := ∑ i in support φ, ↑(monomial i) (c' i)
i : σ →₀ ℕ
hi : coeff i φ = 0
⊢ coeff i φ = r * 0