Skip to content

Commit 177e455

Browse files
committed
feat(CategoryTheory/Sites): the maximal 1-hypercover containing a 0-hypercover (leanprover-community#35904)
1 parent 24248ce commit 177e455

File tree

2 files changed

+139
-0
lines changed

2 files changed

+139
-0
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,6 +3170,7 @@ public import Mathlib.CategoryTheory.Sites.Grothendieck
31703170
public import Mathlib.CategoryTheory.Sites.Hypercover.Homotopy
31713171
public import Mathlib.CategoryTheory.Sites.Hypercover.IsSheaf
31723172
public import Mathlib.CategoryTheory.Sites.Hypercover.One
3173+
public import Mathlib.CategoryTheory.Sites.Hypercover.Saturate
31733174
public import Mathlib.CategoryTheory.Sites.Hypercover.SheafOfTypes
31743175
public import Mathlib.CategoryTheory.Sites.Hypercover.Subcanonical
31753176
public import Mathlib.CategoryTheory.Sites.Hypercover.Zero
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/-
2+
Copyright (c) 2025 Christian Merten. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Christian Merten
5+
-/
6+
module
7+
8+
public import Mathlib.CategoryTheory.Sites.Hypercover.Homotopy
9+
public import Mathlib.CategoryTheory.Sites.Hypercover.SheafOfTypes
10+
public import Mathlib.CategoryTheory.Limits.Shapes.Diagonal
11+
12+
/-!
13+
# Saturation of a `0`-hypercover
14+
15+
Given a `0`-hypercover `E`, we define a `1`-hypercover `E.saturate`
16+
-/
17+
18+
@[expose] public section
19+
20+
namespace CategoryTheory.PreZeroHypercover
21+
22+
variable {C : Type*} [Category* C] {A : Type*} [Category* A]
23+
24+
open Limits
25+
26+
/-- A relation on a pre-`0`-hypercover is a commutative diagram
27+
```
28+
obj ----> E.X i
29+
| |
30+
| |
31+
v v
32+
E.X j ---> S
33+
```
34+
-/
35+
structure Relation {S : C} (E : PreZeroHypercover S) (i j : E.I₀) where
36+
/-- The object. -/
37+
obj : C
38+
/-- The first projection. -/
39+
fst : obj ⟶ E.X i
40+
/-- The second projection. -/
41+
snd : obj ⟶ E.X j
42+
w : fst ≫ E.f i = snd ≫ E.f j
43+
44+
/-- The maximal pre-`1`-hypercover containing `E`, where the `1`-components are all relations
45+
on `E`. -/
46+
@[simps toPreZeroHypercover I₁ Y p₁ p₂]
47+
def saturate {S : C} (E : PreZeroHypercover S) : PreOneHypercover S where
48+
__ := E
49+
I₁ := E.Relation
50+
Y _ _ r := r.obj
51+
p₁ _ _ r := r.fst
52+
p₂ _ _ r := r.snd
53+
w _ _ r := r.w
54+
55+
/-- For a presheaf of types, sections over the multifork associated to `E.saturate` are equivalent
56+
to compatible families. -/
57+
@[simps]
58+
def sectionsSaturateEquiv {S : C} (E : PreZeroHypercover S) (F : Cᵒᵖ ⥤ Type*) :
59+
(E.saturate.multicospanIndex F).sections ≃ Subtype (Presieve.Arrows.Compatible F E.f) where
60+
toFun s := ⟨s.val, fun i j _ _ _ hgij ↦ s.property ⟨(i, j), ⟨_, _, _, hgij⟩⟩⟩
61+
invFun s := ⟨s.val, fun r ↦ s.property _ _ _ _ _ r.snd.w⟩
62+
left_inv _ := rfl
63+
right_inv _ := rfl
64+
65+
lemma isLimit_saturate_type_iff {S : C} (E : PreZeroHypercover S) (F : Cᵒᵖ ⥤ Type*) :
66+
Nonempty (IsLimit <| E.saturate.multifork F) ↔ E.presieve₀.IsSheafFor F := by
67+
rw [Multifork.isLimit_types_iff, Presieve.isSheafFor_ofArrows_iff_bijective_toCompabible,
68+
← Function.Bijective.of_comp_iff' (E.sectionsSaturateEquiv F).symm.bijective]
69+
rfl
70+
71+
/-- If `E` has pairwise pullbacks, this is the canonical map from the minimal `1`-hypercover
72+
to the saturation. -/
73+
@[simps]
74+
noncomputable
75+
def toSaturateOfHasPullbacks {S : C} (E : PreZeroHypercover S) [E.HasPullbacks] :
76+
E.toPreOneHypercover ⟶ E.saturate where
77+
s₀ i := i
78+
h₀ i := 𝟙 _
79+
s₁ {i j} k := ⟨pullback (E.f i) (E.f j), _, _, pullback.condition⟩
80+
h₁ {i j} k := 𝟙 _
81+
82+
set_option backward.isDefEq.respectTransparency false in
83+
/-- If `E` has pairwise pullbacks, this is the canonical map to the minimal `1`-hypercover
84+
from the saturation. -/
85+
@[simps]
86+
noncomputable
87+
def fromSaturateOfHasPullbacks {S : C} (E : PreZeroHypercover S)
88+
[E.HasPullbacks] : E.saturate ⟶ E.toPreOneHypercover where
89+
s₀ i := i
90+
h₀ i := 𝟙 _
91+
s₁ {i j} k := ⟨⟩
92+
h₁ {i j} k := pullback.lift k.fst k.snd k.w
93+
94+
variable {S : C} (E : PreZeroHypercover S) [E.HasPullbacks]
95+
96+
/-- The identity of the minimal pre-`1`-hypercover when `E` has pairwise pullbacks
97+
is homotopic to itself. -/
98+
noncomputable
99+
def toPreOneHypercoverHomotopy {S : C} (E : PreZeroHypercover S)
100+
[E.HasPullbacks] :
101+
PreOneHypercover.Homotopy (.id E.toPreOneHypercover) (.id E.toPreOneHypercover) where
102+
H _ := ⟨⟩
103+
a i := pullback.diagonal (E.f i)
104+
wl := by simp
105+
wr := by simp
106+
107+
variable {S : C} (E : PreZeroHypercover S) [E.HasPullbacks]
108+
109+
@[simp]
110+
lemma toSaturateOfHasPullbacks_fromSaturateOfHasPullbacks :
111+
E.toSaturateOfHasPullbacks.comp E.fromSaturateOfHasPullbacks = .id _ := by
112+
refine PreOneHypercover.Hom.ext' rfl (by simp) (by simp) (by simp)
113+
114+
set_option backward.isDefEq.respectTransparency false in
115+
/-- The composition `E.saturate ⟶ E.toPreOneHypercover ⟶ E.saturate` is homotopic to the
116+
identity. -/
117+
noncomputable
118+
def fromSaturateToSaturateHomotopy : PreOneHypercover.Homotopy
119+
(E.fromSaturateOfHasPullbacks.comp E.toSaturateOfHasPullbacks) (.id _) where
120+
H i := ⟨pullback (E.f i) (E.f i), pullback.fst _ _, pullback.snd _ _, pullback.condition⟩
121+
a i := pullback.diagonal (E.f i)
122+
wl i := by simp
123+
wr i := by simp
124+
125+
/-- If the pre-`0`-hypercover `E` has pairwise pullbacks, then the multifork associated to the
126+
full saturated pre-`1`-hypercover is exact if and only if the minimal one given by taking
127+
the pairwise pullbacks is exact. -/
128+
noncomputable
129+
def isLimitSaturateEquivOfHasPullbacks {S : C} (E : PreZeroHypercover S)
130+
[E.HasPullbacks] (F : Cᵒᵖ ⥤ A) :
131+
IsLimit (E.saturate.multifork F) ≃ IsLimit (E.toPreOneHypercover.multifork F) :=
132+
PreOneHypercover.Homotopy.isLimitMultiforkEquiv E.fromSaturateOfHasPullbacks
133+
E.toSaturateOfHasPullbacks E.fromSaturateToSaturateHomotopy
134+
(by
135+
rw [toSaturateOfHasPullbacks_fromSaturateOfHasPullbacks]
136+
exact E.toPreOneHypercoverHomotopy)
137+
138+
end CategoryTheory.PreZeroHypercover

0 commit comments

Comments
 (0)