Skip to content

Commit 7a40523

Browse files
committed
chore(CategoryTheory): dualize to right liftings (#40499)
This PR adds api for `RightLift`s, following exactly the case of `LeftLift`s.
1 parent ae9f73a commit 7a40523

2 files changed

Lines changed: 164 additions & 4 deletions

File tree

Mathlib/CategoryTheory/Bicategory/Extension.lean

Lines changed: 82 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ abbrev mk (h : b ⟶ c) (counit : f ≫ h ⟶ g) : RightExtension f g :=
313313
/-- To construct a morphism between right extensions, we need a 2-morphism between the extensions,
314314
and to check that it is compatible with the counits. -/
315315
abbrev homMk {s t : RightExtension f g} (η : s.extension ⟶ t.extension)
316-
(w : f ◁ η ≫ t.counit = s.counit) : s ⟶ t :=
316+
(w : f ◁ η ≫ t.counit = s.counit := by cat_disch) : s ⟶ t :=
317317
CostructuredArrow.homMk η w
318318

319319
@[reassoc (attr := simp)]
@@ -355,22 +355,100 @@ abbrev counit (t : RightLift f g) : t.lift ≫ f ⟶ g := t.hom
355355
abbrev mk (h : c ⟶ b) (counit : h ≫ f ⟶ g) : RightLift f g :=
356356
CostructuredArrow.mk counit
357357

358+
variable {s t : RightLift f g}
359+
358360
/-- To construct a morphism between right lifts, we need a 2-morphism between the lifts,
359361
and to check that it is compatible with the counits. -/
360-
abbrev homMk {s t : RightLift f g} (η : s.lift ⟶ t.lift) (w : η ▷ f ≫ t.counit = s.counit) :
362+
abbrev homMk (η : s.lift ⟶ t.lift) (w : η ▷ f ≫ t.counit = s.counit := by cat_disch) :
361363
s ⟶ t :=
362364
CostructuredArrow.homMk η w
363365

364366
@[reassoc (attr := simp)]
365-
theorem w {s t : RightLift f g} (h : s ⟶ t) :
366-
h.left ▷ f ≫ t.counit = s.counit :=
367+
theorem w (h : s ⟶ t) : h.left ▷ f ≫ t.counit = s.counit :=
367368
CostructuredArrow.w h
368369

369370
/-- The right lift along the identity. -/
370371
def alongId (g : c ⟶ a) : RightLift (𝟙 a) g := .mk _ (ρ_ g).hom
371372

372373
instance : Inhabited (RightLift (𝟙 a) g) := ⟨alongId g⟩
373374

375+
/-- Construct a right lift along `g : c ⟶ a` from a right lift along `𝟙 c ≫ g`. -/
376+
@[simps!]
377+
def ofIdComp (t : RightLift f (𝟙 c ≫ g)) : RightLift f g :=
378+
mk (lift t) (counit t ≫ (λ_ _).hom)
379+
380+
/-- Whisker a 1-morphism to a lift.
381+
```
382+
b
383+
◹ |
384+
lift / | | counit
385+
/ | f ▽
386+
/ ▽
387+
x - - - ▷ c - - - ▷ a
388+
h g
389+
```
390+
-/
391+
def whisker (t : RightLift f g) {x : B} (h : x ⟶ c) : RightLift f (h ≫ g) :=
392+
.mk _ <| (α_ _ _ _).hom ≫ h ◁ t.counit
393+
394+
@[simp]
395+
theorem whisker_lift (t : RightLift f g) {x : B} (h : x ⟶ c) :
396+
(t.whisker h).lift = h ≫ t.lift :=
397+
rfl
398+
399+
@[simp]
400+
theorem whisker_counit (t : RightLift f g) {x : B} (h : x ⟶ c) :
401+
(t.whisker h).counit = (α_ h t.lift f).hom ≫ h ◁ t.counit :=
402+
rfl
403+
404+
/-- Whiskering a 1-morphism is a functor. -/
405+
@[simps]
406+
def whiskering {x : B} (h : x ⟶ c) : RightLift f g ⥤ RightLift f (h ≫ g) where
407+
obj t := t.whisker h
408+
map η := RightLift.homMk (h ◁ η.left) <| by
409+
dsimp only [whisker_lift, whisker_counit]
410+
rw [← RightLift.w η]
411+
simp [-RightLift.w]
412+
413+
set_option backward.isDefEq.respectTransparency false in
414+
/-- Define a morphism between right lifts by cancelling the whiskered identities. -/
415+
@[simps! left]
416+
def whiskerIdCancel
417+
(t : RightLift f (𝟙 c ≫ g)) {s : RightLift f g} (τ : s.whisker (𝟙 c) ⟶ t) :
418+
s ⟶ t.ofIdComp :=
419+
RightLift.homMk ((λ_ _).inv ≫ τ.left)
420+
421+
set_option backward.isDefEq.respectTransparency false in
422+
/-- Construct a morphism between whiskered lifts. -/
423+
@[simps! left]
424+
def whiskerHom (i : s ⟶ t) {x : B} (h : x ⟶ c) :
425+
s.whisker h ⟶ t.whisker h :=
426+
CostructuredArrow.homMk (h ◁ i.left) <| by
427+
rw [← cancel_epi (α_ h _ _).inv]
428+
calc
429+
_ = h ◁ (i.left ▷ f ≫ t.counit) := by simp [-RightLift.w]
430+
_ = h ◁ s.counit := congrArg (h ◁ ·) (RightLift.w i)
431+
_ = _ := by simp
432+
433+
/-- Construct an isomorphism between whiskered lifts. -/
434+
def whiskerIso (i : s ≅ t) {x : B} (h : x ⟶ c) :
435+
s.whisker h ≅ t.whisker h :=
436+
Iso.mk (whiskerHom i.hom h) (whiskerHom i.inv h)
437+
(CostructuredArrow.hom_ext _ _ <|
438+
calc
439+
_ = h ◁ (i.hom ≫ i.inv).left := by simp [-Iso.hom_inv_id]
440+
_ = 𝟙 _ := by simp [Iso.hom_inv_id])
441+
(CostructuredArrow.hom_ext _ _ <|
442+
calc
443+
_ = h ◁ (i.inv ≫ i.hom).left := by simp [-Iso.inv_hom_id]
444+
_ = 𝟙 _ := by simp [Iso.inv_hom_id])
445+
446+
set_option backward.defeqAttrib.useBackward true in
447+
/-- The isomorphism between right lifts induced by a left unitor. -/
448+
@[simps! hom_left inv_left]
449+
def whiskerOfIdCompIsoSelf (t : RightLift f g) : (t.whisker (𝟙 c)).ofIdComp ≅ t :=
450+
CostructuredArrow.isoMk (λ_ (lift t))
451+
374452
end RightLift
375453

376454
end Bicategory

Mathlib/CategoryTheory/Bicategory/Kan/IsKan.lean

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,88 @@ variable {f : b ⟶ a} {g : c ⟶ a}
248248
/-- A right Kan lift of `g` along `f` is a terminal object in `RightLift f g`. -/
249249
abbrev IsKan (t : RightLift f g) := t.IsUniversal
250250

251+
/-- An absolute right Kan lift is a Kan lift such that every 1-morphism commutes with it. -/
252+
abbrev IsAbsKan (t : RightLift f g) :=
253+
∀ {x : B} (h : x ⟶ c), IsKan (t.whisker h)
254+
255+
namespace IsKan
256+
257+
variable {s t : RightLift f g}
258+
259+
/-- To show that a right lift `t` is a Kan lift, we need to show that for every right lift `s`
260+
there is a unique morphism `s ⟶ t`. -/
261+
abbrev mk (desc : ∀ s, s ⟶ t) (w : ∀ s τ, τ = desc s) :
262+
IsKan t :=
263+
.ofUniqueHom desc w
264+
265+
/-- The family of 2-morphisms into a right Kan lift. -/
266+
abbrev desc (H : IsKan t) (s : RightLift f g) : s.lift ⟶ t.lift :=
267+
CostructuredArrow.IsUniversal.lift H s
268+
269+
@[reassoc (attr := simp)]
270+
theorem fac (H : IsKan t) (s : RightLift f g) :
271+
H.desc s ▷ f ≫ t.counit = s.counit :=
272+
CostructuredArrow.IsUniversal.fac H s
273+
274+
/-- Two 2-morphisms into a right Kan lift are equal if their compositions with
275+
each triangle 2-morphism are equal. -/
276+
theorem hom_ext (H : IsKan t) {k : c ⟶ b} {τ τ' : k ⟶ t.lift}
277+
(w : τ ▷ f ≫ t.counit = τ' ▷ f ≫ t.counit) : τ = τ' :=
278+
CostructuredArrow.IsUniversal.hom_ext H w
279+
280+
/-- Kan lifts on `g` along `f` are unique up to isomorphism. -/
281+
def uniqueUpToIso (P : IsKan s) (Q : IsKan t) : s ≅ t :=
282+
Limits.IsTerminal.uniqueUpToIso P Q
283+
284+
@[simp]
285+
theorem uniqueUpToIso_hom_left (P : IsKan s) (Q : IsKan t) :
286+
(uniqueUpToIso P Q).hom.left = Q.desc s := rfl
287+
288+
@[simp]
289+
theorem uniqueUpToIso_inv_left (P : IsKan s) (Q : IsKan t) :
290+
(uniqueUpToIso P Q).inv.left = P.desc t := rfl
291+
292+
/-- Transport evidence that a right lift is a Kan lift across an isomorphism of lifts. -/
293+
def ofIsoKan (P : IsKan s) (i : s ≅ t) : IsKan t :=
294+
Limits.IsTerminal.ofIso P i
295+
296+
set_option backward.isDefEq.respectTransparency false in
297+
/-- If `t : RightLift f (𝟙 c ≫ g)` is a Kan lift, then `t.ofIdComp : RightLift f g` is also
298+
a Kan lift. -/
299+
def ofIdComp (t : RightLift f (𝟙 c ≫ g)) (P : IsKan t) : IsKan t.ofIdComp :=
300+
.mk (fun s ↦ t.whiskerIdCancel <| P.from (s.whisker (𝟙 c))) <| by
301+
intro s τ
302+
ext
303+
apply P.hom_ext
304+
simp [← RightLift.w τ]
305+
306+
/-- If `s ≅ t` and `IsKan (s.whisker h)`, then `IsKan (t.whisker h)`. -/
307+
def whiskerOfCommute (s t : RightLift f g) (i : s ≅ t) {x : B} (h : x ⟶ c)
308+
(P : IsKan (s.whisker h)) :
309+
IsKan (t.whisker h) :=
310+
P.ofIsoKan <| whiskerIso i h
311+
312+
end IsKan
313+
314+
namespace IsAbsKan
315+
316+
variable {s t : RightLift f g}
317+
318+
/-- The family of 2-morphisms into an absolute right Kan lift. -/
319+
abbrev desc (H : IsAbsKan t) {x : B} {h : x ⟶ c} (s : RightLift f (h ≫ g)) :
320+
s.lift ⟶ h ≫ t.lift :=
321+
(H h).desc s
322+
323+
/-- An absolute right Kan lift is a right Kan lift. -/
324+
def isKan (H : IsAbsKan t) : IsKan t :=
325+
((H (𝟙 c)).ofIdComp _).ofIsoKan <| whiskerOfIdCompIsoSelf t
326+
327+
/-- Transport evidence that a right lift is a Kan lift across an isomorphism of lifts. -/
328+
def ofIsoAbsKan (P : IsAbsKan s) (i : s ≅ t) : IsAbsKan t :=
329+
fun h ↦ (P h).ofIsoKan (whiskerIso i h)
330+
331+
end IsAbsKan
332+
251333
end RightLift
252334

253335
end Bicategory

0 commit comments

Comments
 (0)