File: Mathlib/RingTheory/Localization/AtPrime.lean

full_name: Ideal.primeCompl
code: /-- The complement of a prime ideal `P ⊆ R` is a submonoid of `R`. -/
def primeCompl : Submonoid R 
goal: Submonoid R

full_name: Ideal.primeCompl_le_nonZeroDivisors
code: theorem primeCompl_le_nonZeroDivisors [NoZeroDivisors R] : P.primeCompl ≤ nonZeroDivisors R 
goal: P.primeCompl ≤ nonZeroDivisors R

full_name: IsLocalization.AtPrime
code: /-- Given a prime ideal `P`, the typeclass `IsLocalization.AtPrime S P` states that `S` is
isomorphic to the localization of `R` at the complement of `P`. -/
protected abbrev IsLocalization.AtPrime 
goal: Prop

full_name: Localization.AtPrime
code: /-- Given a prime ideal `P`, `Localization.AtPrime P` is a localization of
`R` at the complement of `P`, as a quotient type. -/
protected abbrev Localization.AtPrime 
goal: Type u_1

full_name: IsLocalization.AtPrime.Nontrivial
code: theorem AtPrime.Nontrivial [IsLocalization.AtPrime S P] : Nontrivial S 
goal: Nontrivial S

full_name: IsLocalization.AtPrime.localRing
code: theorem AtPrime.localRing [IsLocalization.AtPrime S P] : LocalRing S 
goal: LocalRing S

full_name: Localization.AtPrime.localRing
code: /-- The localization of `R` at the complement of a prime ideal is a local ring. -/
instance AtPrime.localRing : LocalRing (Localization P.primeCompl) 
goal: LocalRing (Localization P.primeCompl)

full_name: IsLocalization.isDomain_of_local_atPrime
code: /-- The localization of an integral domain at the complement of a prime ideal is an integral domain.
-/
instance isDomain_of_local_atPrime {P : Ideal A} (_ : P.IsPrime) :
    IsDomain (Localization.AtPrime P) 
goal: ∀ (x : P.IsPrime), IsDomain (Localization.AtPrime P)

full_name: IsLocalization.AtPrime.orderIsoOfPrime
code: /-- The prime ideals in the localization of a commutative ring at a prime ideal I are in
order-preserving bijection with the prime ideals contained in I. -/
def orderIsoOfPrime : { p : Ideal S // p.IsPrime } ≃o { p : Ideal R // p.IsPrime ∧ p ≤ I } 
goal: { p // p.IsPrime } ≃o { p // p.IsPrime ∧ p ≤ I }

full_name: IsLocalization.AtPrime.isUnit_to_map_iff
code: theorem isUnit_to_map_iff (x : R) : IsUnit ((algebraMap R S) x) ↔ x ∈ I.primeCompl 
goal: IsUnit ((algebraMap R S) x) ↔ x ∈ I.primeCompl

full_name: IsLocalization.AtPrime.to_map_mem_maximal_iff
code: theorem to_map_mem_maximal_iff (x : R) (h : LocalRing S := localRing S I) :
    algebraMap R S x ∈ LocalRing.maximalIdeal S ↔ x ∈ I 
goal: (algebraMap R S) x ∈ LocalRing.maximalIdeal S ↔ x ∈ I

full_name: IsLocalization.AtPrime.comap_maximalIdeal
code: theorem comap_maximalIdeal (h : LocalRing S := localRing S I) :
    (LocalRing.maximalIdeal S).comap (algebraMap R S) = I 
goal: Ideal.comap (algebraMap R S) (LocalRing.maximalIdeal S) = I

full_name: IsLocalization.AtPrime.isUnit_mk'_iff
code: theorem isUnit_mk'_iff (x : R) (y : I.primeCompl) : IsUnit (mk' S x y) ↔ x ∈ I.primeCompl 
goal: IsUnit (IsLocalization.mk' S x y) ↔ x ∈ I.primeCompl

full_name: IsLocalization.AtPrime.mk'_mem_maximal_iff
code: theorem mk'_mem_maximal_iff (x : R) (y : I.primeCompl) (h : LocalRing S := localRing S I) :
    mk' S x y ∈ LocalRing.maximalIdeal S ↔ x ∈ I 
goal: IsLocalization.mk' S x y ∈ LocalRing.maximalIdeal S ↔ x ∈ I

full_name: Localization.AtPrime.comap_maximalIdeal
code: /-- The unique maximal ideal of the localization at `I.primeCompl` lies over the ideal `I`. -/
theorem AtPrime.comap_maximalIdeal :
    Ideal.comap (algebraMap R (Localization.AtPrime I))
        (LocalRing.maximalIdeal (Localization I.primeCompl)) =
      I 
goal: Ideal.comap (algebraMap R (Localization.AtPrime I)) (LocalRing.maximalIdeal (Localization I.primeCompl)) = I

full_name: Localization.AtPrime.map_eq_maximalIdeal
code: /-- The image of `I` in the localization at `I.primeCompl` is a maximal ideal, and in particular
it is the unique maximal ideal given by the local ring structure `AtPrime.localRing` -/
theorem AtPrime.map_eq_maximalIdeal :
    Ideal.map (algebraMap R (Localization.AtPrime I)) I =
      LocalRing.maximalIdeal (Localization I.primeCompl) 
goal: Ideal.map (algebraMap R (Localization.AtPrime I)) I = LocalRing.maximalIdeal (Localization I.primeCompl)

full_name: Localization.le_comap_primeCompl_iff
code: theorem le_comap_primeCompl_iff {J : Ideal P} [hJ : J.IsPrime] {f : R →+* P} :
    I.primeCompl ≤ J.primeCompl.comap f ↔ J.comap f ≤ I 
goal: I.primeCompl ≤ Submonoid.comap f J.primeCompl ↔ Ideal.comap f J ≤ I

full_name: Localization.localRingHom
code: /-- For a ring hom `f : R →+* S` and a prime ideal `J` in `S`, the induced ring hom from the
localization of `R` at `J.comap f` to the localization of `S` at `J`.

To make this definition more flexible, we allow any ideal `I` of `R` as input, together with a proof
that `I = J.comap f`. This can be useful when `I` is not definitionally equal to `J.comap f`.
 -/
noncomputable def localRingHom (J : Ideal P) [J.IsPrime] (f : R →+* P) (hIJ : I = J.comap f) :
    Localization.AtPrime I →+* Localization.AtPrime J 
goal: Localization.AtPrime I →+* Localization.AtPrime J

full_name: Localization.localRingHom_to_map
code: theorem localRingHom_to_map (J : Ideal P) [J.IsPrime] (f : R →+* P) (hIJ : I = J.comap f)
    (x : R) : localRingHom I J f hIJ (algebraMap _ _ x) = algebraMap _ _ (f x) 
goal: (Localization.localRingHom I J f hIJ) ((algebraMap R (Localization.AtPrime I)) x) =
  (algebraMap P (Localization.AtPrime J)) (f x)

full_name: Localization.localRingHom_mk'
code: theorem localRingHom_mk' (J : Ideal P) [J.IsPrime] (f : R →+* P) (hIJ : I = J.comap f) (x : R)
    (y : I.primeCompl) :
    localRingHom I J f hIJ (IsLocalization.mk' _ x y) =
      IsLocalization.mk' (Localization.AtPrime J) (f x)
        (⟨f y, le_comap_primeCompl_iff.mpr (ge_of_eq hIJ) y.2⟩ : J.primeCompl) 
goal: (Localization.localRingHom I J f hIJ) (IsLocalization.mk' (Localization.AtPrime I) x y) =
  IsLocalization.mk' (Localization.AtPrime J) (f x) ⟨f ↑y, ⋯⟩

full_name: Localization.isLocalRingHom_localRingHom
code: instance isLocalRingHom_localRingHom (J : Ideal P) [hJ : J.IsPrime] (f : R →+* P)
    (hIJ : I = J.comap f) : IsLocalRingHom (localRingHom I J f hIJ) 
goal: IsLocalRingHom (Localization.localRingHom I J f hIJ)

full_name: Localization.localRingHom_unique
code: theorem localRingHom_unique (J : Ideal P) [J.IsPrime] (f : R →+* P) (hIJ : I = J.comap f)
    {j : Localization.AtPrime I →+* Localization.AtPrime J}
    (hj : ∀ x : R, j (algebraMap _ _ x) = algebraMap _ _ (f x)) : localRingHom I J f hIJ = j 
goal: Localization.localRingHom I J f hIJ = j

full_name: Localization.localRingHom_id
code: @[simp]
theorem localRingHom_id : localRingHom I I (RingHom.id R) (Ideal.comap_id I).symm = RingHom.id _ 
goal: Localization.localRingHom I I (RingHom.id R) ⋯ = RingHom.id (Localization.AtPrime I)

full_name: Localization.localRingHom_comp
code: theorem localRingHom_comp {S : Type*} [CommSemiring S] (J : Ideal S) [hJ : J.IsPrime] (K : Ideal P)
    [hK : K.IsPrime] (f : R →+* S) (hIJ : I = J.comap f) (g : S →+* P) (hJK : J = K.comap g) :
    localRingHom I K (g.comp f) (by rw [hIJ, hJK, Ideal.comap_comap f g]) =
      (localRingHom J K g hJK).comp (localRingHom I J f hIJ) 
goal: Localization.localRingHom I K (g.comp f) ⋯ =
  (Localization.localRingHom J K g hJK).comp (Localization.localRingHom I J f hIJ)