Weighted Limits¶
Limits and colimits weighted by enrichment in V-categories.
weighted_limits
¶
Weighted (co)limits for V-enriched categories.
In a V-enriched category, the correct notion of limit is the weighted limit. Given a V-functor D: J → C (diagram) and a V-functor W: J → V (weight), the weighted limit {W, D} is characterized by:
C(X, {W, D}) ≅ [J, V](W, C(X, D-))
and the weighted colimit W ⊗_J D by:
C(W ⊗_J D, X) ≅ [J, V](W, C(D-, X))
In our finite setting, these reduce to end/coend computations:
{W, D} = ∫_j [W(j), D(j)] (weighted limit)
W ⊗_J D = ∫^j W(j) ⊗ D(j) (weighted colimit)
where [-, -] denotes the internal hom in V and ⊗ the tensor.
This module provides:
Weight — a V-valued presheaf (weight functor)
Diagram — a finite diagram of objects/morphisms
weighted_limit() — compute {W, D}
weighted_colimit() — compute W ⊗_J D
representable_weight() — weight represented by an object
terminal_weight() — constant weight at the unit
Weight
dataclass
¶
A V-valued presheaf on a finite indexing category.
Represents a weight functor W: J → V where J is a finite set of indices, and W assigns a V-value (scalar in the algebra's lattice) to each index.
Holds a torch.Tensor of values; not a value type.
| PARAMETER | DESCRIPTION |
|---|---|
values
|
A 1D tensor of shape (|J|,) with values in L (the algebra's lattice). W(j) = values[j].
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
Diagram
didactic-model
¶
Diagram(*, objects: tuple[SetObject, ...])
Bases: Model
A finite diagram of morphisms sharing a common domain or codomain.
For weighted limits, this is a collection of morphisms D(j): X → A_j for each index j (cone-shaped). For weighted colimits, this is a collection of morphisms D(j): A_j → X for each index j (cocone-shaped).
In the discrete case, this is a tuple of objects with no connecting morphisms.
| ATTRIBUTE | DESCRIPTION |
|---|---|
objects |
The objects A_j in the diagram, one per index j.
TYPE:
|
weighted_limit
¶
Compute the weighted limit {W, D} for a discrete diagram.
For a discrete diagram (no connecting morphisms), the weighted limit reduces to:
{W, D} = ∫_j [W(j), D(j)] = ⋀_j [W(j), D(j)]
where [w, x] is the internal hom in the algebra (residuation):
[w, x] = sup{v : w ⊗ v ≤ x}
For the product-fuzzy algebra, [w, x] = min(1, x/w) when w > 0, and the unit when w = 0.
For discrete diagrams with objects A_0, ..., A_{n-1}, this computes a tensor of shape (∏_j |A_j|,) representing the weighted product.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
The weight W with values W(j) for each j.
TYPE:
|
diagram
|
The diagram of objects.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
The weighted limit tensor. For discrete diagrams, shape is the meet of identity tensors scaled by the weights. |
Source code in src/quivers/enriched/weighted_limits.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
weighted_colimit
¶
Compute the weighted colimit W ⊗_J D for a discrete diagram.
For a discrete diagram, the weighted colimit reduces to:
W ⊗_J D = ∫^j W(j) ⊗ D(j) = ⋁_j W(j) ⊗ D(j)
This is the join (existential) over j of the tensor product of the weight value with the identity at each object.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
The weight W with values W(j) for each j.
TYPE:
|
diagram
|
The diagram of objects.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
The weighted colimit tensor. |
Source code in src/quivers/enriched/weighted_limits.py
weighted_limit_morphisms
¶
weighted_limit_morphisms(weight: Weight, morphisms: Sequence[Morphism], algebra: Algebra | None = None) -> Tensor
Compute a weighted limit from a family of morphisms.
Given morphisms f_j: X → A_j and weights W(j), computes the weighted meet:
result[x, ...] = ⋀_j [W(j), f_j(x, ...)]
This is the tensor-level computation of the weighted limit of a cone.
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
The weight W.
TYPE:
|
morphisms
|
The morphisms f_j comprising the cone.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
The weighted limit tensor. |
Source code in src/quivers/enriched/weighted_limits.py
weighted_colimit_morphisms
¶
weighted_colimit_morphisms(weight: Weight, morphisms: Sequence[Morphism], algebra: Algebra | None = None) -> Tensor
Compute a weighted colimit from a family of morphisms.
Given morphisms f_j: A_j → X and weights W(j), computes the weighted join:
result[..., x] = ⋁_j W(j) ⊗ f_j(..., x)
| PARAMETER | DESCRIPTION |
|---|---|
weight
|
The weight W.
TYPE:
|
morphisms
|
The morphisms f_j comprising the cocone.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
The weighted colimit tensor. |
Source code in src/quivers/enriched/weighted_limits.py
representable_weight
¶
representable_weight(index_set: FinSet, represented_at: int, algebra: Algebra | None = None) -> Weight
Create a representable weight (Yoneda-style).
The representable weight at index k is W(j) = I if j == k, and W(j) = ⊥ otherwise. Weighted limits with representable weights recover evaluation: {y(k), D} ≅ D(k).
| PARAMETER | DESCRIPTION |
|---|---|
index_set
|
The indexing set J.
TYPE:
|
represented_at
|
The representing index k.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Weight
|
The representable weight at k. |
Source code in src/quivers/enriched/weighted_limits.py
terminal_weight
¶
Create the terminal (constant unit) weight.
W(j) = I for all j. Weighted limits with the terminal weight recover ordinary (conical) limits.
| PARAMETER | DESCRIPTION |
|---|---|
index_set
|
The indexing set J.
TYPE:
|
algebra
|
The enrichment algebra. Defaults to PRODUCT_FUZZY.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Weight
|
The terminal weight. |