diff --git a/Book-Poly.tex b/Book-Poly.tex index 5484ce2..c0b849d 100644 --- a/Book-Poly.tex +++ b/Book-Poly.tex @@ -1,7 +1,7 @@ -\documentclass[11pt]{memoir} +\documentclass[10pt]{memoir} \settrims{0pt}{0pt} % page and stock same size -\settypeblocksize{*}{34.5pc}{*} % {height}{width}{ratio} +\settypeblocksize{190mm}{110mm}{*} % {height}{width}{ratio} \setlrmargins{*}{*}{1} % {spine}{edge}{ratio} \setulmarginsandblock{1in}{1in}{*} % height of typeblock computed \setheadfoot{\onelineskip}{2\onelineskip} % {headheight}{footskip} @@ -31,8 +31,7 @@ \usepackage{subfiles} \usepackage[backend=biber, backref=true, maxbibnames = 10, style = alphabetic]{biblatex} \usepackage{xr-hyper} -\usepackage[bookmarks=true, colorlinks=true, linkcolor=blue!50!black, -citecolor=orange!50!black, urlcolor=orange!50!black, pdfencoding=unicode]{hyperref} +\usepackage[bookmarks=true,hidelinks,pdfencoding=unicode]{hyperref} \usepackage[capitalize]{cleveref} % Multirow tables @@ -49,11 +48,8 @@ \usepackage{varwidth} \usepackage[prefix=tikzsym]{tikzsymbols} \usepackage{makecell}%database table thickness -%\usepackage{graphicx} -%\usepackage[all]{xy} \usepackage{multirow} - % Fonts \usepackage{amssymb} \usepackage{newpxtext} @@ -63,20 +59,12 @@ \usepackage{dutchcal} \usepackage{fontawesome} -% For matrices with labeled columns and rows -% \usepackage{kbordermatrix}% http://www.hss.caltech.edu/~kcb/TeX/kbordermatrix.sty -%\usepackage{accents} -%\usepackage{eucal} - % MathVersion kludge \DeclareMathVersion{normal2} % For external graphics. \graphicspath{graphics/} -%\usepackage{changepage} %indented paragraphs in solutions -%\usepackage{showkeys} %for drafting; prints labels in margin - %-------- Package setup --------% % cleveref % @@ -99,15 +87,6 @@ % footnote \makesavenoteenv{tabular} -% minted -%\newenvironment{agda} -% {\VerbatimEnvironment -% \begin{minted}[escapeinside=??, mathescape=true, frame=single, framesep=5pt, tabsize=1 -% ]{Agda}} -% {\end{minted}} - - - % tikz % \usetikzlibrary{ cd, @@ -141,10 +120,6 @@ } \end{tikzpicture}}} -%\usepackage{circuitikz} - - -% mdframed/tablefootnote% % This makes \tablefootnote allow construction of footnotes that appear at bottom of page instead of inside frame \makeatletter @@ -167,51 +142,46 @@ % Colored box background colours -\colorlet{theoremcolor}{white!92!blue} -\colorlet{definitioncolor}{white!92!purple} -\colorlet{examplecolor}{white!91!green} -\colorlet{exercisecolor}{white!96!green} +\colorlet{theoremcolor}{white} +\colorlet{definitioncolor}{white} +\colorlet{examplecolor}{white} +\colorlet{exercisecolor}{white} \mdfdefinestyle{theoremframe}{ - linewidth=0pt, - %linecolor=blue, - backgroundcolor=theoremcolor, + linewidth=1pt, roundcorner=6pt, nobreak=true, leftmargin=0, - innerleftmargin=0, + innerleftmargin=9pt, rightmargin=0, - innerrightmargin=0, + innerrightmargin=9pt, } \mdfdefinestyle{definitionframe}{ - linewidth=0pt, - %linecolor=blue, - backgroundcolor=definitioncolor, + linewidth=1pt, roundcorner=6pt, leftmargin=0, - innerleftmargin=0, + innerleftmargin=9pt, rightmargin=0, - innerrightmargin=0, + innerrightmargin=9pt, } \mdfdefinestyle{exampleframe}{ - linewidth=0pt, - backgroundcolor=examplecolor, + linewidth=1pt, + roundcorner=6pt, leftmargin=0, - innerleftmargin=0, + innerleftmargin=9pt, rightmargin=0, - innerrightmargin=0, + innerrightmargin=9pt, } \mdfdefinestyle{exerciseframe}{ - linewidth=0pt, - backgroundcolor=exercisecolor, + linewidth=1pt, leftmargin=0, - innerleftmargin=0, + innerleftmargin=9pt, rightmargin=0, - innerrightmargin=0, + innerrightmargin=9pt, } \newtheoremstyle{plain} @@ -258,30 +228,6 @@ \newcommand{\nolisttopbreak}{\nobreak\@afterheading} \makeatother -% \newcounter{solcounterlocal}[section] -% \newcounter{solcounterglobal} - -% \newcommand{\sol}[4][noprint]{ - -% \stepcounter{solcounterlocal}\stepcounter{solcounterglobal} - -% \noindent\ignorespacesafterend\emph{Solution to} \cref{#2}.% -% \nopagebreak% -% \ifthenelse{\equal{#1}{print}}{ -% \nopagebreak% -% \begin{mdframed}[backgroundcolor=examplecolor,linewidth=0pt]% -% #3% -% \end{mdframed}% -% \nopagebreak -% }{}% -% \nolisttopbreak -% \begin{description}[leftmargin=2.5ex,itemindent=0pt,topsep=0ex,nosep] -% \item\nopagebreak -% #4 -% \end{description} -% \bigskip -% } - \Newassociation{solution}{Sol}{solutions} \renewenvironment{Sol}[1] @@ -672,7 +618,7 @@ \vspace{2in} \begin{center} \begin{tabular}{lll} -\LARGE Nelson Niu&~\hspace{.75in}~&\LARGE David I. Spivak\\ +\LARGE Nelson Niu&~\hspace{.5in}~&\LARGE David I. Spivak\\ \large University of Washington&&\large Topos Institute\\ \large Seattle, WA&&\large Berkeley, CA \end{tabular} diff --git a/P1-Polynomials.tex b/P1-Polynomials.tex index 349b1f8..db20e0c 100644 --- a/P1-Polynomials.tex +++ b/P1-Polynomials.tex @@ -11,7 +11,7 @@ \part{The category of polynomial functors}\label{part.poly} \Opensolutionfile{solutions}[solution-file1] %------------ Chapter ------------% -\chapter{Representable functors from the~category of sets} \label{ch.poly.rep-sets} +\chapter{Representable functors} \label{ch.poly.rep-sets} In this chapter, we lay the categorical groundwork needed to define our category of interest, the category of polynomial functors. We begin by examining a special kind of polynomial functor that you may already be familiar with---representable functors from the category $\smset$ of sets and functions.% @@ -31,7 +31,7 @@ \section{Representable functors and the Yoneda lemma} \label{sec.poly.rep-sets.y While much of the following theory applies to representable functors from any category, we need only focus on representable functors $\smset\to\smset$. \begin{definition}[Representable functor] \label{def.representable} - For a set $S$, we denote by $\yon^S\colon\smset\to\smset$ the functor that sends each set $X$ to the set $X^S=\smset(S,X)$ and each function $h\colon X\to Y$ to the function $h^S\colon X^S\to Y^S$ that sends $g\colon S\to X$ to $g\then h\colon S\to Y$.\footnote{Throughout this text, given morphisms $f \colon A \to B$ and $g \colon B \to C$ in a category, we will denote their composite morphism $A \to C$ interchangeably as $f \then g$ or $g \circ f$ (or even $gf$), whichever is more convenient.} + For a set $S$, we denote by $\yon^S\colon\smset\to\smset$ the functor that sends each set $X$ to the set $X^S=\smset(S,X)$ and each function $h\colon X\to Y$ to the function $h^S\colon X^S\to Y^S$ that sends $g\colon S\to X$ to $g\then h\colon S\to Y$.\tablefootnote{Throughout this text, given morphisms $f \colon A \to B$ and $g \colon B \to C$ in a category, we will denote their composite morphism $A \to C$ interchangeably as $f \then g$ or $g \circ f$ (or even $gf$), whichever is more convenient.} We call a functor (isomorphic to one) of this form a \emph{representable functor}, or a \emph{representable}. In particular, we call $\yon^S$ the functor \emph{represented by} $S$, and we call $S$ the \emph{representing set of $\yon^S$}. @@ -356,7 +356,7 @@ \section{Sums and products of sets} \label{sec.poly.rep-sets.sum-prod-set} \[ \sum_{i\in \2}X_i=X_1+X_2=\{(1,a),(1,b),(1,c),(2,c),(2,d)\}. \] - The cardinality\footnote{The \emph{cardinality} of a set is the number of elements it contains, at least when the set is finite; with care the notion can be extended to infinite sets as well.} of $X_1+X_2$ will always be the sum of the cardinalities of $X_1$ and $X_2$, justifying the use of the word ``sum.'' + The cardinality\tablefootnote{The \emph{cardinality} of a set is the number of elements it contains, at least when the set is finite; with care the notion can be extended to infinite sets as well.} of $X_1+X_2$ will always be the sum of the cardinalities of $X_1$ and $X_2$, justifying the use of the word ``sum.'' Meanwhile, their product is the usual cartesian product \index{cartesian product|see{product}}\index{product} @@ -456,7 +456,7 @@ \section{Sums and products of sets} \label{sec.poly.rep-sets.sum-prod-set} \] that sends each $g\colon(i\in I)\to X_i$ to the \emph{composite dependent function} $(i\in I)\to Y_i$, denoted $g\then f$ or $f\circ g$, which sends $i\in I$ to $f_i(g(i))$. - When $I\coloneqq\{i_1,\ldots,i_n\}$ is finite, we may alternatively denote this categorical sum and product of functions respectively as\footnote{We will take care to highlight when this notation may clash with a sum (resp.\ product) of functions with common domain and codomain whose codomain has an additive (resp.\ multiplicative) structure.} + When $I\coloneqq\{i_1,\ldots,i_n\}$ is finite, we may alternatively denote this categorical sum and product of functions respectively as\tablefootnote{We will take care to highlight when this notation may clash with a sum (resp.\ product) of functions with common domain and codomain whose codomain has an additive (resp.\ multiplicative) structure.} \[ f_{i_1}+\cdots+f_{i_n} \qqand f_{i_1}\times\cdots\times f_{i_n}. \] @@ -600,20 +600,20 @@ \section{Sums and products of sets} \label{sec.poly.rep-sets.sum-prod-set} Let $I\coloneqq\{1,2\}$; let $J(1)\coloneqq\{j\}$ and $J(2)\coloneqq\{j,j'\}$; let $K(1,j)\coloneqq\{k_1,k_2\}$, $K(2,j)\coloneqq\{k_1\}$, and $K(2,j')\coloneqq\{k'\}$; and let $X(i,j,k)\coloneqq\{x,y\}$ for all $i,j,k$. Now the formula \[\sum_{i\in I}\prod_{j\in J(i)}\sum_{k\in K(i,j)}X(i,j,k)\] - from \eqref{eqn.sum_prod_sum} specifies a fixed set. Here is a list of all eight of its elements: + from \eqref{eqn.sum_prod_sum} specifies a fixed set: \[ \left\{ \begin{gathered} - \big(1, j\mapsto(k_1,x)\big),\qquad - \big(1, j\mapsto(k_1,y)\big),\qquad - \big(1, j\mapsto(k_2,x)\big),\qquad + \big(1, j\mapsto(k_1,x)\big), + \big(1, j\mapsto(k_1,y)\big), + \big(1, j\mapsto(k_2,x)\big), \big(1, j\mapsto(k_2,y)\big),\\ - \big(2, j\mapsto(k_1,x), j'\mapsto(k',x)\big),\qquad + \big(2, j\mapsto(k_1,x), j'\mapsto(k',x)\big), \big(2, j\mapsto(k_1,x), j'\mapsto(k',y)\big),\\ - \big(2, j\mapsto(k_1,y), j'\mapsto(k',x)\big),\qquad + \big(2, j\mapsto(k_1,y), j'\mapsto(k',x)\big), \big(2, j\mapsto(k_1,y), j'\mapsto(k',y)\big) \end{gathered} - \right\} + \right\}. \] In each case, we first chose an element $i\in I$, either 1 or 2. Then for each $j\in J(i)$ we chose an element $k\in K(i,j)$ and an element of $X(i,j,k)$. \end{example} @@ -680,7 +680,7 @@ \section{Expanding products of sums} \label{sec.poly.rep-sets.expand} \begin{equation}\label{eqn.set_completely_distributive} \prod_{i\in I}\sum_{j\in J(i)}X(i,j) \iso - \sum_{\bar{j}\in \prod_{i\in I}J(i)}\;\prod_{i\in I}X(i,\bar{j}(i)).\footnote{We draw a bar over $j$ in $\bar{j}$ to remind ourselves that $\bar{j}$ is no longer just an index but a (dependent) function.} + \sum_{\bar{j}\in \prod_{i\in I}J(i)}\;\prod_{i\in I}X(i,\bar{j}(i)).\tablefootnote{We draw a bar over $j$ in $\bar{j}$ to remind ourselves that $\bar{j}$ is no longer just an index but a (dependent) function.} \end{equation} \end{proposition} \begin{proof} @@ -729,7 +729,7 @@ \section{Expanding products of sums} \label{sec.poly.rep-sets.expand} In general, we refer to a category having this property as follows. \begin{definition}[Completely distributive category]\index{coproduct}\index{product} - A category $\Cat{C}$ with all small products and coproducts is \emph{completely distributive}\footnote{While our terminology generalizes that of a completely distributive lattice, which has the additional requirement that the category be a poset, it is unfortunately not standard: a completely distributive category refers to a different concept in some categorical literature. We will not use this other concept, so there is no ambiguity.} if products distribute over coproducts as in \eqref{eqn.set_completely_distributive}; that is, for any set $I$, sets $(J(i))_{i\in I}$, and objects $(X(i,j))_{i\in I,j\in J(i)}$ from $\Cat{C}$, we have a natural isomorphism\index{isomorphism!natural} + A category $\Cat{C}$ with all small products and coproducts is \emph{completely distributive}\tablefootnote{While our terminology generalizes that of a completely distributive lattice, which has the additional requirement that the category be a poset, it is unfortunately not standard: a completely distributive category refers to a different concept in some categorical literature. We will not use this other concept, so there is no ambiguity.} if products distribute over coproducts as in \eqref{eqn.set_completely_distributive}; that is, for any set $I$, sets $(J(i))_{i\in I}$, and objects $(X(i,j))_{i\in I,j\in J(i)}$ from $\Cat{C}$, we have a natural isomorphism\index{isomorphism!natural} \begin{equation}\label{eqn.cat_completely_distributive} \prod_{i\in I}\sum_{j\in J(i)}X(i,j) \iso @@ -860,7 +860,11 @@ \section{Sums and products of functors $\smset\to\smset$} \label{sec.poly.rep-se The category $\smset^\smset$ has all small limits and colimits, and they are computed pointwise. In particular, on objects, given a small category $\cat{J}$ and a functor $F\colon \cat{J}\to\smset^\smset$, for all $X\in\smset$, the limit and colimit of $F$ satisfy isomorphisms \[ - \left(\lim_{j\in\cat{J}} F(j)\right)(X) \iso \lim_{j\in\cat{J}} \left(F(j)(X)\right) \qqand \left(\colim_{j\in\cat{J}} F(j)\right)(X) \iso \colim_{j\in\cat{J}} \left(F(j)(X)\right) + \left(\lim_{j\in\cat{J}} F(j)\right)(X) \iso \lim_{j\in\cat{J}} \left(F(j)(X)\right) + \] + and + \[ + \left(\colim_{j\in\cat{J}} F(j)\right)(X) \iso \colim_{j\in\cat{J}} \left(F(j)(X)\right) \] natural in $X$. \end{proposition} @@ -1115,14 +1119,15 @@ \section{Introducing polynomial functors} \label{sec.poly.obj.intro} p(X) &\iso \sum_{i\in\4}\{a,b\}^{p[i]} \\ &= \{a,b\}^\2 + \{a,b\}^\1 + \{a,b\}^\1 + \{a,b\}^\0 \\ &\iso - \{(1,(a,a)),(1,(a,b)),(1,(b,a)),(1,(b,b)),(2,(a)),(2,(b)),(3,(a)),(3,(b)),(4,())\}. + \{(1,(a,a)),(1,(a,b)),(1,(b,a)),(1,(b,b)),(2,(a)),(2,(b)), \\ & + \qquad (3,(a)),(3,(b)),(4,())\}. \end{align*} Above, we denote each function $f\colon p[i]\to\{a,b\}$ in the set $\{a,b\}^{p[i]}$ by the $n$-tuple $(f(1),\ldots,f(n))$ whenever $p[i]\coloneqq\ord{n}$. For ease of reading, we may drop the parentheses around these $n$-tuples to obtain the equivalent set - \[ - p(X) \iso - \{(1,a,a),(1,a,b),(1,b,a),(1,b,b),(2,a),(2,b),(3,a),(3,b),(4)\}. - \] + \begin{align*} + p(X) &\iso + \{(1,a,a),(1,a,b),(1,b,a),(1,b,b),(2,a),(2,b), \\ & \qquad (3,a),(3,b),(4)\}. + \end{align*} As we might expect, the set $p(X)$ contains $2^2+2+2+1=9$ elements, equal to the value obtained when we plug $|X|=2$ into the original polynomial $p$ when we interpret its coefficients and exponents as numbers instead of sets. \end{example} @@ -1148,9 +1153,10 @@ \section{Introducing polynomial functors} \label{sec.poly.obj.intro} \begin{enumerate} \item Let $I\coloneqq\1$ and $p[1]\coloneqq\3$ so that $p\coloneqq\yon^\3\iso\sum_{i\in I}\yon^{p[i]}$. Then - \[ - p(X)\iso\{(1, 4, 4, 4), (1, 4, 4, 9), (1, 4, 9, 4), (1, 4, 9, 9), (1, 9, 4, 4), (1, 9, 4, 9), (1, 9, 9, 4), (1, 9, 9, 9)\}. - \] + \begin{align*} + p(X)&\iso\{(1, 4, 4, 4), (1, 4, 4, 9), (1, 4, 9, 4), (1, 4, 9, 9), \\ + &\qquad(1, 9, 4, 4), (1, 9, 4, 9), (1, 9, 9, 4), (1, 9, 9, 9)\}. + \end{align*} \item Let $I\coloneqq\4$, $p[1]\coloneqq p[2]\coloneqq p[3]\coloneqq\2$, and $p[4]\coloneqq\1$, so that $p\coloneqq\3\yon^\2+\1\iso\sum_{i\in I}\yon^{p[i]}$. Then $p(X)\iso\{(1,a,a),(2,a,a),(3,a,a),(4)\}$. @@ -1237,23 +1243,23 @@ \section{Introducing polynomial functors} \label{sec.poly.obj.intro} \begin{example} Suppose $p\coloneqq\yon^\2+\2\yon+1$. Let $X\coloneqq\{a_1,a_2,b_1\}$ and $Y\coloneqq\{a,b,c\}$, and let $f\colon X\to Y$ be the function sending $a_1,a_2\mapsto a$ and $b_1\mapsto b$. The induced function $p(f)\colon p(X)\to p(Y)$, according to \cref{prop.poly_on_functions}, is shown below: \[ - \begin{tikzcd}[row sep=2pt, column sep=3pt, shorten <=-5pt, shorten >=-5pt, dashed] - \LMO{(1,a_1,a_1)}\ar[rrrr, blue, bend left=25pt]&\LMO{(1,a_1,a_2)}\ar[rrr, blue, bend left=25pt]&\LMO{(1,a_1,b_1)}\ar[rrr, blue, bend left=25pt]&[30pt]& + \begin{tikzcd}[row sep=2pt, column sep=3pt, shorten <=-5pt, shorten >=-5pt, dashed, font=\small] + \LMO{(1,a_1,a_1)}\ar[rrrr, bend left=25pt]&\LMO{(1,a_1,a_2)}\ar[rrr, bend left=25pt]&\LMO{(1,a_1,b_1)}\ar[rrr, bend left=25pt]&[30pt]& \LMO{(1,a,a)}&\LMO{(1,a,b)}&\LMO{(1,a,c)}&& \\ - \LMO{(1,a_2,a_1)}\ar[rrrru, blue, bend left=10pt]&\LMO{(1,a_2,a_2)}\ar[rrru, blue, bend left=10pt]&\LMO{(1,a_2,b_1)}\ar[rrru, blue, bend left=10pt]&& + \LMO{(1,a_2,a_1)}\ar[rrrru, bend left=10pt]&\LMO{(1,a_2,a_2)}\ar[rrru, bend left=10pt]&\LMO{(1,a_2,b_1)}\ar[rrru, bend left=10pt]&& \LMO{(1,b,a)}&\LMO{(1,b,b)}&\LMO{(1,b,c)}&& \\ - \LMO{(1,b_1,a_1)}\ar[rrrru, blue, bend left=10pt]&\LMO{(1,b_1,a_2)}\ar[rrru, blue, bend left=10pt]&\LMO{(1,b_1,b_1)}\ar[rrru, blue, bend left=10pt]&& + \LMO{(1,b_1,a_1)}\ar[rrrru, bend left=10pt]&\LMO{(1,b_1,a_2)}\ar[rrru, bend left=10pt]&\LMO{(1,b_1,b_1)}\ar[rrru, bend left=10pt]&& \LMO{(1,c,a)}&\LMO{(1,c,b)}&\LMO{(1,c,c)}&& \\ - \LMO{(2,a_1)}\ar[rrrr, blue, bend left=25pt]&\LMO{(2,a_2)}\ar[rrr, blue, bend left=25pt]&\LMO{(2,b_1)}\ar[rrr, blue, bend left=25pt]&& + \LMO{(2,a_1)}\ar[rrrr, bend left=25pt]&\LMO{(2,a_2)}\ar[rrr, bend left=25pt]&\LMO{(2,b_1)}\ar[rrr, bend left=25pt]&& \LMO{(2,a)}&\LMO{(2,b)}&\LMO{(2,c)}&& \\ - \LMO{(3,a_1)}\ar[rrrr, blue, bend left=25pt]&\LMO{(3,a_2)}\ar[rrr, blue, bend left=25pt]&\LMO{(3,b_1)}\ar[rrr, blue, bend left=25pt]&& + \LMO{(3,a_1)}\ar[rrrr, bend left=25pt]&\LMO{(3,a_2)}\ar[rrr, bend left=25pt]&\LMO{(3,b_1)}\ar[rrr, bend left=25pt]&& \LMO{(3,a)}&\LMO{(3,b)}&\LMO{(3,c)}&& \\& - \LMO{(4)}\ar[rrrr, blue]&&&&\LMO{(4)} + \LMO{(4)}\ar[rrrr]&&&&\LMO{(4)} \end{tikzcd} \] \end{example} @@ -1309,7 +1315,7 @@ \section{Special classes of polynomial functors} \label{sec.poly.obj.spec} Throughout, let $p\iso\sum_{i\in p(\1)}\yon^{p[i]}$ be a polynomial functor. \begin{definition}[Linear, affine] -We say that $p$ is \emph{linear}\footnote{Unlike linear polynomials from high school algebra (which are really \emph{affine linear functions} rather than necessarily \emph{linear functions}), our linear polynomial functors have no (nonzero) constant terms: they always send $\0$ to $\0$. A polynomial is \emph{affine} if it is of the form $A\yon+B$, though we will not use this concept much in the book.} +We say that $p$ is \emph{linear}\tablefootnote{Unlike linear polynomials from high school algebra (which are really \emph{affine linear functions} rather than necessarily \emph{linear functions}), our linear polynomial functors have no (nonzero) constant terms: they always send $\0$ to $\0$. A polynomial is \emph{affine} if it is of the form $A\yon+B$, though we will not use this concept much in the book.} if $p\iso I\yon$ for some set $I$. \end{definition} \index{linear polynomial} @@ -1721,24 +1727,24 @@ \section{Corolla forests} \node["$1$" below] (1) {$\bullet$} child {node {$a$}} child {node {$a$}}; - \node["$1$" below, right=1.2 of 1] (2) {$\bullet$} + \node["$1$" below, right=1 of 1] (2) {$\bullet$} child {node {$a$}} child {node {$b$}}; - \node["$1$" below, right=1.2 of 2] (3) {$\bullet$} + \node["$1$" below, right=1 of 2] (3) {$\bullet$} child {node {$b$}} child {node {$a$}}; - \node["$1$" below, right=1.2 of 3] (4) {$\bullet$} + \node["$1$" below, right=1 of 3] (4) {$\bullet$} child {node {$b$}} child {node {$b$}}; - \node["$2$" below, right=1.1 of 4] (5) {$\bullet$} + \node["$2$" below, right=.9 of 4] (5) {$\bullet$} child {node {$a$}}; - \node["$2$" below, right=of 5] (6) {$\bullet$} + \node["$2$" below, right=.9 of 5] (6) {$\bullet$} child {node {$b$}}; - \node["$3$" below, right=of 6] (7) {$\bullet$} + \node["$3$" below, right=.9 of 6] (7) {$\bullet$} child {node {$a$}}; - \node["$3$" below, right=of 7] (8) {$\bullet$} + \node["$3$" below, right=.9 of 7] (8) {$\bullet$} child {node {$b$}}; - \node["$4$" below, right=0.9 of 8] (9) {$\bullet$}; + \node["$4$" below, right=.8 of 8] (9) {$\bullet$}; \end{tikzpicture} \] \end{example} @@ -2188,7 +2194,7 @@ \section{Dependent lenses as interaction protocols} \end{tikzpicture} } \end{center} - Finally, since $q[f_\1(\const{content})]=q[\const{closed}]=\0$, the $\const{content}$-component of $f^\sharp$ is the vacuously-defined on-directions function $f^\sharp_{\const{content}}\colon \0\to p[\const{content}]$. + Finally, as $q[f_\1(\const{content})]=q[\const{closed}]=\0$, the $\const{content}$-component of $f^\sharp$ is the vacuously-defined on-directions function $f^\sharp_{\const{content}}\colon \0\to p[\const{content}]$. Together, the on-positions function $f_\1$ and the on-directions map $f^\sharp$ defined above completely characterize a lens $f\colon p\to q$ depicting the interaction between the coin jar and its owner. \end{example} @@ -3333,7 +3339,7 @@ \section{Identity lenses and lens composition} \label{subsec.poly.cat.morph.id-c \begin{exercise}[Identity lenses] \label{exc.arena_morph_id} For $p\in\poly$, let $\id_p \colon p \to p$ be its identity natural transformation, whose $X$-component $(\id_p)_X\colon p(X)\to p(X)$ for $X\in\smset$ is the identity function on $p(X)$; that is, $(\id_p)_X=\id_{p(X)}$. -Use \cref{cor.morph_func_to_arena} to show that the on-positions function $(\id_p)_\1\colon p(\1)\to p(\1)$ and the on-directions functions $(\id_p)^\sharp_i\colon p[(\id_p)_\1i]\to p[i]$ for $i\in p(\1)$ of $\id_p$ are all identity functions. +Use \cref{cor.morph_func_to_arena} to demonstrate that the on-positions function $(\id_p)_\1\colon p(\1)\to p(\1)$ as well as, for each $i\in p(\1)$, the on-directions function $(\id_p)^\sharp_i\colon p[(\id_p)_\1i]\to p[i]$ are all identity functions. \begin{solution} Fix $i\in p(\1)$. Since the $p[i]$-component $(\id_p)_{p[i]}$ of $\id_p$ is the identity function on $p(p[i])$, by \cref{cor.morph_func_to_arena}, @@ -3619,7 +3625,7 @@ \section{Polybox pictures of lens composition} \label{sec.poly.cat.} \begin{tikzpicture}[polybox, mapstos] \node[poly, dom, "$p$" below] (p) {$\left(\dfrac{i}{i+j}\cdot\dfrac{i+j}2,\dfrac{j}{i+j}\cdot\dfrac{i+j}2\right)$\at$(i,j)$}; - \node[poly, right=of p, "$q$" below] (q) {$\vphantom{\left(\dfrac{j}{i+j}\dfrac{i+j}2\right)}\dfrac{i+j}2$\at$i+j$}; + \node[poly, right=.8 of p, "$q$" below] (q) {$\vphantom{\left(\dfrac{j}{i+j}\dfrac{i+j}2\right)}\dfrac{i+j}2$\at$i+j$}; \draw (p_pos) -- node[below] {$f_\1$} (q_pos); \draw (q_dir) -- node[above] {$f^\sharp$} (p_dir); @@ -3627,7 +3633,7 @@ \section{Polybox pictures of lens composition} \label{sec.poly.cat.} \draw (q_pos) to[climb'] node[right] {$\gamma$} (q_dir); \end{tikzpicture} }; - \node[right=1.8 of 1] (2) { + \node[right=.8 of 1] (2) { \begin{tikzpicture}[polybox, mapstos] \node[poly, dom, "$p$" below] (p) {$(i/2,j/2)$\at$(i,j)$}; @@ -3910,7 +3916,7 @@ \section{Symmetric monoidal products of polynomial functors} \label{sec.poly.cat \end{solution} \end{exercise} -Much of \cref{part.comon} will focus on the remarkable features of another monoidal structure, an asymmetric one, whose definition we will postpone---we will save its surprises for when we can better savor them. +Much of \cref{part.comon} will focus on the features of another monoidal structure, an asymmetric one, whose definition we will postpone---we will save its surprises for when we can better savor them. But here we introduce a third symmetric monoidal structure, given by an operation you were not allowed to do to polynomials back in high school. % TODO: explain coprods, prods (both univ prop and monoidal), and parallel products in terms of interaction @@ -4008,7 +4014,10 @@ \section{Symmetric monoidal products of polynomial functors} \label{sec.poly.cat \item We evaluate $(2\cdot2^y+3\cdot1^y+1) \cdot (1\cdot4^y+3\cdot3^y+2)$ using ordinary laws of arithmetic: \begin{align*} - (2\cdot2^y+3\cdot 1^y) \cdot (1\cdot4^y+3\cdot 3^y) &= 2\cdot1\cdot2^y\cdot4^y + 2\cdot3\cdot2^y\cdot3^y + 3\cdot1\cdot1^y\cdot4^y + 3\cdot3\cdot1^y\cdot3^y \\ + (2\cdot2^y+3\cdot 1^y) \cdot (1\cdot4^y+3\cdot 3^y) + &= + (2\cdot2^y+3)(4^y+3\cdot 3^y) \\ + &= 2\cdot2^y\cdot4^y + 2\cdot3\cdot2^y\cdot3^y + 3\cdot4^y + 3\cdot3\cdot3^y \\ &= 2\cdot8^y + 6\cdot6^y + 3\cdot4^y + 9\cdot3^y. \end{align*} @@ -4084,19 +4093,19 @@ \section{Symmetric monoidal products of polynomial functors} \label{sec.poly.cat child {} child {} ; - \node[right=1.5 of 12, "\tiny {(1,3)}" below] (13) {$\bullet$} + \node[right=1.2 of 12, "\tiny {(1,3)}" below] (13) {$\bullet$} ; - \node[right=1.5 of 13, "\tiny {(2,1)}" below] (21) {$\bullet$} + \node[right=1.2 of 13, "\tiny {(2,1)}" below] (21) {$\bullet$} child {} child {} child {} child {} ; - \node[right=1.5 of 21, "\tiny {(2,2)}" below] (22) {$\bullet$} + \node[right=1.2 of 21, "\tiny {(2,2)}" below] (22) {$\bullet$} child {} child {} ; - \node[right=1.5 of 22, "\tiny {(2,3)}" below] (23) {$\bullet$} + \node[right=1 of 22, "\tiny {(2,3)}" below] (23) {$\bullet$} ; \end{tikzpicture} }; @@ -4473,8 +4482,8 @@ \section{Summary and further reading} The main result of this chapter was a concrete characterization of our dependent lenses between polynomial functors. A dependent lens $f\colon p\to q$ is characterized by its \begin{itemize} - \item \emph{on-positions function}, a function $f_\1\colon p(\1)\to q(\1)$ sending $p$-positions forward to $q$-positions; and its - \item \emph{on-directions functions}, one for each $p$-position $i$ denoted $f^\sharp_i\colon q[f_\1 i]\to p[i]$ sending $q[f_\1 i]$-directions backward to $p[i]$-directions. + \item \emph{on-positions function}, a function that we denote by $f_\1\colon p(\1)\to q(\1)$ sending $p$-positions forward to $q$-positions; and its + \item \emph{on-directions functions}, one for each $p$-position $i$ that we denote by $f^\sharp_i\colon q[f_\1 i]\to p[i]$ sending $q[f_\1 i]$-directions backward to $p[i]$-directions. \end{itemize} This forward-backward relationship is what makes dependent lenses so well-suited for modeling \emph{interaction protocols}. Given two agents with positions and directions, a dependent lens between them defines an interaction protocol that describes how the position of the first agent determines the position of the second agent and how the direction of the second agent determines the direction of the first. @@ -4486,14 +4495,15 @@ \section{Summary and further reading} We then unwound our interpretation of natural transformations between polynomials as dependent lenses with on-positions and on-directions functions to describe what happens to these functions when lenses compose. This gave us an accessible way to interpret commutative diagrams in $\poly$ that is particularly convenient to express using polyboxes. -Finally, we considered various categorical structures on $\poly$, e.g.\ that it has all products and coproducts, and that these distribute: $\prod\sum\to\sum\prod$. -\begin{align*} - \sum_{a\in A}p_a&\coloneqq\sum_{(a,i)\in\sum_{a\in A}p_a(1)}\yon^{p_a[i]}& - \prod_{a\in A}p_a&\coloneqq\sum_{i\in\prod_{a\in A}p_a(1)}\yon^{\sum_{a\in A}p_a[i a]} -\\ - p_1+p_2&\coloneqq\sum_{(a,i)\in\{(1,i_1)\mid i_1\in p_1(\1)\}+\{(2,i_2)\mid i_2\in p_2(\1)\}}\yon^{p_a[i]}& - p_1\times p_2&\coloneqq\sum_{(i_1,i_2)\in p_1(1)\times p_2(1)}\yon^{p_1[i_1]+p_2[i_2]} -\end{align*} +Finally, we considered various categorical structures on $\poly$, e.g.\ that it has all products and coproducts, and that these distribute. +%$\prod\sum\to\sum\prod$. +%\begin{align*} +% \sum_{a\in A}p_a&\coloneqq\sum_{(a,i)\in\sum_{a\in A}p_a(1)}\yon^{p_a[i]}& +% \prod_{a\in A}p_a&\coloneqq\sum_{i\in\prod_{a\in A}p_a(1)}\yon^{\sum_{a\in A}p_a[i a]} +%\\ +% p_1+p_2&\coloneqq\sum_{(a,i)\in\{(1,i_1)\mid i_1\in p_1(\1)\}+\{(2,i_2)\mid i_2\in p_2(\1)\}}\yon^{p_a[i]}& +% p_1\times p_2&\coloneqq\sum_{(i_1,i_2)\in p_1(1)\times p_2(1)}\yon^{p_1[i_1]+p_2[i_2]} +%\end{align*} We also discussed how one can take any monoidal product $\star$ from $\smset$ and lift it to a monoidal product $\cdot$ on $\poly$: \[ p_1\odot p_2\coloneqq\sum_{i_1,i_2)\in p_1(1)\times p_2(1)}\yon^{p_1[i_1]\cdot p_2[i_2]} @@ -4550,7 +4560,7 @@ \section{Moore machines}\label{sec.poly.dyn_sys.moore} \index{Moore machine!states of} \index{Moore machine!update}\index{Moore machine!return} -The input/output terminology is standard, while the position/direction terminology is our own: we will soon see how the positions and directions of a Moore machine relate to that of a polynomial. +The input and output terminology is standard, while the position and direction terminology is our own: we will soon see how the positions and directions of a Moore machine relate to that of a polynomial. We should interpret an $(A,I)$-Moore machine as follows. At any time, the machine inhabits one of the states in its state-set $S$. @@ -5970,7 +5980,7 @@ \subsection{Sections as wrappers}\label{subsec.poly.dyn_sys.new.sit_encl} But for convenience of notation, we will continue to identify the position-set of a state system with each of its direction-sets. More concretely, the section $\epsilon\colon S\yon^S\to\yon$ acts as a very special (if rather unexciting) dynamical system: it is the \emph{do-nothing section}, with only one possible position and one possible direction that always keeps the current state the same. -While the system literally does nothing, we do know one key fact about it: given any state system, regardless of the state-set, we can always define a do-nothing section on it.\footnote{It may have bothered you that we call $S\yon^S$, which is a single polynomial, a state \emph{system}, when we also use the word ``system'' to refer to dependent dynamical systems, which are lenses $S\yon^S\to p$. +While the system literally does nothing, we do know one key fact about it: given any state system, regardless of the state-set, we can always define a do-nothing section on it.\tablefootnote{It may have bothered you that we call $S\yon^S$, which is a single polynomial, a state \emph{system}, when we also use the word ``system'' to refer to dependent dynamical systems, which are lenses $S\yon^S\to p$. The existence of the do-nothing section explains why our terminology does not clash: every polynomial $S\yon^S$ comes equipped with a dependent dynamical system $\epsilon\colon S\yon^S\to\yon$, so it really is a state \emph{system}. %Later on we will see other systems that come with $S\yon^S$ for free. } @@ -6142,7 +6152,7 @@ \subsection{Wrapping juxtaposed dynamical systems together} Suppose we want to be very strict about what how far the machine can move and what can make it move. To model this, we introduce two intermediary systems, which we call the \emph{paddler} and the \emph{tracker}:% -\footnote{Perhaps one could refer to the tracker as the \emph{demiurge}; it is responsible for maintaining the material universe.} +\tablefootnote{Perhaps one could refer to the tracker as the \emph{demiurge}; it is responsible for maintaining the material universe.} \[ \text{paddler}\colon S\yon^S\to\2\yon \qqand @@ -6931,7 +6941,7 @@ \subsection{Wiring diagrams as interaction patterns} \] We can think of $G$ as an alternative representation of a specific kind of wiring diagram, one in which each inner box has exactly one position wire coming out and the outer box is closed (i.e.\ no wires in or out, representing the interface $\yon$ with exactly $1$ position and $1$ direction). The vertices $v\in V$ are the inner boxes, the set $\tau(v)$ is the position-set associated with the wire coming out of $v$, and each edge $e$ is a wire connecting the position wire of its target $t(e)$ to a direction wire of its source $s(e)$. -An edge from a vertex $v_0$ to a vertex $v_1$ indicates that the directions received by $v_0$ depend on the positions returned by $v_1$.\footnote{We could swap the roles of the sources and the targets, so that edges point in the direction of data flow rather than in the direction of data dependencies; this is an arbitrary choice.} +An edge from a vertex $v_0$ to a vertex $v_1$ indicates that the directions received by $v_0$ depend on the positions returned by $v_1$.\tablefootnote{We could swap the roles of the sources and the targets, so that edges point in the direction of data flow rather than in the direction of data dependencies; this is an arbitrary choice.} In other words, we can associate each vertex $v\in V$ with the monomial \[ diff --git a/P2-Comonoids.tex b/P2-Comonoids.tex index 5cd4e54..d1eaa0e 100644 --- a/P2-Comonoids.tex +++ b/P2-Comonoids.tex @@ -242,8 +242,7 @@ \subsection{Composite functors}\label{subsec.comon.comp.def.functor} This corresponds to \emph{horizontal composition} of natural transformations. In this case, we'll use the verb phrase ``\emph{taking the monoidal product}.'' -On the other hand, we'll use the terms ``composite'' and ``composition product'' interchangeably to refer to polynomials $p\tri q$, obtained by composing $p,q\in\poly$ as functors or, equivalently, applying the monoidal product functor $\tri$ on them---as there is no risk of confusion here.% -%\footnote{Some authors refer to $\tri$ as the \emph{substitution} product, rather than the composition product. We elected to use the composition product terminology because it provides a good noun form ``the composite'' for $p\tri q$, whereas ``the substitute'' is somehow strange in English.} +On the other hand, we'll use the terms ``composite'' and ``composition product'' interchangeably to refer to polynomials $p\tri q$, obtained by composing $p,q\in\poly$ as functors or, equivalently, applying the monoidal product functor $\tri$ on them---as there is no risk of confusion here. This is another reason we tend to avoid the symbol $\circ$, preferring to use $\then$ for vertical composition and $\tri$ for horizontal composition. Of course, if you're ever confused, you can always check whether the codomain of the first lens matches up with the domain of the second. @@ -9700,7 +9699,7 @@ \subsection{Vertical-cartesian factorization of retrofunctors} \begin{proposition} \label{prop.cart_dopf} The wide% -\footnote{A subcategory $\Cat{D}$ of a category $\Cat{C}$ is \emph{wide} if every object of $\Cat{C}$ is in $\Cat{D}$.} +\tablefootnote{A subcategory $\Cat{D}$ of a category $\Cat{C}$ is \emph{wide} if every object of $\Cat{C}$ is in $\Cat{D}$.} subcategory of cartesian retrofunctors in $\catsharp$ is isomorphic to the wide subcategory of discrete opfibrations in $\smcat$. \end{proposition} \begin{proof} @@ -10340,7 +10339,7 @@ \subsection{Bicomodules} \end{tikzcd} \end{equation} We may denote such a bicomodule by $\cat{C}\bimodfrom[m]\cat{D}$ when its left and right coactions have yet to be specified or may be inferred from context---or even by $\car{c}\bimodfrom[m]\car{d}$ when the comonoid structures on $\car{c}$ and $\car{d}$ can be inferred from context as well.% -\footnote{The notation $\car{c}\bimodfrom\car{d}$ has a mnemonic advantage, as each $\tri$ goes in the correct direction: $\car{c}\tri m\from m$ and $m\to m\tri\car{d}$. +\tablefootnote{The notation $\car{c}\bimodfrom\car{d}$ has a mnemonic advantage, as each $\tri$ goes in the correct direction: $\car{c}\tri m\from m$ and $m\to m\tri\car{d}$. But it also looks like an arrow going backward from $\car{d}$ to $\car{c}$, which will turn out to have a semantic advantage as well.%; see \cref{**}. } diff --git a/tikz_stuff.tex b/tikz_stuff.tex index e1cc28c..ae497ba 100644 --- a/tikz_stuff.tex +++ b/tikz_stuff.tex @@ -284,7 +284,7 @@ \tikzset{ - mapsto/.style={->, densely dashed, blue, shorten <=\short, shorten + mapsto/.style={->, densely dashed, shorten <=\short, shorten >=\short, >=stealth, thick}, short/.store in=\short, short=0pt