Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/RingTheory/RingHom/     Datei vom 15.10.2026 mit Größe 4 kB image not shown  

Quelle  Unramified.lean   Sprache: Lean

 

/-
Copyright (c) 2024 Andrew Yang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Andrew Yang
-/

module

public import Mathlib.RingTheory.Unramified.Locus

/-!
# The meta properties of unramified ring homomorphisms.
-/


@[expose] public section

namespace RingHom

variable {R : Type*} {S : Type*} [CommRing R] [CommRing S]

/--
A ring homomorphism `R →+* A` is formally unramified if `Ω[A⁄R]` is trivial.
See `Algebra.FormallyUnramified`.
-/

@[algebraize Algebra.FormallyUnramified]
def FormallyUnramified (f : R →+* S) : Prop :=
  letI := f.toAlgebra
  Algebra.FormallyUnramified R S

lemma formallyUnramified_algebraMap [Algebra R S] :
    (algebraMap R S).FormallyUnramified ↔ Algebra.FormallyUnramified R S := by
  rw [FormallyUnramified, toAlgebra_algebraMap]

namespace FormallyUnramified

lemma of_surjective {f : R →+* S} (hf : Function.Surjective f) : f.FormallyUnramified := by
  algebraize [f]
  exact Algebra.FormallyUnramified.of_surjective (Algebra.ofId R S) hf

lemma of_comp {T : Type*} [CommRing T] {f : R →+* S} {g : S →+* T}
    (h : (g.comp f).FormallyUnramified) :
    g.FormallyUnramified := by
  algebraize [f, g, g.comp f]
  exact Algebra.FormallyUnramified.of_restrictScalars R _ _

lemma comp {T : Type*} [CommRing T] {f : R →+* S} {g : S →+* T} (hf : f.FormallyUnramified)
    (hg : g.FormallyUnramified) :
    (g.comp f).FormallyUnramified := by
  algebraize [f, g, g.comp f]
  exact Algebra.FormallyUnramified.comp R S T

lemma stableUnderComposition : StableUnderComposition FormallyUnramified :=
  fun _ _ _ _ _ _ _ _ hf hg ↦ .comp hf hg

lemma respectsIso :
    RespectsIso FormallyUnramified := by
  refine stableUnderComposition.respectsIso ?_
  intro R S _ _ e
  exact .of_surjective e.surjective

lemma isStableUnderBaseChange :
    IsStableUnderBaseChange FormallyUnramified := by
  refine .mk respectsIso ?_
  introv H
  rw [formallyUnramified_algebraMap] at H ⊢
  infer_instance

lemma holdsForLocalization :
    HoldsForLocalization FormallyUnramified := by
  intro R S _ _ _ M _
  rw [formallyUnramified_algebraMap]
  exact .of_isLocalization M

lemma holdsForLocalizationAway :
    HoldsForLocalizationAway FormallyUnramified :=
  holdsForLocalization.holdsForLocalizationAway

lemma ofLocalizationPrime :
    OfLocalizationPrime FormallyUnramified := by
  intro R S _ _ f H
  algebraize [f]
  rw [FormallyUnramified, Algebra.formallyUnramified_iff_forall]
  intro x
  let Rₓ := Localization.AtPrime (x.asIdeal.comap f)
  let Sₓ := Localization.AtPrime x.asIdeal
  let : Algebra Rₓ Sₓ := (Localization.localRingHom _ _ _ rfl).toAlgebra
  have : IsScalarTower R Rₓ Sₓ := .of_algebraMap_eq
    fun x ↦ (Localization.localRingHom_to_map _ _ _ rfl x).symm
  have : Algebra.FormallyUnramified Rₓ Sₓ := H _ _
  exact Algebra.FormallyUnramified.comp R Rₓ Sₓ

lemma ofLocalizationSpanTarget :
    OfLocalizationSpanTarget FormallyUnramified := by
  intro R S _ _ f s hs H
  algebraize [f]
  rw [FormallyUnramified, Algebra.formallyUnramified_iff_forall]
  intro x
  obtain ⟨r, hr, hrx⟩ : ∃ r ∈ s, x ∈ PrimeSpectrum.basicOpen r := by
    simpa using (PrimeSpectrum.iSup_basicOpen_eq_top_iff'.mpr hs).ge
      (TopologicalSpace.Opens.mem_top x)
  refine Algebra.basicOpen_subset_unramifiedLocus_iff.mpr ?_ hrx
  convert H ⟨r, hr⟩
  dsimp
  rw [← algebraMap_toAlgebra f, ← IsScalarTower.algebraMap_eq,
    formallyUnramified_algebraMap]

lemma propertyIsLocal :
    PropertyIsLocal FormallyUnramified := by
  constructor
  · exact isStableUnderBaseChange.localizationPreserves.away
  · exact ofLocalizationSpanTarget
  · exact ofLocalizationSpanTarget.ofLocalizationSpan
      (stableUnderComposition.stableUnderCompositionWithLocalizationAway
          holdsForLocalizationAway).1
  · exact (stableUnderComposition.stableUnderCompositionWithLocalizationAway
        holdsForLocalizationAway).2

end FormallyUnramified

lemma FormallyEtale.of_comp {T : Type*} [CommRing T] {f : R →+* S} {g : S →+* T}
    (hf : f.FormallyUnramified) (h : (g.comp f).FormallyEtale) :
    g.FormallyEtale := by
  algebraize [f, g, g.comp f]
  exact Algebra.FormallyEtale.of_restrictScalars (R := R)

end RingHom

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland