Theorem: Ideal.mem_map_C_iff
File: Mathlib/RingTheory/Polynomial/Basic.lean

tactic: constructor
state_before: R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
⊢ f ∈ map C I ↔ ∀ (n : ℕ), coeff f n ∈ I

tactic: intro hf
state_before: case mp
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
⊢ f ∈ map C I → ∀ (n : ℕ), coeff f n ∈ I

tactic: apply @Submodule.span_induction _ _ _ _ _ f _ _ hf
state_before: case mp
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (n : ℕ), coeff f n ∈ I

tactic: intro f hf n
state_before: case mp.Hs
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (x : R[X]), x ∈ ↑C '' ↑I → ∀ (n : ℕ), coeff x n ∈ I

tactic: cases' (Set.mem_image _ _ _).mp hf with x hx
state_before: case mp.Hs
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
⊢ coeff f n ∈ I

tactic: rw [← hx.right, coeff_C]
state_before: case mp.Hs.intro
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
⊢ coeff f n ∈ I

tactic: by_cases h : n = 0
state_before: case mp.Hs.intro
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
⊢ (if n = 0 then x else 0) ∈ I

tactic: simpa [h] using hx.left
state_before: case pos
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
h : n = 0
⊢ (if n = 0 then x else 0) ∈ I

tactic: simp [h]
state_before: case neg
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f : R[X]
hf : f ∈ ↑C '' ↑I
n : ℕ
x : R
hx : x ∈ ↑I ∧ ↑C x = f
h : ¬n = 0
⊢ (if n = 0 then x else 0) ∈ I

tactic: simp
state_before: case mp.H0
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (n : ℕ), coeff 0 n ∈ I

tactic: exact fun f g hf hg n => by simp [I.add_mem (hf n) (hg n)]
state_before: case mp.H1
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (x y : R[X]), (∀ (n : ℕ), coeff x n ∈ I) → (∀ (n : ℕ), coeff y n ∈ I) → ∀ (n : ℕ), coeff (x + y) n ∈ I

tactic: simp [I.add_mem (hf n) (hg n)]
state_before: R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf✝ : f✝ ∈ map C I
f g : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
hg : ∀ (n : ℕ), coeff g n ∈ I
n : ℕ
⊢ coeff (f + g) n ∈ I

tactic: refine' fun f g hg n => _
state_before: case mp.H2
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (a x : R[X]), (∀ (n : ℕ), coeff x n ∈ I) → ∀ (n : ℕ), coeff (a • x) n ∈ I

tactic: rw [smul_eq_mul, coeff_mul]
state_before: case mp.H2
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf : f✝ ∈ map C I
f g : R[X]
hg : ∀ (n : ℕ), coeff g n ∈ I
n : ℕ
⊢ coeff (f • g) n ∈ I

tactic: exact I.sum_mem fun c _ => I.mul_mem_left (f.coeff c.fst) (hg c.snd)
state_before: case mp.H2
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf : f✝ ∈ map C I
f g : R[X]
hg : ∀ (n : ℕ), coeff g n ∈ I
n : ℕ
⊢ ∑ x in Nat.antidiagonal n, coeff f x.fst * coeff g x.snd ∈ I

tactic: intro hf
state_before: case mpr
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
⊢ (∀ (n : ℕ), coeff f n ∈ I) → f ∈ map C I

tactic: rw [← sum_monomial_eq f]
state_before: case mpr
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
⊢ f ∈ map C I

tactic: refine' (I.map C : Ideal R[X]).sum_mem fun n _ => _
state_before: case mpr
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
⊢ (sum f fun n a => ↑(monomial n) a) ∈ map C I

tactic: simp [← C_mul_X_pow_eq_monomial]
state_before: case mpr
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
n : ℕ
x✝ : n ∈ support f
⊢ (fun n a => ↑(monomial n) a) n (coeff f n) ∈ map C I

tactic: rw [mul_comm]
state_before: case mpr
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
n : ℕ
x✝ : n ∈ support f
⊢ ↑C (coeff f n) * X ^ n ∈ map C I

tactic: exact (I.map C : Ideal R[X]).mul_mem_left _ (mem_map_of_mem _ (hf n))
state_before: case mpr
R : Type u
S : Type ?u.120906
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), coeff f n ∈ I
n : ℕ
x✝ : n ∈ support f
⊢ X ^ n * ↑C (coeff f n) ∈ map C I