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

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

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

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

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

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

case mp.add
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (x y : R[X]), (∀ (n : ℕ), x.coeff n ∈ I) → (∀ (n : ℕ), y.coeff n ∈ I) → ∀ (n : ℕ), (x + y).coeff n ∈ I

case mp.smul
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ (a x : R[X]), (∀ (n : ℕ), x.coeff n ∈ I) → ∀ (n : ℕ), (a • x).coeff n ∈ I

tactic: intro f hf n
state_before: case mp.mem
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : f ∈ map C I
⊢ ∀ x ∈ ⇑C '' ↑I, ∀ (n : ℕ), x.coeff n ∈ I
state_after: case mp.mem
R : Type u
S : Type u_1
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 : ℕ
⊢ f.coeff n ∈ I

tactic: cases' (Set.mem_image _ _ _).mp hf with x hx
state_before: case mp.mem
R : Type u
S : Type u_1
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 : ℕ
⊢ f.coeff n ∈ I
state_after: case mp.mem.intro
R : Type u
S : Type u_1
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
⊢ f.coeff n ∈ I

tactic: rw [← hx.right, coeff_C]
state_before: case mp.mem.intro
R : Type u
S : Type u_1
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
⊢ f.coeff n ∈ I
state_after: case mp.mem.intro
R : Type u
S : Type u_1
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: by_cases h : n = 0
state_before: case mp.mem.intro
R : Type u
S : Type u_1
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
state_after: case pos
R : Type u
S : Type u_1
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

case neg
R : Type u
S : Type u_1
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: simpa [h] using hx.left
state_before: case pos
R : Type u
S : Type u_1
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
state_after: no goals

tactic: simp [h]
state_before: case neg
R : Type u
S : Type u_1
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
state_after: no goals

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

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

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

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

tactic: rw [smul_eq_mul, coeff_mul]
state_before: case mp.smul
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf : f✝ ∈ map C I
f g : R[X]
hg : ∀ (n : ℕ), g.coeff n ∈ I
n : ℕ
⊢ (f • g).coeff n ∈ I
state_after: case mp.smul
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f✝ : R[X]
hf : f✝ ∈ map C I
f g : R[X]
hg : ∀ (n : ℕ), g.coeff n ∈ I
n : ℕ
⊢ ∑ x ∈ antidiagonal n, f.coeff x.1 * g.coeff x.2 ∈ I

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

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

tactic: rw [← sum_monomial_eq f]
state_before: case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
⊢ f ∈ map C I
state_after: case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
⊢ (f.sum fun n a => (monomial n) a) ∈ 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_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
⊢ (f.sum fun n a => (monomial n) a) ∈ map C I
state_after: case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
n : ℕ
x✝ : n ∈ f.support
⊢ (fun n a => (monomial n) a) n (f.coeff n) ∈ map C I

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

tactic: rw [mul_comm]
state_before: case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
n : ℕ
x✝ : n ∈ f.support
⊢ C (f.coeff n) * X ^ n ∈ map C I
state_after: case mpr
R : Type u
S : Type u_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
n : ℕ
x✝ : n ∈ f.support
⊢ X ^ n * C (f.coeff 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_1
inst✝¹ : CommSemiring R
inst✝ : Semiring S
I : Ideal R
f : R[X]
hf : ∀ (n : ℕ), f.coeff n ∈ I
n : ℕ
x✝ : n ∈ f.support
⊢ X ^ n * C (f.coeff n) ∈ map C I
state_after: no goals