proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Squares.Kan

Description

Kan extensions and lifts as squares. Pointwise constructions have only horizontal functor wires; corepresentable encodings use CorepStar. Their pointwiseness is supplied by the underlying profunctor universal properties.

Synopsis

Documentation

ran :: forall {k} {j1} {i} (j2 :: k +-> j1) (p :: k +-> i). (Profunctor j2, Profunctor p) => Sq (j2 '::: ((j2 |> p) '::: ('Nil :: Path i i))) (p '::: ('Nil :: Path i i)) ('Nil :: Path i i) ('Nil :: Path k k) Source Github #

Evaluate a profunctor right Kan extension. All three wires are vertical.

K---r---j---I
|   \   /   |
|     @     |
|     |     |
K-----p-----I

ranUniv :: forall {i1} {k} {i2} (j :: i1 +-> k) (p :: i1 +-> i2) (g :: k +-> i2). (Profunctor j, Profunctor p, Profunctor g) => Sq (j '::: (g '::: ('Nil :: Path i2 i2))) (p '::: ('Nil :: Path i2 i2)) ('Nil :: Path i2 i2) ('Nil :: Path i1 i1) -> Sq (g '::: ('Nil :: Path i2 i2)) ((j |> p) '::: ('Nil :: Path i2 i2)) ('Nil :: Path i2 i2) ('Nil :: Path k k) Source Github #

Factor a square through the right Kan extension.

The dotted inner square is the input; the solid outer square is the result.

K-------g-----------A
|       |           |
|   K...+...j...I   |
|   :   \   /   :   |
|   :     @     :   |
|   :     |     :   |
|   K.....p.....I   |
|                   |
K---------r---------A

Here r = j |> p.

rift :: forall {j1} {i} {k} (j2 :: j1 +-> i) (p :: k +-> i). (Profunctor j2, Profunctor p) => Sq ((p <| j2) '::: (j2 '::: ('Nil :: Path i i))) (p '::: ('Nil :: Path i i)) ('Nil :: Path i i) ('Nil :: Path k k) Source Github #

Evaluate a profunctor right Kan lift.

I---j---r---K
|   \   /   |
|     @     |
|     |     |
I-----p-----K

riftUniv :: forall {i1} {i2} {k} (j :: i1 +-> i2) (p :: k +-> i2) (g :: k +-> i1). (Profunctor j, Profunctor p, Profunctor g) => Sq (g '::: (j '::: ('Nil :: Path i2 i2))) (p '::: ('Nil :: Path i2 i2)) ('Nil :: Path i2 i2) ('Nil :: Path k k) -> Sq (g '::: ('Nil :: Path i1 i1)) ((p <| j) '::: ('Nil :: Path i1 i1)) ('Nil :: Path i1 i1) ('Nil :: Path k k) Source Github #

Factor a square through the right Kan lift.

The dotted inner square is the input; the solid outer square is the result.

A-----------g-------K
|           |       |
|   I...j...+...K   |
|   :   \   /   :   |
|   :     @     :   |
|   :     |     :   |
|   I.....p.....K   |
|                   |
A---------r---------K

Here r = p <| j.

pwRan :: forall {j1} {j2} {k} (j3 :: j1 +-> j2) (p :: j1 +-> k). PointwiseRightKanExtension j3 p => Sq ('Nil :: Path j1 j1) ('Nil :: Path k k) (j3 '::: ((j3 |> p) '::: ('Nil :: Path k k))) (p '::: ('Nil :: Path k k)) Source Github #

Pointwise Ran: r . j => p, with all three functors horizontal.

I-----------I
j>---\      |
|     @---->p
r>---/      |
K-----------K

pwRanUniv :: forall {i} {j1} {k} (j2 :: i +-> j1) (p :: i +-> k) (g :: j1 +-> k). (PointwiseRightKanExtension j2 p, Representable g) => Sq ('Nil :: Path i i) ('Nil :: Path k k) (j2 '::: (g '::: ('Nil :: Path k k))) (p '::: ('Nil :: Path k k)) -> Sq ('Nil :: Path j1 j1) ('Nil :: Path k k) (g '::: ('Nil :: Path k k)) ((j2 |> p) '::: ('Nil :: Path k k)) Source Github #

The universal property of pointwise Ran.

The dotted inner square is the input; the solid outer square is the result.

A-------------------A
|                   |
|   I...........I   |
|   j>---\      :   |
|   :     @---->p   r
g>-------/      :   |
|   K...........K   |
|                   |
K-------------------K

Here r = j |> p.

pwRift :: forall {j1} {k} {j2} (j3 :: j1 +-> k) (p :: j2 +-> k). PointwiseRightKanLift j3 p => Sq ('Nil :: Path j2 j2) ('Nil :: Path k k) ((p <| j3) '::: (j3 '::: ('Nil :: Path k k))) (p '::: ('Nil :: Path k k)) Source Github #

Pointwise Rift: j . r => p, with all three functors horizontal.

J-----------J
r>---\      |
|     @---->p
j>---/      |
I-----------I

pwRiftUniv :: forall {k} {i} {j1} (j2 :: k +-> i) (p :: j1 +-> i) (g :: j1 +-> k). (PointwiseRightKanLift j2 p, Representable g) => Sq ('Nil :: Path j1 j1) ('Nil :: Path i i) (g '::: (j2 '::: ('Nil :: Path i i))) (p '::: ('Nil :: Path i i)) -> Sq ('Nil :: Path j1 j1) ('Nil :: Path k k) (g '::: ('Nil :: Path k k)) ((p <| j2) '::: ('Nil :: Path k k)) Source Github #

The universal property of pointwise Rift.

The dotted inner square is the input; the solid outer square is the result.

J-------------------J
|                   |
|   J...........J   |
g>-------\      :   |
|   :     @---->p   r
|   j>---/      :   |
|   I...........I   |
|                   |
K-------------------K

Here r = p <| j.

corepSquare :: forall {j1} {j2} {k} (j3 :: j1 +-> j2) (p :: k +-> j1) (d :: k +-> j2). (Profunctor j3, Corepresentable p, Corepresentable d) => ((j3 :.: p) :~> d) -> Sq (j3 '::: ('Nil :: Path j2 j2)) ('Nil :: Path k k) (CorepStar d '::: ('Nil :: Path k k)) (CorepStar p '::: ('Nil :: Path k k)) Source Github #

Mate a transformation between corepresentable diagrams into a square. Used for weighted colimits and for mating pointwise Lan and Lift.

corepSquareInv :: forall {j1} {k} {k1} (j2 :: j1 +-> k) (p :: k1 +-> j1) (d :: k1 +-> k). (Profunctor j2, Corepresentable p, Corepresentable d) => Sq (j2 '::: ('Nil :: Path k k)) ('Nil :: Path k1 k1) (CorepStar d '::: ('Nil :: Path k1 k1)) (CorepStar p '::: ('Nil :: Path k1 k1)) -> (j2 :.: p) :~> d Source Github #

Recover the transformation from its corepresentable mate.

corepMateInv :: forall {j1} {k} {j2} (j3 :: j1 +-> k) (p :: j2 +-> j1) (d :: j2 +-> k). (Profunctor j3, Corepresentable p, Corepresentable d) => Prof (CorepStar d :.: j3) (CorepStar p) -> Prof (j3 :.: p) d Source Github #

Undo the corepresentable mate of j :.: p ~> d. The weight j may be an arbitrary profunctor, as in a weighted colimit.

corepComposeSquareInv :: forall {j} {k} {k1} (p :: j +-> k) (q :: k1 +-> j) (d :: k1 +-> k). (Corepresentable p, Corepresentable q, Corepresentable d) => Sq ('Nil :: Path k k) ('Nil :: Path k1 k1) (CorepStar d '::: ('Nil :: Path k1 k1)) (CorepStar p '::: (CorepStar q '::: ('Nil :: Path k1 k1))) -> (p :.: q) :~> d Source Github #

Recover a transformation between corepresentable profunctors from its mate between horizontal functor paths. Mating reverses composition order.

corepComposeMateInv :: forall {j1} {k} {j2} (p :: j1 +-> k) (q :: j2 +-> j1) (d :: j2 +-> k). (Corepresentable p, Corepresentable q, Corepresentable d) => Prof (CorepStar d) (CorepStar q :.: CorepStar p) -> Prof (p :.: q) d Source Github #

Undo mating between corepresentable composites and their representing functors. The order of composition is reversed.

pwLan :: forall {j1} {i} {k} (j2 :: j1 +-> i) (p :: k +-> i). PointwiseLeftKanExtension j2 p => Sq ('Nil :: Path i i) ('Nil :: Path k k) (CorepStar p '::: ('Nil :: Path k k)) (CorepStar j2 '::: (CorepStar (p <| j2) '::: ('Nil :: Path k k))) Source Github #

Pointwise Lan: p => l . j, with all three functors horizontal.

I-----------I
|      /--->j
p>----@     |
|      \--->l
K-----------K

pwLanUniv :: forall {j1} {i} {k} (j2 :: j1 +-> i) (p :: k +-> i) (g :: k +-> j1). (PointwiseLeftKanExtension j2 p, Corepresentable g) => Sq ('Nil :: Path i i) ('Nil :: Path k k) (CorepStar p '::: ('Nil :: Path k k)) (CorepStar j2 '::: (CorepStar g '::: ('Nil :: Path k k))) -> Sq ('Nil :: Path j1 j1) ('Nil :: Path k k) (CorepStar (p <| j2) '::: ('Nil :: Path k k)) (CorepStar g '::: ('Nil :: Path k k)) Source Github #

The universal property of pointwise Lan. Mating reverses the transformation between the corepresentable profunctors.

The dotted inner square is the input; the solid outer square is the result.

A-------------------A
|                   |
|   I...........I   |
|   :      /--->j   |
l   p>----@     :   |
|   :      \------->g
|   K...........K   |
|                   |
K-------------------K

Here l is the corepresenting functor of p <| j.

pwLift :: forall {k} {j1} {j2} (j3 :: k +-> j1) (p :: k +-> j2). PointwiseLeftKanLift j3 p => Sq ('Nil :: Path j2 j2) ('Nil :: Path k k) (CorepStar p '::: ('Nil :: Path k k)) (CorepStar (j3 |> p) '::: (CorepStar j3 '::: ('Nil :: Path k k))) Source Github #

Pointwise Lift: p => j . l, with all three functors horizontal.

K-----------K
|      /--->l
p>----@     |
|      \--->j
I-----------I

pwLiftUniv :: forall {i} {k} {j1} (j2 :: i +-> k) (p :: i +-> j1) (g :: k +-> j1). (PointwiseLeftKanLift j2 p, Corepresentable g) => Sq ('Nil :: Path j1 j1) ('Nil :: Path i i) (CorepStar p '::: ('Nil :: Path i i)) (CorepStar g '::: (CorepStar j2 '::: ('Nil :: Path i i))) -> Sq ('Nil :: Path j1 j1) ('Nil :: Path k k) (CorepStar (j2 |> p) '::: ('Nil :: Path k k)) (CorepStar g '::: ('Nil :: Path k k)) Source Github #

The universal property of pointwise Lift.

The dotted inner square is the input; the solid outer square is the result.

K-------------------K
|                   |
|   K...........K   |
|   :      /------->g
l   p>----@     :   |
|   :      \--->j   |
|   I...........I   |
|                   |
J-------------------J

Here l is the corepresenting functor of j |> p.