Skip to content

Commit 2b4c615

Browse files
committed
feat(AlgebraicGeometry): Scheme has disjoint coproducts (#34014)
From Proetale.
1 parent 1b968c6 commit 2b4c615

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

Mathlib/AlgebraicGeometry/Limits.lean

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ module
88
public import Mathlib.CategoryTheory.Limits.Shapes.Opposites.Products
99
public import Mathlib.AlgebraicGeometry.Pullbacks
1010
public import Mathlib.AlgebraicGeometry.AffineScheme
11+
public import Mathlib.CategoryTheory.Limits.MonoCoprod
12+
public import Mathlib.CategoryTheory.Limits.Shapes.DisjointCoproduct
13+
1114

1215
/-!
1316
# (Co)Limits of Schemes
@@ -120,6 +123,10 @@ noncomputable def isInitialOfIsEmpty {X : Scheme} [IsEmpty X] : IsInitial X :=
120123
noncomputable def specPunitIsInitial : IsInitial (Spec <| .of PUnit.{u + 1}) :=
121124
emptyIsInitial.ofIso (asIso <| emptyIsInitial.to _)
122125

126+
lemma isInitial_iff_isEmpty {X : Scheme.{u}} : Nonempty (IsInitial X) ↔ IsEmpty X :=
127+
fun ⟨h⟩ ↦ (h.uniqueUpToIso specPunitIsInitial).hom.homeomorph.isEmpty,
128+
fun _ ↦ ⟨isInitialOfIsEmpty⟩⟩
129+
123130
instance (priority := 100) isAffine_of_isEmpty {X : Scheme} [IsEmpty X] : IsAffine X :=
124131
.of_isIso (inv (emptyIsInitial.to X) ≫ emptyIsInitial.to (Spec <| .of PUnit))
125132

@@ -169,8 +176,8 @@ instance [Small.{u} σ] : PreservesColimitsOfShape (Discrete σ) Scheme.forgetTo
169176
instance [Small.{u} σ] : HasColimitsOfShape (Discrete σ) Scheme.{u} :=
170177
fun _ ↦ hasColimit_of_created _ Scheme.forgetToLocallyRingedSpace⟩
171178

172-
lemma sigmaι_eq_iff (i j : ι) (x y) :
173-
Sigma.ι f i x = Sigma.ι f j y ↔ (Sigma.mk i x : Σ i, f i) = Sigma.mk j y := by
179+
lemma sigmaι_eq_iff [Small.{u} σ] (i j : σ) (x y) :
180+
Sigma.ι g i x = Sigma.ι g j y ↔ (Sigma.mk i x : Σ i, g i) = Sigma.mk j y := by
174181
refine (Scheme.IsLocallyDirected.ι_eq_ι_iff _).trans ⟨?_, ?_⟩
175182
· rintro ⟨k, ⟨⟨⟨⟩⟩⟩, ⟨⟨⟨⟩⟩⟩, x, rfl, rfl⟩; simp
176183
· simp only [Discrete.functor_obj_eq_as, Sigma.mk.injEq]
@@ -179,14 +186,41 @@ lemma sigmaι_eq_iff (i j : ι) (x y) :
179186
exact ⟨⟨i⟩, 𝟙 _, 𝟙 _, x, by simp⟩
180187

181188
/-- The images of each component in the coproduct is disjoint. -/
182-
lemma disjoint_opensRange_sigmaι (i j : ι) (h : i ≠ j) :
183-
Disjoint (Sigma.ι f i).opensRange (Sigma.ι f j).opensRange := by
189+
lemma disjoint_opensRange_sigmaι [Small.{u} σ] (i j : σ) (h : i ≠ j) :
190+
Disjoint (Sigma.ι g i).opensRange (Sigma.ι g j).opensRange := by
184191
intro U hU hU' x hx
185192
obtain ⟨x, rfl⟩ := hU hx
186193
obtain ⟨y, hy⟩ := hU' hx
187194
obtain ⟨rfl⟩ := (sigmaι_eq_iff _ _ _ _ _).mp hy
188195
cases h rfl
189196

197+
variable {g} in
198+
lemma isEmpty_of_commSq_sigmaι_of_ne [Small.{u} σ] {i j : σ} {Z : Scheme.{u}} {a : Z ⟶ g i}
199+
{b : Z ⟶ g j} (h : CommSq a b (Sigma.ι g i) (Sigma.ι g j)) (hij : i ≠ j) :
200+
IsEmpty Z := by
201+
refine ⟨fun z ↦ ?_⟩
202+
fapply eq_bot_iff.mp <| disjoint_iff.mp <| disjoint_opensRange_sigmaι g i j hij
203+
· exact (a ≫ Sigma.ι g i).base z
204+
· exact ⟨⟨a.base z, rfl⟩, ⟨b.base z, by rw [← Scheme.Hom.comp_apply, h.w]⟩⟩
205+
206+
lemma isEmpty_pullback_sigmaι_of_ne [Small.{u} σ] {i j : σ} (hij : i ≠ j) :
207+
IsEmpty ↑(pullback (Sigma.ι g i) (Sigma.ι g j)) :=
208+
isEmpty_of_commSq_sigmaι_of_ne ⟨pullback.condition⟩ hij
209+
210+
noncomputable instance [Small.{u} σ] : CoproductsOfShapeDisjoint Scheme.{u} σ where
211+
coproductDisjoint g := by
212+
refine .of_hasCoproduct (fun _ ↦ pullback.cone _ _) (fun _ ↦ pullback.isLimit _ _) ?_
213+
intro i j hij
214+
apply Nonempty.some
215+
rw [isInitial_iff_isEmpty]
216+
exact isEmpty_pullback_sigmaι_of_ne _ hij
217+
218+
instance : HasFiniteCoproducts Scheme.{u} where
219+
out := inferInstance
220+
221+
instance : MonoCoprod Scheme.{u} :=
222+
.mk' fun X Y ↦ ⟨.mk coprod.inl coprod.inr, coprodIsCoprod X Y, inferInstanceAs <| Mono coprod.inl⟩
223+
190224
/-- The cover of `∐ X` by the `Xᵢ`. -/
191225
@[simps!]
192226
noncomputable def sigmaOpenCover [Small.{u} σ] : (∐ g).OpenCover :=

Mathlib/CategoryTheory/Limits/Shapes/DisjointCoproduct.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ lemma CoproductDisjoint.of_cofan {c : Cofan X} (hc : IsColimit c)
7575
rw [show d.inj i = c.inj i ≫ (hd.uniqueUpToIso hc).inv.hom by simp]
7676
infer_instance
7777

78+
lemma CoproductDisjoint.of_hasCoproduct [HasCoproduct X] [∀ i, Mono (Sigma.ι X i)]
79+
(s : ∀ {i j : ι} (_ : i ≠ j), PullbackCone (Sigma.ι X i) (Sigma.ι X j))
80+
(hs : ∀ {i j : ι} (hij : i ≠ j), IsLimit (s hij))
81+
(H : ∀ {i j : ι} (hij : i ≠ j), IsInitial (s hij).pt) :
82+
CoproductDisjoint X :=
83+
have (i : ι) : Mono ((Cofan.mk (∐ X) (Sigma.ι X)).inj i) := inferInstanceAs <| Mono (Sigma.ι X i)
84+
.of_cofan (coproductIsCoproduct X) s hs H
85+
7886
variable [CoproductDisjoint X]
7987

8088
lemma _root_.CategoryTheory.Mono.of_coproductDisjoint {c : Cofan X} (hc : IsColimit c) (i : ι) :

0 commit comments

Comments
 (0)