import OAI.AlgebraicGeometry.Quotients.FiniteDescent.GlobalQuotientOf import OAI.AlgebraicGeometry.Quotients.FiniteDescent.QuotientTransitionsOpen /-! # Chart -/ namespace OAI.AlgebraicGeometry.Quotients.FiniteDescent.Chart.Construction.ChartQuotients /-! # Gluing local quotients without supplied quotient transitions Only the local quotients and their kernel pairs are input data. The transition maps, their functor laws, and the cartesian quotient diagram are constructed by effective descent and uniqueness. -/ open _root_.CategoryTheory _root_.CategoryTheory.Limits _root_.AlgebraicGeometry universe u v /-- Local quotient data on an open cover. The relation chart is the source restriction of the original relation, with target in the same object chart. -/ structure Data {R X : Scheme.{u}} (s t : R ⟶ X) (š’° : X.OpenCover) where quotient : š’°.Iā‚€ → Scheme.{u} projection : āˆ€ i, š’°.X i ⟶ quotient i finite : āˆ€ i, IsFinite (projection i) flat : āˆ€ i, Flat (projection i) finitelyPresented : āˆ€ i, LocallyOfFinitePresentation (projection i) surjective : āˆ€ i, Surjective (projection i) relation : š’°.Iā‚€ → Scheme.{u} inclusion : āˆ€ i, relation i ⟶ R source : āˆ€ i, relation i ⟶ š’°.X i target : āˆ€ i, relation i ⟶ š’°.X i source_isPullback : āˆ€ i, IsPullback (source i) (inclusion i) (š’°.f i) s target_comp : āˆ€ i, target i ≫ š’°.f i = inclusion i ≫ t kernelPair : āˆ€ i, IsKernelPair (projection i) (source i) (target i) namespace Data variable {R X : Scheme.{u}} {s t : R ⟶ X} {š’° : X.OpenCover} (d : Data s t š’°) instance (i : š’°.Iā‚€) : IsFinite (d.projection i) := d.finite i instance (i : š’°.Iā‚€) : Flat (d.projection i) := d.flat i instance (i : š’°.Iā‚€) : LocallyOfFinitePresentation (d.projection i) := d.finitelyPresented i instance (i : š’°.Iā‚€) : Surjective (d.projection i) := d.surjective i variable [Category.{v} š’°.Iā‚€] [š’°.LocallyDirected] /-- The transition between source restrictions of the relation. -/ noncomputable def relationMap {i j : š’°.Iā‚€} (f : i ⟶ j) : d.relation i ⟶ d.relation j := (d.source_isPullback j).lift (d.source i ≫ š’°.trans f) (d.inclusion i) (by rw [Category.assoc, š’°.trans_map, (d.source_isPullback i).w]) @[reassoc (attr := simp)] theorem relationMap_source {i j : š’°.Iā‚€} (f : i ⟶ j) : d.relationMap f ≫ d.source j = d.source i ≫ š’°.trans f := (d.source_isPullback j).lift_fst _ _ _ @[reassoc (attr := simp)] theorem relationMap_inclusion {i j : š’°.Iā‚€} (f : i ⟶ j) : d.relationMap f ≫ d.inclusion j = d.inclusion i := (d.source_isPullback j).lift_snd _ _ _ theorem relationMap_isPullback {i j : š’°.Iā‚€} (f : i ⟶ j) : IsPullback (d.source i) (d.relationMap f) (š’°.trans f) (d.source j) := by apply IsPullback.of_bot _ (d.relationMap_source f).symm (d.source_isPullback j) simpa only [d.relationMap_inclusion, š’°.trans_map] using d.source_isPullback i theorem relationMap_target {i j : š’°.Iā‚€} (f : i ⟶ j) : d.target i ≫ š’°.trans f = d.relationMap f ≫ d.target j := by apply (cancel_mono (š’°.f j)).mp simp only [Category.assoc, š’°.trans_map, d.target_comp, d.relationMap_inclusion_assoc] theorem existsUnique_transition {i j : š’°.Iā‚€} (f : i ⟶ j) : ∃! g : d.quotient i ⟶ d.quotient j, d.projection i ≫ g = š’°.trans f ≫ d.projection j ∧ IsOpenImmersion g ∧ IsPullback (d.projection i) (š’°.trans f) g (d.projection j) := by have : IsOpenImmersion (š’°.trans f) := š’°.property_trans f exact QuotientTransitionsOpen.Construction.QuotientTransitions.existsUnique_open_transition (d.projection j) (d.kernelPair j) (š’°.trans f) (d.relationMap f) (d.source i) (d.target i) (d.relationMap_isPullback f) (d.relationMap_target f) (d.projection i) (d.kernelPair i) /-- The canonical map between quotient charts. -/ noncomputable def transition {i j : š’°.Iā‚€} (f : i ⟶ j) : d.quotient i ⟶ d.quotient j := (d.existsUnique_transition f).choose theorem transition_properties {i j : š’°.Iā‚€} (f : i ⟶ j) : d.projection i ≫ d.transition f = š’°.trans f ≫ d.projection j ∧ IsOpenImmersion (d.transition f) ∧ IsPullback (d.projection i) (š’°.trans f) (d.transition f) (d.projection j) := (d.existsUnique_transition f).choose_spec.1 @[reassoc (attr := simp)] theorem transition_fac {i j : š’°.Iā‚€} (f : i ⟶ j) : d.projection i ≫ d.transition f = š’°.trans f ≫ d.projection j := (d.transition_properties f).1 instance {i j : š’°.Iā‚€} (f : i ⟶ j) : IsOpenImmersion (d.transition f) := (d.transition_properties f).2.1 /-- The quotient diagram; its identity and composition laws follow from epimorphic local quotient projections. -/ noncomputable def functor : š’°.Iā‚€ ℤ Scheme.{u} where obj := d.quotient map := d.transition map_id i := by apply (cancel_epi (d.projection i)).mp rw [d.transition_fac, š’°.trans_id, Category.id_comp, Category.comp_id] map_comp f g := by apply (cancel_epi (d.projection _)).mp rw [d.transition_fac, ← Category.assoc, d.transition_fac, Category.assoc, d.transition_fac, ← Category.assoc, ← š’°.trans_comp] /-- The local quotient projections form a natural transformation. -/ noncomputable def natTrans : š’°.functorOfLocallyDirected ⟶ d.functor where app := d.projection naturality _ _ f := (d.transition_fac f).symm theorem equifibered : d.natTrans.Equifibered := fun {_ _} f => (d.transition_properties f).2.2.flip instance {i j : š’°.Iā‚€} (f : i ⟶ j) : IsOpenImmersion (d.functor.map f) := inferInstanceAs (IsOpenImmersion (d.transition f)) include d in /-- Local quotient data alone suffice to build the global quotient. -/ theorem exists_quotient [Small.{u} š’°.Iā‚€] [Quiver.IsThin š’°.Iā‚€] : ∃ (Q : Scheme.{u}) (Ļ€ : X ⟶ Q), IsFinite Ļ€ ∧ Flat Ļ€ ∧ LocallyOfFinitePresentation Ļ€ ∧ Surjective Ļ€ ∧ IsKernelPair Ļ€ s t ∧ āˆ€ (T : Scheme.{u}) (f : X ⟶ T), s ≫ f = t ≫ f → ∃! g : Q ⟶ T, Ļ€ ≫ g = f := GlobalQuotientOf.Construction.GlobalQuotient.exists_of_cartesian_charts s t š’° d.functor d.natTrans d.equifibered d.finite d.flat d.finitelyPresented d.surjective d.relation d.inclusion d.source d.target d.source_isPullback d.target_comp d.kernelPair end Data end OAI.AlgebraicGeometry.Quotients.FiniteDescent.Chart.Construction.ChartQuotients