Skip to content

Commit b412ba7

Browse files
chrisflavyuanyi-350
authored andcommitted
feat(CategoryTheory/Sites/MorphismProperty): add induced coverage (leanprover-community#28778)
We add the (pre)coverage induced by a morphism property and show the induced topology is the same as the one induced by `MorphismProperty.pretopology`. This will be used in the upcoming refactor of `Scheme.Cover`, which will be built upon `Precoverage.ZeroHypercover`.
1 parent 434155e commit b412ba7

File tree

4 files changed

+125
-26
lines changed

4 files changed

+125
-26
lines changed

Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ lemma jointlySurjectiveTopology_eq_toGrothendieck_jointlySurjectivePretopology
102102
lemma pretopology_le_inf [IsJointlySurjectivePreserving ⊤] :
103103
pretopology P ≤ jointlySurjectivePretopology ⊓ P.pretopology := by
104104
rintro X S ⟨𝒰, rfl⟩
105-
refine ⟨fun x ↦ ?_, fun ⟨i⟩ ↦ 𝒰.map_prop i⟩
105+
refine ⟨fun x ↦ ?_, fun _ _ ⟨i⟩ ↦ 𝒰.map_prop i⟩
106106
obtain ⟨a, ha⟩ := 𝒰.covers x
107107
refine ⟨𝒰.obj (𝒰.f x), a, 𝒰.map (𝒰.f x), ⟨_⟩, ha⟩
108108

Mathlib/CategoryTheory/MorphismProperty/Limits.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,17 @@ lemma universally_mk' (P : MorphismProperty C) [P.RespectsIso] {X Y : C} (g : X
843843

844844
end Universally
845845

846+
variable (P : MorphismProperty C)
847+
848+
/-- `P` has pullbacks if for every `f` satisfying `P`, pullbacks of arbitrary morphisms along `f`
849+
exist. -/
850+
protected class HasPullbacks : Prop where
851+
hasPullback {X Y S : C} {f : X ⟶ S} (g : Y ⟶ S) : P f → HasPullback f g := by infer_instance
852+
853+
instance [HasPullbacks C] : P.HasPullbacks where
854+
855+
alias hasPullback := HasPullbacks.hasPullback
856+
846857
end MorphismProperty
847858

848859
end CategoryTheory

Mathlib/CategoryTheory/Sites/Coverage.lean

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ def toGrothendieck (K : Coverage C) : GrothendieckTopology C where
248248
exact hS hg
249249
transitive' _ _ hS _ hR := .transitive _ _ _ hS hR
250250

251+
lemma mem_toGrothendieck {K : Coverage C} {X : C} {S : Sieve X} :
252+
S ∈ K.toGrothendieck C X ↔ Saturate K X S := .rfl
253+
251254
instance : PartialOrder (Coverage C) where
252255
le A B := A.coverings ≤ B.coverings
253256
le_refl _ _ := le_refl _
@@ -329,6 +332,28 @@ def Pretopology.toCoverage [HasPullbacks C] (J : Pretopology C) : Coverage C whe
329332
coverings := J
330333
pullback _ _ f R hR := ⟨R.pullbackArrows f, J.pullbacks _ _ hR, .pullbackArrows f R⟩
331334

335+
@[simp]
336+
lemma Pretopology.mem_toCoverage [HasPullbacks C] (J : Pretopology C) {X : C} (S : Presieve X) :
337+
S ∈ J.toCoverage X ↔ S ∈ J X := .rfl
338+
339+
lemma Pretopology.toGrothendieck_toCoverage [HasPullbacks C] (J : Pretopology C) :
340+
J.toCoverage.toGrothendieck = J.toGrothendieck := by
341+
ext T S
342+
rw [mem_toGrothendieck, Coverage.mem_toGrothendieck]
343+
refine ⟨fun h ↦ ?_, fun ⟨R, hR, hle⟩ ↦ ?_⟩
344+
· induction h with
345+
| of X S hS => use S, hS, Sieve.le_generate S
346+
| top X => use Presieve.singleton (𝟙 X), J.has_isos (𝟙 X), le_top
347+
| transitive X R S hR hRS hle hfS =>
348+
obtain ⟨R', hR', hle⟩ := hle
349+
choose S' hS' hS'le using hfS
350+
refine ⟨Presieve.bind R' (fun Y f hf ↦ S' (hle _ hf)), ?_, fun Z u hu ↦ ?_⟩
351+
· exact J.transitive R' (fun Y f hf ↦ S' (hle Y hf)) hR' fun Y f H ↦ hS' (hle Y H)
352+
· obtain ⟨W, g, w, hw, hg, rfl⟩ := hu
353+
exact hS'le _ _ hg
354+
· refine Coverage.saturate_of_superset _ ?_ (.of _ _ hR)
355+
rwa [Sieve.generate_le_iff]
356+
332357
open Coverage
333358

334359
namespace Presieve

Mathlib/CategoryTheory/Sites/MorphismProperty.lean

Lines changed: 88 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Christian Merten
55
-/
66
import Mathlib.CategoryTheory.MorphismProperty.Limits
77
import Mathlib.CategoryTheory.Sites.Pretopology
8+
import Mathlib.CategoryTheory.Sites.Coverage
89

910
/-!
1011
# The site induced by a morphism property
@@ -22,44 +23,106 @@ namespace CategoryTheory
2223

2324
open Limits
2425

25-
variable {C : Type*} [Category C] [HasPullbacks C]
26+
variable {C : Type*} [Category C]
2627

2728
namespace MorphismProperty
2829

30+
variable {P Q : MorphismProperty C}
31+
32+
/-- This is the precoverage on `C` where covering presieves are those where every
33+
morphism satisfies `P`. -/
34+
def precoverage (P : MorphismProperty C) : Precoverage C where
35+
coverings X S := ∀ ⦃Y : C⦄ ⦃f : Y ⟶ X⦄, S f → P f
36+
37+
@[simp]
38+
lemma ofArrows_mem_precoverage {X : C} {ι : Type*} {Y : ι → C} {f : ∀ i, Y i ⟶ X} :
39+
.ofArrows Y f ∈ precoverage P X ↔ ∀ i, P (f i) :=
40+
fun h i ↦ h ⟨i⟩, fun h _ g ⟨i⟩ ↦ h i⟩
41+
42+
instance [P.ContainsIdentities] [P.RespectsIso] : P.precoverage.HasIsos where
43+
mem_coverings_of_isIso f _ _ _ := fun ⟨⟩ ↦ P.of_isIso f
44+
45+
instance [P.IsStableUnderBaseChange] : P.precoverage.IsStableUnderBaseChange where
46+
mem_coverings_of_isPullback {ι} S X f hf T g W p₁ p₂ h Z g hg := by
47+
obtain ⟨i⟩ := hg
48+
exact P.of_isPullback (h i).flip (hf ⟨i⟩)
49+
50+
instance [P.IsStableUnderComposition] : P.precoverage.IsStableUnderComposition where
51+
comp_mem_coverings {ι} S X f hf σ Y g hg Z p := by
52+
intro ⟨i⟩
53+
exact P.comp_mem _ _ (hg _ ⟨i.2⟩) (hf ⟨i.1⟩)
54+
55+
lemma precoverage_monotone (hPQ : P ≤ Q) : precoverage P ≤ precoverage Q :=
56+
fun _ _ hR _ _ hg ↦ hPQ _ (hR hg)
57+
58+
variable (P Q) in
59+
lemma precoverage_inf : precoverage (P ⊓ Q) = precoverage P ⊓ precoverage Q := by
60+
ext X R
61+
exact ⟨fun hS ↦ ⟨fun _ _ hf ↦ (hS hf).left, fun _ _ hf ↦ (hS hf).right⟩,
62+
fun h ↦ fun _ _ hf ↦ ⟨h.left hf, h.right hf⟩⟩
63+
64+
/-- If `P` is stable under base change, this is the coverage on `C` where covering presieves
65+
are those where every morphism satisfies `P`. -/
66+
@[simps toPrecoverage]
67+
def coverage (P : MorphismProperty C) [P.IsStableUnderBaseChange] [P.HasPullbacks] :
68+
Coverage C where
69+
__ := precoverage P
70+
pullback X Y f S hS := by
71+
have : S.HasPullbacks f := ⟨fun {W} h hh ↦ P.hasPullback _ (hS hh)⟩
72+
refine ⟨S.pullbackArrows f, ?_, .pullbackArrows f S⟩
73+
intro Z g ⟨W, a, h⟩
74+
have := S.hasPullback f h
75+
exact P.pullback_snd _ _ (hS h)
76+
77+
/-- If `P` is stable under base change, it induces a Grothendieck topology: the one associated
78+
to `coverage P`. -/
79+
abbrev grothendieckTopology (P : MorphismProperty C) [P.IsStableUnderBaseChange] [P.HasPullbacks] :
80+
GrothendieckTopology C :=
81+
P.coverage.toGrothendieck
82+
83+
section HasPullbacks
84+
85+
variable [P.IsStableUnderBaseChange] [HasPullbacks C]
86+
2987
/-- If `P` is a multiplicative morphism property which is stable under base change on a category
3088
`C` with pullbacks, then `P` induces a pretopology, where coverings are given by presieves whose
3189
elements satisfy `P`. -/
90+
@[simps! toPrecoverage]
3291
def pretopology (P : MorphismProperty C) [P.IsMultiplicative] [P.IsStableUnderBaseChange] :
33-
Pretopology C where
34-
coverings X S := ∀ {Y : C} {f : Y ⟶ X}, S f → P f
35-
has_isos X Y f h Z g hg := by
36-
cases hg
37-
exact P.of_isIso f
38-
pullbacks X Y f S hS Z g hg := by
39-
obtain ⟨Z, g, hg⟩ := hg
40-
apply P.pullback_snd g f (hS hg)
41-
transitive X S Ti hS hTi Y f hf := by
42-
obtain ⟨Z, g, h, H, H', rfl⟩ := hf
43-
exact comp_mem _ _ _ (hTi h H H') (hS H)
44-
45-
/-- To a morphism property `P` satisfying the conditions of `MorphismProperty.pretopology`, we
46-
associate the Grothendieck topology generated by `P.pretopology`. -/
47-
abbrev grothendieckTopology (P : MorphismProperty C) [P.IsMultiplicative]
48-
[P.IsStableUnderBaseChange] : GrothendieckTopology C :=
49-
P.pretopology.toGrothendieck
92+
Pretopology C :=
93+
(precoverage P).toPretopology
94+
95+
/-- If `P` is also multiplicative, the coverage induced by `P` is the pretopology induced by `P`. -/
96+
lemma coverage_eq_toCoverage_pretopology [P.IsMultiplicative] :
97+
P.coverage = P.pretopology.toCoverage := rfl
98+
99+
/-- If `P` is also multiplicative, the topology induced by `P` is the topology induced by the
100+
pretopology induced by `P`. -/
101+
lemma grothendieckTopology_eq_toGrothendieck_pretopology [P.IsMultiplicative] :
102+
P.grothendieckTopology = P.pretopology.toGrothendieck := by
103+
rw [grothendieckTopology, coverage_eq_toCoverage_pretopology,
104+
Pretopology.toGrothendieck_toCoverage]
105+
106+
section
50107

51108
variable {P Q : MorphismProperty C}
52109
[P.IsMultiplicative] [P.IsStableUnderBaseChange]
53110
[Q.IsMultiplicative] [Q.IsStableUnderBaseChange]
54111

55-
lemma pretopology_le (hPQ : P ≤ Q) : P.pretopology ≤ Q.pretopology :=
56-
fun _ _ hS _ f hf ↦ hPQ f (hS hf)
112+
lemma pretopology_monotone (hPQ : P ≤ Q) : P.pretopology ≤ Q.pretopology :=
113+
precoverage_monotone hPQ
114+
115+
@[deprecated (since := "2025-08-28")]
116+
alias pretopology_le := pretopology_monotone
57117

58118
variable (P Q) in
59-
lemma pretopology_inf :
60-
(P ⊓ Q).pretopology = P.pretopology ⊓ Q.pretopology := by
61-
ext X S
62-
exact ⟨fun hS ↦ ⟨fun hf ↦ (hS hf).left, fun hf ↦ (hS hf).right⟩,
63-
fun h ↦ fun hf ↦ ⟨h.left hf, h.right hf⟩⟩
119+
lemma pretopology_inf : (P ⊓ Q).pretopology = P.pretopology ⊓ Q.pretopology := by
120+
ext : 1
121+
simp only [pretopology_toPrecoverage, precoverage_inf]
122+
rfl
123+
124+
end
125+
126+
end HasPullbacks
64127

65128
end CategoryTheory.MorphismProperty

0 commit comments

Comments
 (0)