Theorem: Polynomial.C_dvd_iff_dvd_coeff
File: Mathlib/Data/Polynomial/Coeff.lean

tactic: constructor
state_before: R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
⊢ ↑C r ∣ φ ↔ ∀ (i : ℕ), r ∣ coeff φ i

tactic: rintro ⟨φ, rfl⟩ c
state_before: case mp
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
⊢ ↑C r ∣ φ → ∀ (i : ℕ), r ∣ coeff φ i

tactic: rw [coeff_C_mul]
state_before: case mp.intro
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ
⊢ r ∣ coeff (↑C r * φ) c

tactic: apply dvd_mul_right
state_before: case mp.intro
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ
⊢ r ∣ r * coeff φ c

tactic: intro h
state_before: case mpr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
⊢ (∀ (i : ℕ), r ∣ coeff φ i) → ↑C r ∣ φ

tactic: choose c hc using h
state_before: case mpr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
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
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
⊢ ↑C r ∣ φ

tactic: let ψ : R[X] := ∑ i in φ.support, monomial i (c' i)
state_before: case mpr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
⊢ ↑C r ∣ φ

tactic: use ψ
state_before: case mpr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
⊢ ↑C r ∣ φ

tactic: ext i
state_before: case mpr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
⊢ φ = ↑C r * ψ

tactic: simp only [coeff_C_mul, mem_support_iff, coeff_monomial, finset_sum_coeff,
  Finset.sum_ite_eq']
state_before: case mpr.a
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
i : ℕ
⊢ coeff φ i = coeff (↑C r * ψ) i

tactic: split_ifs with hi
state_before: case mpr.a
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
i : ℕ
⊢ coeff φ i = r * if coeff φ i ≠ 0 then if coeff φ i ≠ 0 then c i else 0 else 0

tactic: rw [hc]
state_before: case mpr.a.inl
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
i : ℕ
hi : coeff φ i ≠ 0
⊢ coeff φ i = r * c i

tactic: rw [Classical.not_not] at hi
state_before: case mpr.a.inr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
i : ℕ
hi : ¬coeff φ i ≠ 0
⊢ coeff φ i = r * 0

tactic: rwa [mul_zero]
state_before: case mpr.a.inr
R : Type u
S : Type v
a b : R
n m : ℕ
inst✝ : Semiring R
p q r✝ : R[X]
r : R
φ : R[X]
c : ℕ → R
hc : ∀ (i : ℕ), coeff φ i = r * c i
c' : ℕ → R := fun i => if i ∈ support φ then c i else 0
ψ : R[X] := ∑ i in support φ, ↑(monomial i) (c' i)
i : ℕ
hi : coeff φ i = 0
⊢ coeff φ i = r * 0