\documentclass{article}
\input{packages}
\input{def}

\lecture{Aggregation}

\begin{document}
\maketitle

\begin{definition}[(Unbiased) Monoid]
A tuple $\langle M, \Pi, \prf{a}, \prf{i} \rangle$ where the components have the following types:
\begin{framed}
\begin{description}
\item[Underlying Set $M$:] $\Type$
\item[Aggregator $\Pi$:] $\List M \to M$
\item[Associativity $\prf{a}$:] $\forall n : \N,\; \vec{m}_1, \dots, \vec{m}_n : \List M.\; \Pi \left[\Pi \vec{m}_1, \dots, \Pi \vec{m}_n\right] = \Pi (\vec{m}_1 \append \dots \append \vec{m}_n)$
\item[Identity $\prf{i}$:] $\forall m : M.\; m = \Pi \left[m\right]$
\end{description}
\end{framed}
\end{definition}

\begin{notation}
We use $m_1 * \dots * m_n$ to denote $\prod \left[m_1, \dots, m_n\right]$.
\end{notation}

\begin{remark}
This definition provides an $n$-ary operator for every $n$, which is why we call it \emph{unbiased}.
The former definition provided an operator for only arities $0$ and~$2$, which is why we call it \emph{biased}.
\end{remark}

\begin{example}
\begin{description}
\setlength{\itemsep}{0pt}
\item[$\N_\Sigma =$] $\langle \N, \Sigma, \noprf, \noprf \rangle$
\item[$\N_\Pi =$] $\langle \N, \Pi, \noprf, \noprf \rangle$
\item[$\N_{\max} =$] $\langle \N, \max, \noprf, \noprf \rangle$
\item[$\Z_\Sigma =$] $\langle \Z, \Sigma, \noprf, \noprf \rangle$
\item[$\Z_\Pi =$] $\langle \Z, \Pi, \noprf, \noprf \rangle$
\item[$\R_\Sigma =$] $\langle \R, \Sigma, \noprf, \noprf \rangle$
\item[$\R_\Pi =$] $\langle \R, \Pi, \noprf, \noprf \rangle$
\item[$\N^\infty_\Sigma =$] $\langle \N^\infty, \Sigma, \noprf, \noprf \rangle$ where $\forall \vec{n} : \List(\N^\infty).\; \infty \in \vec{n} \implies \Sigma \vec{n} = \infty$
\item[$\N^\infty_{\min} =$] $\langle \N^\infty, \min, \noprf, \noprf \rangle$ where $\forall \vec{n} : \List(\N^\infty).\; \min \vec{n} = \infty \implies \vec{n} = [\infty, \dots, \infty]$ (including $\nil$)
\item[$\B_\wedge =$] $\langle \B, \wedge, \noprf, \noprf \rangle$
\item[$\B_\vee =$] $\langle \B, \vee, \noprf, \noprf \rangle$
\item[$(\List T)_\Sigma =$] $\langle \List T, \Sigma, \cdot, \cdot \rangle$ where $\Sigma \left[\vec{t}_1, \dots, \vec{t}_n\right] = \vec{t}_1 \append \dots \append \vec{t}_n$ ($\nil$ when $n = 0$)
\item[$(\Multiset T)_\Sigma =$] $\langle \Multiset T, \Sigma, \cdot, \cdot \rangle$
\item[$(\Finset T)_\cup =$] $\langle \Finset T, \cup, \cdot, \cdot \rangle$
\item[$(\Set T)_\cup =$] $\langle \Set T, \cup, \cdot, \cdot \rangle$
\item[$(\Set T)_\cap =$] $\langle \Set T, \cap, \cdot, \cdot \rangle$
\end{description}
\end{example}

\begin{exercise}
Give a bijection between unbiased monoids and biased monoids.
\end{exercise}
\begin{remark}
The mapping of underlying sets and operations is fairly straightforward, but proving the associativity and identity laws is challenging, especially in the biased-to-unbiased direction.
\end{remark}
\begin{notation}
We call the function from unbiased monoids to biased monoids $\mathit{Bias}$, and the inverse $\mathit{Unbias}$.
\end{notation}

\end{document}