Kan Extensions¶
Left and right Kan extensions in enriched categories.
kan_extensions
¶
Kan extensions: generalized (re)indexing of morphisms.
The left Kan extension of a morphism R: A → B along a map p: A → A' produces a morphism Lan_p(R): A' → B via:
(Lan_p R)(a', b) = ⋁{a : p(a) = a'} R(a, b)
The right Kan extension uses meet (⋀) instead of join (⋁):
(Ran_p R)(a', b) = ⋀{a : p(a) = a'} R(a, b)
Marginalization is a special case: left Kan extension along a projection π: A₁×...×Aₙ → A_{i₁}×...×A_{iₖ}.
This module provides:
ObjectMap (abstract) — maps between finite sets
├── Projection — π: A₁×...×Aₙ → some subset of components
└── Inclusion — ι: A → A + B (coproduct injection)
left_kan() — left Kan extension
right_kan() — right Kan extension
ObjectMap
¶
Bases: ABC
An abstract deterministic map between finite sets.
Represents a function p: A → A' at the element level, used as the map along which to compute Kan extensions.
apply
abstractmethod
¶
Map a source index to a target index.
| PARAMETER | DESCRIPTION |
|---|---|
source_idx
|
An element of A as a multi-index.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple[int, ...]
|
The corresponding element of A'. |
Source code in src/quivers/enriched/kan_extensions.py
fiber_indices
¶
Return all source indices that map to the given target index.
| PARAMETER | DESCRIPTION |
|---|---|
target_idx
|
An element of A'.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
list[tuple[int, ...]]
|
All a ∈ A such that p(a) = target_idx. |
Source code in src/quivers/enriched/kan_extensions.py
Projection
¶
Projection(product: ProductSet, keep_indices: tuple[int, ...])
Bases: ObjectMap
Projection from a product to a subset of its components.
Given ProductSet(A₁, ..., Aₙ), projects onto the components at the specified indices: π(a₁, ..., aₙ) = (a_{i₁}, ..., a_{iₖ}).
| PARAMETER | DESCRIPTION |
|---|---|
product
|
The source product set.
TYPE:
|
keep_indices
|
Indices of the components to keep (0-based).
TYPE:
|
Source code in src/quivers/enriched/kan_extensions.py
drop_indices
property
¶
Indices of the dropped (marginalized) components.
apply
¶
Project by keeping only the selected component indices.
Source code in src/quivers/enriched/kan_extensions.py
Inclusion
¶
Inclusion(coproduct: CoproductSet, component_index: int)
Bases: ObjectMap
Coproduct inclusion ι_k: Aₖ → A₁ + ... + Aₙ.
Embeds the k-th component of a CoproductSet into the full set.
| PARAMETER | DESCRIPTION |
|---|---|
coproduct
|
The target coproduct set.
TYPE:
|
component_index
|
Which component to include (0-based).
TYPE:
|
Source code in src/quivers/enriched/kan_extensions.py
apply
¶
left_kan
¶
left_kan(morph: Morphism, along: ObjectMap, algebra: Algebra | None = None) -> ObservedMorphism
Left Kan extension of a morphism along an object map.
Computes: (Lan_p R)(a', b) = ⋁{a : p(a) = a'} R(a, b)
| PARAMETER | DESCRIPTION |
|---|---|
morph
|
The morphism R: A → B.
TYPE:
|
along
|
The map p: A → A'.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The left Kan extension Lan_p(R): A' → B. |
Source code in src/quivers/enriched/kan_extensions.py
right_kan
¶
right_kan(morph: Morphism, along: ObjectMap, algebra: Algebra | None = None) -> ObservedMorphism
Right Kan extension of a morphism along an object map.
Computes: (Ran_p R)(a', b) = ⋀{a : p(a) = a'} R(a, b)
| PARAMETER | DESCRIPTION |
|---|---|
morph
|
The morphism R: A → B.
TYPE:
|
along
|
The map p: A → A'.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The right Kan extension Ran_p(R): A' → B. |