Profunctors¶
Profunctors (bimodules) in enriched categories.
profunctors
¶
Profunctors (bimodules) for V-enriched categories.
A V-profunctor R: A ↛ B is a V-valued functor A^op ⊗ B → V, represented as a tensor of shape (A.shape, B.shape). Every morphism in a V-enriched category is canonically a profunctor.
Profunctor composition uses the coend formula:
(R ; S)(a, c) = ∫^b R(a, b) ⊗ S(b, c)
which is exactly V-enriched composition. This module makes the profunctor structure explicit and provides composition via the coend from ends_coends.py.
This module provides:
Profunctor — explicit profunctor with contravariant/covariant structure
Profunctor
¶
A V-profunctor R: A ↛ B.
Wraps a tensor of shape (A.shape, B.shape) with explicit contravariant (A) and covariant (B) objects.
| PARAMETER | DESCRIPTION |
|---|---|
contra
|
The contravariant (domain/source) object A.
TYPE:
|
co
|
The covariant (codomain/target) object B.
TYPE:
|
tensor
|
The profunctor's tensor of shape (A.shape, B.shape).
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
Source code in src/quivers/enriched/profunctors.py
from_morphism
classmethod
¶
from_morphism(morph: Morphism) -> Profunctor
View a morphism as a profunctor (Yoneda embedding).
| PARAMETER | DESCRIPTION |
|---|---|
morph
|
A morphism R: A → B.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Profunctor
|
The profunctor R: A ↛ B with the same tensor. |
Source code in src/quivers/enriched/profunctors.py
compose
¶
compose(other: Profunctor) -> Profunctor
Profunctor composition via coend.
(R ; S)(a, c) = ∫^b R(a, b) ⊗ S(b, c)
This is equivalent to V-enriched composition via the algebra's compose method.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
Right profunctor S: B ↛ C.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Profunctor
|
Composed profunctor R ; S: A ↛ C. |
Source code in src/quivers/enriched/profunctors.py
to_morphism
¶
to_morphism() -> ObservedMorphism
Convert back to a morphism (same tensor, different framing).
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
A morphism with domain=contra, codomain=co. |