Adjunctions¶
Adjoint functor pairs and adjoint relationships between categories.
adjunctions
¶
Adjunctions between endofunctors.
An adjunction F ⊣ G consists of functors F (left adjoint) and G (right adjoint), together with natural transformations:
η: Id ⇒ G ∘ F (unit)
ε: F ∘ G ⇒ Id (counit)
satisfying the triangle identities:
ε_{F(A)} ∘ F(η_A) = id_{F(A)}
G(ε_A) ∘ η_{G(A)} = id_{G(A)}
Every adjunction induces a monad T = G ∘ F with η as unit and μ = G(ε_F) as multiplication.
This module provides:
Adjunction (abstract)
└── FreeForgetfulAdjunction — Free monoid ⊣ Forgetful
ForgetfulFunctor
¶
Bases: Functor
The forgetful functor from FreeMonoid-algebras to FinSet.
On objects: A ↦ A (the underlying set). Since FreeMonoid is already a CoproductSet (hence a SetObject), the forgetful functor is the identity on the set level. On morphisms: identity on tensors.
In the adjunction Free ⊣ Forget, "Forget" maps A back to A as a bare set (no monoid structure). Since we represent everything as bare sets already, this is the identity functor.
map_object
¶
Identity on objects.
Source code in src/quivers/categorical/adjunctions.py
50 51 52 | |
map_morphism
¶
map_morphism(morph: Morphism) -> FunctorMorphism
Identity on morphisms.
Source code in src/quivers/categorical/adjunctions.py
54 55 56 57 58 | |
map_tensor
¶
map_tensor(tensor: Tensor, quantale: object) -> Tensor
Identity on tensors.
Source code in src/quivers/categorical/adjunctions.py
60 61 62 | |
Adjunction
¶
Bases: ABC
Abstract adjunction F ⊣ G.
Subclasses must implement left, right, unit_component, and counit_component.
unit_component
abstractmethod
¶
The unit component η_A: A → G(F(A)).
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object A.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Morphism
|
The unit morphism η_A. |
Source code in src/quivers/categorical/adjunctions.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
counit_component
abstractmethod
¶
The counit component ε_A: F(G(A)) → A.
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object A.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Morphism
|
The counit morphism ε_A. |
Source code in src/quivers/categorical/adjunctions.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
verify_triangle_left
¶
verify_triangle_left(obj: SetObject, atol: float = 1e-05) -> bool
Verify left triangle identity: ε_{F(A)} ∘ F(η_A) ≈ id_{F(A)}.
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object A.
TYPE:
|
atol
|
Absolute tolerance.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the identity holds within tolerance. |
Source code in src/quivers/categorical/adjunctions.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
verify_triangle_right
¶
verify_triangle_right(obj: SetObject, atol: float = 1e-05) -> bool
Verify right triangle identity: G(ε_A) ∘ η_{G(A)} ≈ id_{G(A)}.
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object A.
TYPE:
|
atol
|
Absolute tolerance.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the identity holds within tolerance. |
Source code in src/quivers/categorical/adjunctions.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
FreeForgetfulAdjunction
¶
FreeForgetfulAdjunction(max_length: int)
Bases: Adjunction
The free-forgetful adjunction: Free ⊣ Forget.
Free: FinSet → FinSet via FreeMonoidFunctor (A ↦ A) Forget: identity at set level (A ↦ A* as bare set)
η_A: A → A embeds each element as a length-1 word. ε_A: A → A projects onto length-1 words (for A a FinSet).
| PARAMETER | DESCRIPTION |
|---|---|
max_length
|
Maximum string length for the free monoid.
TYPE:
|
Source code in src/quivers/categorical/adjunctions.py
187 188 189 190 | |
unit_component
¶
η_A: A → A* embeds as length-1 words.
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
Must be a FinSet.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Morphism
|
The embedding morphism. |
Source code in src/quivers/categorical/adjunctions.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
counit_component
¶
ε_A: Free(Forget(A)) → A.
For a FinSet A, this projects A* onto A by extracting the length-1 stratum. Length-1 words map to their element; all others (empty string, longer words) map to zero.
For a FreeMonoid A (needed by the left triangle identity), this is the monoid evaluation map (A) → A that concatenates formal words of words into single words.
| PARAMETER | DESCRIPTION |
|---|---|
obj
|
The object A.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Morphism
|
The counit morphism. |
Source code in src/quivers/categorical/adjunctions.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |