Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
672e72f
feat(CategoryTheory): define profunctors
dagurtomas Apr 15, 2026
0b4e7af
add Adrian Marti as coauthor
adrianmartir Apr 15, 2026
e00691a
profunctor composition
dagurtomas Apr 15, 2026
9065f37
mk_all
dagurtomas Apr 15, 2026
8c69b82
cleanup
dagurtomas Apr 15, 2026
4994d15
make coends in type computable
dagurtomas Apr 15, 2026
dfc1c79
more general universes
dagurtomas Apr 15, 2026
2aa981a
.
dagurtomas Apr 15, 2026
26797dc
left unitor
dagurtomas Apr 15, 2026
b14790f
wip
dagurtomas Apr 15, 2026
ba83fbc
right unitor
dagurtomas Apr 16, 2026
1a7bb2d
Update Mathlib/CategoryTheory/Profunctor/Basic.lean
dagurtomas Apr 17, 2026
b84027d
Update Mathlib/CategoryTheory/Profunctor/Basic.lean
dagurtomas Apr 17, 2026
202f7b9
clarify docstring, change name
dagurtomas Apr 17, 2026
758c54a
Merge branch 'profunctor' into profunctor-comp
dagurtomas Apr 17, 2026
945d17e
.
dagurtomas Apr 17, 2026
3183769
wip
dagurtomas Apr 20, 2026
873ef40
wip
dagurtomas Apr 20, 2026
4217f6a
wip
dagurtomas Apr 20, 2026
8939f1e
wip
dagurtomas Apr 20, 2026
d2c3bca
sorry free associator
dagurtomas Apr 21, 2026
f6f5d18
remove wrong lemma
dagurtomas Apr 21, 2026
cecf662
bicategory structure
dagurtomas Apr 21, 2026
e950611
.
dagurtomas Apr 21, 2026
3111103
.
dagurtomas Apr 22, 2026
714b469
cleanup
dagurtomas Apr 22, 2026
4a9ea3e
mk_all
dagurtomas Apr 22, 2026
ab81904
merge
dagurtomas Apr 28, 2026
48eaca0
Merge branch 'master' into profunctor-comp
dagurtomas May 12, 2026
c4c50bd
Update End.lean
dagurtomas May 12, 2026
da677b3
fix the build
dagurtomas May 12, 2026
3162a43
fix the build
dagurtomas May 12, 2026
33e3bbf
Apply suggestions from code review
dagurtomas May 20, 2026
d650f12
chore: remove profunctor bicategory from PR
dagurtomas May 20, 2026
d3ae39b
chore: remove stale comment
dagurtomas May 20, 2026
898e964
feat(CategoryTheory): the bicategory of profunctors
dagurtomas May 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -3243,6 +3243,8 @@ public import Mathlib.CategoryTheory.Products.Basic
public import Mathlib.CategoryTheory.Products.Bifunctor
public import Mathlib.CategoryTheory.Products.Unitor
public import Mathlib.CategoryTheory.Profunctor.Basic
public import Mathlib.CategoryTheory.Profunctor.Bicategory
public import Mathlib.CategoryTheory.Profunctor.Comp
public import Mathlib.CategoryTheory.Quotient
public import Mathlib.CategoryTheory.Quotient.Linear
public import Mathlib.CategoryTheory.Quotient.LocallySmall
Expand Down
83 changes: 83 additions & 0 deletions Mathlib/CategoryTheory/Profunctor/Bicategory.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/-
Copyright (c) 2026 Dagur Asgeirsson. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Dagur Asgeirsson
-/
module

public import Mathlib.CategoryTheory.Profunctor.Comp

/-!
# The Profunctor Bicategory

This file defines the bicategory `ProfCat` whose objects are categories and whose 1-morphisms are
profunctors.
-/

@[expose] public section

universe w v u

namespace CategoryTheory

/-- The bicategory of categories where the 1-morphisms are profunctors. -/
@[nolint checkUnivs]
structure ProfCat where
of ::
/-- The objects of the bicategory are types... -/
obj : Type u
/-- ... bundled with a category instance. -/
[str : Category.{v} obj]

initialize_simps_projections ProfCat (-str)

instance : CoeSort ProfCat (Type u) :=
⟨ProfCat.obj⟩

attribute [instance] ProfCat.str

open Limits Types Profunctor

namespace Profunctor

section

@[reassoc (attr := simp)]
lemma pentagon {C D E F G : Type u} [Category* C] [Category* D] [Category* E]
[Category* F] [Category* G] (P : Profunctor.{max u w} C D) (Q : Profunctor.{max u w} D E)
(R : Profunctor.{max u w} E F) (S : Profunctor.{max u w} F G) :
whiskerRight S (P.associator Q R).hom ≫
(P.associator (Q.comp R) S).hom ≫ P.whiskerLeft (Q.associator R S).hom =
((P.comp Q).associator R S).hom ≫ (P.associator Q (R.comp S)).hom := by
ext _ _ ⟨_, ⟨_, ⟨_, _, _⟩, _⟩, _⟩
rfl

set_option backward.isDefEq.respectTransparency false in
attribute [local simp] Types.chosenCoend_def in
@[reassoc (attr := simp)]
lemma triangle {C D E : Type u} [Category* C] [Category.{u} D] [Category* E]
(P : Profunctor.{u} C D) (Q : Profunctor.{u} D E) :
(P.associator (Profunctor.id (C := D)) Q).hom ≫ P.whiskerLeft (Q.leftUnitor.hom) =
whiskerRight Q (P.rightUnitor.hom) := by
ext _ _ ⟨_, ⟨_, _, g⟩, _⟩
dsimp [chosenCoend.map_apply, Quot.map]
symm
apply Quot.sound
rw [coendRel_iff]
exact ⟨g, by simp⟩

end

end Profunctor

instance : Bicategory ProfCat.{u, u} where
Hom X Y := Profunctor.{u} X Y
id X := .id
comp P Q := P.comp Q
whiskerLeft P _ _ f := P.whiskerLeft f
whiskerRight f R := whiskerRight R f
associator P Q R := P.associator Q R
leftUnitor P := P.leftUnitor
rightUnitor P := P.rightUnitor

end CategoryTheory
Loading
Loading