Theorem: Ideal.exists_coeff_mem_comap_sdiff_comap_of_root_mem_sdiff
File: Mathlib/RingTheory/Ideal/Over.lean

tactic: obtain ⟨hrJ, hrI⟩ := hr
state_before: R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
hr : r ∈ ↑J \ ↑I
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: have rbar_ne_zero : Ideal.Quotient.mk I r ≠ 0 := mt (Quotient.mk_eq_zero I).mp hrI
state_before: case intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: have rbar_mem_J : Ideal.Quotient.mk I r ∈ J.map (Ideal.Quotient.mk I) := mem_map_of_mem _ hrJ
state_before: case intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: have quotient_f : ∀ x ∈ I.comap f, (Ideal.Quotient.mk I).comp f x = 0 := by
  simp [Quotient.eq_zero_iff_mem]
state_before: case intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: have rbar_root :
  (p.map (Ideal.Quotient.mk (I.comap f))).eval₂ (Quotient.lift (I.comap f) _ quotient_f)
      (Ideal.Quotient.mk I r) =
    0 := by
  convert Quotient.eq_zero_iff_mem.mpr hpI
  exact _root_.trans (eval₂_map _ _ _) (hom_eval₂ p f (Ideal.Quotient.mk I) r).symm
state_before: case intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: obtain ⟨i, ne_zero, mem⟩ :=
  exists_coeff_ne_zero_mem_comap_of_root_mem rbar_ne_zero rbar_mem_J p_ne_zero rbar_root
state_before: case intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: rw [coeff_map] at ne_zero mem
state_before: case intro.intro.intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : coeff (Polynomial.map (Quotient.mk (comap f I)) p) i ≠ 0
mem :
  coeff (Polynomial.map (Quotient.mk (comap f I)) p) i ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: refine' ⟨i, (mem_quotient_iff_mem hIJ).mp _, mt _ ne_zero⟩
state_before: case intro.intro.intro
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : ↑(Quotient.mk (comap f I)) (coeff p i) ≠ 0
mem :
  ↑(Quotient.mk (comap f I)) (coeff p i) ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ ∃ i, coeff p i ∈ ↑(comap f J) \ ↑(comap f I)

tactic: simp [Quotient.eq_zero_iff_mem]
state_before: case intro.intro.intro.refine'_2
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : ↑(Quotient.mk (comap f I)) (coeff p i) ≠ 0
mem :
  ↑(Quotient.mk (comap f I)) (coeff p i) ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ coeff p i ∈ ↑(comap f I) → ↑(Quotient.mk (comap f I)) (coeff p i) = 0

tactic: simp [Quotient.eq_zero_iff_mem]
state_before: R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
⊢ ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0

tactic: convert Quotient.eq_zero_iff_mem.mpr hpI
state_before: R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
⊢ eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0

tactic: exact _root_.trans (eval₂_map _ _ _) (hom_eval₂ p f (Ideal.Quotient.mk I) r).symm
state_before: case h.e'_2
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
⊢ eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    ↑(Quotient.mk I) (eval₂ f r p)

tactic: simpa using mem
state_before: case intro.intro.intro.refine'_1
R : Type u_2
inst✝² : CommRing R
S : Type u_1
inst✝¹ : CommRing S
f : R →+* S
I J : Ideal S
inst✝ : IsPrime I
hIJ : I ≤ J
r : S
p : R[X]
p_ne_zero : Polynomial.map (Quotient.mk (comap f I)) p ≠ 0
hpI : eval₂ f r p ∈ I
hrJ : r ∈ ↑J
hrI : ¬r ∈ ↑I
rbar_ne_zero : ↑(Quotient.mk I) r ≠ 0
rbar_mem_J : ↑(Quotient.mk I) r ∈ map (Quotient.mk I) J
quotient_f : ∀ (x : R), x ∈ comap f I → ↑(RingHom.comp (Quotient.mk I) f) x = 0
rbar_root :
  eval₂ (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (↑(Quotient.mk I) r)
      (Polynomial.map (Quotient.mk (comap f I)) p) =
    0
i : ℕ
ne_zero : ↑(Quotient.mk (comap f I)) (coeff p i) ≠ 0
mem :
  ↑(Quotient.mk (comap f I)) (coeff p i) ∈
    comap (Quotient.lift (comap f I) (RingHom.comp (Quotient.mk I) f) quotient_f) (map (Quotient.mk I) J)
⊢ ↑(Quotient.mk I) (↑f (coeff p i)) ∈ map (Quotient.mk I) J