|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Christian Merten. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Christian Merten |
| 5 | +-/ |
| 6 | +import Mathlib.CategoryTheory.MorphismProperty.Comma |
| 7 | +import Mathlib.CategoryTheory.Adjunction.Over |
| 8 | +import Mathlib.CategoryTheory.MorphismProperty.Limits |
| 9 | + |
| 10 | +/-! |
| 11 | +# Adjunction of pushforward and pullback in `P.Over Q X` |
| 12 | +
|
| 13 | +A morphism `f : X ⟶ Y` defines two functors: |
| 14 | +
|
| 15 | +- `Over.map`: post-composition with `f` |
| 16 | +- `Over.pullback`: base-change along `f` |
| 17 | +
|
| 18 | +These are adjoint under suitable assumptions on `P` and `Q`. |
| 19 | +
|
| 20 | +-/ |
| 21 | + |
| 22 | +namespace CategoryTheory.MorphismProperty |
| 23 | + |
| 24 | +open Limits |
| 25 | + |
| 26 | +variable {T : Type*} [Category T] (P Q : MorphismProperty T) [Q.IsMultiplicative] |
| 27 | +variable {X Y : T} (f : X ⟶ Y) |
| 28 | + |
| 29 | +section Map |
| 30 | + |
| 31 | +variable {P} [P.IsStableUnderComposition] (hPf : P f) |
| 32 | + |
| 33 | +variable {f} |
| 34 | + |
| 35 | +/-- If `P` is stable under composition and `f : X ⟶ Y` satisfies `P`, |
| 36 | +this is the functor `P.Over Q X ⥤ P.Over Q Y` given by composing with `f`. -/ |
| 37 | +@[simps! obj_left obj_hom map_left] |
| 38 | +def Over.map : P.Over Q X ⥤ P.Over Q Y := |
| 39 | + Comma.mapRight _ (Discrete.natTrans fun _ ↦ f) <| fun X ↦ P.comp_mem _ _ X.prop hPf |
| 40 | + |
| 41 | +lemma Over.map_comp {X Y Z : T} {f : X ⟶ Y} (hf : P f) {g : Y ⟶ Z} (hg : P g) : |
| 42 | + map Q (P.comp_mem f g hf hg) = map Q hf ⋙ map Q hg := by |
| 43 | + fapply Functor.ext |
| 44 | + · simp [map, Comma.mapRight, CategoryTheory.Comma.mapRight, Comma.lift] |
| 45 | + · intro U V k |
| 46 | + ext |
| 47 | + simp |
| 48 | + |
| 49 | +/-- `Over.map` commutes with composition. -/ |
| 50 | +@[simps! hom_app_left inv_app_left] |
| 51 | +def Over.mapComp {X Y Z : T} {f : X ⟶ Y} (hf : P f) {g : Y ⟶ Z} (hg : P g) [Q.RespectsIso] : |
| 52 | + map Q (P.comp_mem f g hf hg) ≅ map Q hf ⋙ map Q hg := |
| 53 | + NatIso.ofComponents (fun X ↦ Over.isoMk (Iso.refl _)) |
| 54 | + |
| 55 | +end Map |
| 56 | + |
| 57 | +section Pullback |
| 58 | + |
| 59 | +variable [HasPullbacks T] [P.IsStableUnderBaseChange] [Q.IsStableUnderBaseChange] |
| 60 | + |
| 61 | +/-- If `P` and `Q` are stable under base change and pullbacks exist in `T`, |
| 62 | +this is the functor `P.Over Q Y ⥤ P.Over Q X` given by base change along `f`. -/ |
| 63 | +@[simps! obj_left obj_hom map_left] |
| 64 | +noncomputable def Over.pullback : P.Over Q Y ⥤ P.Over Q X where |
| 65 | + obj A := |
| 66 | + { __ := (CategoryTheory.Over.pullback f).obj A.toComma |
| 67 | + prop := P.pullback_snd _ _ A.prop } |
| 68 | + map {A B} g := |
| 69 | + { __ := (CategoryTheory.Over.pullback f).map g.toCommaMorphism |
| 70 | + prop_hom_left := Q.baseChange_map f g.toCommaMorphism g.prop_hom_left |
| 71 | + prop_hom_right := trivial } |
| 72 | + |
| 73 | +variable {P} {Q} |
| 74 | + |
| 75 | +/-- `Over.pullback` commutes with composition. -/ |
| 76 | +@[simps! hom_app_left inv_app_left] |
| 77 | +noncomputable def Over.pullbackComp [Q.RespectsIso] {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) : |
| 78 | + Over.pullback P Q (f ≫ g) ≅ Over.pullback P Q g ⋙ Over.pullback P Q f := |
| 79 | + NatIso.ofComponents |
| 80 | + (fun X ↦ Over.isoMk ((pullbackLeftPullbackSndIso X.hom g f).symm) (by simp)) |
| 81 | + |
| 82 | +lemma Over.pullbackComp_left_fst_fst [Q.RespectsIso] {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) |
| 83 | + (A : P.Over Q Z) : |
| 84 | + ((Over.pullbackComp f g).hom.app A).left ≫ |
| 85 | + pullback.fst (pullback.snd A.hom g) f ≫ pullback.fst A.hom g = |
| 86 | + pullback.fst A.hom (f ≫ g) := by |
| 87 | + simp |
| 88 | + |
| 89 | +/-- If `f = g`, then base change along `f` is naturally isomorphic to base change along `g`. -/ |
| 90 | +noncomputable def Over.pullbackCongr {X Y : T} {f g : X ⟶ Y} (h : f = g) : |
| 91 | + Over.pullback P Q f ≅ Over.pullback P Q g := |
| 92 | + NatIso.ofComponents (fun X ↦ eqToIso (by rw [h])) |
| 93 | + |
| 94 | +@[reassoc (attr := simp)] |
| 95 | +lemma Over.pullbackCongr_hom_app_left_fst {X Y : T} {f g : X ⟶ Y} (h : f = g) (A : P.Over Q Y) : |
| 96 | + ((Over.pullbackCongr h).hom.app A).left ≫ pullback.fst A.hom g = |
| 97 | + pullback.fst A.hom f := by |
| 98 | + subst h |
| 99 | + simp [pullbackCongr] |
| 100 | + |
| 101 | +end Pullback |
| 102 | + |
| 103 | +section Adjunction |
| 104 | + |
| 105 | +variable [P.IsStableUnderComposition] [P.IsStableUnderBaseChange] |
| 106 | + [Q.IsStableUnderBaseChange] [HasPullbacks T] |
| 107 | + |
| 108 | +/-- `P.Over.map` is left adjoint to `P.Over.pullback` if `f` satisfies `P`. -/ |
| 109 | +noncomputable def Over.mapPullbackAdj [Q.HasOfPostcompProperty Q] (hPf : P f) (hQf : Q f) : |
| 110 | + Over.map Q hPf ⊣ Over.pullback P Q f := |
| 111 | + Adjunction.mkOfHomEquiv |
| 112 | + { homEquiv := fun A B ↦ |
| 113 | + { toFun := fun g ↦ |
| 114 | + Over.homMk (pullback.lift g.left A.hom <| by simp) (by simp) <| by |
| 115 | + apply Q.of_postcomp (W' := Q) |
| 116 | + · exact Q.pullback_fst B.hom f hQf |
| 117 | + · simpa using g.prop_hom_left |
| 118 | + invFun := fun h ↦ Over.homMk (h.left ≫ pullback.fst B.hom f) |
| 119 | + (by |
| 120 | + simp only [map_obj_left, Functor.const_obj_obj, pullback_obj_left, Functor.id_obj, |
| 121 | + Category.assoc, pullback.condition, map_obj_hom, ← pullback_obj_hom, Over.w_assoc]) |
| 122 | + (Q.comp_mem _ _ h.prop_hom_left (Q.pullback_fst _ _ hQf)) |
| 123 | + left_inv := by aesop_cat |
| 124 | + right_inv := fun h ↦ by |
| 125 | + ext |
| 126 | + dsimp |
| 127 | + ext |
| 128 | + · simp |
| 129 | + · simpa using h.w.symm } } |
| 130 | + |
| 131 | +end Adjunction |
| 132 | + |
| 133 | +end CategoryTheory.MorphismProperty |
0 commit comments