import OAI.AlgebraicGeometry.Resolution.Blowups.PrincipalBlowup import OAI.AlgebraicGeometry.Resolution.Blowups.Blowup.FlatBaseChange import OAI.AlgebraicGeometry.Resolution.Blowups.Blowup.Localization import OAI.AlgebraicGeometry.Resolution.Blowups.IdempotentQuotientCenter import Mathlib.AlgebraicGeometry.Morphisms.IsIso /-! # Principal Blowup -/ namespace OAI.AlgebraicGeometry.Resolution.Blowups.Locally.PrincipalBlowup.Construction noncomputable section /-! The actual affine blowup of a center in a regular zero-dimensional hypersurface is an isomorphism. -/ open _root_.CategoryTheory _root_.AlgebraicGeometry universe u variable {R : Type u} [CommRing R] private theorem isIso_restrict_of_pullback {X Y U V : Scheme.{u}} {f : X ⟶ Y} {j : U ⟶ Y} [IsOpenImmersion j] {i : V ⟶ X} {g : V ⟶ U} (hpb : IsPullback i g f j) [IsIso g] : IsIso (f ∣_ j.opensRange) := by have hcomp : IsIso (hpb.isoPullback.hom ≫ Limits.pullback.snd f j) := by rw [hpb.isoPullback_hom_snd] infer_instance let : IsIso (Limits.pullback.snd f j) := IsIso.of_isIso_comp_left hpb.isoPullback.hom _ exact ((MorphismProperty.isomorphisms Scheme).arrow_mk_iso_iff (morphismRestrictOpensRange f j)).mpr (inferInstanceAs (IsIso (Limits.pullback.snd f j))) /-- An isomorphism of the actual localized blowup identifies the restriction of the original blowup over the same principal open. -/ theorem affineBlowup_basicOpen_isIso_of_localized (I : Ideal R) (s : R) (hiso : IsIso (ReesGrading.Construction.affineBlowupToSpec (I.map (algebraMap R (Localization.Away s))))) : IsIso (ReesGrading.Construction.affineBlowupToSpec I ∣_ PrimeSpectrum.basicOpen s) := by let S := Localization.Away s let : IsIso (ReesGrading.Construction.affineBlowupToSpec (I.map (algebraMap R S))) := hiso have h := isIso_restrict_of_pullback (Blowup.FlatBaseChange.Construction.affineBlowup_flat_isPullback (S := S) I) have hrange : (Spec.map (CommRingCat.ofHom (algebraMap R S))).opensRange = PrimeSpectrum.basicOpen s := Scheme.Hom.opensRange_localizationAway (R := CommRingCat.of R) s rw [hrange] at h exact h /-- A regular principal description after localization proves that the actual original blowup is an isomorphism over that principal open. -/ theorem affineBlowup_basicOpen_isIso_of_local_principal (I : Ideal R) (s : R) (a : I.map (algebraMap R (Localization.Away s))) (hI : I.map (algebraMap R (Localization.Away s)) = Ideal.span {a.val}) (ha : IsRegular a.val) : IsIso (ReesGrading.Construction.affineBlowupToSpec I ∣_ PrimeSpectrum.basicOpen s) := affineBlowup_basicOpen_isIso_of_localized I s (PrincipalBlowup.Construction.affineBlowupToSpec_isIso_of_principal _ a hI ha) /-- An ideal generated by a regular hypersurface equation and a lift of an idempotent in its quotient has an isomorphic blowup. -/ theorem affineBlowupToSpec_isIso_of_idempotent_quotient (I : Ideal R) (r z : R) (hI : I = Ideal.span {r} ⊔ Ideal.span {z}) (hrel : r * (1 - r) ∈ Ideal.span {z}) (hz : IsRegular z) : IsIso (ReesGrading.Construction.affineBlowupToSpec I) := by have hrI : r ∈ I := hI.symm ▸ (show r ∈ Ideal.span {r} ⊔ Ideal.span {z} from (show Ideal.span {r} ≤ Ideal.span {r} ⊔ Ideal.span {z} from le_sup_left) (Ideal.mem_span_singleton_self r)) have hunit := IdempotentQuotientCenter.Construction.center_map_away_member_eq_top I r hrI let a : I.map (algebraMap R (Localization.Away r)) := ⟨1, by rw [hunit]; trivial⟩ have hprincipal : I.map (algebraMap R (Localization.Away r)) = Ideal.span {a.val} := by change I.map (algebraMap R (Localization.Away r)) = Ideal.span {1} rw [hunit] exact Ideal.span_singleton_one.symm have hr := affineBlowup_basicOpen_isIso_of_local_principal I r a hprincipal isRegular_one have hcomplement := IdempotentQuotientCenter.Construction.idempotent_quotient_center_map_complement I r z hI hrel let S := Localization.Away (1 - r) let b : I.map (algebraMap R S) := ⟨algebraMap R S z, by rw [hcomplement] exact Ideal.mem_span_singleton_self _⟩ have hzS : IsRegular (algebraMap R S z) := (Commute.isRegular_iff (Commute.all _)).mpr (hz.left.isSMulRegular.of_flat (S := S)) have h1r := affineBlowup_basicOpen_isIso_of_local_principal I (1 - r) b hcomplement hzS let c : Bool → R := fun i => if i then r else 1 - r have hcover : (⨆ i : Bool, PrimeSpectrum.basicOpen (c i)) = ⊤ := by apply PrimeSpectrum.iSup_basicOpen_eq_top_iff.mpr apply (Ideal.eq_top_iff_one _).mpr have hr : r ∈ Ideal.span (Set.range c) := Ideal.subset_span ⟨true, rfl⟩ have ht : 1 - r ∈ Ideal.span (Set.range c) := Ideal.subset_span ⟨false, rfl⟩ simpa only [add_sub_cancel] using (Ideal.span (Set.range c)).add_mem hr ht apply IsZariskiLocalAtTarget.of_iSup_eq_top (P := MorphismProperty.isomorphisms Scheme) (fun i : Bool => PrimeSpectrum.basicOpen (c i)) hcover intro i cases i · exact h1r · exact hr /-- Every center inside a reduced zero-dimensional regular hypersurface has an isomorphic actual blowup, without any chosen ambient retraction. -/ theorem zero_dimensional_hypersurface_center_blowup_isIso (z : R) (hz : IsRegular z) [IsNoetherianRing (R ⧸ Ideal.span {z})] [IsReduced (R ⧸ Ideal.span {z})] (hd : ringKrullDim (R ⧸ Ideal.span {z}) ≤ 0) (I : Ideal R) (hzI : z ∈ I) : IsIso (ReesGrading.Construction.affineBlowupToSpec I) := by obtain ⟨r, _, hI, hrel⟩ := IdempotentQuotientCenter.Construction.zero_dimensional_hypersurface_center_generators z hd I hzI exact affineBlowupToSpec_isIso_of_idempotent_quotient I r z hI hrel hz end end OAI.AlgebraicGeometry.Resolution.Blowups.Locally.PrincipalBlowup.Construction