\documentclass{article}
\input{packages}
\input{def}

\pdfmapline{=rossbb rossbb <rossbb.pfb}
\DeclareSymbolFont{rossbb}{T1}{rossbb}{m}{n}
\DeclareMathSymbol{\bbepsilon}{\mathord}{rossbb}{`e}
\DeclareMathSymbol{\bbsemicolon}{\mathpunct}{rossbb}{`;}

\lecture{Effectors}

\begin{document}
\maketitle

\begin{definition}[Effector]
A tuple $\langle E, \xmapsto{\bbsemicolon}, \prf{a}, \prf{i} \rangle$ whose components have the following types:
\begin{framed}
\begin{description}
\item[Set of Effects~$E$:] $\Type$
\item[Sequence Relation~$\xmapsto{\bbsemicolon}$:] $\List(E) \times E \to \Prop$
\item[Associativity~$\prf{a}$:] $\forall \vec{\varepsilon}_1,\dots,\vec{\varepsilon}_n, \varepsilon.\; \forall \varepsilon_1,\dots,\varepsilon_n.\; (\forall i. \vec{\varepsilon}_i \xmapsto{\bbsemicolon} \varepsilon_i) \wedge [\varepsilon_1,\dots,\varepsilon_n] \xmapsto{\bbsemicolon} \varepsilon \implies \vec{\varepsilon}_1 \append \dots \append \vec{\varepsilon}_n \xmapsto{\bbsemicolon} \varepsilon$
\item[Identity~$\prf{i}$:] $\forall \varepsilon.\; [\varepsilon] \xmapsto{\bbsemicolon} \varepsilon$
\end{description}
\end{framed}
\end{definition}

\begin{example}
An important example is where $E$ is the singleton set and $\xmapsto{\bbsemicolon}$ always holds.
\end{example}

\begin{definition}[(Biased) $\cat{M}$-Enriched Natural Transformation from $\langle F_1, \mo{f}_1, \noprf, \noprf \rangle$ to $\langle F_2, \mo{f}_2, \noprf, \noprf \rangle$ as $\cat{M}$-enriched functors from $\langle O_1, \ob{M}_1, \mo{c}_1, \noprf, \mo{i}_1, \noprf \rangle$ to $\langle O_2, \ob{M}_2, \mo{c}_2, \noprf, \mo{i}_2, \noprf \rangle$]
A tuple $\langle \mo{t}, \prf{n} \rangle$ where the components have the following types:
\begin{framed}
\begin{description}
\item[Transformation $\mo{t}$:] For all pairs $\ob{C}_1, \ob{C}_2 : O_1$, an $\cat{M}$-morphism $\mo{t} : [\ob{M}_1(\ob{C}_1, \ob{C}_2)] \mto \ob{M}_2(F_1(\ob{C}_1), F_2(\ob{C}_2))$
\item[Naturality $\prf{d}$:] For all triples of objects $\ob{C}_1, \ob{C}_2, \ob{C}_3 : O_1$:
$$\begin{tikzpicture}[trim left=-78mm]
\path (-4.5,0) \marrow{o2}{\mo{c}_2};
\path ($(-1,-.5) + (o2.in12)$) \marrow{f11}{\mo{t}};
\path ($(-1,.5) + (o2.in22)$) \marrow{f12}{\mo{f}_2};
\draw[->] (f11.in11) +(-4mm,0) node[left] {$\ob{M}_1(\ob{C}_1,\ob{C}_2)$} -- +(0,0);
\draw[->] (f12.in11) +(-4mm,0) node[left] {$\ob{M}_1(\ob{C}_2,\ob{C}_3)$} -- +(0,0);
\draw[->] (f11.out) -- node[anchor=north west] {\hspace{-2mm}$\ob{M}_2(F_1(\ob{C}_1),F_2(\ob{C}_2))$} (o2.in12);
\draw[->] (f12.out) -- node[anchor=south west] {\hspace{-2mm}$\ob{M}_2(F_2(\ob{C}_2),F_2(\ob{C}_3))$} (o2.in22);
\draw[->] (o2.out) -- +(4mm,0) node[right] {$\ob{M}_2(F_1(\ob{C}_1),F_2(\ob{C}_3))$};
\node at (0,0) {$=$};
\path (4.5,0) \marrow{o2}{\mo{c}_2};
\path ($(-1,-.5) + (o2.in12)$) \marrow{f11}{\mo{f}_1};
\path ($(-1,.5) + (o2.in22)$) \marrow{f12}{\mo{t}};
\draw[->] (f11.in11) +(-4mm,0) node[left] {$\ob{M}_1(\ob{C}_1,\ob{C}_2)$} -- +(0,0);
\draw[->] (f12.in11) +(-4mm,0) node[left] {$\ob{M}_1(\ob{C}_2,\ob{C}_3)$} -- +(0,0);
\draw[->] (f11.out) -- node[anchor=north west] {\hspace{-2mm}$\ob{M}_2(F_1(\ob{C}_1),F_1(\ob{C}_2))$} (o2.in12);
\draw[->] (f12.out) -- node[anchor=south west] {\hspace{-2mm}$\ob{M}_2(F_1(\ob{C}_2),F_2(\ob{C}_3))$} (o2.in22);
\draw[->] (o2.out) -- +(4mm,0) node[right] {$\ob{M}_2(F_1(\ob{C}_1),F_2(\ob{C}_3))$};
\end{tikzpicture}$$
\end{description}
\end{framed}
\end{definition}

\begin{example}
A $\cat{Prost}$-enriched category is essentially a category with a preordering on each set of morphisms such that composition preserves the preordering.
A $\cat{Prost}$-enriched functor is essentially a functor~$F$ with the additional property that $\mo{m}_1 \leq \mo{m}_2$ in the domain $\cat{Prost}$-enriched category implies that $F(\mo{m}_1) \leq F(\mo{m}_2)$ in the codomain $\cat{Prost}$-enriched category.
A $\cat{Prost}$-enriched natural transformation turns out to be equivalent to just a natural transformation.
\end{example}

\begin{notation}
A $\cat{M}$-enriched category is sometimes referred to as simply a $\cat{M}$-category.
A $\cat{M}$-enriched functor is sometimes referred to as simply a $\cat{M}$-functor.
A $\cat{M}$-enriched natural transformation is sometimes referred to as simply a $\cat{M}$-transformation.
\end{notation}

\begin{definition}[$\cat{CAT}(\cat{M})$]
The 2-category whose objects are $\cat{M}$-categories, whose morphisms are $\cat{M}$-functors, and whose 2-cells are $\cat{M}$-transformations.
\end{definition}

\begin{example}
The function on sets/types $\List$ can be made into a $\cat{Prost}$-monad on the $\cat{Prost}$-category $\cat{Rel}$.
\end{example}

\begin{definition}[Lax Algebra of a $\cat{Prost}$-Monad~$\alg{M}$ on a $\cat{Prost}$-Category~$\cat{C}$]
A tuple $\langle \ob{C}, \mo{a}, \prf{a}, \prf{i} \rangle$ whose components have the following types:
\begin{framed}
\begin{description}
\item[Underlying Object $\ob{C}$:] $\cat{C}$
\item[Operation $\mo{a}$:] $M(\ob{C}) \mto \ob{C}$
\item[Associativity $\prf{a}$:] $M(\mo{a}) \cocomp \mo{a} \leq \mu_\ob{C} \cocomp \mo{a} : M(M(\ob{C})) \mto \ob{C}$
\item[Identity $\prf{i}$:] $\id_\ob{C} \leq \eta_\ob{C} \cocomp \mo{a} : \ob{C} \mto \ob{C}$
\end{description}
\end{framed}
\end{definition}

\begin{remark}
The above definition can be generalized to $\cat{CAT}$-monads by changing $\prf{a}$ and $\prf{i}$ to be 2-cells $\alpha$ and $\iota$ and then imposing equations required to be satisfied by $\alpha$ and $\iota$.
\end{remark}

\begin{remark}
An effector is exactly a lax algebra of the $\cat{Prost}$-monad $\List$ on the $\cat{Prost}$-category $\cat{Rel}$.
\end{remark}

\begin{exercise}
Prove that there is a bijection between the set of effectors and the set of small thin multicategories (where thin means there is at most one morphism from any domain to any codomain).
\end{exercise}

\begin{definition}[Semi-strict Effector]
An effector with the following additional property:
$$\forall \vec{\varepsilon}_1,\dots,\vec{\varepsilon}_n, \varepsilon.\; \vec{\varepsilon}_1 \append \dots \append \vec{\varepsilon}_n \xmapsto{\bbsemicolon} \varepsilon \implies \exists \varepsilon_1,\dots,\varepsilon_n.\; (\forall i. \vec{\varepsilon}_i \xmapsto{\bbsemicolon} \varepsilon_i) \wedge [\varepsilon_1,\dots,\varepsilon_n] \xmapsto{\bbsemicolon} \varepsilon$$
\end{definition}

\begin{definition}[Effectoid]
A set $E$ along with a unary relation $\bbepsilon \mapsto \bullet$, a binary relation $\bullet \leq \bullet$, and a ternary relation $\bullet \mathop{\bbsemicolon} \bullet \mapsto \bullet$ satisfying:
$$\begin{array}{@{}r@{\quad}r@{\;\;\;}c@{}}
\textbf{Identity} &
\forall \varepsilon, \varepsilon'. &
\begin{array}{@{}c@{}}
\exists \varepsilon_\ell.\; \bbepsilon \mapsto \varepsilon_\ell \wedge \varepsilon_\ell \bbsemicolon \varepsilon \mapsto \varepsilon' \\
\Updownarrow \\
\varepsilon \leq \varepsilon' \\
\Updownarrow \\
\exists \varepsilon_r.\; \bbepsilon \mapsto \varepsilon_r \wedge \varepsilon \bbsemicolon \varepsilon_r \mapsto \varepsilon'
\end{array} \\ \\
\textbf{Associativity} &
\forall \varepsilon_1, \varepsilon_2, \varepsilon_3, \varepsilon. &
\begin{array}{@{}c@{}}
\exists \bar{\varepsilon}.\; \varepsilon_1 \bbsemicolon \varepsilon_2 \mapsto \bar{\varepsilon} \wedge \bar{\varepsilon} \bbsemicolon \varepsilon_3 \mapsto \varepsilon \\
\Updownarrow \\
\exists \hat{\varepsilon}.\; \varepsilon_2 \bbsemicolon \varepsilon_3 \mapsto \hat{\varepsilon} \wedge \varepsilon_1 \bbsemicolon \hat{\varepsilon} \mapsto \varepsilon
\end{array} \\ \\
\textbf{Reflexivity} & \forall \varepsilon. & \varepsilon \leq \varepsilon \\ \\
& \forall \varepsilon, \varepsilon'. & \bbepsilon \mapsto \varepsilon \wedge \varepsilon \leq \varepsilon' \implies \bbepsilon \mapsto \varepsilon' \\
\textbf{Congruence} \\
& \forall \varepsilon_1, \varepsilon_2, \varepsilon, \varepsilon'. & \varepsilon_1 \bbsemicolon \varepsilon_2 \mapsto \varepsilon \wedge \varepsilon \leq \varepsilon' \implies \varepsilon_1 \bbsemicolon \varepsilon_2 \mapsto \varepsilon'
\end{array}$$
\end{definition}

\begin{theorem}
There is a bijection between the set of semi-strict effectors and the set of effectoids.
The bijection preserves the set $E$.
The unary relation $\bbepsilon \mapsto \varepsilon$ corresponds to $\nil \xmapsto{\bbsemicolon} \varepsilon$; the binary relation $\varepsilon \leq \varepsilon'$ corresponds to $[\varepsilon] \xmapsto{\bbsemicolon} \varepsilon'$; and the ternary relation $\varepsilon_1 \bbsemicolon \varepsilon_2 \mapsto \varepsilon$ corresponds to $[\varepsilon_1, \varepsilon_2] \xmapsto{\bbsemicolon} \varepsilon$.
\end{theorem}

\end{document}
