@@ -295,6 +295,82 @@ lemma bindOfArrows_ofArrows {ι : Type*} {S : C} {X : ι → C} (f : (i : ι)
295295 rintro W u ⟨i, v, ⟨j⟩⟩
296296 exact ⟨Sigma.mk i j⟩
297297
298+ /-- Compose a presieve on the right with a morphism. -/
299+ def pushforward {X Y : C} (f : X ⟶ Y) (R : Presieve X) : Presieve Y :=
300+ fun Z fg ↦ ∃ (g : Z ⟶ X), g ≫ f = fg ∧ R g
301+
302+ @ [grind .]
303+ lemma pushforward_apply_comp {X Y Z : C} {f : X ⟶ Y} {R : Presieve X} {g : Z ⟶ X} (hg : R g) :
304+ R.pushforward f (g ≫ f) :=
305+ ⟨g, rfl, hg⟩
306+
307+ lemma pushforward_ofArrows {ι : Type *} {U : ι → C} {X Y : C} (g : ∀ i, U i ⟶ X)
308+ (f : X ⟶ Y) : (ofArrows _ g).pushforward f = ofArrows _ (g · ≫ f) := by
309+ refine le_antisymm ?_ ?_
310+ · rintro _ _ ⟨u, rfl, ⟨i⟩⟩
311+ exact ⟨i⟩
312+ · rw [ofArrows_le_iff]
313+ intro i
314+ use g i, rfl
315+ exact ⟨i⟩
316+
317+ lemma pushforward_singleton {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) :
318+ (singleton f).pushforward g = .singleton (f ≫ g) := by
319+ rw [← ofArrows_pUnit.{_, _, 0 }, pushforward_ofArrows, ofArrows_pUnit.{_, _, 0 }]
320+
321+ /-- The pullback of a presieve `R` on `Y` along a morphism `f : X ⟶ Y` is the presieve on `X`
322+ given by all morphisms `g : Z ⟶ X` such that `f ≫ g` is in `R`. -/
323+ def pullback {X Y : C} (f : X ⟶ Y) (R : Presieve Y) : Presieve X :=
324+ fun _ g ↦ R (g ≫ f)
325+
326+ variable {f} in
327+ @ [simp, grind =]
328+ lemma pullback_iff {R : Presieve X} {Z : C} {g : Z ⟶ Y} :
329+ R.pullback f g ↔ R (g ≫ f) :=
330+ .rfl
331+
332+ lemma pushforward_le_iff_le_pullback (R : Presieve Y) (T : Presieve X) :
333+ R.pushforward f ≤ T ↔ R ≤ T.pullback f := by
334+ refine ⟨fun hle Z g hg ↦ hle _ _ (pushforward_apply_comp hg), ?_⟩
335+ rintro hle Z - ⟨g, rfl, hg⟩
336+ exact hle _ _ hg
337+
338+ lemma galoisConnection_pushforward_pullback :
339+ GaloisConnection (pushforward f) (pullback f) :=
340+ pushforward_le_iff_le_pullback f
341+
342+ lemma monotone_pushforward : Monotone (pushforward f) :=
343+ (galoisConnection_pushforward_pullback f).monotone_l
344+
345+ lemma monotone_pullback : Monotone (pullback f) :=
346+ (galoisConnection_pushforward_pullback f).monotone_u
347+
348+ lemma pushforward_pullback_le (R : Presieve X) : (R.pullback f).pushforward f ≤ R :=
349+ (galoisConnection_pushforward_pullback f).l_u_le _
350+
351+ lemma le_pullback_pushforward (R : Presieve Y) : R ≤ (R.pushforward f).pullback f :=
352+ (galoisConnection_pushforward_pullback f).le_u_l _
353+
354+ @[simp]
355+ lemma pullback_id (R : Presieve X) : R.pullback (𝟙 X) = R := by
356+ funext
357+ simp
358+
359+ lemma pullback_comp (R : Presieve Z) (g : X ⟶ Z) :
360+ R.pullback (f ≫ g) = (R.pullback g).pullback f := by
361+ funext
362+ simp
363+
364+ @[simp]
365+ lemma pushforward_id (R : Presieve X) : R.pushforward (𝟙 X) = R := by
366+ funext
367+ simp [pushforward]
368+
369+ lemma pushforward_comp (R : Presieve Y) (g : X ⟶ Z) :
370+ R.pushforward (f ≫ g) = (R.pushforward f).pushforward g := by
371+ funext
372+ simp [pushforward]
373+
298374/-- Given a presieve on `F(X)`, we can define a presieve on `X` by taking the preimage via `F`. -/
299375def functorPullback (R : Presieve (F.obj X)) : Presieve X := fun _ f => R (F.map f)
300376
@@ -462,7 +538,8 @@ def uncurry : Set (Σ Y, Y ⟶ X) :=
462538 obtain ⟨rfl, h⟩ := h; subst h; constructor
463539
464540@[simp] theorem uncurry_pullbackArrows [HasPullbacks C] {B : C} (b : B ⟶ X) :
465- (pullbackArrows b s).uncurry = (fun f ↦ ⟨pullback f.2 b, pullback.snd _ _⟩) '' s.uncurry := by
541+ (pullbackArrows b s).uncurry =
542+ (fun f ↦ ⟨Limits.pullback f.2 b, pullback.snd _ _⟩) '' s.uncurry := by
466543 ext ⟨Z, v⟩; constructor
467544 · rintro ⟨Y, u, hu⟩; exact ⟨⟨Y, u⟩, hu, rfl⟩
468545 · rintro ⟨⟨Y, u⟩, hu, h⟩
@@ -956,6 +1033,19 @@ theorem pullbackArrows_comm {X Y : C} (f : Y ⟶ X) (R : Presieve X) [R.HasPullb
9561033 have := R.hasPullback f hk
9571034 exact ⟨_, _, _, Presieve.pullbackArrows.mk _ _ hk, pullback.lift_snd _ _ comm⟩
9581035
1036+ lemma pullback_arrows {X Y : C} (f : X ⟶ Y) (S : Sieve Y) :
1037+ (S.pullback f).arrows = S.arrows.pullback f :=
1038+ rfl
1039+
1040+ lemma pushforward_arrows {X Y : C} (f : X ⟶ Y) (S : Sieve X) :
1041+ (S.pushforward f).arrows = S.arrows.pushforward f :=
1042+ rfl
1043+
1044+ lemma generate_pushforward {X Y : C} (f : X ⟶ Y) (R : Presieve X) :
1045+ generate (R.pushforward f) = (generate R).pushforward f := by
1046+ ext
1047+ grind [generate_apply, Presieve.pushforward, pushforward_apply]
1048+
9591049section Functor
9601050
9611051variable {E : Type u₃} [Category.{v₃} E] (G : D ⥤ E)
0 commit comments