Theorem: Ideal.eq_zero_of_polynomial_mem_map_range
File: Mathlib/RingTheory/Polynomial/Quotient.lean

tactic: let i := ((Quotient.mk I).comp C).rangeRestrict
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
⊢ x = 0

tactic: have hi' : RingHom.ker (Polynomial.mapRingHom i) ≤ I := by
  refine' fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => _
  rw [mem_comap, ← Quotient.eq_zero_iff_mem, ← RingHom.comp_apply]
  rw [RingHom.mem_ker, coe_mapRingHom] at hf
  replace hf := congr_arg (fun f : Polynomial _ => f.coeff n) hf
  simp only [coeff_map, coeff_zero] at hf
  rwa [Subtype.ext_iff, RingHom.coe_rangeRestrict] at hf
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
⊢ x = 0

tactic: obtain ⟨x, hx'⟩ := x
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
⊢ x = 0

tactic: obtain ⟨y, rfl⟩ := RingHom.mem_range.1 hx'
state_before: case mk
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
x : R[X] ⧸ I
hx' : x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx : ↑C { val := x, property := hx' } ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
⊢ { val := x, property := hx' } = 0

tactic: refine' Subtype.eq _
state_before: case mk.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
⊢ { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } = 0

tactic: simp only [RingHom.comp_apply, Quotient.eq_zero_iff_mem, ZeroMemClass.coe_zero]
state_before: case mk.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
⊢ ↑{ val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } = ↑0

tactic: suffices C (i y) ∈ I.map (Polynomial.mapRingHom i) by
  obtain ⟨f, hf⟩ := mem_image_of_mem_map_of_surjective (Polynomial.mapRingHom i)
    (Polynomial.map_surjective _ (RingHom.rangeRestrict_surjective ((Quotient.mk I).comp C))) this
  refine' sub_add_cancel (C y) f ▸ I.add_mem (hi' _ : C y - f ∈ I) hf.1
  rw [RingHom.mem_ker, RingHom.map_sub, hf.2, sub_eq_zero, coe_mapRingHom, map_C]
state_before: case mk.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
⊢ ↑C y ∈ I

tactic: exact hx
state_before: case mk.intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
⊢ ↑C (↑i y) ∈ map (mapRingHom i) I

tactic: refine' fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => _
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
⊢ RingHom.ker (mapRingHom i) ≤ I

tactic: rw [mem_comap, ← Quotient.eq_zero_iff_mem, ← RingHom.comp_apply]
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
f : R[X]
hf : f ∈ RingHom.ker (mapRingHom i)
n : ℕ
⊢ coeff f n ∈ comap C I

tactic: rw [RingHom.mem_ker, coe_mapRingHom] at hf
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
f : R[X]
hf : f ∈ RingHom.ker (mapRingHom i)
n : ℕ
⊢ ↑(RingHom.comp (Quotient.mk I) C) (coeff f n) = 0

tactic: replace hf := congr_arg (fun f : Polynomial _ => f.coeff n) hf
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
f : R[X]
hf : Polynomial.map i f = 0
n : ℕ
⊢ ↑(RingHom.comp (Quotient.mk I) C) (coeff f n) = 0

tactic: simp only [coeff_map, coeff_zero] at hf
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
f : R[X]
n : ℕ
hf : (fun f => coeff f n) (Polynomial.map i f) = (fun f => coeff f n) 0
⊢ ↑(RingHom.comp (Quotient.mk I) C) (coeff f n) = 0

tactic: rwa [Subtype.ext_iff, RingHom.coe_rangeRestrict] at hf
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
x : { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) }
hx : ↑C x ∈ map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
f : R[X]
n : ℕ
hf : ↑(RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)) (coeff f n) = 0
⊢ ↑(RingHom.comp (Quotient.mk I) C) (coeff f n) = 0

tactic: obtain ⟨f, hf⟩ := mem_image_of_mem_map_of_surjective (Polynomial.mapRingHom i)
  (Polynomial.map_surjective _ (RingHom.rangeRestrict_surjective ((Quotient.mk I).comp C))) this
state_before: R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
this : ↑C (↑i y) ∈ map (mapRingHom i) I
⊢ ↑C y ∈ I

tactic: refine' sub_add_cancel (C y) f ▸ I.add_mem (hi' _ : C y - f ∈ I) hf.1
state_before: case intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
this : ↑C (↑i y) ∈ map (mapRingHom i) I
f : R[X]
hf : f ∈ ↑I ∧ ↑(mapRingHom i) f = ↑C (↑i y)
⊢ ↑C y ∈ I

tactic: rw [RingHom.mem_ker, RingHom.map_sub, hf.2, sub_eq_zero, coe_mapRingHom, map_C]
state_before: case intro
R : Type u_1
inst✝ : CommRing R
I : Ideal R[X]
i : R →+* { x // x ∈ RingHom.range (RingHom.comp (Quotient.mk I) C) } :=
  RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C)
hi' : RingHom.ker (mapRingHom i) ≤ I
y : R
hx' : ↑(RingHom.comp (Quotient.mk I) C) y ∈ RingHom.range (RingHom.comp (Quotient.mk I) C)
hx :
  ↑C { val := ↑(RingHom.comp (Quotient.mk I) C) y, property := hx' } ∈
    map (mapRingHom (RingHom.rangeRestrict (RingHom.comp (Quotient.mk I) C))) I
this : ↑C (↑i y) ∈ map (mapRingHom i) I
f : R[X]
hf : f ∈ ↑I ∧ ↑(mapRingHom i) f = ↑C (↑i y)
⊢ ↑C y - f ∈ RingHom.ker (mapRingHom i)