Skip to content

Commit 3117eec

Browse files
committed
feat(CategoryTheory/Sites): the equalizer sheaf condition for a singleton (leanprover-community#25839)
Co-authored-by: Christian Merten <136261474+chrisflav@users.noreply.github.com>
1 parent 44a1bd5 commit 3117eec

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,32 @@ theorem sheaf_condition : (Presieve.ofArrows X π).IsSheafFor P ↔
367367

368368
end Arrows
369369

370+
/-- The sheaf condition for a single morphism is the same as the canonical fork diagram being
371+
limiting. -/
372+
lemma isSheafFor_singleton_iff {F : Cᵒᵖ ⥤ Type*} {X Y : C} {f : X ⟶ Y}
373+
(c : PullbackCone f f) (hc : IsLimit c) :
374+
Presieve.IsSheafFor F (.singleton f) ↔
375+
Nonempty
376+
(IsLimit (Fork.ofι (F.map f.op) (f := F.map c.fst.op) (g := F.map c.snd.op)
377+
(by simp [← Functor.map_comp, ← op_comp, c.condition]))) := by
378+
have h (x : F.obj (op X)) : (∀ {Z : C} (p₁ p₂ : Z ⟶ X),
379+
p₁ ≫ f = p₂ ≫ f → F.map p₁.op x = F.map p₂.op x) ↔ F.map c.fst.op x = F.map c.snd.op x := by
380+
refine ⟨fun H ↦ H _ _ c.condition, fun H Z p₁ p₂ h ↦ ?_⟩
381+
rw [← PullbackCone.IsLimit.lift_fst hc _ _ h, op_comp, FunctorToTypes.map_comp_apply, H]
382+
simp [← FunctorToTypes.map_comp_apply, ← op_comp]
383+
rw [Types.type_equalizer_iff_unique, Presieve.isSheafFor_singleton]
384+
simp_rw [h]
385+
386+
/-- Special case of `isSheafFor_singleton_iff` with `c = pullback.cone f f`. -/
387+
lemma isSheafFor_singleton_iff_of_hasPullback {F : Cᵒᵖ ⥤ Type*} {X Y : C} {f : X ⟶ Y}
388+
[HasPullback f f] :
389+
Presieve.IsSheafFor F (.singleton f) ↔
390+
Nonempty
391+
(IsLimit (Fork.ofι (F.map f.op) (f := F.map (pullback.fst f f).op)
392+
(g := F.map (pullback.snd f f).op)
393+
(by simp [← Functor.map_comp, ← op_comp, pullback.condition]))) :=
394+
isSheafFor_singleton_iff (pullback.cone f f) (pullback.isLimit f f)
395+
370396
end Presieve
371397

372398
end

Mathlib/CategoryTheory/Sites/IsSheafFor.lean

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ def FamilyOfElements (P : Cᵒᵖ ⥤ Type w) (R : Presieve X) :=
9393
instance : Inhabited (FamilyOfElements P (⊥ : Presieve X)) :=
9494
fun _ _ => False.elim⟩
9595

96+
@[ext]
97+
lemma FamilyOfElements.ext {R : Presieve X} {x y : R.FamilyOfElements P}
98+
(H : ∀ {Y : C} (f : Y ⟶ X) (hf : R f), x f hf = y f hf) :
99+
x = y := by
100+
funext Z f hf
101+
exact H f hf
102+
96103
/-- A family of elements for a presheaf on the presieve `R₂` can be restricted to a smaller presieve
97104
`R₁`.
98105
-/
@@ -113,6 +120,21 @@ lemma FamilyOfElements.restrict_map
113120
(p : FamilyOfElements P R) (φ : P ⟶ Q) {R' : Presieve X} (h : R' ≤ R) :
114121
(p.restrict h).map φ = (p.map φ).restrict h := rfl
115122

123+
variable (P) in
124+
/-- A family of elements on `{ f : X ⟶ Y }` is an element of `F(X)`. -/
125+
@[simps apply, simps -isSimp symm_apply]
126+
def FamilyOfElements.singletonEquiv {X Y : C} (f : X ⟶ Y) :
127+
(singleton f).FamilyOfElements P ≃ P.obj (op X) where
128+
toFun x := x f (by simp)
129+
invFun x Z g hg := P.map (eqToHom <| by cases hg; rfl).op x
130+
left_inv x := by ext _ _ ⟨rfl⟩; simp
131+
right_inv x := by simp
132+
133+
@[simp]
134+
lemma FamilyOfElements.singletonEquiv_symm_apply_self {X Y : C} (f : X ⟶ Y) (x : P.obj (op X)) :
135+
(singletonEquiv P f).symm x f ⟨⟩ = x := by
136+
simp [singletonEquiv_symm_apply]
137+
116138
/-- A family of elements for the arrow set `R` is *compatible* if for any `f₁ : Y₁ ⟶ X` and
117139
`f₂ : Y₂ ⟶ X` in `R`, and any `g₁ : Z ⟶ Y₁` and `g₂ : Z ⟶ Y₂`, if the square `g₁ ≫ f₁ = g₂ ≫ f₂`
118140
commutes then the elements of `P Z` obtained by restricting the element of `P Y₁` along `g₁` and
@@ -267,6 +289,14 @@ theorem FamilyOfElements.comp_of_compatible (S : Sieve X) {x : FamilyOfElements
267289
x (g ≫ f) (S.downward_closed hf g) = P.map g.op (x f hf) := by
268290
simpa using t (𝟙 _) g (S.downward_closed hf g) hf (id_comp _)
269291

292+
lemma FamilyOfElements.compatible_singleton_iff
293+
{X Y : C} (f : X ⟶ Y) (x : (singleton f).FamilyOfElements P) :
294+
x.Compatible ↔ ∀ {Z : C} (p₁ p₂ : Z ⟶ X), p₁ ≫ f = p₂ ≫ f →
295+
P.map p₁.op (x f ⟨⟩) = P.map p₂.op (x f ⟨⟩) := by
296+
refine ⟨fun H Z p₁ p₂ h ↦ H _ _ _ _ h, fun H Y₁ Y₂ Z g₁ g₂ f₁ f₂ ↦ ?_⟩
297+
rintro ⟨rfl⟩ ⟨rfl⟩ h
298+
exact H _ _ h
299+
270300
section FunctorPullback
271301

272302
variable {D : Type u₂} [Category.{v₂} D] (F : D ⥤ C) {Z : D}
@@ -372,6 +402,14 @@ theorem isAmalgamation_sieveExtend {R : Presieve X} (x : FamilyOfElements P R) (
372402
dsimp [FamilyOfElements.sieveExtend]
373403
rw [← ht _, ← FunctorToTypes.map_comp_apply, ← op_comp, hf.choose_spec.choose_spec.choose_spec.2]
374404

405+
@[simp]
406+
lemma FamilyOfElements.isAmalgamation_singleton_iff {X Y : C} (f : X ⟶ Y)
407+
(x : (singleton f).FamilyOfElements P) (y : P.obj (op Y)) :
408+
x.IsAmalgamation y ↔ P.map f.op y = x f ⟨⟩ := by
409+
refine ⟨fun H ↦ H _ _, ?_⟩
410+
rintro H Y g ⟨rfl⟩
411+
exact H
412+
375413
/-- A presheaf is separated for a presieve if there is at most one amalgamation. -/
376414
def IsSeparatedFor (P : Cᵒᵖ ⥤ Type w) (R : Presieve X) : Prop :=
377415
∀ (x : FamilyOfElements P R) (t₁ t₂), x.IsAmalgamation t₁ → x.IsAmalgamation t₂ → t₁ = t₂
@@ -757,6 +795,24 @@ theorem isSheafFor_arrows_iff_pullbacks : (ofArrows X π).IsSheafFor P ↔
757795

758796
end Arrows
759797

798+
@[simp]
799+
lemma isSeparatedFor_singleton {X Y : C} {f : X ⟶ Y} :
800+
Presieve.IsSeparatedFor P (.singleton f) ↔
801+
Function.Injective (P.map f.op) := by
802+
rw [IsSeparatedFor, Equiv.forall_congr_left (Presieve.FamilyOfElements.singletonEquiv P f)]
803+
simp_rw [FamilyOfElements.isAmalgamation_singleton_iff,
804+
FamilyOfElements.singletonEquiv_symm_apply_self, Function.Injective]
805+
aesop
806+
807+
lemma isSheafFor_singleton {X Y : C} {f : X ⟶ Y} :
808+
Presieve.IsSheafFor P (.singleton f) ↔
809+
∀ (x : P.obj (op X)),
810+
(∀ {Z : C} (p₁ p₂ : Z ⟶ X), p₁ ≫ f = p₂ ≫ f → P.map p₁.op x = P.map p₂.op x) →
811+
∃! y, P.map f.op y = x := by
812+
rw [IsSheafFor, Equiv.forall_congr_left (Presieve.FamilyOfElements.singletonEquiv P f)]
813+
simp_rw [FamilyOfElements.compatible_singleton_iff,
814+
FamilyOfElements.isAmalgamation_singleton_iff, FamilyOfElements.singletonEquiv_symm_apply_self]
815+
760816
end Presieve
761817

762818
end CategoryTheory

0 commit comments

Comments
 (0)