\documentclass{article}
\input{packages}
\input{def}

\lecture{Types}

\begin{document}
\maketitle

\begin{definition}[(Binary) Tensor $\ob{A} \otimes \ob{B}$ (where $\ob{A}$ and $\ob{B}$ are objects of a multicategory $\cat{M}$)]
An object of $\cat{M}$, denoted $\ob{A} \otimes \ob{B}$, with a morphism from $[\ob{A}, \ob{B}]$ to $\ob{A} \otimes \ob{B}$, denoted (unfortunately) $\langle,\rangle$, such that for any morphism $\mo{f}$ as in the left diagram below there exists a unique morphism $\mo{f}'$ as in the right diagram below such that the two diagrams depict equal morphisms.
\begin{center}
\begin{tikzpicture}[baseline=0]
\path (1,0) \marrow{m}{\mo{f}};
\draw[->] (m.in24)+(-4mm,0) node[left]{$\ob{A}$} -- (m.in24);
\draw[->] (m.in34)+(-4mm,0) node[left]{$\ob{B}$} -- (m.in34);
\draw[->] (m.in14) +(-4mm,-2.5mm) -- +(0,-.5mm);
\draw[->] (m.in14) +(-4mm,-2mm) -- +(0,0mm);
\draw[->] (m.in14) +(-4mm,-1.5mm) -- +(0,.5mm);
\draw[->] (m.in44) +(-4mm,1.5mm) -- +(0,-.5mm);
\draw[->] (m.in44) +(-4mm,2mm) -- +(0,0mm);
\draw[->] (m.in44) +(-4mm,2.5mm) -- +(0,.5mm);
\draw[->] (m.out) -- +(4mm,0);
\end{tikzpicture}
\qquad\qquad
\begin{tikzpicture}[baseline=0]
\path (1.5,0) \marrow{m}{\mo{f}'};
\path (-1.5,0) \marrow{m12}{\langle,\rangle};
\draw[->] (m12.in12) +(-4mm,0mm) node[left]{$\ob{A}$} -- +(0,0mm);
\draw[->] (m12.in22) +(-4mm,0mm) node[left]{$\ob{B}$} -- +(0,0mm);
\draw[->] (m12.out) -- node[above,near start]{$\ob{A} \otimes \ob{B}$} (m.in23);
\draw[->] (m.in13) +(-4mm,-2.5mm) -- +(0,-.5mm);
\draw[->] (m.in13) +(-4mm,-2mm) -- +(0,0mm);
\draw[->] (m.in13) +(-4mm,-1.5mm) -- +(0,.5mm);
\draw[->] (m.in33) +(-4mm,1.5mm) -- +(0,-.5mm);
\draw[->] (m.in33) +(-4mm,2mm) -- +(0,0mm);
\draw[->] (m.in33) +(-4mm,2.5mm) -- +(0,.5mm);
\draw[->] (m.out) -- +(4mm,0);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{definition}[Nullary Tensor $1$ (in a multicategory~$\cat{M}$)]
An object of $\cat{M}$, denoted $1$, with a nullary morphism to $1$, denoted (unfortunately) $\langle \rangle$, such that for any morphism $\mo{f}$ as in the left diagram below there exists a unique morphism $\mo{f}'$ as in the right diagram below such that the two diagrams depict equal morphisms.
\begin{center}
\begin{tikzpicture}[baseline=0]
\path (1,0) \marrow{m}{\mo{f}};
\draw[->] (m.in12) +(-4mm,-2.5mm) -- +(0,-.5mm);
\draw[->] (m.in12) +(-4mm,-2mm) -- +(0,0mm);
\draw[->] (m.in12) +(-4mm,-1.5mm) -- +(0,.5mm);
\draw[->] (m.in22) +(-4mm,1.5mm) -- +(0,-.5mm);
\draw[->] (m.in22) +(-4mm,2mm) -- +(0,0mm);
\draw[->] (m.in22) +(-4mm,2.5mm) -- +(0,.5mm);
\draw[->] (m.out) -- +(4mm,0);
\end{tikzpicture}
\qquad\qquad
\begin{tikzpicture}[baseline=0]
\path (1.5,0) \marrow{m}{\mo{f}'};
\path (-1.5,0) \marrow{m12}{\langle\rangle};
\draw[->] (m12.out) -- node[above,near start]{$1$} (m.in23);
\draw[->] (m.in13) +(-4mm,-2.5mm) -- +(0,-.5mm);
\draw[->] (m.in13) +(-4mm,-2mm) -- +(0,0mm);
\draw[->] (m.in13) +(-4mm,-1.5mm) -- +(0,.5mm);
\draw[->] (m.in33) +(-4mm,1.5mm) -- +(0,-.5mm);
\draw[->] (m.in33) +(-4mm,2mm) -- +(0,0mm);
\draw[->] (m.in33) +(-4mm,2.5mm) -- +(0,.5mm);
\draw[->] (m.out) -- +(4mm,0);
\end{tikzpicture}
\end{center}
\end{definition}

\begin{definition}[Representable Multicategory]
A multicategory with the property that a nullary tensor exists and a binary tensor exists for all pairs of objects.
\end{definition}

\begin{theorem}
There is a 2-functor on $\cat{MULTICAT}$, called $\List$, with a 2-transformation~$[\bullet] : \cat{MULTICAT} \nto \List$, such that a multicategory $\cat{M}$ is representable if and only if the 1-cell~$[\bullet]_\cat{M}$ is a right adjoint.
Given a multicategory~$\cat{M}$, the objects of $\List(\cat{M})$ are lists of objects of $\cat{M}$, and the morphisms of $\List(\cat{M})$ from $[\vec{\ob{C}}_1, \dots, \vec{\ob{C}}_n]$ to $\vec{\ob{C}}$ are a list $\vec{\mo{f}}$ of morphisms of $\cat{M}$ such that the list of outputs of $\vec{f}$ equals $\vec{\ob{C}}$ and flattening the list of lists of inputs of $\vec{f}$ equals $\vec{\ob{C}}_1 \append \dots \append \vec{\ob{C}}_n$.
$\eta_\cat{M}$ is the functor of multicategories mapping an object~$\ob{C}$ of $\cat{M}$ to the object $[\ob{C}]$ of $\List(\cat{M})$ and mapping a morphism~$\ob{f}$ to the morphism $[\ob{f}]$, which has the appropriate type because singleton is a unit of flatten.
\end{theorem}

\begin{definition}[Left Exponential $\ob{A} \multimap \ob{B}$ (where $\ob{A}$ and $\ob{B}$ are objects of a multicategory $\cat{M}$)]
An object of $\cat{M}$, denoted $\ob{A} \multimap \ob{B}$, with a morphism from $[\ob{A}, \ob{A} \multimap \ob{B}]$ to $\ob{B}$, denoted $\mo{eval}$, such that for any morphism $\mo{f}$ as in the left diagram below there exists a unique morphism, denoted $\lambda \mo{f}$, as in the right diagram below such that the two diagrams depict equal morphisms.
\begin{center}
\begin{tikzpicture}[baseline=0]
\path (0,0) \marrow{m}{\mo{f}};
\draw[->] (m.in12)+(-4mm,0) node[left]{$\ob{A}$} -- (m.in12);
\draw[->] (m.in22) +(-4mm,-.5mm) -- +(0,-.5mm);
\draw[->] (m.in22) +(-4mm,0mm) -- +(0,0mm);
\draw[->] (m.in22) +(-4mm,.5mm) -- +(0,.5mm);
\draw[->] (m.out) -- +(4mm,0) node[right]{$\ob{B}$};
\end{tikzpicture}
\qquad\qquad
\begin{tikzpicture}[baseline=(m.out)]
\path (2,0) \marrow{e}{\mo{eval}};
\path (e.in22) +(-2,0) \marrow{m}{\lambda \mo{f}};
\draw[->] (m.in11) +(-4mm,-.5mm) -- +(0,-.5mm);
\draw[->] (m.in11) +(-4mm,0mm) -- +(0,0mm);
\draw[->] (m.in11) +(-4mm,.5mm) -- +(0,.5mm);
\draw[->] (m.out) -- node[above]{$\ob{A} \multimap \ob{B}$} (e.in22);
\draw[->] (e.in12)+(-4mm,0) node[left]{$\ob{A}$} -- (e.in12);
\draw[->] (e.out) -- +(+4mm,0) node[right]{$\ob{B}$};
\end{tikzpicture}
\end{center}
\end{definition}

\begin{definition}[Left-Closed Multicategory]
A multicategory with the property that left exponentionals exist for all pairs of objects.
\end{definition}

\begin{remark}
There are analogous definitions for right exponential (denoted $\multimapinv$) and right-closed. A multicategory that is both left-closed and right-closed is simply called closed. For symmetric multicategories, left exponentials are always isomorphic to right exponentials, so being left-closed implies being right-closed and vice versa.
\end{remark}

\begin{remark}
Given a category~$\cat{C}$ with finite products (including terminal object), one can construct a multicategory $\cat{C}_\with$ with the same objects as $\cat{C}$ such that a morphism in $\cat{C}_\with$ from $[\ob{C}_1, \dots, \ob{C}_n]$ to $\ob{C}$ is a morphism in $\cat{C}$ from $\with_{i : \mathbb{n}} \ob{C}_i$ to $\ob{C}$.
$\cat{C}_\with$ will always be representable (and symmetric); the tensor of $\ob{A}$ and $\ob{B}$ is $\ob{A} \with \ob{B}$.
\end{remark}

\begin{definition}[Cartesian-Closed Category]
A category~$\cat{C}$ with finite products such that $\cat{C}_\with$ is closed.
\end{definition}

\begin{theorem}
Suppose $\cat{E}$ is finite.
If $\cat{C}$ has all limits with a finite scheme~$\cat{S}$, then $\cat{E} \expto \cat{C}$ has all limits with the scheme~$\cat{S}$ (constructed pointwise).
If $\cat{C}$ has all colimits with a finite scheme~$\cat{S}$, then $\cat{E} \expto \cat{C}$ has all colimits with the scheme~$\cat{S}$ (constructed pointwise).
If $\cat{C}$ is finitely complete and cartesian-closed, then $\cat{E} \expto \cat{C}$ is also cartesian-closed.
Given objects $\ob{A}$ and $\ob{B}$ of $\cat{E} \expto \cat{C}$, the exponential $\ob{A} \expto \ob{B}$ is constructed by the following process.
TODO: Twisted arrow category under $\ob{E}$.
\end{theorem}

\end{document}
