Mario RomΓ‘n

Search

Search IconIcon to open search

Promonoidal category of optics

Last updated Apr 23, 2024

promonoidal-category-of-optics

See also

# Definition

Let $𝕍$ be a monoidal category. The promonoidal category of optics $\operatorname{Optic}(𝕍)$ is a category with the same objects as $𝕍 Γ— 𝕍^{op}$ and with morphisms given by $$ \operatorname{Optic}(𝕍)\left( \binom{X}{X’};\binom{Y}{Y’} \right) = ∫^{A \in 𝕍} 𝕍(Y; A βŠ— X) Γ— 𝕍(A βŠ— X’; Y’). $$ The promonoidal structure is given by $$ \operatorname{Optic}(𝕍)\left( \binom{X}{X’},\binom{Y}{Y’};\binom{Z}{Z’} \right) = ∫^{A \in 𝕍} 𝕍(Z; X βŠ— A) Γ— 𝕍(A βŠ— X; B βŠ— Y) Γ— 𝕍(Y βŠ— B’ ; Z’), $$ $$ \operatorname{Optic}(𝕍)\left( \binom{X}{X’} \right) = 𝕍(X,X’).$$

# Protensor and prounit of optics

protensor-and-prounit-of-optics

The promonoidal structure of optics is determined by two profunctors $𝕆𝕍(\bullet)$ and $𝕆𝕍(\bullet,\bullet;\bullet)$. The actions of optics on these two profunctors determine multiple possible insertions of optics and transformations on the context that an optic determines.

The prounit of optics becomes a profunctor, $(𝕆𝕍(\bullet), <)$, with optic evaluation, $$ (<)οΉ• 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix} \right) Γ— 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}; \begin{matrix} Y \\ Y’ \end{matrix} \right) β†’ 𝕆𝕍\left( \begin{matrix} Y \\ Y’ \end{matrix} \right), $$ defined by $f < \langle g_0 \mid g_1 \rangle = g_0 β¨Ύ (id βŠ— f) β¨Ύ g_1$.

The protensor of optics becomes a profunctor, $(𝕆𝕍(\bullet,\bullet;\bullet),>_l,>_r,<)$, with the two possible optic insertions and evaluation, $$ (>_l)οΉ• 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}; \begin{matrix} A \\ A’ \end{matrix} \right) Γ— 𝕆𝕍\left( \begin{matrix} A \\ A’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix} ; \begin{matrix} Z \\ Z’ \end{matrix}\right) β†’ 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix} ; \begin{matrix} Z \\ Z’ \end{matrix}\right), $$ $$ (>_r)οΉ• 𝕆𝕍\left( \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} A \\ A’ \end{matrix} \right) Γ— 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} A \\ A’ \end{matrix} ; \begin{matrix} Z \\ Z’ \end{matrix}\right) β†’ 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix} ; \begin{matrix} Z \\ Z’ \end{matrix}\right), $$ $$ (<)οΉ• 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} A \\ A’ \end{matrix} ; \begin{matrix} A \\ A’ \end{matrix}\right) Γ— 𝕆𝕍\left( \begin{matrix} A \\ A’ \end{matrix}; \begin{matrix} Z \\ Z’ \end{matrix} \right) β†’ 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix} ; \begin{matrix} Z \\ Z’ \end{matrix}\right), $$ which are defined by $$\langle gβ‚€ \mid g₁ \rangle \mathbin{>_l}\langle fβ‚€ \mid f₁ \mid fβ‚‚ \rangle = \langle fβ‚€ β¨Ύ (id βŠ— gβ‚€) \mid (id βŠ— g₁) β¨Ύ f₁ \mid fβ‚‚ \rangle,$$ $$\langle hβ‚€ \mid h₁ \rangle \mathbin{>_r}\langle fβ‚€ \mid f₁ \mid fβ‚‚ \rangle = \langle fβ‚€ \mid f₁ β¨Ύ (id βŠ— hβ‚€) \mid (id βŠ— h₁) β¨Ύ fβ‚‚ \rangle,$$ $$ \langle fβ‚€ \mid f₁ \mid fβ‚‚ \rangle \mathbin{<} \langle tβ‚€ \mid t₁ \rangle = \langle tβ‚€ β¨Ύ (id βŠ— fβ‚€) \mid (id βŠ— f₁) \mid (id βŠ— fβ‚‚) β¨Ύ t₁ \rangle.$$

# Procoherence for optics

procoherence-for-optics

The unitors may be constructed via coend calculus, using the units of the monoidal category. $$ \begin{aligned} & ∫^{\begin{pmatrix} X \\ X’ \end{pmatrix} \in 𝕆𝕍} 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix} \right) Γ— 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} Z \\ Z’ \end{matrix} \right) \\ \cong & \quad \mbox{Introducing units by definition of optic.} \\ & ∫^{\begin{pmatrix} X \\ X’ \end{pmatrix} \in 𝕆𝕍} 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix} ; \begin{matrix} I \\ I \end{matrix} \right) Γ— 𝕆𝕍\left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} Z \\ Z’ \end{matrix} \right) \\ \cong & \quad \mbox{Yoneda reduction.}\\ & 𝕆𝕍\left( \begin{matrix} I \\ I \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} Z \\ Z’ \end{matrix} \right) \\ \cong & \quad \mbox{Reducing units by definition of optic.}\\ & 𝕆𝕍\left( \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} Z \\ Z’ \end{matrix} \right) \\ \end{aligned} $$ The associators are finally constructed via coend calculus, by noticing that three-part data accessors have a common representation, independent of that how we get to them. $$ \begin{aligned} & ∫^{\begin{pmatrix} U \\ U’ \end{pmatrix} \in 𝕆𝕍} 𝕆𝕍 \left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} U \\ U’ \end{matrix} \right) Γ— 𝕆𝕍 \left( \begin{matrix} U \\ U’ \end{matrix}, \begin{matrix} Z \\ Z’ \end{matrix}; \begin{matrix} T \\ T’ \end{matrix} \right) \\ \cong & \quad \mbox{Splitting by definition of optic.} \\ & ∫^{\begin{pmatrix} U \\ U’ \end{pmatrix} \in 𝕆𝕍, C \in 𝕍} 𝕆𝕍 \left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} U \\ U’ \end{matrix} \right) Γ— 𝕆𝕍 \left( \begin{matrix} U \\ U’ \end{matrix}; \begin{matrix} T \\ C βŠ— Z \end{matrix} \right) Γ— 𝕍 \left( C βŠ— Z’,T' \right) \\ \cong & \quad \mbox{Yoneda reduction.} \\ & ∫^{C \in 𝕍} 𝕆𝕍 \left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} Y \\ Y’ \end{matrix}; \begin{matrix} T \\ C βŠ— Z \end{matrix} \right) Γ— 𝕍 \left( C βŠ— Z’,T' \right) \\ \cong & \quad \mbox{By the definition of protensor.} \\ & ∫^{A, B, C \in 𝕍} 𝕍 (T; A βŠ— X) Γ— 𝕍(A βŠ— X’; B βŠ— Y) Γ— 𝕍(B βŠ— Y’; C βŠ— Z)×𝕍(C βŠ— Z’,T’) \\ \cong & \quad \mbox{By the definition of protensor.} \\ & ∫^{A \in 𝕍} 𝕍 \left( T, A βŠ— X \right) Γ— 𝕆𝕍 \left( \begin{matrix} Y \\ Z \end{matrix}, \begin{matrix} Z \\ Z’ \end{matrix}; \begin{matrix} A βŠ— X’ \\ T’ \end{matrix} \right)\\ \cong & \quad \mbox{Yoneda reduction.} \\ & ∫^{\begin{pmatrix} U \\ U’ \end{pmatrix} \in 𝕆𝕍, A \in 𝕍} 𝕍 \left( T, A βŠ— X \right) Γ— 𝕆𝕍 \left( \begin{matrix} U \\ U’ \end{matrix}; \begin{matrix} A βŠ— X’ \\ T’ \end{matrix} \right) Γ— 𝕆𝕍 \left( \begin{matrix} Y \\ Y’ \end{matrix}, \begin{matrix} Z \\ Z’ \end{matrix}; \begin{matrix} U \\ U’ \end{matrix} \right)\\ \cong & \quad \mbox{Splitting by definition of optic.} \\ & ∫^{\begin{pmatrix} U \\ U’ \end{pmatrix} \in 𝕆𝕍} 𝕆𝕍 \left( \begin{matrix} X \\ X’ \end{matrix}, \begin{matrix} U \\ U’ \end{matrix}; \begin{matrix} T \\ T’ \end{matrix} \right) Γ— 𝕆𝕍 \left( \begin{matrix} Y \\ Y’ \end{matrix}, \begin{matrix} Z \\ Z’ \end{matrix}; \begin{matrix} U \\ U’ \end{matrix} \right). \end{aligned} $$