Base Change¶
Change of enriching category for V-enriched categories.
base_change
¶
Change of enrichment (change of base) for V-enriched categories.
A lax monoidal functor F: V → W between quantales induces a change-of-base 2-functor from V-Cat to W-Cat. This transforms all morphism tensors by applying F elementwise, changing the enrichment algebra from V to W.
This module provides:
BaseChange (abstract)
├── BoolToFuzzy — inclusion {0,1} ↪ [0,1]
└── FuzzyToBool — thresholding [0,1] → {0,1}
BaseChange
¶
Bases: ABC
Abstract change of enrichment from quantale V to quantale W.
Subclasses must implement source, target, and apply_to_values. apply_to_morphism is derived.
apply_to_values
abstractmethod
¶
apply_to_values(tensor: Tensor) -> Tensor
Apply the value-level map V → W elementwise.
| PARAMETER | DESCRIPTION |
|---|---|
tensor
|
A V-valued tensor.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tensor
|
The corresponding W-valued tensor. |
Source code in src/quivers/categorical/base_change.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
apply_to_morphism
¶
apply_to_morphism(morph: Morphism) -> ObservedMorphism
Transform a V-morphism to a W-morphism.
Applies the value-level map to the morphism's tensor and returns an observed morphism with the target quantale.
| PARAMETER | DESCRIPTION |
|---|---|
morph
|
A morphism enriched over V.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ObservedMorphism
|
The same morphism re-enriched over W. |
Source code in src/quivers/categorical/base_change.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
BoolToFuzzy
¶
Bases: BaseChange
Inclusion of the boolean quantale into the fuzzy quantale.
The identity map {0, 1} ↪ [0, 1]. Boolean-valued tensors are already valid fuzzy-valued tensors, so this is the identity on tensor values.
apply_to_values
¶
apply_to_values(tensor: Tensor) -> Tensor
Identity: {0,1} values are already in [0,1].
Source code in src/quivers/categorical/base_change.py
112 113 114 | |
FuzzyToBool
¶
FuzzyToBool(threshold: float = 0.5)
Bases: BaseChange
Thresholding from the fuzzy quantale to the boolean quantale.
Applies a threshold: values >= threshold become 1, others become 0. This is a right adjoint to BoolToFuzzy.
| PARAMETER | DESCRIPTION |
|---|---|
threshold
|
The threshold value. Must be in (0, 1). Default 0.5.
TYPE:
|
Source code in src/quivers/categorical/base_change.py
129 130 131 132 133 | |
apply_to_values
¶
apply_to_values(tensor: Tensor) -> Tensor
Threshold: values >= threshold → 1, else → 0.
Source code in src/quivers/categorical/base_change.py
148 149 150 | |