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

tactic: obtain ⟨Q' : Ideal (S ⧸ I), ⟨Q'_prime, hQ'⟩⟩ :=
  @exists_ideal_over_prime_of_is_integral' (R ⧸ I.comap (algebraMap R S)) _ (S ⧸ I) _
    Ideal.quotientAlgebra _ (isIntegral_quotient_of_isIntegral H)
    (map (Ideal.Quotient.mk (I.comap (algebraMap R S))) P)
    (map_isPrime_of_surjective Quotient.mk_surjective (by simp [hIP]))
    (le_trans (le_of_eq ((RingHom.injective_iff_ker_eq_bot _).1 algebraMap_quotient_injective))
      bot_le)
state_before: R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
⊢ ∃ Q, Q ≥ I ∧ IsPrime Q ∧ comap (algebraMap R S) Q = P

tactic: haveI := Q'_prime
state_before: case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
⊢ ∃ Q, Q ≥ I ∧ IsPrime Q ∧ comap (algebraMap R S) Q = P

tactic: refine' ⟨Q'.comap _, le_trans (le_of_eq mk_ker.symm) (ker_le_comap _), ⟨comap_isPrime _ Q', _⟩⟩
state_before: case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ ∃ Q, Q ≥ I ∧ IsPrime Q ∧ comap (algebraMap R S) Q = P

tactic: rw [comap_comap]
state_before: case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (algebraMap R S) (comap (Quotient.mk I) Q') = P

tactic: refine' _root_.trans _ (_root_.trans (congr_arg (comap (Ideal.Quotient.mk
  (comap (algebraMap R S) I))) hQ') _)
state_before: case intro.intro
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (RingHom.comp (Quotient.mk I) (algebraMap R S)) Q' = P

tactic: simp [hIP]
state_before: R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
⊢ RingHom.ker (Quotient.mk (comap (algebraMap R S) I)) ≤ P

tactic: rw [comap_comap]
state_before: case intro.intro.refine'_1
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (RingHom.comp (Quotient.mk I) (algebraMap R S)) Q' =
    comap (Quotient.mk (comap (algebraMap R S) I)) (comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q')

tactic: exact congr_arg (comap . Q') (RingHom.ext fun r => rfl)
state_before: case intro.intro.refine'_1
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (RingHom.comp (Quotient.mk I) (algebraMap R S)) Q' =
    comap (RingHom.comp (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) (Quotient.mk (comap (algebraMap R S) I))) Q'

tactic: refine' _root_.trans (comap_map_of_surjective _ Quotient.mk_surjective _) (sup_eq_left.2 _)
state_before: case intro.intro.refine'_2
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (Quotient.mk (comap (algebraMap R S) I)) (map (Quotient.mk (comap (algebraMap R S) I)) P) = P

tactic: simpa [← RingHom.ker_eq_comap_bot] using hIP
state_before: case intro.intro.refine'_2
R : Type u_1
inst✝⁴ : CommRing R
S : Type u_2
inst✝³ : CommRing S
f : R →+* S
I✝ J : Ideal S
inst✝² : Algebra R S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝¹ : IsPrime P
I : Ideal S
inst✝ : IsPrime I
hIP : comap (algebraMap R S) I ≤ P
Q' : Ideal (S ⧸ I)
Q'_prime : IsPrime Q'
hQ' : comap (algebraMap (R ⧸ comap (algebraMap R S) I) (S ⧸ I)) Q' = map (Quotient.mk (comap (algebraMap R S) I)) P
this : IsPrime Q'
⊢ comap (Quotient.mk (comap (algebraMap R S) I)) ⊥ ≤ P