@@ -5,6 +5,7 @@ Authors: Bhavik Mehta
5
5
-/
6
6
import Mathlib.CategoryTheory.Sites.IsSheafFor
7
7
import Mathlib.CategoryTheory.Limits.Shapes.Types
8
+ import Mathlib.Tactic.ApplyFun
8
9
9
10
#align_import category_theory.sites.sheaf_of_types from "leanprover-community/mathlib" @"70fd9563a21e7b963887c9360bd29b2393e6225a"
10
11
@@ -185,7 +186,8 @@ namespace Presieve
185
186
186
187
variable [R.hasPullbacks]
187
188
188
- /-- The rightmost object of the fork diagram of https://stacks.math.columbia.edu/tag/00VM, which
189
+ /--
190
+ The rightmost object of the fork diagram of https://stacks.math.columbia.edu/tag/00VM, which
189
191
contains the data used to check a family of elements for a presieve is compatible.
190
192
-/
191
193
@[simp] def SecondObj : Type max v u :=
@@ -259,6 +261,104 @@ theorem sheaf_condition : R.IsSheafFor P ↔ Nonempty (IsLimit (Fork.ofι _ (w P
259
261
simp [forkMap]
260
262
#align category_theory.equalizer.presieve.sheaf_condition CategoryTheory.Equalizer.Presieve.sheaf_condition
261
263
264
+ namespace Arrows
265
+
266
+ open Presieve
267
+
268
+ variable {B : C} {I : Type } (X : I → C) (π : (i : I) → X i ⟶ B) [UnivLE.{w, max v u}]
269
+ [(ofArrows X π).hasPullbacks]
270
+ -- TODO: allow `I : Type w`
271
+
272
+ /--
273
+ The middle object of the fork diagram of <https://stacks.math.columbia.edu/tag/00VM>.
274
+ The difference between this and `Equalizer.FirstObj P (ofArrows X π)` arrises if the family of
275
+ arrows `π` contains duplicates. The `Presieve.ofArrows` doesn't see those.
276
+ -/
277
+ def FirstObj : Type max v u := ∏ (fun i ↦ P.obj (op (X i)))
278
+
279
+ @[ext]
280
+ lemma FirstObj.ext (z₁ z₂ : FirstObj P X) (h : ∀ i, (Pi.π _ i : FirstObj P X ⟶ _) z₁ =
281
+ (Pi.π _ i : FirstObj P X ⟶ _) z₂) : z₁ = z₂ := by
282
+ apply Limits.Types.limit_ext
283
+ rintro ⟨i⟩
284
+ exact h i
285
+
286
+ /--
287
+ The rightmost object of the fork diagram of https://stacks.math.columbia.edu/tag/00VM.
288
+ The difference between this and `Equalizer.Presieve.SecondObj P (ofArrows X π)` arrises if the
289
+ family of arrows `π` contains duplicates. The `Presieve.ofArrows` doesn't see those.
290
+ -/
291
+ def SecondObj : Type max v u :=
292
+ ∏ (fun (ij : I × I) ↦ P.obj (op (pullback (π ij.1 ) (π ij.2 ))))
293
+
294
+ @[ext]
295
+ lemma SecondObj.ext (z₁ z₂ : SecondObj P X π) (h : ∀ ij, (Pi.π _ ij : SecondObj P X π ⟶ _) z₁ =
296
+ (Pi.π _ ij : SecondObj P X π ⟶ _) z₂) : z₁ = z₂ := by
297
+ apply Limits.Types.limit_ext
298
+ rintro ⟨i⟩
299
+ exact h i
300
+
301
+ /--
302
+ The left morphism of the fork diagram.
303
+ -/
304
+ def forkMap : P.obj (op B) ⟶ FirstObj P X := Pi.lift (fun i ↦ P.map (π i).op)
305
+
306
+ /--
307
+ The first of the two parallel morphisms of the fork diagram, induced by the first projection in
308
+ each pullback.
309
+ -/
310
+ def firstMap : FirstObj P X ⟶ SecondObj P X π := Pi.lift fun _ => Pi.π _ _ ≫ P.map pullback.fst.op
311
+
312
+ /--
313
+ The second of the two parallel morphisms of the fork diagram, induced by the second projection in
314
+ each pullback.
315
+ -/
316
+ def secondMap : FirstObj P X ⟶ SecondObj P X π := Pi.lift fun _ => Pi.π _ _ ≫ P.map pullback.snd.op
317
+
318
+ theorem w : forkMap P X π ≫ firstMap P X π = forkMap P X π ≫ secondMap P X π := by
319
+ ext x ij
320
+ simp only [firstMap, secondMap, forkMap, types_comp_apply, Types.pi_lift_π_apply,
321
+ ← FunctorToTypes.map_comp_apply, ← op_comp, pullback.condition]
322
+
323
+ /--
324
+ The family of elements given by `x : FirstObj P S` is compatible iff `firstMap` and `secondMap`
325
+ map it to the same point.
326
+ -/
327
+ theorem compatible_iff (x : FirstObj P X) : (Arrows.Compatible P π ((Types.productIso _).hom x)) ↔
328
+ firstMap P X π x = secondMap P X π x := by
329
+ rw [Arrows.pullbackCompatible_iff]
330
+ constructor
331
+ · intro t
332
+ ext ij
333
+ simpa [firstMap, secondMap] using t ij.1 ij.2
334
+ · intro t i j
335
+ apply_fun Pi.π (fun (ij : I × I) ↦ P.obj (op (pullback (π ij.1 ) (π ij.2 )))) ⟨i, j⟩ at t
336
+ simpa [firstMap, secondMap] using t
337
+
338
+ /--
339
+ `P` is a sheaf for `Presieve.ofArrows X π`, iff the fork given by `w` is an equalizer.
340
+ See <https://stacks.math.columbia.edu/tag/00VM>.
341
+ -/
342
+ theorem sheaf_condition : (ofArrows X π).IsSheafFor P ↔
343
+ Nonempty (IsLimit (Fork.ofι (forkMap P X π) (w P X π))) := by
344
+ rw [Types.type_equalizer_iff_unique, isSheafFor_arrows_iff]
345
+ erw [← Equiv.forall_congr_left (Types.productIso _).toEquiv.symm]
346
+ simp_rw [← compatible_iff, ← Iso.toEquiv_fun, Equiv.apply_symm_apply]
347
+ apply ball_congr
348
+ intro x _
349
+ apply exists_unique_congr
350
+ intro t
351
+ erw [Equiv.eq_symm_apply]
352
+ constructor
353
+ · intro q
354
+ funext i
355
+ simpa [forkMap] using q i
356
+ · intro q i
357
+ rw [← q]
358
+ simp [forkMap]
359
+
360
+ end Arrows
361
+
262
362
end Presieve
263
363
264
364
end
0 commit comments