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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
have hP0 : (0 : S) ∉ Algebra.algebraMapSubmonoid S P.primeCompl := by
  rintro ⟨x, ⟨hx, x0⟩⟩
  exact absurd (hP x0) hx
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
let Rₚ := Localization P.primeCompl
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
let Sₚ := Localization (Algebra.algebraMapSubmonoid S P.primeCompl)
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
letI : IsDomain (Localization (Algebra.algebraMapSubmonoid S P.primeCompl)) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
case 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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
obtain ⟨Qₚ : Ideal Sₚ, Qₚ_maximal⟩ := exists_maximal Sₚ
case 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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
case 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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
haveI Qₚ_max : IsMaximal (comap _ Qₚ) :=
  @isMaximal_comap_of_isIntegral_of_isMaximal Rₚ _ Sₚ _ (localizationAlgebra P.primeCompl S)
    (isIntegral_localization H) _ Qₚ_maximal
case 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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap (algebraMap R S) (comap (algebraMap S Sₚ) Qₚ) = P
case 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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ ∃ Q, IsPrime Q ∧ comap (algebraMap R S) Q = P
refine' ⟨comap (algebraMap S Sₚ) Qₚ, ⟨comap_isPrime _ Qₚ, _⟩⟩
case h.e'_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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap (algebraMap R S) (comap (algebraMap S Sₚ) Qₚ) =
    comap (algebraMap R (Localization.AtPrime P)) (LocalRing.maximalIdeal (Localization (primeCompl P)))
case 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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap (algebraMap R S) (comap (algebraMap S Sₚ) Qₚ) = P
convert Localization.AtPrime.comap_maximalIdeal (I := P)
case h.e'_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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap
      (RingHom.comp
        (IsLocalization.map Sₚ (algebraMap R S)
          (_ :
            ∀ (p : R) (hp : p ∈ primeCompl P),
              ↑(algebraMap R S) ↑{ val := p, property := hp } ∈ Algebra.algebraMapSubmonoid S (primeCompl P)))
        (algebraMap R Rₚ))
      Qₚ =
    comap (algebraMap R (Localization.AtPrime P)) (comap (algebraMap Rₚ Sₚ) Qₚ)
case h.e'_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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap (algebraMap R S) (comap (algebraMap S Sₚ) Qₚ) =
    comap (algebraMap R (Localization.AtPrime P)) (LocalRing.maximalIdeal (Localization (primeCompl P)))
rw [comap_comap, ← LocalRing.eq_maximalIdeal Qₚ_max,
  ←@IsLocalization.map_comp (P := S) (Q := Sₚ) (g := algebraMap R S)
  (M := P.primeCompl) (T := Algebra.algebraMapSubmonoid S P.primeCompl) (S := Rₚ) _
  _ _ _ _ _ (fun p hp => Algebra.mem_algebraMapSubmonoid_of_mem ⟨p, hp⟩) _ _]
no goals
case h.e'_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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
hP0 : ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
Rₚ : Type u_1 := Localization (primeCompl P)
Sₚ : Type u_2 := Localization (Algebra.algebraMapSubmonoid S (primeCompl P))
this : IsDomain (Localization (Algebra.algebraMapSubmonoid S (primeCompl P))) :=
  IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0)
Qₚ : Ideal Sₚ
Qₚ_maximal : IsMaximal Qₚ
Qₚ_max : IsMaximal (comap (algebraMap Rₚ Sₚ) Qₚ)
⊢ comap
      (RingHom.comp
        (IsLocalization.map Sₚ (algebraMap R S)
          (_ :
            ∀ (p : R) (hp : p ∈ primeCompl P),
              ↑(algebraMap R S) ↑{ val := p, property := hp } ∈ Algebra.algebraMapSubmonoid S (primeCompl P)))
        (algebraMap R Rₚ))
      Qₚ =
    comap (algebraMap R (Localization.AtPrime P)) (comap (algebraMap Rₚ Sₚ) Qₚ)
rfl
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
x : R
hx : x ∈ ↑(primeCompl P)
x0 : ↑(algebraMap R S) x = 0
⊢ False
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
⊢ ¬0 ∈ Algebra.algebraMapSubmonoid S (primeCompl P)
rintro ⟨x, ⟨hx, x0⟩⟩
no goals
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
inst✝¹ : IsDomain S
H : Algebra.IsIntegral R S
P : Ideal R
inst✝ : IsPrime P
hP : RingHom.ker (algebraMap R S) ≤ P
x : R
hx : x ∈ ↑(primeCompl P)
x0 : ↑(algebraMap R S) x = 0
⊢ False
exact absurd (hP x0) hx