Theorem: Polynomial.mem_span_C_coeff
File: Mathlib/Data/Polynomial/Induction.lean

tactic: let p := Ideal.span { g : R[X] | ∃ i : ℕ, g = C (coeff f i) }
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n : ℕ
inst✝ : Semiring R
p q r f : R[X]
I : Ideal R[X]
⊢ f ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: nth_rw 1 [(sum_C_mul_X_pow_eq f).symm]
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
⊢ f ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: refine' Submodule.sum_mem _ fun n _hn => _
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
⊢ (sum f fun n a => ↑C a * X ^ n) ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: dsimp
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
⊢ (fun n a => ↑C a * X ^ n) n (coeff f n) ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: have : C (coeff f n) ∈ p := by
  apply subset_span
  rw [mem_setOf_eq]
  use n
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
⊢ ↑C (coeff f n) * X ^ n ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: have : monomial n (1 : R) • C (coeff f n) ∈ p := p.smul_mem _ this
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
this : ↑C (coeff f n) ∈ p
⊢ ↑C (coeff f n) * X ^ n ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: convert this using 1
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
this✝ : ↑C (coeff f n) ∈ p
this : ↑(monomial n) 1 • ↑C (coeff f n) ∈ p
⊢ ↑C (coeff f n) * X ^ n ∈ Ideal.span {g | ∃ i, g = ↑C (coeff f i)}

tactic: simp only [monomial_mul_C, one_mul, smul_eq_mul]
state_before: case h.e'_4
R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
this✝ : ↑C (coeff f n) ∈ p
this : ↑(monomial n) 1 • ↑C (coeff f n) ∈ p
⊢ ↑C (coeff f n) * X ^ n = ↑(monomial n) 1 • ↑C (coeff f n)

tactic: rw [← C_mul_X_pow_eq_monomial]
state_before: case h.e'_4
R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
this✝ : ↑C (coeff f n) ∈ p
this : ↑(monomial n) 1 • ↑C (coeff f n) ∈ p
⊢ ↑C (coeff f n) * X ^ n = ↑(monomial n) (coeff f n)

tactic: apply subset_span
state_before: R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
⊢ ↑C (coeff f n) ∈ p

tactic: rw [mem_setOf_eq]
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
⊢ ↑C (coeff f n) ∈ {g | ∃ i, g = ↑C (coeff f i)}

tactic: use n
state_before: case a
R : Type u
S : Type v
T : Type w
ι : Type x
k : Type y
A : Type z
a b : R
m n✝ : ℕ
inst✝ : Semiring R
p✝ q r f : R[X]
I : Ideal R[X]
p : Ideal R[X] := Ideal.span {g | ∃ i, g = ↑C (coeff f i)}
n : ℕ
_hn : n ∈ support f
⊢ ∃ i, ↑C (coeff f n) = ↑C (coeff f i)