Skip to content

Commit cb86c75

Browse files
committed
feat(CategoryTheory): pushforward pullback adjunction for P.Over Q X (#19271)
1 parent 01b31e1 commit cb86c75

File tree

5 files changed

+238
-4
lines changed

5 files changed

+238
-4
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,7 @@ import Mathlib.CategoryTheory.MorphismProperty.Concrete
19911991
import Mathlib.CategoryTheory.MorphismProperty.Factorization
19921992
import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy
19931993
import Mathlib.CategoryTheory.MorphismProperty.Limits
1994+
import Mathlib.CategoryTheory.MorphismProperty.OverAdjunction
19941995
import Mathlib.CategoryTheory.MorphismProperty.Representable
19951996
import Mathlib.CategoryTheory.NatIso
19961997
import Mathlib.CategoryTheory.NatTrans

Mathlib/CategoryTheory/Limits/MorphismProperty.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ instance [P.ContainsIdentities] (Y : P.Over ⊤ X) :
119119
uniq a := by
120120
ext
121121
· simp only [mk_left, Hom.hom_left, homMk_hom, Over.homMk_left]
122-
rw [← Over.w a.hom]
122+
rw [← Over.w a]
123123
simp only [mk_left, Functor.const_obj_obj, Hom.hom_left, mk_hom, Category.comp_id]
124-
· rfl
125124

126125
/-- `X ⟶ X` is the terminal object of `P.Over ⊤ X`. -/
127126
def mkIdTerminal [P.ContainsIdentities] :

Mathlib/CategoryTheory/MorphismProperty/Basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ lemma RespectsIso.precomp (P : MorphismProperty C) [P.RespectsIso] {X Y Z : C} (
157157
[IsIso e] (f : Y ⟶ Z) (hf : P f) : P (e ≫ f) :=
158158
RespectsLeft.precomp (Q := isomorphisms C) e ‹IsIso e› f hf
159159

160+
instance : RespectsIso (⊤ : MorphismProperty C) where
161+
precomp _ _ _ _ := trivial
162+
postcomp _ _ _ _ := trivial
163+
160164
lemma RespectsIso.postcomp (P : MorphismProperty C) [P.RespectsIso] {X Y Z : C} (e : Y ⟶ Z)
161165
[IsIso e] (f : X ⟶ Y) (hf : P f) : P (f ≫ e) :=
162166
RespectsRight.postcomp (Q := isomorphisms C) e ‹IsIso e› f hf

Mathlib/CategoryTheory/MorphismProperty/Comma.lean

Lines changed: 99 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,8 @@ lemma Hom.hom_mk {X Y : P.Comma L R Q W}
7979
(f : CommaMorphism X.toComma Y.toComma) (hf) (hg) :
8080
Comma.Hom.hom ⟨f, hf, hg⟩ = f := rfl
8181

82-
@[simp]
8382
lemma Hom.hom_left {X Y : P.Comma L R Q W} (f : Comma.Hom X Y) : f.hom.left = f.left := rfl
8483

85-
@[simp]
8684
lemma Hom.hom_right {X Y : P.Comma L R Q W} (f : Comma.Hom X Y) : f.hom.right = f.right := rfl
8785

8886
/-- See Note [custom simps projection] -/
@@ -133,6 +131,14 @@ lemma id_hom (X : P.Comma L R Q W) : (𝟙 X : X ⟶ X).hom = 𝟙 X.toComma :=
133131
lemma comp_hom {X Y Z : P.Comma L R Q W} (f : X ⟶ Y) (g : Y ⟶ Z) :
134132
(f ≫ g).hom = f.hom ≫ g.hom := rfl
135133

134+
@[reassoc]
135+
lemma comp_left {X Y Z : P.Comma L R Q W} (f : X ⟶ Y) (g : Y ⟶ Z) :
136+
(f ≫ g).left = f.left ≫ g.left := rfl
137+
138+
@[reassoc]
139+
lemma comp_right {X Y Z : P.Comma L R Q W} (f : X ⟶ Y) (g : Y ⟶ Z) :
140+
(f ≫ g).right = f.right ≫ g.right := rfl
141+
136142
/-- If `i` is an isomorphism in `Comma L R`, it is also a morphism in `P.Comma L R Q W`. -/
137143
@[simps hom]
138144
def homFromCommaOfIsIso [Q.RespectsIso] [W.RespectsIso] {X Y : P.Comma L R Q W}
@@ -205,6 +211,63 @@ def forgetFullyFaithful : (forget L R P ⊤ ⊤).FullyFaithful where
205211
instance : (forget L R P ⊤ ⊤).Full :=
206212
Functor.FullyFaithful.full (forgetFullyFaithful L R P)
207213

214+
section
215+
216+
variable {L R}
217+
218+
@[simp]
219+
lemma eqToHom_left {X Y : P.Comma L R Q W} (h : X = Y) :
220+
(eqToHom h).left = eqToHom (by rw [h]) := by
221+
subst h
222+
rfl
223+
224+
@[simp]
225+
lemma eqToHom_right {X Y : P.Comma L R Q W} (h : X = Y) :
226+
(eqToHom h).right = eqToHom (by rw [h]) := by
227+
subst h
228+
rfl
229+
230+
end
231+
232+
section Functoriality
233+
234+
variable {L R P Q W}
235+
variable {L₁ L₂ L₃ : A ⥤ T} {R₁ R₂ R₃ : B ⥤ T}
236+
237+
/-- Lift a functor `F : C ⥤ Comma L R` to the subcategory `P.Comma L R Q W` under
238+
suitable assumptions on `F`. -/
239+
@[simps obj_toComma map_hom]
240+
def lift {C : Type*} [Category C] (F : C ⥤ Comma L R)
241+
(hP : ∀ X, P (F.obj X).hom)
242+
(hQ : ∀ {X Y} (f : X ⟶ Y), Q (F.map f).left)
243+
(hW : ∀ {X Y} (f : X ⟶ Y), W (F.map f).right) :
244+
C ⥤ P.Comma L R Q W where
245+
obj X :=
246+
{ __ := F.obj X
247+
prop := hP X }
248+
map {X Y} f :=
249+
{ __ := F.map f
250+
prop_hom_left := hQ f
251+
prop_hom_right := hW f }
252+
253+
variable (R) in
254+
/-- A natural transformation `L₁ ⟶ L₂` induces a functor `P.Comma L₂ R Q W ⥤ P.Comma L₁ R Q W`. -/
255+
@[simps!]
256+
def mapLeft (l : L₁ ⟶ L₂) (hl : ∀ X : P.Comma L₂ R Q W, P (l.app X.left ≫ X.hom)) :
257+
P.Comma L₂ R Q W ⥤ P.Comma L₁ R Q W :=
258+
lift (forget _ _ _ _ _ ⋙ CategoryTheory.Comma.mapLeft R l) hl
259+
(fun f ↦ f.prop_hom_left) (fun f ↦ f.prop_hom_right)
260+
261+
variable (L) in
262+
/-- A natural transformation `R₁ ⟶ R₂` induces a functor `P.Comma L R₁ Q W ⥤ P.Comma L R₂ Q W`. -/
263+
@[simps!]
264+
def mapRight (r : R₁ ⟶ R₂) (hr : ∀ X : P.Comma L R₁ Q W, P (X.hom ≫ r.app X.right)) :
265+
P.Comma L R₁ Q W ⥤ P.Comma L R₂ Q W :=
266+
lift (forget _ _ _ _ _ ⋙ CategoryTheory.Comma.mapRight L r) hr
267+
(fun f ↦ f.prop_hom_left) (fun f ↦ f.prop_hom_right)
268+
269+
end Functoriality
270+
208271
end Comma
209272

210273
end Comma
@@ -251,6 +314,23 @@ protected def Over.homMk {A B : P.Over Q X} (f : A.left ⟶ B.left)
251314
prop_hom_left := hf
252315
prop_hom_right := trivial
253316

317+
/-- Make an isomorphism in `P.Over Q X` from an isomorphism in `T` with compatibilities. -/
318+
@[simps! hom_left inv_left]
319+
protected def Over.isoMk [Q.RespectsIso] {A B : P.Over Q X} (f : A.left ≅ B.left)
320+
(w : f.hom ≫ B.hom = A.hom := by aesop_cat) : A ≅ B :=
321+
Comma.isoMk f (Discrete.eqToIso' rfl)
322+
323+
@[ext]
324+
lemma Over.Hom.ext {A B : P.Over Q X} {f g : A ⟶ B} (h : f.left = g.left) : f = g := by
325+
ext
326+
· exact h
327+
· simp
328+
329+
@[reassoc]
330+
lemma Over.w {A B : P.Over Q X} (f : A ⟶ B) :
331+
f.left ≫ B.hom = A.hom := by
332+
simp
333+
254334
end Over
255335

256336
section Under
@@ -295,6 +375,23 @@ protected def Under.homMk {A B : P.Under Q X} (f : A.right ⟶ B.right)
295375
prop_hom_left := trivial
296376
prop_hom_right := hf
297377

378+
/-- Make an isomorphism in `P.Under Q X` from an isomorphism in `T` with compatibilities. -/
379+
@[simps! hom_right inv_right]
380+
protected def Under.isoMk [Q.RespectsIso] {A B : P.Under Q X} (f : A.right ≅ B.right)
381+
(w : A.hom ≫ f.hom = B.hom := by aesop_cat) : A ≅ B :=
382+
Comma.isoMk (Discrete.eqToIso' rfl) f
383+
384+
@[ext]
385+
lemma Under.Hom.ext {A B : P.Under Q X} {f g : A ⟶ B} (h : f.right = g.right) : f = g := by
386+
ext
387+
· simp
388+
· exact h
389+
390+
@[reassoc]
391+
lemma Under.w {A B : P.Under Q X} (f : A ⟶ B) :
392+
A.hom ≫ f.right = B.hom := by
393+
simp
394+
298395
end Under
299396

300397
end CategoryTheory.MorphismProperty
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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

Comments
 (0)