├── cattheory.pdf ├── topos.tex ├── Makefile ├── opticsrefraction.tex ├── .travis.yml ├── README.md ├── introduction.tex ├── notations.tex ├── appendices.tex ├── kleisli.tex ├── monoidalobject.tex ├── curryhoward.tex ├── cattheory.tex ├── functors.tex ├── license.tex ├── nt.tex ├── yoneda.tex ├── limits.tex └── cattheory.bib /cattheory.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CatTheoryByExample/book/HEAD/cattheory.pdf -------------------------------------------------------------------------------- /topos.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Topos} 3 | \label{sec:topos} 4 | Every \mynameref{def:set} can be considered from a categorical point of 5 | view (see \mynameref{def:categorical_approach}) i.e. every set can be 6 | considered as a category. From other side not every category can be 7 | considered as a set. \textit{Toposes} are categories that have all 8 | properties required to be a set. 9 | 10 | TBD 11 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: pdf 2 | 3 | pdf: cattheory.tex 4 | pdflatex -interaction=nonstopmode -shell-escape cattheory.tex 5 | bibtex cattheory 6 | makeindex cattheory.nlo -s nomencl.ist -o cattheory.nls 7 | pdflatex -interaction=nonstopmode -shell-escape cattheory.tex 8 | pdflatex -interaction=nonstopmode -shell-escape cattheory.tex 9 | 10 | clean: 11 | rm -rf *.aux cattheory.bbl *.dvi *.blg *.toc *.out *.idx *.nlo *.ist *.nls 12 | rm -rf _minted-* 13 | find . \( -name "*.log" -o -name "*~" -o -name "*.ind" -o -name "*.ilg" \) -exec rm -rf {} \; 14 | -------------------------------------------------------------------------------- /opticsrefraction.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | % Refraction 3 | % Author: Jimi Oke 4 | \begin{tikzpicture} 5 | 6 | % define coordinates 7 | \coordinate (O) at (0,0) ; 8 | \coordinate (A) at (0,4) ; 9 | \coordinate (B) at (0,-4) ; 10 | 11 | % media 12 | \fill[blue!25!,opacity=.3] (-4,0) rectangle (4,4); 13 | \fill[blue!60!,opacity=.3] (-4,0) rectangle (4,-4); 14 | \node[right] at (2,2) {Air}; 15 | \node[left] at (-2,-2) {Water}; 16 | 17 | % axis 18 | \draw[dash pattern=on5pt off3pt] (A) -- (B) ; 19 | 20 | % rays 21 | \draw[red,ultra thick,reverse directed] (O) -- (130:5.2); 22 | \draw[blue,directed,ultra thick] (O) -- (-70:4.24); 23 | 24 | % angles 25 | \draw (0,1) arc (90:130:1); 26 | \draw (0,-1.4) arc (270:290:1.4) ; 27 | \node[] at (280:1.8) {$\theta_{2}$}; 28 | \node[] at (110:1.4) {$\theta_{1}$}; 29 | \node[] at (135:5.0) {$A$}; 30 | \node[] at (295:4.2) {$B$}; 31 | \end{tikzpicture} 32 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | - gem install bundler 3 | - sudo apt-get update && sudo apt-get install texlive-fonts-recommended texlive-latex-extra texlive-fonts-extra texlive-latex-recommended dvipng texlive-science python-pygments texlive-lang-cyrillic 4 | script: 5 | - make 6 | deploy: 7 | provider: releases 8 | api_key: 9 | secure: hZ+u5Dz+i76HMT9UXa33gpHIr+u+Vct8UeSNsIwtMTPxtCO15w26iZ645WBh2doC53/CPLUzAwN5qnkMepYMUGNWyTWWLGsziPnRElVXGi1nHcAHG7PlrcvJ6xRfin0iBRh58XilPBQN+59X6t18TAzW96rZMbo12t2MZcJxYc1VoV3YbxCHlmjrdX+SxnwqxcQgar4pP1BOOrRGb0LDwLBiaf66oH5ix8SrO8KjD1ibdhWc+8EkUjay9cPN3agn2CtfTm5jQkXmPO8G7ONLq6PYGag3QZcSAAWgUQeKdMCSP6glO71/1T2P2fQNbrEEw8fEhu1beyuBbOC8h0wDkis0xvRLyyWLcrFhSRibT8cXjj5jinb9nAbdbQ3rm2Za1qvD9KYAs9Fr/40/kNc5tRGJHcYzfG0+XC+du1T5hQHtoGAC2VFaUHYBPGVSCK+VPYck3dtIflxnnLrhM9PxIFIJltCGIQ9ChrWLowliC6TLnZPjNFRoBJPEYBb/S5eHKVfsVj3LhN1HiOGvowSwtBFVyT5y6h9jdlCY6ed9CJN8zWiEgA1/LB5ZbMwIyqNODt5x1XjVmJ37Xb7F9ShNajY3N4CMC/msBYB7knbN01LbAyaxJ9gE9DinToq0frtFAHNxOE8NlDMYhHWgJ2rJp5JPITnYJIKR3ZGZaKPZsmQ= 10 | file: cattheory.pdf 11 | name: Build $(date +'%d.%m.%Y %R') 12 | skip-cleanup: true 13 | on: 14 | all_branches: true 15 | tags: true 16 | repo: CatTheoryByExample/book 17 | condition: "$TRAVIS_TAG =~ ^release.*$" 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The Category Theory by Example 2 | ============================== 3 | 4 | [![Build Status](https://travis-ci.org/CatTheoryByExample/book.svg?branch=master)](https://travis-ci.org/CatTheoryByExample/book) 5 | [![Release (0.0.7)](https://img.shields.io/badge/Latest-release-orange.svg)](https://github.com/CatTheoryByExample/book/releases/download/release-0.0.7/cattheory.pdf) 6 | 7 | Content: 8 | The [latest pdf build can be view via nbviewer](https://nbviewer.jupyter.org/github/CatTheoryByExample/book/blob/master/cattheory.pdf) 9 | 10 | The most important files: 11 | - Makefile - build scripts 12 | - cattheory.tex - the main latex file with macro and all includes 13 | - cattheory.bib - the bibliography 14 | 15 | Build: 16 | - build cattheory.pdf file: make 17 | - cleanup: make clean 18 | 19 | Branches: 20 | - master - the main upstream 21 | 22 | Note: the builds are not possible now since Travis CI requires payment for it 23 | 24 | Previous instruction for build/release is following: 25 | To start release publishing: 26 | - commit and push your changes 27 | - set release tag: for instance git tag release-0.0.123 28 | - push the tags: git push origin release-0.0.123 29 | - check the build progress: https://travis-ci.org/CatTheoryByExample/book/builds 30 | - see a new published release on https://github.com/CatTheoryByExample/book/releases 31 | -------------------------------------------------------------------------------- /introduction.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter*{Introduction} 3 | 4 | You just looked at yet another introduction to Category Theory. The 5 | subject mostly consists of a lot of definitions that are related each 6 | others. We wrote the book to collect all the definitions in one 7 | place to be easy checked and updated in future when we decide to refresh 8 | our knowledge about the field of math. Thus the book was written mostly 9 | for our category theory studying purposes but we shall appreciate if 10 | somebody else find it useful. 11 | 12 | The topics(chapters) cover base definitions 13 | (\mynameref{def:object}, \mynameref{def:morphism} and 14 | \mynameref{def:category}) as well as more advanced ones (\mynameref{def:functor}, 15 | \mynameref{def:nt}, \mynameref{def:monad}) and also include important 16 | results from the category theory such as Yoneda's lemma (see 17 | \cref{sec:yoneda}) and Curry-Howard-Lambek correspondence (see 18 | \cref{sec:curry_howard_lambek}). The \cref{sec:topos} gives an 19 | introduction to the topos theory i.e. just another view of the 20 | \mynameref{def:set}s. 21 | 22 | There are a lot of examples in each chapter. The examples cover 23 | different category 24 | theory application areas. We assume that the reader is familiar with 25 | the corresponding area and the example(s) can be passed if not. I.e. 26 | anyone can choose suitable example(s) for they. 27 | 28 | The most important examples are related to the set theory. The set 29 | theory and category theory are very close related. Each one can be 30 | considered as an alternative view to another one. 31 | 32 | There are also several examples from programming languages which include 33 | Haskell, Scala, C\texttt{++}. The source files for programming languages 34 | examples (Haskell, C\texttt{++}, Scala) can be found on github repositories: 35 | \begin{itemize} 36 | \item Haskell: \cite{github:cattheory_hs_examples} 37 | \item Scala: \cite{github:cattheory_scala_examples} 38 | \item C\texttt{++}: \cite{github:cattheory_cpp_examples} 39 | \end{itemize} 40 | 41 | The examples from physics are related to quantum mechanics that is the 42 | most known to us. For the examples we were inspired by the Bob Coecke 43 | article \cite{bib:arxiv:Bob_Coecke_2008}. 44 | 45 | There is also additional material related to abstract algebra (see 46 | \cref{sec:abstractalgebra}) taken from 47 | \cite{github:galois_ivanmurashko}. The material describes the 48 | different math constructions used in the book. 49 | 50 | The text is distributed under \textbf{Creative Common Public License} 51 | (see the text of the license at the end of the book) 52 | i.e. any reader has right to copy, store, modify, distribute or build 53 | upon the book until the original authors are pointed in the derivative 54 | products. The initial text of the book can be found at 55 | \cite{github:cattheory_ivanmurashko}. 56 | -------------------------------------------------------------------------------- /notations.tex: -------------------------------------------------------------------------------- 1 | % -*- coding:utf-8 -*- 2 | \renewcommand{\nomname}{Notations} 3 | \nomenclature{$\forall$}{for all} 4 | \nomenclature{$\exists$}{exists} 5 | %\nomenclature{\(\exists"!\)}{exists exactly one} 6 | \nomenclature{$\Ima{f}$}{\mynameref{def:function_image} of the function $f$} 7 | \nomenclature{$\cat{Set}$}{\mynameref{def:setcategory}} 8 | \nomenclature{$\cat{Rel}$}{\mynameref{def:relcategory}} 9 | \nomenclature{$\cat{Proof}$}{\mynameref{def:proof_category}} 10 | \nomenclature{$\cat{FdHilb}$}{\mynameref{def:fdhilbcategory}} 11 | \nomenclature{$\cat{Hask}$}{\mynameref{def:haskcategory}} 12 | \nomenclature{$\cat{Scala}$}{\mynameref{def:scalacategory}} 13 | \nomenclature{$\cat{C\texttt{++}}$}{\mynameref{def:cppcategory}} 14 | \nomenclature{$\cat{Cat}$}{\mynameref{def:catcategory}} 15 | \nomenclature{$a, b$}{\mynameref{def:object}s (Latin small letters)} 16 | \nomenclature{$f, g, h$}{\mynameref{def:morphism} 17 | (\mynameref{def:arrow}) (Latin small letter)} 18 | \nomenclature{$a \times b$}{\mynameref{def:product}} 19 | \nomenclature{$a \oplus b$}{\mynameref{def:sum}} 20 | \nomenclature{$f: a \to b$}{\mynameref{def:morphism} (simple arrow)} 21 | \nomenclature{$f: a \hookrightarrow b$}{\mynameref{def:monomorphism} 22 | (hook arrow)} 23 | \nomenclature{$f \circ g$}{Morphism composition (circle dot)} 24 | \nomenclature{$\cat{C}$}{\mynameref{def:category} (bold capital Latin 25 | letter)} 26 | \nomenclature{$\cat{C}^{op}$}{\mynameref{def:op_category}} 27 | \nomenclature{$\idm{a}$}{\mynameref{def:id}} 28 | \nomenclature{$\idf{C}$}{\mynameref{def:idfunctor}} 29 | \nomenclature{$F, G$}{\mynameref{def:functor} 30 | (capital Latin letter)} 31 | \nomenclature{$\dom f$}{\mynameref{def:domain}} 32 | \nomenclature{$\cod f$}{\mynameref{def:codomain}} 33 | \nomenclature{$F: \cat{C} \tof \cat{D}$}{\mynameref{def:functor} 34 | (double arrow)} 35 | \nomenclature{$F \circ G$}{\mynameref{def:functor_composition} (circle 36 | dot)} 37 | \nomenclature{$\Delta_c$}{\mynameref{def:const_functor}} 38 | \nomenclature{$\alpha, \beta$}{\mynameref{def:nt} 39 | (Greek small letters)} 40 | \nomenclature{$\alpha: F \tont G$}{\mynameref{def:nt} 41 | (arrow with dot)} 42 | \nomenclature{$\funcat{C}{D}$}{\mynameref{def:funcategory}} 43 | \nomenclature{$\alpha \circ 44 | \beta$}{\mynameref{def:vertical_composition} of natural 45 | transformations (circle dot)} 46 | \nomenclature{$\alpha \star \beta$}{\mynameref{def:horizontal_composition} of natural transformations (star dot)} 47 | \nomenclature{$\alpha H$}{\mynameref{def:lw}} 48 | \nomenclature{$H \alpha$}{\mynameref{def:rw}} 49 | \nomenclature{$\idnt{F}$}{\mynameref{def:idnt}} 50 | \nomenclature{$a \cong_f b$}{there is an \mynameref{def:isomorphism} $f$ 51 | between $a$ and $b$} 52 | \nomenclature{$a \cong b$}{there is an \mynameref{def:isomorphism} 53 | between $a$ and $b$. The exact isomorphism does not matter in the case} 54 | \nomenclature{$\left$}{\mynameref{def:monad}} 55 | \nomenclature{$\cat{C_M}$}{\mynameref{def:kleisli_category}} 56 | \nomenclature{$\catmset{a}{b}$}{\mynameref{def:morphism_set} between $a$ and $b$} 57 | \nomenclature{$\catmset[C]{a}{b}$}{\mynameref{def:morphism_set} 58 | between $a$ and $b$ in category $\cat{C}$} 59 | \nomenclature{$\mathcal{H}_n$}{finite dimensional 60 | \mynameref{def:hilbert_space}} 61 | \nomenclature{$a^b$}{\mynameref{def:exponential}} 62 | \nomenclature{$P \implies Q$}{\mynameref{def:implication}} 63 | \nomenclature{$\catcone{c}{f}$}{\mynameref{def:cone}} 64 | \nomenclature{$\catcocone{c}{f}$}{\mynameref{def:cocone}} 65 | \nomenclature{$\Delta \downarrow 66 | F$}{\mynameref{def:category_of_cones}} 67 | \nomenclature{$F \downarrow 68 | \Delta$}{\mynameref{def:category_of_cocones}} 69 | \nomenclature{$eq\left(f, g\right)$}{\mynameref{def:equalizer}} 70 | \nomenclature{$\catcovhom{C}{a}$}{\mynameref{def:cov_hom_functor}} 71 | \nomenclature{$\catconhom{C}{a}$}{\mynameref{def:con_hom_functor}} 72 | %% https://tex.stackexchange.com/questions/31562/nomencl-package-and-vertical-bar 73 | \nomenclature{$\lvert A \rvert$ }{\mynameref{def:cardinality} of a 74 | \mynameref{def:set} $A$} 75 | \nomenclature{$curry(f)$ }{\mynameref{def:currying_set}} 76 | \nomenclature{TBD}{To Be Defined (later)} 77 | 78 | \printnomenclature 79 | 80 | -------------------------------------------------------------------------------- /appendices.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \begin{appendices} 3 | 4 | \chapter{Abstract algebra} 5 | 6 | \label{sec:abstractalgebra} 7 | 8 | \section{Groups} 9 | 10 | \begin{definition}[Group] 11 | \label{def:group} 12 | Let we have a set of elements $G$ with a defined binary operation 13 | $\circ$ that satisfied the following properties. 14 | \begin{enumerate} 15 | \item Closure: $\forall a, b \in G$: $a \circ b \in G$ 16 | \item Associativity: $\forall a, b, c \in G$: 17 | $a \circ \left( b \circ c \right) = 18 | \left( a \circ b \right) \circ c$ 19 | \item Identity element: $\exists e \in G$ such that 20 | $\forall a \in G$: $e \circ a = a \circ e = a$ 21 | \item Inverse element: $\forall a \in G$ $\exists a^{-1} \in G$ such that 22 | $a \circ a^{-1} = e$ 23 | \end{enumerate} 24 | In this case $\left(G, \circ\right)$ is called as group. 25 | \end{definition} 26 | Therefore the group is a \mynameref{def:monoid} with inverse element 27 | property. 28 | 29 | \begin{example}[Group $\mathbb{Z}/2\mathbb{Z}$] 30 | Consider a set of 2 elements: $G = \left\{0, 1\right\}$ with the 31 | operation $\circ$ defined by the table \ref{tab:CayleyZ2Z}. 32 | \begin{table} 33 | \centering 34 | \caption{Cayley table for $\mathbb{Z}/2\mathbb{Z}$} 35 | \label{tab:CayleyZ2Z} 36 | \begin{tabular}{l|ll} 37 | \toprule 38 | $\circ$ & 0 & 1 \\ 39 | \midrule 40 | 0 & 0 & 1 \\ 41 | 1 & 1 & 0 \\ 42 | \bottomrule 43 | \end{tabular} 44 | \end{table} 45 | 46 | The identity element is $0$ i.e. $e = 0$. 47 | Inverse element is the element itself 48 | because $\forall a \in G$: $a \circ a = 0 = e$. 49 | \label{ex:groupZ2} 50 | \end{example} 51 | 52 | \begin{definition}[Abelian group] 53 | Let we have a \mynameref{def:group} $\left(G, \circ\right)$. 54 | The group is called an Abelian or commutative if 55 | $\forall a, b \in G$ it holds $a \circ b = b \circ a$. 56 | \label{def:abeliangroup} 57 | \end{definition} 58 | 59 | 60 | \section{Rings and Fields} 61 | 62 | \subsection{Rings} 63 | 64 | \begin{definition}[Ring] 65 | Consider a set $R$ with 2 binary operations defined. The first one 66 | $\oplus$ (addition) and elements of $R$ forms an 67 | \mynameref{def:abeliangroup} 68 | under this operation. The second one is $\odot$ (multiplication) and 69 | the elements of $R$ forms a \mynameref{def:monoid} under 70 | the operation. The two binary operations are connected each other 71 | via the following distributive law 72 | \begin{itemize} 73 | \item Left distributivity: 74 | $\forall a,b,c \in R$: 75 | $a \odot \left(b \oplus c\right) = 76 | a \odot b \oplus a \odot c$ 77 | \item Right distributivity: 78 | $\forall a,b,c \in R$: 79 | $\left( a \oplus b \right) \odot c = 80 | a \odot c \oplus b \odot c$ 81 | 82 | The identity element for $\left(R, \oplus\right)$ is denoted as $0$ 83 | (additive identity). 84 | The identity element for $\left(R, \odot\right)$ is denoted as $1$ 85 | (multiplicative identity). 86 | 87 | The inverse element to $a$ in $\left(R, \oplus\right)$ is denoted as $-a$ 88 | \end{itemize} 89 | 90 | In this case $\left(R, \oplus, \odot\right)$ is called as ring. 91 | \label{def:ring} 92 | \end{definition} 93 | 94 | The \mynameref{def:ring} is a generalization of integer numbers conception. 95 | \begin{example}[Ring of integers $\mathbb{Z}$] 96 | The set of integer numbers $\mathbb{Z}$ forms a \mynameref{def:ring} 97 | under $+$ and $\cdot$ operations i.e. addition $\oplus$ is 98 | $+$ and multiplication $\odot$ is $\cdot$. Thus for integer 99 | numbers we have the following \mynameref{def:ring}: 100 | $\left(\mathbb{Z}, +, \cdot\right)$ 101 | \label{ex:ring} 102 | \end{example} 103 | 104 | \subsection{Fields} 105 | 106 | \begin{definition}[Field] 107 | The ring $\left(R, \oplus, \odot\right)$ is called as a field if 108 | $\left(R \setminus \{0\}, \odot\right)$ is an \mynameref{def:abeliangroup}. 109 | 110 | The inverse element to $a$ in 111 | $\left(R \setminus\{0\}, \odot\right)$ is denoted as $a^{-1}$ 112 | \label{def:field} 113 | \end{definition} 114 | 115 | \begin{example}[Field $\mathbb{Q}$] 116 | Note that $\mathbb{Z}$ is not a field because not for every integer 117 | number an inverse exists. But if we consider a set of fractions 118 | $\mathbb{Q} = \left\{a/b \mid a \in \mathbb{Z}, b \in 119 | \mathbb{Z}\setminus\{0\}\right\}$ when it will be a field. 120 | 121 | The 122 | inverse element to $a/b$ in 123 | $\left(\mathbb{Q}\setminus\{0\}, \cdot\right)$ will be $b/a$. 124 | \label{ex:field} 125 | \end{example} 126 | 127 | \section{Linear algebra} 128 | 129 | \begin{definition}[Vector space] 130 | \label{def:vectorspace} 131 | Let $F$ is a \mynameref{def:field}. The set $V$ is called as vector 132 | space under $F$ if the following conditions are satisfied 133 | \begin{enumerate} 134 | \item We have a binary operation $V \times V \rightarrow V$ 135 | (addition): $(x,y) \rightarrow x + y$ with the following 136 | properties: 137 | \begin{enumerate} 138 | \item $x + y = y + x$ 139 | \item $(x + y) + z = x + ( y + z )$ 140 | \item $\exists 0 \in V$ such that $\forall x \in V: x + 0 = x$ 141 | \item $\forall x \in V \exists -x \in V$ such that $x + (-x) = x - 142 | x = 0$ 143 | \end{enumerate} 144 | \item We have a binary operation $F \times V \rightarrow V$ (scalar 145 | multiplication) with the following properties 146 | \begin{enumerate} 147 | \item $1_F \cdot x = x$ 148 | \item $\forall a,b \in F, x \in V$: $a\cdot\left(b \cdot x\right) 149 | = \left(a b\right) \cdot x$. 150 | \item $\forall a,b \in F, x \in V$: 151 | $(a+b)\cdot x = a \cdot x + b \cdot x$ 152 | \item $\forall a \in F, x, y \in V$: 153 | $a\cdot(x+y) = a\cdot x + a \cdot y$ 154 | \end{enumerate} 155 | \end{enumerate} 156 | \end{definition} 157 | 158 | 159 | \end{appendices} 160 | -------------------------------------------------------------------------------- /kleisli.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Kleisli category} 3 | 4 | \begin{definition}[Kleisli category] 5 | \label{def:kleisli_category} 6 | Let $\cat{C}$ is a category, $M$ is an \mynameref{def:endofunctor} and 7 | $\left$ is a \mynameref{def:monad}. Then we can 8 | construct a new category $\cat{C_M}$ as follows: 9 | \begin{eqnarray} 10 | \catob{C_M} = \catob{C}, 11 | \nonumber \\ 12 | \catmset[C_M]{a}{b} = 13 | \catmset[C]{a}{M(b)} 14 | \nonumber 15 | \end{eqnarray} 16 | i.e. objects of categories $\cat{C}$ and $\cat{C_M}$ are the same but 17 | morphisms from $\cat{C_M}$ form a subset of morphisms $\cat{C}$: 18 | $\cathom{C_M} \subset \cathom{C}$. The category is called as 19 | \textit{Kleisli category}. 20 | 21 | The identity morphism in the Kleisli category is the 22 | \mynameref{def:nt} $\eta$ \eqref{eq:monad_eta} defined by the monad 23 | $\left$: 24 | \[ 25 | \idm{C_M} = \eta 26 | \] 27 | \end{definition} 28 | 29 | \begin{remark}[Kleisli category composition] 30 | \mynameref{def:kleisli_category} has a non trivial composition rules. 31 | If we have 2 \mynameref{def:morphism}s from $\cathom{C_M}$: 32 | \[ 33 | f_M: a \to b 34 | \] 35 | and 36 | \[ 37 | g_M: b \to c. 38 | \] 39 | The morphisms have correspondent ones in $\cat{C}$: 40 | \[ 41 | f: a \to M(b) 42 | \] 43 | and 44 | \[ 45 | g: b \to M(c). 46 | \] 47 | The composition $g_M \circ f_M$ gives a new morphism 48 | \[ 49 | h_M = g_M \circ f_M: a \to c. 50 | \] 51 | The corresponding one from $\cat{C}$ is 52 | \[ 53 | h: a \to M(c). 54 | \] 55 | It has to be pointed that the compositions in $\cat{C}$ and 56 | $\cat{C_M}$ are not the same: 57 | \[ 58 | g_M \circ f_M \ne g \circ f. 59 | \] 60 | \end{remark} 61 | 62 | \mynameref{def:kleisli_category} widely spread in programming 63 | especially it provides good description for different types of 64 | computations, for instance \cite{bib:Moggi91, bib:milewski2018category} 65 | \begin{itemize} 66 | \item \textbf{Partiality} i.e. then a function not defined for each input, for 67 | instance the following expression is undefined (or partially 68 | defined) for $x = 0$: $f(x) = \frac{1}{x}$ 69 | \item \textbf{Non-Determinism} i.e. then multiply output are possible 70 | \item \textbf{Side-effects} i.e. then a function communicates with 71 | an environment 72 | \item \textbf{Exception} i.e. when some input is incorrect and can 73 | produce an abnormal result. Therefore it is the same as 74 | \textbf{Partiality} and will be considered below as the same type of 75 | computation. 76 | \item \textbf{Continuation} i.e. when we need to save the current 77 | state of the computation and be able to restore it on demand later 78 | \item \textbf{Interactive input} i.e. a function that reads data from 79 | an input device (keyboard, mouse, etc.) 80 | \item \textbf{Interactive output} i.e. a function that writes data to 81 | an output device (monitor etc.) 82 | \end{itemize} 83 | 84 | \section{Partiality and Exception} 85 | 86 | Partial functions and exceptions can be processed via monad be called 87 | as Maybe. There will be implementations in different languages below. 88 | And the usage example for the following function implementation 89 | \[ 90 | h(x) = \frac{1}{2 \sqrt{x}}. 91 | \] 92 | The function is a composition of 3 functions: 93 | \begin{eqnarray} 94 | f_1(x) = \sqrt{x}, 95 | \nonumber \\ 96 | f_2(x) = 2 \cdot x, 97 | \nonumber \\ 98 | f_3(x) = \frac{1}{x} 99 | \label{eq:monadmaybe_ex_f} 100 | \end{eqnarray} 101 | and as result the goal can be implemented as the following 102 | composition: 103 | \begin{equation} 104 | h = f_3 \circ f_2 \circ f_1. 105 | \label{eq:monadmaybe_ex_h} 106 | \end{equation} 107 | $f_2$ is a \mynameref{def:pure_function} and defined $\forall x \in \mathbb{R}$. The 108 | functions $f_1, f_3$ are partially defined. 109 | 110 | \subsection{Haskell example} 111 | 112 | \begin{example}[Maybe monad][$\cat{Hask}$] 113 | \label{ex:maybe_monad_haskell} 114 | The Maybe monad can be implemented as follows 115 | \begin{minted}{haskell} 116 | instance Monad Maybe where 117 | return = Just 118 | join Just( Just x) = Just x 119 | join _ = Nothing 120 | \end{minted} 121 | 122 | Our functions \eqref{eq:monadmaybe_ex_f} can be implemented as follows 123 | \begin{minted}{haskell} 124 | f1 :: (Ord a, Floating a) => a -> Maybe a 125 | f1 x = if x >= 0 then Just(sqrt x) else Nothing 126 | 127 | f2 :: Num a => a -> Maybe a 128 | f2 x = Just (2*x) 129 | 130 | f3 :: (Eq a, Fractional a) => a -> Maybe a 131 | f3 x = if x /= 0 then Just(1/x) else Nothing 132 | \end{minted} 133 | 134 | The $h$ \eqref{eq:monadmaybe_ex_h} is the composition via bind 135 | operator: 136 | \begin{minted}{haskell} 137 | h :: (Ord a, Floating a) => a -> Maybe a 138 | h x = (return x) >>= f1 >>= f2 >>= f3 139 | \end{minted} 140 | 141 | The usage example is the following: 142 | \begin{minted}{bash} 143 | *Main> h 4 144 | Just 0.25 145 | *Main> h 1 146 | Just 0.5 147 | *Main> h 0 148 | Nothing 149 | *Main> h (-1) 150 | Nothing 151 | \end{minted} 152 | 153 | \end{example} 154 | 155 | \subsection{C\texttt{++} example} 156 | 157 | \begin{example}[Maybe monad][$\cat{C\texttt{++}}$] 158 | \label{ex:maybe_monad_cpp} 159 | The Maybe monad can be implemented as follows 160 | \begin{minted}{c++} 161 | template using Maybe = std::optional; 162 | 163 | template < class A, class B> 164 | Maybe fmap(std::function f, Maybe a) { 165 | if (a) { 166 | return f(a.value()); 167 | } 168 | return {}; 169 | } 170 | 171 | template < class A> 172 | Maybe pure(A a) { 173 | return a; 174 | } 175 | 176 | template < class A> 177 | Maybe join(Maybe< Maybe > a){ 178 | if (a) { 179 | return a.value(); 180 | } 181 | return {}; 182 | } 183 | \end{minted} 184 | 185 | Our functions \eqref{eq:monadmaybe_ex_f} can be implemented as follows 186 | \begin{minted}{c++} 187 | std::function(float)> f1 = 188 | [](float x) { 189 | if (x >= 0) { 190 | return Maybe(sqrt(x)); 191 | } 192 | return Maybe(); 193 | }; 194 | 195 | std::function(float)> f2 = [](float x) { return 2 * x; }; 196 | 197 | std::function(float)> f3 = 198 | [](float x) { 199 | if (x != 0) { 200 | return Maybe(1 / x); 201 | } 202 | return Maybe(); 203 | }; 204 | } 205 | \end{minted} 206 | 207 | The $h$ \eqref{eq:monadmaybe_ex_h} is the composition via bind 208 | operator: 209 | \begin{minted}{c++} 210 | auto h(float x) { 211 | Maybe a = pure(x); 212 | return bind(f3,bind(f2,bind(f1, a))); 213 | }; 214 | \end{minted} 215 | 216 | \end{example} 217 | 218 | \section{Non-Determinism} 219 | 220 | The situation when a function returns several values is not applicable 221 | for \mynameref{def:setcategory} but can appear for 222 | \mynameref{def:relcategory}. From other hand the non standard 223 | situation is required for practical applications and as result has to 224 | be modeled in programming languages. The \textbf{List} monad is used 225 | for it. 226 | 227 | \subsection{Haskell example} 228 | 229 | \begin{example}[List monad][$\cat{Hask}$] 230 | \label{ex:list_monad_haskell} 231 | \begin{minted}{haskell} 232 | instance Monad [] where 233 | return x = [x] 234 | join = concat 235 | \end{minted} 236 | \end{example} 237 | 238 | \section{Side effects and interactive input/output} 239 | 240 | TBD 241 | 242 | \section{Continuation} 243 | 244 | TBD 245 | 246 | -------------------------------------------------------------------------------- /monoidalobject.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \section{Monoidal object} 3 | 4 | Monoid plays very important role in category theory 5 | 6 | \section{Monoid in $\cat{Set}$} 7 | Lets consider \mynameref{def:monoid} in the terms of Set theory and 8 | will try to give the definition that is based rather on morphisms then 9 | on internal set structure. Consider a set $M$ and by the definition 10 | $\forall m_1, m_2 \in M$ we can define a new element of the set 11 | $\mu(m_1, m_2) \in M$. Later we shall use the following notation for 12 | the $\mu$: 13 | \[ 14 | \mu(m_1, m_2) \equiv m_1 \cdot m_2. 15 | \] 16 | If the $(M, \cdot)$ is monoid then the following 2 conditions have to 17 | be satisfied. The first one (associativity) declares that $\forall 18 | m_1, m_2, m_3 \in M$ 19 | \[ 20 | m_1 \cdot ( m_2 \cdot m_3) = ( m_1 \cdot 21 | m_2 ) \cdot m_3. 22 | \] 23 | The second one (identity presence) says that 24 | \( 25 | \exists e \in M 26 | \) such that $\forall m \in M$: 27 | \begin{equation} 28 | m \cdot e = e \cdot m = m. 29 | \label{eq:monoid2} 30 | \end{equation} 31 | 32 | Lets start with the first one we can define $\mu$ as 33 | \mynameref{def:morphism} in the following way $\mu: M\times M \to M$ 34 | where $M \times M$ is \mynameref{ex:set_product} in 35 | \mynameref{def:setcategory}. I.e. $M, M \times M \in \catob{Set}$ and 36 | $\mu \in \cathom{Set}$. Consider another objects of $\cat{Set}$: $A = 37 | M \times \left( M \times M \right)$ and $A' = \left( M \times M \right) 38 | \times M$. They are not the same but there is a trivial 39 | \mynameref{def:isomorphism} between them $A \cong_\alpha A'$, where 40 | \[ 41 | \alpha(x,(y,z)) = ((x,y),z). 42 | \] 43 | Consider the action of \mynameref{def:product_of_morphisms} 44 | $\idm{M} \times \mu$ on $A$: 45 | \[ 46 | \idm{M} \times \mu \left(x,\left(y,z\right)\right) = 47 | \left(\idm{M}(x),\mu\left(y,z\right)\right) = 48 | \left(x, y \cdot z\right) \in M \times M 49 | \] 50 | i.e. $\idm{M} \times \mu: M \times \left( M \times M \right) \to M 51 | \times M$. If we act $\mu$ on the result we shall get: 52 | \begin{eqnarray} 53 | \mu \left(\idm{M} \times \mu \left(x,\left(y,z\right)\right)\right) = 54 | \left(\idm{M}(x),\mu\left(y,z\right)\right) = 55 | \nonumber \\ 56 | = 57 | \mu\left(x, y \cdot z\right) = x \cdot (y\cdot z) \in M, 58 | \nonumber 59 | \end{eqnarray} 60 | i.e. 61 | $\mu \circ \left(\idm{M} \times \mu\right): M \times \left( M \times M 62 | \right) \to M$. 63 | 64 | For $A'$ we have the following one: 65 | \begin{eqnarray} 66 | \mu\circ\left(\mu \times \idm{M}\right)\left(\left(x,y\right),z\right) 67 | = \mu\left(x \cdot y, z\right) = (x \cdot y) \cdot z. 68 | \nonumber 69 | \end{eqnarray} 70 | Monoid associativity requires 71 | \[ 72 | x \cdot (y\cdot z) = 73 | (x \cdot y) \cdot z 74 | \] 75 | i.e. the morphisms the corresponding morphisms commute: 76 | \[ 77 | \mu\circ\left(\mu \times \idm{M}\right) = 78 | \mu \circ \left(\idm{M} \times \mu\right) \circ \alpha. 79 | \] 80 | This corresponds the diagram is at \cref{fig:monoid_mu_alpha}. 81 | 82 | \begin{figure} 83 | \centering 84 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 85 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 86 | sep=-2pt}] 87 | 88 | % the texts 89 | 90 | \node[ele,label=above:$M\times\left(M \times M\right)$] (M31) at (0,3) {}; 91 | \node[ele,label=above:$\left(M \times M\right)\times M$] (M32) at (6,3) {}; 92 | \node[ele,label=below:$M \times M$] (M21) at (0,0) {}; 93 | \node[ele,label=below:$M \times M$] (M22) at (6,0) {}; 94 | \node[ele,label=below:$M$] (M) at (3,0) {}; 95 | 96 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M31) to 97 | node[sloped,above]{$\alpha$} (M32); 98 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M31) to 99 | node[sloped,below]{$\idm{M} \times \mu$} (M21); 100 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M32) to 101 | node[sloped,below]{$\mu \times \idm{M}$} (M22); 102 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M22) to 103 | node[sloped,above]{$\mu$} (M); 104 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M21) to 105 | node[sloped,above]{$\mu$} (M); 106 | \end{tikzpicture} 107 | \caption{Commutative diagram for $\mu\circ\left(\mu \times 108 | \idm{M}\right) = \mu \circ \left(\idm{M} \times \mu\right) \circ 109 | \alpha$.} 110 | \label{fig:monoid_mu_alpha} 111 | \end{figure} 112 | Very often the isomorphism $\alpha$ is omitted i.e. 113 | \[ 114 | M\times\left(M \times M\right) 115 | = \left(M \times M\right)\times M = M^3 116 | \] 117 | and the morphism 118 | equality is written as follow 119 | \[ 120 | \mu\circ\left(\mu \times \idm{M}\right) = 121 | \mu \circ \left(\idm{M} \times \mu\right) 122 | \] 123 | The corresponding commutative diagram is shown in 124 | \cref{fig:monoid_mu}. 125 | \begin{figure} 126 | \centering 127 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 128 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 129 | sep=-2pt}] 130 | 131 | % the texts 132 | 133 | \node[ele,label=above:$M^3$] (M3) at (0,3) {}; 134 | \node[ele,label=above:$M \times M$] (M21) at (3,3) {}; 135 | \node[ele,label=below:$M \times M$] (M22) at (0,0) {}; 136 | \node[ele,label=below:$M$] (M) at (3,0) {}; 137 | 138 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M3) to 139 | node[sloped,below]{$\idm{M} \times \mu$} (M21); 140 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M3) to 141 | node[sloped,above]{$\mu \times \idm{M}$} (M22); 142 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M22) to 143 | node[sloped,above]{$\mu$} (M); 144 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M21) to 145 | node[sloped,above]{$\mu$} (M); 146 | \end{tikzpicture} 147 | \caption{Commutative diagram for $\mu\circ\left(\mu \times 148 | \idm{M}\right) = \mu \circ \left(\idm{M} \times \mu\right)$.} 149 | \label{fig:monoid_mu} 150 | \end{figure} 151 | 152 | For \eqref{eq:monoid2} consider a morphism $\eta$ from 153 | a one point set $I = \{0\}$ to a special element $e \in M$ such that 154 | $\forall m \in M: e \cdot m = m \cdot e = m$. I.e. $\eta: I \to M$ and 155 | $e = \eta(0)$. Consider 2 sets $B = I \times M$ and $B' = M \times I$. 156 | We have 2 \mynameref{def:isomorphism}s: $B \cong_\lambda M$ and $B' 157 | \cong_\rho M$ where the isomorphisms are defined as follow 158 | \[ 159 | \lambda(0, m) = m 160 | \] 161 | and 162 | \[ 163 | \rho(m, 0) = m. 164 | \] 165 | 166 | If we apply \mynameref{def:product_of_morphisms} $\eta \times \mu$ and 167 | $\mu \times \eta$ on $B$ and $B'$ respectively then we get 168 | \begin{eqnarray} 169 | \eta \times \idm{M} \left(0 \times m\right) = e \times m, 170 | \nonumber \\ 171 | \idm{M} \times \eta \left(m \times 0\right) = m \times e. 172 | \nonumber 173 | \end{eqnarray} 174 | If we apply $\mu$ on the result then we get 175 | \begin{eqnarray} 176 | \mu \left(\eta \times \idm{M} \left(0 \times m\right) \right) = e \cdot m, 177 | \nonumber \\ 178 | \idm{M} \times \eta \left(m \times 0\right) = m \times e. 179 | \nonumber 180 | \end{eqnarray} 181 | \begin{figure} 182 | \centering 183 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 184 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 185 | sep=-2pt}] 186 | 187 | % the texts 188 | 189 | \node[ele,label=above:$M$] (M') at (0,3) {}; 190 | \node[ele,label=above:$M \times M$] (M21) at (3,3) {}; 191 | \node[ele,label=below:$M \times M$] (M22) at (0,0) {}; 192 | \node[ele,label=below:$M$] (M) at (3,0) {}; 193 | 194 | \draw [double equal sign distance] (M') to (M); 195 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M') to 196 | node[sloped,below]{$\lambda$} (M21); 197 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M') to 198 | node[sloped,above]{$\rho$} (M22); 199 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M22) to 200 | node[sloped,above]{$\mu$} (M); 201 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (M21) to 202 | node[sloped,above]{$\mu$} (M); 203 | \end{tikzpicture} 204 | \caption{Commutative diagram for $\mu \circ (\eta \times \idm{M}) 205 | \circ \lambda = \mu \circ (\idm{M} \times \mu) \circ \rho = 206 | \idm{M}$ .} 207 | \label{fig:monoid_eta_lambda_rho} 208 | \end{figure} 209 | The \eqref{eq:monoid2} leads to the following equation for morphisms 210 | \[ 211 | \mu \circ (\eta \times \idm{M}) \circ \rho = 212 | \mu \circ (\idm{M} \times \mu) \circ \lambda = 213 | \idm{M} 214 | \] 215 | or the commutative diagram show on \cref{fig:monoid_eta_lambda_rho}. 216 | 217 | \section{Monoidal object} 218 | If we take into consideration that one-point set is 219 | \mynameref{ex:set_terminal_object} then we can conclude that the 220 | monoid can be defined for instance in a \mynameref{def:cartesian_closed_category} 221 | as follow 222 | \begin{definition}[Monoidal object] 223 | \label{def:monoidal_object} 224 | Consider a \mynameref{def:category} $\cat{C}$ with a 225 | \mynameref{def:terminal_object} $t \in \catob{C}$. The object $m \in 226 | \catob{C}$ is called \textit{monoidal object} if the following 227 | conditions satisfied: 228 | \begin{enumerate} 229 | \item the \mynameref{def:product}s $m \times m, m \times t, t \times 230 | m$ exist 231 | \item there is a \mynameref{def:morphism} $\mu: m \times m \to m$ in 232 | the category 233 | \item there is another morphism $\eta: t \to m$ 234 | \item the morphisms satisfy the following conditions: 235 | \begin{eqnarray} 236 | \mu\circ\left(\mu \times 237 | \idm{M}\right) = \mu \circ \left(\idm{M} \times \mu\right) \circ 238 | \alpha, 239 | \nonumber \\ 240 | \mu \circ (\eta \times \idm{M}) 241 | \circ \lambda = \mu \circ (\idm{M} \times \mu) \circ \rho = 242 | \idm{M} 243 | \nonumber 244 | \end{eqnarray} 245 | where $\alpha$ (associator) is an isomorphism between $m \times (m 246 | \times m)$ and $(m \times m) \times m$, $\lambda, \rho$ - 2 another 247 | isomorphisms: 248 | \[ 249 | t \times m \cong_\lambda m 250 | \] 251 | and 252 | \[ 253 | m \times t \cong_\rho m 254 | \] 255 | \end{enumerate} 256 | \end{definition} 257 | 258 | -------------------------------------------------------------------------------- /curryhoward.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Curry-Howard-Lambek correspondence} 3 | \label{sec:curry_howard_lambek} 4 | There is an interesting correspondence between computer programs and 5 | mathematical proofs. Different types of logic correspond to different 6 | computational models. This allows to build a theory of computation on 7 | the base of math logic. First of all consider a category of proofs 8 | \section{$\cat{Proof}$ category} 9 | \begin{definition}[Proposition] 10 | \label{def:proposition} 11 | \textit{Proposition} is a statement that either true or false. 12 | \end{definition} 13 | 14 | There are 2 main propositions 15 | \begin{definition}[True] 16 | \label{def:true} 17 | A true statement is one that is correct, either in all cases or at 18 | least in the sample case \cite{bib:studycom:truefalse}. 19 | \end{definition} 20 | and 21 | \begin{definition}[False] 22 | \label{def:false} 23 | A false statement is one that is not correct \cite{bib:studycom:truefalse}. 24 | \end{definition} 25 | 26 | 27 | \begin{example}[Proposition] 28 | \label{ex:proposition} 29 | There is an example of correct (true) proposition 30 | \[ 31 | \forall n \in \mathbb{R}: n^2 \ge 0 32 | \] 33 | 34 | There is an example of incorrect (false) proposition 35 | \[ 36 | \forall n \in \mathbb{C}: n^2 \ge 0, 37 | \] 38 | for instance $i \in \mathbb{C}$ gives $i^2 = -1$. 39 | 40 | \end{example} 41 | 42 | \begin{definition}[Implication] 43 | \label{def:implication} \textit{An implication} is a 44 | \mynameref{def:proposition} of the form $P \implies Q$ i.e. if $P$ 45 | then $Q$ \cite{bib:whatisaproof}. 46 | \end{definition} 47 | 48 | The main logical deduction rule is the following 49 | \begin{definition}[Modus ponens] 50 | \label{def:modusponens} 51 | If $P$ is true and $P \implies Q$ is true then $Q$ is also true. The 52 | rule is often written as \cite{bib:whatisaproof} 53 | \[ 54 | \frac{ 55 | \begin{array}{c} 56 | P \\ 57 | P \implies Q 58 | \end{array} 59 | }{Q} 60 | \] 61 | where if statements above the line are true then the statement below 62 | the line is also true. 63 | \end{definition} 64 | 65 | \begin{definition}[Proof] 66 | \label{def:proof} 67 | \textit{Proof} is a verification \cite{bib:whatisaproof} of a 68 | \mynameref{def:proposition} by a chain of logical deduction from a 69 | base set of axioms. 70 | \end{definition} 71 | 72 | Propositions can be combined into new propositions via the following 73 | logical operations 74 | \begin{definition}[Conjunction] 75 | \label{def:conjunction} 76 | Conjunction or logical AND is the operation with following rules 77 | \begin{table}[H] 78 | \centering 79 | \caption{Conjunction} 80 | \label{tab:conjunction} 81 | \begin{tabular}{|l|l|l|} 82 | \hline 83 | $a$ & $b$ & $a \land b$ \\ \hline 84 | True & True & True \\ \hline 85 | True & False & False \\ \hline 86 | False & True & False \\ \hline 87 | False & False & False \\ \hline 88 | \end{tabular} 89 | \end{table} 90 | \end{definition} 91 | \begin{definition}[Disjunction] 92 | \label{def:disjunction} 93 | Conjunction or logical OR is the operation with following rules 94 | \begin{table}[H] 95 | \centering 96 | \caption{Disjunction} 97 | \label{tab:disjunction} 98 | \begin{tabular}{|l|l|l|} 99 | \hline 100 | $a$ & $b$ & $a \lor b$ \\ \hline 101 | True & True & True \\ \hline 102 | True & False & True \\ \hline 103 | False & True & True \\ \hline 104 | False & False & False \\ \hline 105 | \end{tabular} 106 | \end{table} 107 | \end{definition} 108 | 109 | Operations in Boolean logic follow the distributive law: 110 | \begin{equation} 111 | a \land ( b \lor c) = (a \land b) \lor (a \land c) 112 | \label{eq:distributive_law_boolean} 113 | \end{equation} 114 | i.e. the operation $\land$ corresponds to multiplication and $\lor$ to 115 | sum. Therefore the $\cat{Proof}$ can be considered as a 116 | \mynameref{def:distributive_category}. 117 | 118 | \begin{definition}[$\cat{Proof}$ category] 119 | \label{def:proof_category} 120 | The $\cat{Proof}$ category is a category where \mynameref{def:proposition}s are 121 | \mynameref{def:object}s and \mynameref{def:proof}s are 122 | \mynameref{def:morphism}s. I.e. proofs are used as connectors between 123 | different propositions. 124 | \end{definition} 125 | 126 | Consider different objects and constructions of the proof (logic) 127 | theory from the categorical point of view 128 | \begin{example}[Initial object][$\cat{Proof}$] 129 | \label{ex:proof_initial_object} 130 | The \textit{false} statement can be considered as the initial object 131 | because for any other statement exists only one proof from the false 132 | statement to that one. 133 | \end{example} 134 | 135 | \begin{example}[Terminal object][$\cat{Proof}$] 136 | \label{ex:proof_terminal_object} 137 | The \textit{true} statement can be considered as the terminal object 138 | \end{example} 139 | 140 | \begin{example}[Product][$\cat{Proof}$] 141 | \label{ex:proof_product} 142 | \mynameref{def:conjunction} can be considered as 143 | \mynameref{def:product} in \mynameref{def:proof_category}. 144 | \end{example} 145 | 146 | \begin{example}[Sum][$\cat{Proof}$] 147 | \label{ex:proof_sum} 148 | \mynameref{def:disjunction} can be considered as 149 | \mynameref{def:sum} in \mynameref{def:proof_category}. 150 | \end{example} 151 | 152 | Thus we can declare the following correspondence (see 153 | \cref{tab:curry_howard_lambek}) between logic 154 | proofs and \mynameref{def:cartesian_closed_category} and therefore 155 | also between programming languages. 156 | \begin{table}[H] 157 | \centering 158 | \caption{Relation between logic proofs and programming languages} 159 | \label{tab:curry_howard_lambek} 160 | \begin{adjustbox}{width=1\textwidth} 161 | \small 162 | \begin{tabular}{l|l|l} 163 | \toprule 164 | \mynameref{def:proof_category} & Programming language & 165 | \mynameref{def:cartesian_closed_category}\\ 166 | \midrule 167 | \mynameref{def:proposition}/\mynameref{def:implication} & Type & 168 | \mynameref{def:object} \\ 169 | \mynameref{def:proof} & Function type & \mynameref{def:exponential} \\ 170 | \mynameref{def:conjunction} & Product type & \mynameref{def:product} \\ 171 | \mynameref{def:disjunction} & Sum type & \mynameref{def:sum} \\ 172 | \mynameref{def:true} & unit type & \mynameref{def:terminal_object} \\ 173 | \mynameref{def:false} & botom type & \mynameref{def:initial_object} \\ 174 | \bottomrule 175 | \end{tabular} 176 | \end{adjustbox} 177 | \end{table} 178 | 179 | 180 | \section{Linear logic and Linear types} 181 | Linear logic \cite{stanford:linear_logic} is one of refinements of 182 | classical logic in the logic the \mynameref{def:implication} has been 183 | modified. In the classical logic the both statements $P$ and $Q$ are 184 | valid after implication $P \implies Q$. But in linear logic we have 185 | another situation when the statement $P$ can be used only once and 186 | become invalid after the usage. The situation then a resource can be used 187 | only once is useful in different types of computations especially in 188 | concurrency. TBD 189 | 190 | \section{Quantum logic and quantum computation} 191 | 192 | Different modifications of logic rules give us new computational 193 | models. One of example is the quantum computations. The quantum logic 194 | differs from Boolean one in the missing distributive law 195 | \eqref{eq:distributive_law_boolean}. 196 | 197 | We can use the Heisenberg inequality to illustrate the violation of 198 | the law. Consider a particle with 2 possible positions range and 1 199 | possible momentum range. The event $P$ is that momentum has 200 | range $\Delta p$. The event $Q_{1,2}$ is that position is in the 201 | corresponding range $\Delta q_{1,2}$ (see \cref{fig:heisenberg}). 202 | 203 | \begin{figure}[H] 204 | \centering 205 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 206 | width=.8pt,inner sep=1pt}] 207 | \node[ele,label=below:$0$] (a) at (0,0) {}; 208 | \node[ele,label=below:$q_1$] (b) at (2,0) {}; 209 | \node[ele,label=below:$q_2$] (c) at (4,0) {}; 210 | \draw[-,thick,shorten <=2pt,shorten >=2pt] (a) to node[above] 211 | {$\Delta q_1$} (b); 212 | \draw[-,thick,shorten <=2pt,shorten >=2pt] (b) to node[above] 213 | {$\Delta q_2$} (c); 214 | \end{tikzpicture} 215 | \caption{Heisenberg inequality. The particle position can be in the 216 | following ranges: $\left[0, q_1\right]$ (uncertainty is $\Delta 217 | q_1$), $\left[q_1, q_2\right]$ (uncertainty is $\Delta 218 | q_2 = \Delta q_1$) or $\left[0, q_2\right]$ (uncertainty is $\Delta 219 | q = \Delta q_1 + \Delta q_2 = 2 \Delta q_1$). We assume that 220 | momentum uncertainty is defined as $\Delta p = \frac{\hbar}{2 221 | \Delta q_1}$. Thus we have $\Delta p \Delta q_1 = \Delta p 222 | \Delta q_1 = \frac{\hbar}{3} < \frac{\hbar}{2}$ and therefore the particle 223 | cannot be localised neither inside $\left[0, q_1\right]$ or 224 | $\left[q_1, q_2\right]$. From other side $\Delta p \Delta q = 2 225 | \Delta p \Delta q_1 = \frac{2 \hbar}{3} > \frac{\hbar}{2}$ and 226 | as result the particle can be localized at interval $\left[0, q_2\right]$} 227 | \label{fig:heisenberg} 228 | \end{figure} 229 | 230 | Heisenberg inequality says 231 | \[ 232 | \Delta p \Delta q_{1,2} \geq \frac{\hbar}{2} 233 | \] 234 | i.e. the following 2 events $P\land Q_{1,2}$ are forbidden as soon as 235 | (see \cref{fig:heisenberg}): 236 | \[ 237 | \Delta p \Delta q_1 = \frac{\hbar}{3} 238 | \] 239 | and 240 | \[ 241 | \Delta p \Delta q_2 = \frac{\hbar}{3} 242 | \] 243 | i.e. 244 | \[ 245 | P \land Q_1 = P \land Q_2 = \mbox{False} 246 | \] 247 | from other side the event $P \land (Q_1 \lor Q_2)$ can be 248 | $\mbox{True}$ as soon as (see \cref{fig:heisenberg}) 249 | \[ 250 | \Delta p (\Delta q_1 + \Delta q_2) = \frac{2\hbar}{3} > 251 | \frac{\hbar}{2}. 252 | \] 253 | Therefore we have distributive law 254 | \eqref{eq:distributive_law_boolean} violation 255 | \[ 256 | P \land (Q_1 \lor Q_2) \ne (P \land Q_1 ) \lor (P \land Q_2). 257 | \] 258 | 259 | 260 | -------------------------------------------------------------------------------- /cattheory.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \documentclass[12pt,a4paper]{book} 3 | \usepackage[toc,page]{appendix} 4 | \usepackage[utf8]{inputenc} 5 | \usepackage{minted} 6 | \usepackage[T1,T2A]{fontenc} 7 | \usepackage[english]{babel} 8 | \usepackage{amsmath} 9 | \usepackage{xparse} %to make Mac OSX compilation happy 10 | \usepackage{amsthm} 11 | \usepackage{amssymb} 12 | \usepackage{array} 13 | \usepackage{booktabs} 14 | \usepackage{imakeidx} 15 | \usepackage{scrbase} 16 | \usepackage{physics} 17 | \usepackage{adjustbox} 18 | \usepackage{nomencl} 19 | \usepackage{mathtools} 20 | %\usepackage{thmbox} % Overrides \newtheorem command! See [nothm] to disable this feature. 21 | \makenomenclature 22 | 23 | % http://tex.stackexchange.com/questions/42343/how-to-add-a-navigation-window-to-a-latex-generated-pdf-document 24 | \usepackage{hyperref} 25 | \hypersetup{ 26 | pdftex, 27 | allcolors=blue, 28 | bookmarksnumbered=true, 29 | bookmarksopen=true, 30 | bookmarksopenlevel=1, 31 | colorlinks=true, 32 | pdfstartview=Fit, 33 | pdfpagemode=UseOutlines, 34 | pdfpagelayout=TwoPageRight, 35 | pdftitle={Category Theory by Example}, 36 | pdfsubject={Category Theory}, 37 | pdfauthor={Ivan Murashko, Alexey Radkov, Marat Minshin}, 38 | pdfkeywords={category theory, Haskell, quantum mechanics} 39 | } 40 | \usepackage{hypcap} 41 | 42 | \usepackage{tikz} 43 | \usepackage{tikz-cd} 44 | \usetikzlibrary{calc,trees,positioning,arrows,fit,shapes,matrix} 45 | \usetikzlibrary{arrows,shapes,positioning} 46 | \usetikzlibrary{decorations.markings} 47 | \tikzstyle arrowstyle=[scale=1] 48 | \tikzstyle directed=[postaction={decorate,decoration={markings, 49 | mark=at position .65 with {\arrow[arrowstyle]{stealth}}}}] 50 | \tikzstyle reverse directed=[postaction={decorate,decoration={markings, 51 | mark=at position .65 with {\arrowreversed[arrowstyle]{stealth};}}}] 52 | 53 | \usepackage{mathtools} 54 | 55 | % https://stackoverflow.com/questions/1673942/latex-table-positioning 56 | \usepackage{float} 57 | \restylefloat{table} 58 | 59 | \DeclareMathOperator{\Ima}{Im} 60 | \newcommand{\eqdef}{\overset{\mathrm{def}}{=\joinrel=}} 61 | 62 | % 63 | % https://tex.stackexchange.com/questions/187388/amsthm-with-shared-counters-messes-up-autoref-references 64 | % 65 | \usepackage{aliascnt} 66 | \usepackage{cleveref} 67 | 68 | \theoremstyle{theorem} 69 | %\newtheorem{theorem}{Theorem}[chapter] 70 | \newtheorem{xtheorem}{Theorem}[chapter] 71 | \providecommand*{\xtheoremautorefname}{Theorem} 72 | \NewDocumentEnvironment{theorem}{oo} 73 | {\IfNoValueTF{#1} 74 | % no optional argument to theorem 75 | {\begin{xtheorem}} 76 | {\begin{xtheorem}[#1]\index{#1 theorem!declaration}} 77 | }% 78 | {\end{xtheorem}} 79 | 80 | % 81 | % https://tex.stackexchange.com/questions/98626/automatically-add-theorems-to-index-and-label-them/98634 82 | % 83 | \theoremstyle{definition} 84 | \newaliascnt{definition}{xtheorem} 85 | \newtheorem{xdefinition}[definition]{Definition} 86 | \aliascntresetthe{definition} 87 | \providecommand*{\definitionautorefname}{Definition} 88 | \NewDocumentEnvironment{definition}{oo} 89 | {\IfNoValueTF{#1} 90 | % no optional argument to definition 91 | {\begin{xdefinition}} 92 | {\begin{xdefinition}[#1]\index{#1!definition}} 93 | }% 94 | {\end{xdefinition}} 95 | 96 | \theoremstyle{remark} 97 | \newaliascnt{example}{xtheorem} 98 | \newtheorem{xexample}[example]{Example} 99 | \aliascntresetthe{example} 100 | \providecommand*{\exampleautorefname}{Example} 101 | \NewDocumentEnvironment{example}{oo} 102 | {\IfNoValueTF{#2} 103 | {\IfNoValueTF{#1} 104 | % no optional argument to example 105 | {\begin{xexample}} 106 | {\begin{xexample}[#1]\index{#1!example}} 107 | }% 108 | {\begin{xexample}[#1][#2]\index{#1!#2 example}} 109 | }% 110 | {\end{xexample}} 111 | 112 | 113 | 114 | \theoremstyle{myremark} 115 | \newaliascnt{myremark}{xtheorem} 116 | \newtheorem{xmyremark}[myremark]{Remark} 117 | \aliascntresetthe{myremark} 118 | \providecommand*{\myremarkautorefname}{Remark} 119 | \NewDocumentEnvironment{myremark}{oo} 120 | {\begin{xmyremark} 121 | \footnote{ 122 | The remark is not a part of the lectures 123 | but it is important to understand the below 124 | content. 125 | } 126 | } 127 | {\end{xmyremark}} 128 | 129 | \theoremstyle{myaxiom} 130 | \newaliascnt{myaxiom}{xtheorem} 131 | \newtheorem{xmyaxiom}[myaxiom]{Axiom} 132 | \aliascntresetthe{myaxiom} 133 | \providecommand*{\myaxiomautorefname}{Axiom} 134 | \NewDocumentEnvironment{myaxiom}{oo} 135 | {\begin{xmyaxiom} 136 | \footnote{ 137 | The axiom is not a part of the lectures 138 | but it is important to understand the below 139 | content. 140 | } 141 | } 142 | {\end{xmyaxiom}} 143 | 144 | 145 | % 146 | % https://tex.stackexchange.com/questions/250035/transform-output-theoremstyleremark-from-italics-to-bold 147 | % 148 | \makeatletter 149 | \def\th@remark{% 150 | \thm@headfont{\bfseries}% 151 | \normalfont % body font 152 | \thm@preskip\topsep \divide\thm@preskip\tw@ 153 | \thm@postskip\thm@preskip 154 | } 155 | \makeatother 156 | 157 | \theoremstyle{remark} 158 | \newaliascnt{remark}{xtheorem} 159 | \newtheorem{xremark}[remark]{Remark} 160 | \aliascntresetthe{remark} 161 | \providecommand*{\remarkautorefname}{Remark} 162 | \NewDocumentEnvironment{remark}{oo} 163 | {\IfNoValueTF{#2} 164 | {\IfNoValueTF{#1} 165 | % no optional argument to remark 166 | {\begin{xremark}} 167 | {\begin{xremark}[#1]\index{#1!remark}} 168 | }% 169 | {\begin{xremark}[#1][#2]\index{#1!#2 remark}} 170 | }% 171 | {\end{xremark}} 172 | 173 | 174 | \theoremstyle{lemma} 175 | \newaliascnt{lemma}{xtheorem} 176 | \newtheorem{xlemma}[lemma]{Lemma} 177 | \aliascntresetthe{lemma} 178 | \providecommand*{\lemmaautorefname}{Lemma} 179 | \NewDocumentEnvironment{lemma}{oo} 180 | {\IfNoValueTF{#1} 181 | % no optional argument to lemma 182 | {\begin{xlemma}} 183 | {\begin{xlemma}[#1] 184 | \index{#1 lemma!declaration} 185 | } 186 | }% 187 | {\end{xlemma}} 188 | 189 | 190 | \newtheorem{claim}[xtheorem]{Claim} 191 | \newtheorem{proposition}[xtheorem]{Proposition} 192 | \newtheorem{corollary}[xtheorem]{Corollary} 193 | 194 | \theoremstyle{property} 195 | \newaliascnt{property}{xtheorem} 196 | \newtheorem{xproperty}[property]{Property} 197 | \aliascntresetthe{property} 198 | \providecommand*{\propertyautorefname}{Property} 199 | \NewDocumentEnvironment{property}{oo} 200 | {\IfNoValueTF{#1} 201 | % no optional argument to property 202 | {\begin{xproperty}} 203 | {\begin{xproperty}[#1] 204 | \index{#1 property!declaration} 205 | } 206 | }% 207 | {\end{xproperty}} 208 | 209 | \theoremstyle{axiom} 210 | \newaliascnt{axiom}{xtheorem} 211 | \newtheorem{xaxiom}[axiom]{Axiom} 212 | \aliascntresetthe{axiom} 213 | \providecommand*{\axiomautorefname}{Axiom} 214 | \NewDocumentEnvironment{axiom}{oo} 215 | {\IfNoValueTF{#1} 216 | % no optional argument to axiom 217 | {\begin{xaxiom}} 218 | {\begin{xaxiom}[#1] 219 | \index{#1 axiom!declaration} 220 | } 221 | }% 222 | {\end{xaxiom}} 223 | 224 | 225 | % 226 | % https://tex.stackexchange.com/questions/357118/expand-nameref-before-creating-index 227 | % 228 | 229 | \makeatletter 230 | \newcommand{\getnamereftext}[1]{% 231 | \@ifundefined{r@#1}{}{% 232 | \unexpanded\expandafter\expandafter\expandafter{% 233 | \expandafter\expandafter\expandafter\@thirdoffive\csname r@#1\endcsname 234 | }% 235 | }% 236 | } 237 | 238 | \newcommand{\mynameref}[1]{% 239 | {\nameref{#1}}% 240 | \ifstrstart{#1}{def:}% 241 | {\expandafter\index{{\getnamereftext{#1}}}}% 242 | { 243 | \def\makeidx 244 | {\ifstrstart{#1}{lem:} 245 | { 246 | \index{{\getnamereftext{#1} lemma}} 247 | } 248 | {\ifstrstart{#1}{thm:} 249 | { 250 | \index{{\getnamereftext{#1} theorem}} 251 | } 252 | {\ifstrstart{#1}{rem:} 253 | { 254 | \index{{\getnamereftext{#1} remark}} 255 | } 256 | {\ifstrstart{#1}{ex:} 257 | { 258 | \index{{\getnamereftext{#1} example}} 259 | } 260 | {\ifstrstart{#1}{prop:} 261 | { 262 | \index{{\getnamereftext{#1} property}} 263 | } 264 | {\ifstrstart{#1}{axm:} 265 | { 266 | \index{{\getnamereftext{#1} axiom}} 267 | } 268 | { 269 | \index{{\getnamereftext{#1} \namecref{#1}}} 270 | } 271 | } 272 | } 273 | } 274 | } 275 | } 276 | } 277 | \makeidx 278 | (\autoref{#1}) 279 | }% 280 | } 281 | 282 | % took from 283 | % http://www.andrew.cmu.edu/user/jonasf/80-413-713/documents/LaTeX_howto.pdf 284 | \newcommand {\cat}{% 285 | \mathbf% 286 | } 287 | \newcommand {\domain} [1] {% 288 | \mathrm{dom}(#1)% 289 | } 290 | \newcommand {\codomain} [1] {% 291 | \mathrm{ cod }(#1)% 292 | } 293 | \newcommand {\idm} [1] {% 294 | \mathbf{1}_{ #1 \to #1 }% 295 | } 296 | 297 | \newcommand {\tof} {% 298 | \Rightarrow% 299 | } 300 | 301 | \newcommand {\idf} [1] {% 302 | \mathbf{1}_{ \cat{#1} \tof \cat{#1} }% 303 | } 304 | 305 | \newcommand {\tont} {% 306 | \xrightarrow{.}% 307 | } 308 | 309 | 310 | \newcommand {\idnt} [1] {% 311 | \mathbf{1}_{ #1 \tont #1 }% 312 | } 313 | 314 | \newcommand {\catob} [1] {% 315 | \mathrm{ob}(\cat{#1})% 316 | } 317 | 318 | \newcommand {\cathom} [1] {% 319 | \mathrm{hom}(\cat{#1})% 320 | } 321 | 322 | \newcommand {\catcone} [2] {% 323 | \mathrm{cone}(#1, #2^{(#1)})% 324 | } 325 | 326 | \newcommand {\catcocone} [2] {% 327 | \mathrm{cocone}(#1, #2^{(#1)})% 328 | } 329 | 330 | % Hom set 331 | \NewDocumentCommand{\catmset}{o m m}{% 332 | \IfNoValueTF{#1}{% 333 | \mathrm{hom}\left(#2, #3\right)% 334 | }{% 335 | \mathrm{hom}_{\cat{#1}}\left(#2, #3\right)% 336 | }% 337 | } 338 | 339 | 340 | \NewDocumentCommand{\catmsetfig}{m m m}{% 341 | \catmset[#1]{#2}{#3} 342 | } 343 | 344 | 345 | % Covariant Hom functor 346 | \newcommand {\catcovhom} [2] {% 347 | \mathrm{Hom}_{\cat{#1}}\left(#2, -\right)% 348 | } 349 | 350 | % Contravariant Hom functor 351 | \newcommand {\catconhom} [2] {% 352 | \mathrm{Hom}_{#1}\left(-, #2\right)% 353 | } 354 | 355 | \newcommand {\funcat} [2] {% 356 | [\cat{#1}, \cat{#2}]% 357 | } 358 | 359 | 360 | \DeclareMathOperator{\dom}{dom} 361 | \DeclareMathOperator{\cod}{cod} 362 | 363 | \makeindex[intoc] 364 | 365 | \title{Category Theory by Example} 366 | \author{Ivan Murashko, Alexey Radkov, Marat Minshin} 367 | %\date{} 368 | \begin{document} 369 | \maketitle 370 | \tableofcontents 371 | 372 | \input ./notations.tex 373 | \input ./introduction.tex 374 | \input ./basedefinitions.tex 375 | \input ./objectsmorphisms.tex 376 | \input ./curryhoward.tex 377 | %\input ./monoidalobject.tex 378 | \input ./functors.tex 379 | \input ./nt.tex 380 | \input ./monads.tex 381 | \input ./kleisli.tex 382 | \input ./limits.tex 383 | \input ./yoneda.tex 384 | \input ./topos.tex 385 | \input ./appendices.tex 386 | 387 | \printindex 388 | \bibliographystyle{acm} 389 | \bibliography{cattheory} 390 | \input ./license.tex 391 | 392 | \end{document} 393 | -------------------------------------------------------------------------------- /functors.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Functors} 3 | 4 | \section{Definitions} 5 | 6 | \begin{definition}[Functor] 7 | \label{def:functor} 8 | Let $\cat{C}$ and $\cat{D}$ are 2 categories. A mapping $F: \cat{C} 9 | \tof \cat{D}$ between the categories is called \textit{functor} if it 10 | preserves the internal structure (see \cref{fig:functor}): 11 | \begin{itemize} 12 | \item $\forall a_C \in \catob{C}, \exists a_D \in \catob{D}$ such that 13 | $a_D = F( a_C )$ 14 | \item $\forall f_C \in \cathom{C}, \exists f_D \in \cathom{D}$ such 15 | that $\dom f_D = F (\dom f_C), \cod f_D = F (\cod f_C)$. We shall use 16 | the following notation later: $f_D = F(f_C)$. 17 | \item $\forall f_C, g_C$ the following equation holds: 18 | \[ 19 | F\left(f_C \circ 20 | g_C\right) = F\left(f_C\right) \circ F\left(g_C\right) = f_D \circ 21 | g_D. 22 | \] 23 | \item $\forall x \in \catob{C}: F(\idm{x}) = \idm{F(x)}$. 24 | \end{itemize} 25 | 26 | \begin{figure} 27 | \centering 28 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 29 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 30 | sep=-2pt}] 31 | 32 | % the texts 33 | 34 | \node at (0,3) {$C$}; 35 | \node at (4,3) {$D$}; 36 | 37 | \node[ele,label=above:$a_C$] (ac) at (0,2) {}; 38 | \node[ele,label=below:$b_C$] (bc) at (0,0) {}; 39 | \node[ele,label=above:$a_D$] (ad) at (4,2) {}; 40 | \node[ele,label=below:$b_D$] (bd) at (4,0) {}; 41 | 42 | \node[draw,fit= (ac) (bc),minimum width=2cm, minimum 43 | height=3.5cm] {} ; 44 | \node[draw,fit= (ad) (bd),minimum width=2cm, minimum 45 | height=3.5cm] {} ; 46 | 47 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 48 | node[left]{$f_C$} (bc); 49 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 50 | node[right]{$f_D$} (bd); 51 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 52 | node[sloped,above]{$a_D = F(a_C)$} (ad); 53 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 54 | node[sloped,above]{$b_D = F(b_C)$} (bd); 55 | \end{tikzpicture} 56 | \caption{Functor $F: \cat{C} \tof \cat{D}$ definition} 57 | \label{fig:functor} 58 | \end{figure} 59 | \end{definition} 60 | 61 | \begin{remark}[Functor] 62 | When we say that functor preserve internal structure we assume that 63 | the functor is not just mapping between \mynameref{def:object}s but 64 | also between \mynameref{def:morphism}s. 65 | 66 | Thus functor is something that allows map one category into another. 67 | The initial category can be considered as a pattern thus the mapping 68 | is some kind of searching of the pattern inside another category. 69 | \end{remark} 70 | 71 | Programming languages can be considered as a good platform for the 72 | functor examples. 73 | The functor can be defined in Haskell as follows 74 | \footnote{the real definition is quite different from the current one} 75 | \begin{example}[Functor][$\cat{Hask}$] 76 | \label{ex:functor_haskell} 77 | \begin{minted}{haskell} 78 | class Functor f where 79 | fmap :: (a -> b) -> f a -> f b 80 | \end{minted} 81 | \end{example} 82 | 83 | In Scala it can be defined in the same way 84 | \begin{example}[Functor][$\cat{Scala}$] 85 | \label{ex:functor_scala} 86 | \begin{minted}{scala} 87 | trait Functor[F[_]] { 88 | def fmap[A, B](f: A => B): F[A] => F[B] 89 | }\end{minted} 90 | \end{example} 91 | 92 | In C\texttt{++} the definition differs 93 | \begin{example}[Functor][$\cat{C\texttt{++}}$] 94 | \label{ex:functor_cpp} 95 | In C\texttt{++} templates can be considered as type constructors in Haskell 96 | and therefore can convert one type for another. For instance the 97 | list of strings can be got with the following construction: 98 | 99 | \begin{minted}{c++} 100 | using StringList = std::list; 101 | StringList a = {"1", "2", "3"}; 102 | \end{minted} 103 | i.e. we have \mynameref{def:object}s mapping out of the box. 104 | Therefore we need to define fmap 105 | operation for \mynameref{def:morphism}s mapping to complete the 106 | \mynameref{def:functor} definition. It can be declared as 107 | follows 108 | \begin{minted}{c++} 109 | template < template< class ...> class F, class A, class B> 110 | F fmap(std::function, F); 111 | \end{minted} 112 | The template specialization for the \textbf{std::list} can be 113 | written as follows 114 | \begin{minted}{c++} 115 | // file: functor.h 116 | template 117 | std::list fmap(std::function f, std::list a) { 118 | std::list res; 119 | std::transform(a.begin(), a.end(), back_inserter(res), f); 120 | return res; 121 | } 122 | \end{minted} 123 | 124 | The simple usage example is the following 125 | \begin{minted}{c++} 126 | StringList a = {"1", "2", "3"}; 127 | std::function f = [](std::string s) { 128 | return 2 * atoi(s.c_str()); 129 | }; 130 | auto res = fmap<>(f, a); 131 | \end{minted} 132 | \end{example} 133 | 134 | 135 | \begin{definition}[Endofunctor] 136 | \label{def:endofunctor} 137 | Let $\cat{C}$ is a \mynameref{def:category}. The 138 | \mynameref{def:functor} $E: \cat{C} \tof \cat{C}$ i.e. 139 | the functor from a category to the same category is called 140 | \textit{endofunctor}. 141 | \end{definition} 142 | 143 | \begin{definition}[Identity functor] 144 | \label{def:idfunctor} 145 | Let $\cat{C}$ is a \mynameref{def:category}. The 146 | \mynameref{def:functor} $\idf{C}: \cat{C} \tof \cat{C}$ is called \textit{identity 147 | functor} if for every object $a \in \catob{C}$ 148 | \[ 149 | \idf{C}(a) = a 150 | \] 151 | and for every \mynameref{def:morphism} $f \in \cathom{C}$ 152 | \[ 153 | \idf{C}(f) = f 154 | \] 155 | \end{definition} 156 | 157 | \begin{remark}[Identity functor] 158 | \label{rem:idfunctor} 159 | First of all notice that \mynameref{def:idfunctor} is an 160 | \mynameref{def:endofunctor}. 161 | 162 | There is difference between identity functor and \mynameref{def:id} 163 | because the first one has deal with both \mynameref{def:object}s and 164 | \mynameref{def:morphism}s while the second one with the objects 165 | only. 166 | \end{remark} 167 | 168 | \begin{definition}[Functor composition] 169 | \label{def:functor_composition} 170 | If we have 3 categories $\cat{C}, \cat{D}, \cat{E}$ and 2 functors 171 | between them: $F: \cat{C} \tof \cat{D}$ and $G: \cat{D} \tof \cat{E}$ 172 | then we can construct a new functor $H: \cat{C} \tof \cat{E}$ that is 173 | called \textit{functor composition} and denoted as $H = G \circ F$. 174 | TBD 175 | \end{definition} 176 | 177 | \section{\textbf{Cat} category} 178 | The \mynameref{def:functor_composition} is associative by definition. 179 | Therefore \mynameref{def:idfunctor} with the associative composition 180 | allow us to define a category where other categories are considered as 181 | objects and functors as morphisms: 182 | \begin{definition}[$\cat{Cat}$ category] 183 | \label{def:catcategory} 184 | The category of small categories (see \mynameref{def:small_category}) 185 | denoted as $\cat{Cat}$ is the \mynameref{def:category} where objects 186 | are small categories and morphisms are \mynameref{def:functor}s 187 | between them. 188 | \end{definition} 189 | 190 | We can construct an extension of Cartesian product as follows 191 | \begin{definition}[Category Product] 192 | \label{def:category_product} 193 | If we have 2 categories $\cat{C}$ and $\cat{D}$ then we can construct 194 | a new category $\cat{C} \times \cat{D}$ with the following components: 195 | \begin{itemize} 196 | \item \mynameref{def:object}s are the pairs $(c,d)$ where $c \in 197 | \catob{C}$ and $d \in \catob{D}$ 198 | \item \mynameref{def:morphism}s are the pair $(f,g)$ where $f \in 199 | \cathom{C}$ and $g \in \cathom{D}$ 200 | \item \mynameref{axm:composition} is defined as follows 201 | \( 202 | (f_1, g_1) \circ (f_2, g_2) = (f_1 \circ f_2, g_1 \circ g_2) 203 | \) 204 | \item Identity is defined as follows: $\idm{C \times D} = 205 | \left(\idm{C}, \idm{D}\right)$ 206 | \end{itemize} 207 | \end{definition} 208 | 209 | \begin{definition}[Constant functor] 210 | \label{def:const_functor} 211 | Let consider a trivial functor $\Delta_c$ from \mynameref{def:category} 212 | $\cat{A}$ to category $\cat{C}$ such that $\forall a \in \catob{A}: 213 | \Delta_c a = c$ -fixed object in $\cat{C}$ and 214 | $\forall f \in \cathom{A}: \Delta_c f = \idm{c}$. The trivial 215 | functor is called \textit{constant functor}. 216 | \end{definition} 217 | 218 | \begin{example}[Initial object][$\cat{Cat}$] 219 | \label{ex:initial_object_cat} 220 | \mynameref{def:empty_category} is the \mynameref{def:initial_object} 221 | in $\cat{Cat}$ category \cite{bib:stackexchange:empty_category}. 222 | \end{example} 223 | 224 | \begin{example}[Terminal object][$\cat{Cat}$] 225 | \label{ex:terminal_object_cat} 226 | \mynameref{def:trivial_category} is the \mynameref{def:terminal_object} 227 | in $\cat{Cat}$ category. 228 | \end{example} 229 | 230 | 231 | The good example can be found in $\cat{Hask}$ category. 232 | \begin{example}[Constant functor][$\cat{Hask}$] 233 | \label{ex:const_functor_hask} 234 | \begin{minted}{haskell} 235 | data Const c a = Const c 236 | fmap :: (a -> b) -> Const c a -> Const c b 237 | fmap f (Const c a) = Const c 238 | \end{minted} 239 | \end{example} 240 | 241 | \section{Contravariant functor} 242 | Ordinary functor preserves the direction of morphisms and often called 243 | as \mynameref{def:covariant_functor}. The functor that reverses the 244 | direction of morphisms is called as 245 | \mynameref{def:contravariant_functor}. 246 | 247 | \begin{definition}[Covariant functor] 248 | \label{def:covariant_functor} 249 | If we have categories $\cat{C}$ and $\cat{D}$ then the 250 | ordinary \mynameref{def:functor} $\cat{C} \tof \cat{D}$ is called 251 | \textit{convariant functor}. 252 | \end{definition} 253 | 254 | \begin{definition}[Contravariant functor] 255 | \label{def:contravariant_functor} 256 | If we have categories $\cat{C}$ and $\cat{D}$ then the 257 | \mynameref{def:functor} $\cat{C^{op}} \tof \cat{D}$ is called 258 | \textit{contravariant functor}. 259 | \end{definition} 260 | 261 | 262 | \begin{example}[Contravariant functor][$\cat{Hask}$] 263 | \label{ex:contravariant_functor_hask} 264 | Function mapping inside a functor is made via \textbf{fmap} (see 265 | \cref{ex:functor_haskell}) but sometimes the function that has to be 266 | mapped is \textbf{a -> b} but the result mapping has an inverse 267 | order: \textbf{f b -> f a}. In the case the contravariant functor 268 | can help 269 | \begin{minted}{haskell} 270 | class Contravariant f where 271 | contramap :: (a -> b) -> f b -> f a 272 | \end{minted} 273 | 274 | The contravariant functor should follow the following laws 275 | \begin{minted}{haskell} 276 | contramap id = id 277 | contramap f . contramap g = contramap (g . f) 278 | \end{minted} 279 | 280 | Consider the following task. We have a predicate for \textbf{Int} 281 | type that returns \textbf{True} if the number is greater than 282 | \textbf{10} otherwise it returns \textbf{False}: 283 | \begin{minted}{haskell} 284 | newtype Predicate a = Predicate { runPredicate :: a -> Bool} 285 | 286 | intgt10 :: Predicate Int 287 | intgt10 = Predicate ( \i -> i > 10 ) 288 | \end{minted} 289 | Now we want to create a predicate that accepts a string and 290 | verify it length greater than 10 or not. 291 | I.e. we want to have something of the following type: 292 | \begin{minted}{haskell} 293 | strgt10 :: Predicate String 294 | \end{minted} 295 | In the case the \mynameref{def:contravariant_functor} helps. 296 | 297 | \begin{minted}{haskell} 298 | instance Contravariant Predicate where 299 | contramap f (Predicate p) = Predicate ( p . f ) 300 | 301 | strgt10 :: Predicate [Char] 302 | strgt10 = contramap length intgt10 303 | \end{minted} 304 | \end{example} 305 | 306 | 307 | \section{Bifunctors} 308 | 309 | \begin{definition}[Bifunctor] 310 | \label{def:bifunctor} 311 | Bifunctor is a \mynameref{def:functor} whose \mynameref{def:domain} is 312 | a \mynameref{def:category_product}. I.e. if $\cat{C_1}, \cat{C_2}, 313 | \cat{D}$ are 3 categories then the \mynameref{def:functor} 314 | \( 315 | F: \cat{C_1} \times \cat{C_2} \tof \cat{D} 316 | \) is called \textit{bifunctor}. 317 | \end{definition} 318 | 319 | \begin{example}[Bifunctor][$\cat{Set}$] 320 | \label{ex:product_bifunctor} 321 | Lets $A,B,C$ and $D$ are sets and $f: A \to C, g: B \to D$ are two 322 | \mynameref{def:function}s. Then the \mynameref{def:cartesian_product} 323 | with \mynameref{def:product_of_morphisms} form a 324 | \mynameref{def:bifunctor} $\times$. 325 | \end{example} 326 | 327 | \begin{example}[Maybe as a bifunctor][$\cat{Hask}$] 328 | \label{ex:maybe_functor} 329 | Lets show how the \textbf{Maybe a} type can be 330 | constructed from different 331 | \mynameref{def:functor}s and as result show that the 332 | \textbf{Maybe a} is also a 333 | \mynameref{def:functor}. 334 | \begin{minted}{haskell} 335 | data Maybe a = Nothing | Just a 336 | -- This is equivalent to 337 | data Maybe a = Either () (Identity a) 338 | -- Either is a bifunctor and () == Const () a 339 | -- Thus Maybe is a composition of 2 functors 340 | \end{minted} 341 | \end{example} 342 | 343 | \begin{definition}[Profunctor] 344 | \label{def:profunctor} 345 | If we have a category $\cat{C}$ then the \mynameref{def:bifunctor} 346 | $\cat{C^{op}} \times \cat{C} \tof \cat{C}$ is called 347 | \textit{profunctor}. 348 | \end{definition} 349 | 350 | \begin{example}[Profunctor][$\cat{Hask}$] 351 | \label{ex:contravariant_functor_hask} 352 | TBD 353 | \begin{minted}{haskell} 354 | class Profunctor p where 355 | dimap :: (a' -> a) -> ( b -> b' ) -> p a b -> p a' b' 356 | -- p a b == a -> b 357 | dimap f g h = g . h . f 358 | \end{minted} 359 | \end{example} 360 | 361 | 362 | 363 | 364 | 365 | -------------------------------------------------------------------------------- /license.tex: -------------------------------------------------------------------------------- 1 | \advance\csname @enumdepth\endcsname\csname @ne\endcsname 2 | \chapter*{Creative Commons Legal Code} 3 | 4 | \section*{Attribution-NonCommercial 3.0 Unported} 5 | 6 | 7 | 8 | 9 | 10 | \begin{quotation} 11 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES 12 | NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE 13 | DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE 14 | COMMONS PROVIDES THIS INFORMATION ON AN ``AS-IS'' BASIS. 15 | CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE 16 | INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES 17 | RESULTING FROM ITS USE. 18 | \end{quotation} 19 | \subsection*{\emph{License}} 20 | \par THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS 21 | OF THIS CREATIVE COMMONS PUBLIC LICENSE (``CCPL'' OR 22 | ``LICENSE''). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER 23 | APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS 24 | AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS 25 | PROHIBITED. 26 | \par BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU 27 | ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. 28 | TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A 29 | CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE 30 | IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND 31 | CONDITIONS. 32 | \par \textbf{1. Definitions} 33 | \begin{enumerate} 34 | \item \textbf{``Adaptation''} means a work based upon 35 | the Work, or upon the Work and other pre-existing works, 36 | such as a translation, adaptation, derivative work, 37 | arrangement of music or other alterations of a literary 38 | or artistic work, or phonogram or performance and 39 | includes cinematographic adaptations or any other form in 40 | which the Work may be recast, transformed, or adapted 41 | including in any form recognizably derived from the 42 | original, except that a work that constitutes a 43 | Collection will not be considered an Adaptation for the 44 | purpose of this License. For the avoidance of doubt, 45 | where the Work is a musical work, performance or 46 | phonogram, the synchronization of the Work in 47 | timed-relation with a moving image (``synching'') will be 48 | considered an Adaptation for the purpose of this 49 | License. 50 | \item \textbf{``Collection''} means a collection of 51 | literary or artistic works, such as encyclopedias and 52 | anthologies, or performances, phonograms or broadcasts, 53 | or other works or subject matter other than works listed 54 | in Section 1(f) below, which, by reason of the selection 55 | and arrangement of their contents, constitute 56 | intellectual creations, in which the Work is included in 57 | its entirety in unmodified form along with one or more 58 | other contributions, each constituting separate and 59 | independent works in themselves, which together are 60 | assembled into a collective whole. A work that 61 | constitutes a Collection will not be considered an 62 | Adaptation (as defined above) for the purposes of this 63 | License. 64 | \item \textbf{``Distribute''} means to make available 65 | to the public the original and copies of the Work or 66 | Adaptation, as appropriate, through sale or other 67 | transfer of ownership. 68 | \item \textbf{``Licensor''} means the individual, 69 | individuals, entity or entities that offer(s) the Work 70 | under the terms of this License. 71 | \item \textbf{``Original Author''} means, in the case 72 | of a literary or artistic work, the individual, 73 | individuals, entity or entities who created the Work or 74 | if no individual or entity can be identified, the 75 | publisher; and in addition (i) in the case of a 76 | performance the actors, singers, musicians, dancers, and 77 | other persons who act, sing, deliver, declaim, play in, 78 | interpret or otherwise perform literary or artistic works 79 | or expressions of folklore; (ii) in the case of a 80 | phonogram the producer being the person or legal entity 81 | who first fixes the sounds of a performance or other 82 | sounds; and, (iii) in the case of broadcasts, the 83 | organization that transmits the broadcast. 84 | \item \textbf{``Work''} means the literary and/or 85 | artistic work offered under the terms of this License 86 | including without limitation any production in the 87 | literary, scientific and artistic domain, whatever may be 88 | the mode or form of its expression including digital 89 | form, such as a book, pamphlet and other writing; a 90 | lecture, address, sermon or other work of the same 91 | nature; a dramatic or dramatico-musical work; a 92 | choreographic work or entertainment in dumb show; a 93 | musical composition with or without words; a 94 | cinematographic work to which are assimilated works 95 | expressed by a process analogous to cinematography; a 96 | work of drawing, painting, architecture, sculpture, 97 | engraving or lithography; a photographic work to which 98 | are assimilated works expressed by a process analogous to 99 | photography; a work of applied art; an illustration, map, 100 | plan, sketch or three-dimensional work relative to 101 | geography, topography, architecture or science; a 102 | performance; a broadcast; a phonogram; a compilation of 103 | data to the extent it is protected as a copyrightable 104 | work; or a work performed by a variety or circus 105 | performer to the extent it is not otherwise considered a 106 | literary or artistic work. 107 | \item \textbf{``You''} means an individual or entity 108 | exercising rights under this License who has not 109 | previously violated the terms of this License with 110 | respect to the Work, or who has received express 111 | permission from the Licensor to exercise rights under 112 | this License despite a previous violation. 113 | \item \textbf{``Publicly Perform''} means to perform 114 | public recitations of the Work and to communicate to the 115 | public those public recitations, by any means or process, 116 | including by wire or wireless means or public digital 117 | performances; to make available to the public Works in 118 | such a way that members of the public may access these 119 | Works from a place and at a place individually chosen by 120 | them; to perform the Work to the public by any means or 121 | process and the communication to the public of the 122 | performances of the Work, including by public digital 123 | performance; to broadcast and rebroadcast the Work by any 124 | means including signs, sounds or images. 125 | \item \textbf{``Reproduce''} means to make copies of 126 | the Work by any means including without limitation by 127 | sound or visual recordings and the right of fixation and 128 | reproducing fixations of the Work, including storage of a 129 | protected performance or phonogram in digital form or 130 | other electronic medium. 131 | \end{enumerate} 132 | \par \textbf{2. Fair Dealing Rights.} Nothing in this 133 | License is intended to reduce, limit, or restrict any uses 134 | free from copyright or rights arising from limitations or 135 | exceptions that are provided for in connection with the 136 | copyright protection under copyright law or other 137 | applicable laws. 138 | \par \textbf{3. License Grant.} Subject to the terms 139 | and conditions of this License, Licensor hereby grants You 140 | a worldwide, royalty-free, non-exclusive, perpetual (for 141 | the duration of the applicable copyright) license to 142 | exercise the rights in the Work as stated below: 143 | \begin{enumerate} 144 | \item to Reproduce the Work, to incorporate the Work into 145 | one or more Collections, and to Reproduce the Work as 146 | incorporated in the Collections; 147 | \item to create and Reproduce Adaptations provided that any 148 | such Adaptation, including any translation in any medium, 149 | takes reasonable steps to clearly label, demarcate or 150 | otherwise identify that changes were made to the original 151 | Work. For example, a translation could be marked ``The 152 | original work was translated from English to Spanish,'' or 153 | a modification could indicate ``The original work has been 154 | modified.''; 155 | \item to Distribute and Publicly Perform the Work including 156 | as incorporated in Collections; and, 157 | \item to Distribute and Publicly Perform Adaptations. 158 | \end{enumerate} 159 | \par The above rights may be exercised in all media and 160 | formats whether now known or hereafter devised. The above 161 | rights include the right to make such modifications as are 162 | technically necessary to exercise the rights in other media 163 | and formats. Subject to Section 8(f), all rights not 164 | expressly granted by Licensor are hereby reserved, 165 | including but not limited to the rights set forth in 166 | Section 4(d). 167 | \par \textbf{4. Restrictions.} The license granted in 168 | Section 3 above is expressly made subject to and limited by 169 | the following restrictions: 170 | \begin{enumerate} 171 | \item You may Distribute or Publicly Perform the Work only 172 | under the terms of this License. You must include a copy 173 | of, or the Uniform Resource Identifier (URI) for, this 174 | License with every copy of the Work You Distribute or 175 | Publicly Perform. You may not offer or impose any terms 176 | on the Work that restrict the terms of this License or 177 | the ability of the recipient of the Work to exercise the 178 | rights granted to that recipient under the terms of the 179 | License. You may not sublicense the Work. You must keep 180 | intact all notices that refer to this License and to the 181 | disclaimer of warranties with every copy of the Work You 182 | Distribute or Publicly Perform. When You Distribute or 183 | Publicly Perform the Work, You may not impose any 184 | effective technological measures on the Work that 185 | restrict the ability of a recipient of the Work from You 186 | to exercise the rights granted to that recipient under 187 | the terms of the License. This Section 4(a) applies to 188 | the Work as incorporated in a Collection, but this does 189 | not require the Collection apart from the Work itself to 190 | be made subject to the terms of this License. If You 191 | create a Collection, upon notice from any Licensor You 192 | must, to the extent practicable, remove from the 193 | Collection any credit as required by Section 4(c), as 194 | requested. If You create an Adaptation, upon notice from 195 | any Licensor You must, to the extent practicable, remove 196 | from the Adaptation any credit as required by Section 197 | 4(c), as requested. 198 | \item You may not exercise any of the rights granted to You 199 | in Section 3 above in any manner that is primarily 200 | intended for or directed toward commercial advantage or 201 | private monetary compensation. The exchange of the Work 202 | for other copyrighted works by means of digital 203 | file-sharing or otherwise shall not be considered to be 204 | intended for or directed toward commercial advantage or 205 | private monetary compensation, provided there is no 206 | payment of any monetary compensation in connection with 207 | the exchange of copyrighted works. 208 | \item If You Distribute, or Publicly Perform the Work or 209 | any Adaptations or Collections, You must, unless a 210 | request has been made pursuant to Section 4(a), keep 211 | intact all copyright notices for the Work and provide, 212 | reasonable to the medium or means You are utilizing: (i) 213 | the name of the Original Author (or pseudonym, if 214 | applicable) if supplied, and/or if the Original Author 215 | and/or Licensor designate another party or parties (e.g., 216 | a sponsor institute, publishing entity, journal) for 217 | attribution (``Attribution Parties'') in Licensor's 218 | copyright notice, terms of service or by other reasonable 219 | means, the name of such party or parties; (ii) the title 220 | of the Work if supplied; (iii) to the extent reasonably 221 | practicable, the URI, if any, that Licensor specifies to 222 | be associated with the Work, unless such URI does not 223 | refer to the copyright notice or licensing information 224 | for the Work; and, (iv) consistent with Section 3(b), in 225 | the case of an Adaptation, a credit identifying the use 226 | of the Work in the Adaptation (e.g., ``French translation 227 | of the Work by Original Author,'' or ``Screenplay based on 228 | original Work by Original Author''). The credit required 229 | by this Section 4(c) may be implemented in any reasonable 230 | manner; provided, however, that in the case of a 231 | Adaptation or Collection, at a minimum such credit will 232 | appear, if a credit for all contributing authors of the 233 | Adaptation or Collection appears, then as part of these 234 | credits and in a manner at least as prominent as the 235 | credits for the other contributing authors. For the 236 | avoidance of doubt, You may only use the credit required 237 | by this Section for the purpose of attribution in the 238 | manner set out above and, by exercising Your rights under 239 | this License, You may not implicitly or explicitly assert 240 | or imply any connection with, sponsorship or endorsement 241 | by the Original Author, Licensor and/or Attribution 242 | Parties, as appropriate, of You or Your use of the Work, 243 | without the separate, express prior written permission of 244 | the Original Author, Licensor and/or Attribution 245 | Parties. 246 | \item 247 | \par For the avoidance of doubt: 248 | \begin{enumerate} 249 | \item \textbf{Non-waivable Compulsory License 250 | Schemes}. In those jurisdictions in which the 251 | right to collect royalties through any statutory or 252 | compulsory licensing scheme cannot be waived, the 253 | Licensor reserves the exclusive right to collect such 254 | royalties for any exercise by You of the rights 255 | granted under this License; 256 | \item \textbf{Waivable Compulsory License 257 | Schemes}. In those jurisdictions in which the 258 | right to collect royalties through any statutory or 259 | compulsory licensing scheme can be waived, the 260 | Licensor reserves the exclusive right to collect such 261 | royalties for any exercise by You of the rights 262 | granted under this License if Your exercise of such 263 | rights is for a purpose or use which is otherwise 264 | than noncommercial as permitted under Section 4(b) 265 | and otherwise waives the right to collect royalties 266 | through any statutory or compulsory licensing scheme; 267 | and, 268 | \item \textbf{Voluntary License Schemes}. The 269 | Licensor reserves the right to collect royalties, 270 | whether individually or, in the event that the 271 | Licensor is a member of a collecting society that 272 | administers voluntary licensing schemes, via that 273 | society, from any exercise by You of the rights 274 | granted under this License that is for a purpose or 275 | use which is otherwise than noncommercial as 276 | permitted under Section 4(c). 277 | \end{enumerate} 278 | 279 | \item Except as otherwise agreed in writing by the Licensor 280 | or as may be otherwise permitted by applicable law, if 281 | You Reproduce, Distribute or Publicly Perform the Work 282 | either by itself or as part of any Adaptations or 283 | Collections, You must not distort, mutilate, modify or 284 | take other derogatory action in relation to the Work 285 | which would be prejudicial to the Original Author's honor 286 | or reputation. Licensor agrees that in those 287 | jurisdictions (e.g. Japan), in which any exercise of the 288 | right granted in Section 3(b) of this License (the right 289 | to make Adaptations) would be deemed to be a distortion, 290 | mutilation, modification or other derogatory action 291 | prejudicial to the Original Author's honor and 292 | reputation, the Licensor will waive or not assert, as 293 | appropriate, this Section, to the fullest extent 294 | permitted by the applicable national law, to enable You 295 | to reasonably exercise Your right under Section 3(b) of 296 | this License (right to make Adaptations) but not 297 | otherwise. 298 | \end{enumerate} 299 | \par \textbf{5. Representations, Warranties and 300 | Disclaimer} 301 | \par UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN 302 | WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO 303 | REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE 304 | WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, 305 | WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, 306 | FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE 307 | ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE 308 | PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. 309 | SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED 310 | WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 311 | \par \textbf{6. Limitation on Liability.} EXCEPT TO 312 | THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL 313 | LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY 314 | SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY 315 | DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, 316 | EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF 317 | SUCH DAMAGES. 318 | \par \textbf{7. Termination} 319 | \begin{enumerate} 320 | \item This License and the rights granted hereunder will 321 | terminate automatically upon any breach by You of the 322 | terms of this License. Individuals or entities who have 323 | received Adaptations or Collections from You under this 324 | License, however, will not have their licenses terminated 325 | provided such individuals or entities remain in full 326 | compliance with those licenses. Sections 1, 2, 5, 6, 7, 327 | and 8 will survive any termination of this License. 328 | \item Subject to the above terms and conditions, the 329 | license granted here is perpetual (for the duration of 330 | the applicable copyright in the Work). Notwithstanding 331 | the above, Licensor reserves the right to release the 332 | Work under different license terms or to stop 333 | distributing the Work at any time; provided, however that 334 | any such election will not serve to withdraw this License 335 | (or any other license that has been, or is required to 336 | be, granted under the terms of this License), and this 337 | License will continue in full force and effect unless 338 | terminated as stated above. 339 | \end{enumerate} 340 | \par \textbf{8. Miscellaneous} 341 | \begin{enumerate} 342 | \item Each time You Distribute or Publicly Perform the Work 343 | or a Collection, the Licensor offers to the recipient a 344 | license to the Work on the same terms and conditions as 345 | the license granted to You under this License. 346 | \item Each time You Distribute or Publicly Perform an 347 | Adaptation, Licensor offers to the recipient a license to 348 | the original Work on the same terms and conditions as the 349 | license granted to You under this License. 350 | \item If any provision of this License is invalid or 351 | unenforceable under applicable law, it shall not affect 352 | the validity or enforceability of the remainder of the 353 | terms of this License, and without further action by the 354 | parties to this agreement, such provision shall be 355 | reformed to the minimum extent necessary to make such 356 | provision valid and enforceable. 357 | \item No term or provision of this License shall be deemed 358 | waived and no breach consented to unless such waiver or 359 | consent shall be in writing and signed by the party to be 360 | charged with such waiver or consent. 361 | \item This License constitutes the entire agreement between 362 | the parties with respect to the Work licensed here. There 363 | are no understandings, agreements or representations with 364 | respect to the Work not specified here. Licensor shall 365 | not be bound by any additional provisions that may appear 366 | in any communication from You. This License may not be 367 | modified without the mutual written agreement of the 368 | Licensor and You. 369 | \item The rights granted under, and the subject matter 370 | referenced, in this License were drafted utilizing the 371 | terminology of the Berne Convention for the Protection of 372 | Literary and Artistic Works (as amended on September 28, 373 | 1979), the Rome Convention of 1961, the WIPO Copyright 374 | Treaty of 1996, the WIPO Performances and Phonograms 375 | Treaty of 1996 and the Universal Copyright Convention (as 376 | revised on July 24, 1971). These rights and subject 377 | matter take effect in the relevant jurisdiction in which 378 | the License terms are sought to be enforced according to 379 | the corresponding provisions of the implementation of 380 | those treaty provisions in the applicable national law. 381 | If the standard suite of rights granted under applicable 382 | copyright law includes additional rights not granted 383 | under this License, such additional rights are deemed to 384 | be included in the License; this License is not intended 385 | to restrict the license of any rights under applicable 386 | law. 387 | \end{enumerate} 388 | 389 | \begin{quotation} 390 | \subsection*{Creative Commons Notice} 391 | \par Creative Commons is not a party to this License, and 392 | makes no warranty whatsoever in connection with the Work. 393 | Creative Commons will not be liable to You or any party 394 | on any legal theory for any damages whatsoever, including 395 | without limitation any general, special, incidental or 396 | consequential damages arising in connection to this 397 | license. Notwithstanding the foregoing two (2) sentences, 398 | if Creative Commons has expressly identified itself as 399 | the Licensor hereunder, it shall have all rights and 400 | obligations of Licensor. 401 | \par Except for the limited purpose of indicating to the 402 | public that the Work is licensed under the CCPL, Creative 403 | Commons does not authorize the use by either party of the 404 | trademark ``Creative Commons'' or any related trademark or 405 | logo of Creative Commons without the prior written 406 | consent of Creative Commons. Any permitted use will be in 407 | compliance with Creative Commons' then-current trademark 408 | usage guidelines, as may be published on its website or 409 | otherwise made available upon request from time to time. 410 | For the avoidance of doubt, this trademark restriction 411 | does not form part of the License. 412 | \par Creative Commons may be contacted at \url{https://creativecommons.org/}. 413 | \end{quotation} 414 | 415 | 416 | 417 | \advance\csname @enumdepth\endcsname-\csname @ne\endcsname 418 | -------------------------------------------------------------------------------- /nt.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Natural transformation} 3 | 4 | Natural transformation is the most important part of the category 5 | theory. It provides a possibility to compare \mynameref{def:functor}s 6 | via a standard tool. 7 | 8 | \section{Definitions} 9 | 10 | The natural transformation is not an easy concept compare other ones 11 | and requires some additional preparations before we can give the 12 | formal definition. 13 | 14 | \begin{figure} 15 | \centering 16 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 17 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 18 | sep=-2pt}] 19 | 20 | % the texts 21 | 22 | \node at (0,3) {$C$}; 23 | \node at (4,3) {$D$}; 24 | 25 | \node[ele,label=above:$a$] (a) at (0,2) {}; 26 | \node[ele,label=above:$a_F$] (af) at (4,2) {}; 27 | \node[ele,label=below:$a_G$] (ag) at (4,0) {}; 28 | 29 | \node[draw,fit= (a),minimum width=2cm, minimum 30 | height=3.5cm] {} ; 31 | \node[draw,fit= (af) (ag),minimum width=2cm, minimum 32 | height=3.5cm] {} ; 33 | 34 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 35 | node[above]{$F$} (af); 36 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 37 | node[above]{$G$} (ag); 38 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 39 | node[right]{$\alpha_a$} (ag); 40 | \end{tikzpicture} 41 | \caption{Natural transformation: object mapping} 42 | \label{fig:nt_objects_mapping} 43 | \end{figure} 44 | 45 | Consider 2 categories $\cat{C}, \cat{D}$ and 2 46 | \mynameref{def:functor}s $F: \cat{C} \tof \cat{D}$ and $G: 47 | \cat{C} \tof \cat{D}$. If we have an \mynameref{def:object} $a \in \catob{C}$ then 48 | it will be translated by different functors into different objects of 49 | category $\cat{D}$: $a_F = F(a), a_G = G(a) \in \catob{D}$ (see 50 | \cref{fig:nt_objects_mapping}). There are 2 options possible 51 | \begin{enumerate} 52 | \item There is not any \mynameref{def:morphism} that connects $a_F$ 53 | and $a_G$. 54 | \item $\exists \alpha_a \in \catmset{a_F}{a_G} \subset 55 | \cathom{D}$. 56 | \end{enumerate} 57 | We can of course to create an artificial morphism that connects the 58 | objects but if we use \textit{natural} morphisms 59 | \footnote{the word natural means that already existent morphisms from 60 | category $\cat{D}$ are used} 61 | then we can get a 62 | special characteristic of the considered functors and categories. For 63 | instance if we have such morphisms then we can say that the 64 | considered functors are related each other. Opposite example if there 65 | are no such morphisms then the functors can be considered as unrelated 66 | each other. 67 | %% Another example if the 68 | %% morphisms are \mynameref{def:isomorphism}s then the functors can be 69 | %% considered as very close each other. 70 | 71 | \begin{figure} 72 | \centering 73 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 74 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 75 | sep=-2pt}] 76 | 77 | % the texts 78 | 79 | \node at (0,3) {$C$}; 80 | \node at (4,3) {$D$}; 81 | 82 | \node[ele,label=above:$a$] (a) at (0,2) {}; 83 | \node[ele,label=below:$b$] (b) at (0,0) {}; 84 | \node[ele,label=above:$a_F$] (af) at (4,2) {}; 85 | \node[ele,label=below:$a_G$] (ag) at (4,0) {}; 86 | \node[ele,label=above:$b_F$] (bf) at (5.5,2) {}; 87 | \node[ele,label=below:$b_G$] (bg) at (5.5,0) {}; 88 | 89 | \node[draw,fit= (a) (b),minimum width=2cm, minimum 90 | height=3.5cm] {} ; 91 | \node[draw,fit= (af) (ag) (bf) (bg),minimum width=3cm, minimum 92 | height=4cm] {} ; 93 | 94 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 95 | node[left]{$f$} (b); 96 | 97 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 98 | node[below]{$f_F$} (bf); 99 | 100 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ag) to 101 | node[above]{$f_G$} (bg); 102 | 103 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 104 | node[above]{$F$} (af); 105 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 106 | [out=45,in=135,looseness=1] node[above]{$F$} (bf); 107 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 108 | node[above]{$G$} (ag); 109 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 110 | [out=-45,in=-135,looseness=1] node[above]{$G$} (bg); 111 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 112 | node[left]{$\alpha_a$} (ag); 113 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bf) to 114 | node[right]{$\alpha_b$} (bg); 115 | \end{tikzpicture} 116 | \caption{Natural transformation: morphisms mapping} 117 | \label{fig:nt_morphisms_mapping} 118 | \end{figure} 119 | 120 | 121 | The functor is not just the object mapping but also the morphisms 122 | mapping. If we have 2 objects $a$ and $b$ in the category $\cat{C}$ 123 | then we potentially can have a morphism $f \in \catmset[C]{a}{b}$. In this 124 | case the morphism is mapped by the functors $F$ and $G$ into 2 125 | morphisms $f_f$ and $f_G$ in the category $\cat{D}$. 126 | As result we have 4 morphisms: $\alpha_a, \alpha_b, f_F, f_G \in 127 | \cathom{D}$. It is natural to impose additional conditions on the 128 | morphisms especially that they form a 129 | \mynameref{def:commutative_diagram} (see \cref{fig:nt_def}): 130 | \[ 131 | f_f \circ \alpha_b = \alpha_a \circ f_G. 132 | \] 133 | 134 | \begin{definition}[Natural transformation] 135 | \label{def:nt} 136 | 137 | \begin{figure} 138 | \centering 139 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 140 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 141 | sep=-2pt}] 142 | 143 | % the texts 144 | \node[ele,label=above:$a_F$] (af) at (0,2) {}; 145 | \node[ele,label=below:$a_G$] (ag) at (0,0) {}; 146 | \node[ele,label=above:$b_F$] (bf) at (1.5,2) {}; 147 | \node[ele,label=below:$b_G$] (bg) at (1.5,0) {}; 148 | 149 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 150 | node[below]{$f_F$} (bf); 151 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ag) to 152 | node[above]{$f_G$} (bg); 153 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 154 | node[left]{$\alpha_a$} (ag); 155 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bf) to 156 | node[right]{$\alpha_b$} (bg); 157 | \end{tikzpicture} 158 | \caption{Natural transformation: commutative diagram} 159 | \label{fig:nt_def} 160 | \end{figure} 161 | 162 | Let $F$ and $G$ are 2 \mynameref{def:functor}s from category $\cat{C}$ 163 | to the category $\cat{D}$. The \textit{natural transformation} is a 164 | set of \mynameref{def:morphism}s $\alpha \subset \cathom{D}$ which 165 | satisfy the following conditions: 166 | \begin{itemize} 167 | \item For every \mynameref{def:object} $a \in \catob{C}$ $\exists 168 | \alpha_a \in \catmset{a_F}{a_G}$ 169 | \footnote{ 170 | $a_F = F(a), a_G = G(a)$ 171 | } 172 | - \mynameref{def:morphism} 173 | in category $\cat{D}$. The morphism $\alpha_a$ is called the component of 174 | the natural transformation. 175 | \item For every morphism $f \in \cathom{C}$ that connects 2 objects 176 | $a$ and $b$, i.e. $f \in \catmset[C]{a}{b}$ the corresponding components of 177 | the natural transformation $\alpha_a, \alpha_b \in \alpha$ should 178 | satisfy the following conditions 179 | \begin{equation} 180 | f_G \circ \alpha_a = \alpha_b \circ f_F, 181 | \label{eq:nt_definition} 182 | \end{equation} 183 | where $f_F = F(f), f_G = G(f)$. 184 | In other words the morphisms form a 185 | \mynameref{def:commutative_diagram} shown on the \cref{fig:nt_def}. 186 | \end{itemize} 187 | 188 | We use the following notation (arrow with a dot) for the natural transformation between 189 | functors $F$ and $G$: $\alpha: F \tont G$. 190 | \end{definition} 191 | 192 | 193 | \begin{definition}[Natural isomorphism] 194 | \label{def:ni} 195 | The \mynameref{def:nt} $\alpha: F \tont G$ is called \textit{natural 196 | isomorphism} if all morphisms $\alpha \subset \cathom{D}$ are 197 | \mynameref{def:isomorphism}s in $\cat{D}$ 198 | \end{definition} 199 | 200 | 201 | \section{Category of functors} 202 | 203 | The functors can be considered as objects in a special category 204 | $\cat{Fun}$. The morphisms in the category are \mynameref{def:nt}s. 205 | 206 | To define a category we need to define composition operation that 207 | satisfied \mynameref{axm:composition}, identity 208 | morphism and verify \mynameref{axm:associativity}. 209 | 210 | \begin{figure} 211 | \centering 212 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 213 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 214 | sep=-2pt}] 215 | 216 | % the texts 217 | 218 | \node at (0,3) {$C$}; 219 | \node at (4,5) {$D$}; 220 | 221 | \node[ele,label=above:$a$] (a) at (0,2) {}; 222 | \node[ele,label=above:$a_F$] (af) at (4,4) {}; 223 | \node[ele,label=right:$a_G$] (ag) at (4,2) {}; 224 | \node[ele,label=below:$a_H$] (ah) at (4,0) {}; 225 | 226 | \node[draw,fit= (a),minimum width=2cm, minimum 227 | height=3.5cm] {} ; 228 | \node[draw,fit= (af) (ag) (ah),minimum width=5cm, minimum 229 | height=5cm] {} ; 230 | 231 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 232 | node[above]{$F$} (af); 233 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 234 | node[above]{$G$} (ag); 235 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 236 | node[above]{$H$} (ah); 237 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 238 | node[right]{$\alpha_a$} (ag); 239 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ag) to 240 | node[right]{$\beta_a$} (ah); 241 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 242 | [out=-45,in=45,looseness=1] node[right]{$\beta_a \circ \alpha_a$} (ah); 243 | \end{tikzpicture} 244 | \caption{Natural transformation vertical composition: object mapping} 245 | \label{fig:nt_objects_mapping_composition} 246 | \end{figure} 247 | 248 | For the composition consider 2 \mynameref{def:nt}s $\alpha, \beta$ and 249 | consider how they act on an object $a \in \catob{C}$ (see 250 | \cref{fig:nt_objects_mapping_composition}). We always can construct 251 | the composition $\beta_a \circ \alpha_a$ i.e. we can define the 252 | composition of natural transformations $\alpha, \beta$ as 253 | \( 254 | \beta \circ \alpha = \left\{ 255 | \beta_a \circ \alpha_a | a \in \catob{C} 256 | \right\} 257 | \). 258 | 259 | \begin{figure} 260 | \centering 261 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 262 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 263 | sep=-2pt}] 264 | 265 | % the texts 266 | 267 | \node[ele,label=above:$a_F$] (af) at (0,4) {}; 268 | \node[ele,label=left:$a_G$] (ag) at (0,2) {}; 269 | \node[ele,label=below:$a_H$] (ah) at (0,0) {}; 270 | \node[ele,label=above:$b_F$] (bf) at (3,4) {}; 271 | \node[ele,label=right:$b_G$] (bg) at (3,2) {}; 272 | \node[ele,label=below:$b_H$] (bh) at (3,0) {}; 273 | 274 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 275 | node[above]{$f_F$} (bf); 276 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ag) to 277 | node[above]{$f_G$} (bg); 278 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ah) to 279 | node[above]{$f_H$} (bh); 280 | 281 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 282 | node[right]{$\alpha_a$} (ag); 283 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ag) to 284 | node[right]{$\beta_a$} (ah); 285 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 286 | [out=-135,in=135,looseness=1] node[left]{$\beta_a \circ 287 | \alpha_a$} (ah); 288 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bf) to 289 | node[right]{$\alpha_b$} (bg); 290 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bg) to 291 | node[right]{$\beta_b$} (bh); 292 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bf) to 293 | [out=-45,in=45,looseness=1] node[right]{$\beta_b \circ \alpha_b$} 294 | (bh); 295 | \end{tikzpicture} 296 | \caption{Natural transformation vertical composition: morphism mapping - 297 | commutative diagram} 298 | \label{fig:nt_morphism_mapping_composition} 299 | \end{figure} 300 | 301 | 302 | The natural transformation is not just object mapping but also 303 | morphism mapping. We shall require that all morphisms shown on 304 | \cref{fig:nt_morphism_mapping_composition} commute. 305 | The composition 306 | defined in such way is called \mynameref{def:vertical_composition}. 307 | \begin{definition}[Vertical composition] 308 | \label{def:vertical_composition} 309 | \index{Natural transformation!Vertical composition} 310 | Let $F,G,H$ are functors between categories $\cat{C}$ and $\cat{D}$. 311 | Also we have $\alpha : F \tont G, \beta: G \tont 312 | H$ - natural transformations. We can compose the $\alpha$ and $\beta$ 313 | as follows 314 | \[ 315 | \alpha \circ \beta: F \tont H. 316 | \] 317 | This composition 318 | is called \textit{vertical composition}. 319 | \end{definition} 320 | 321 | 322 | \begin{definition}[$\cat{Fun}$ category] 323 | \label{def:funcategory} 324 | \index{Object!$\cat{Fun}$ example} 325 | \index{Morphism!$\cat{Fun}$ example} 326 | \index{Category!$\cat{Fun}$ example} 327 | Let $\cat{C}$ and $\cat{D}$ are 2 categories. The category that 328 | contains functors $F: \cat{C} \tof \cat{D}$ as objects and 329 | \mynameref{def:nt} as morphisms is called as \textit{functor 330 | category}. The morphism composition is the 331 | \mynameref{def:vertical_composition} in the category. The \textit{functor 332 | category} between categories $\cat{C}$ and $\cat{D}$ is denoted as 333 | $\funcat{C}{D}$. 334 | \end{definition} 335 | 336 | Uniqueness of \mynameref{def:nt} is the same to uniqueness of morphisms in the 337 | target category as soon as the natural transformation is a set of 338 | \mynameref{def:morphism}s in it. This fact leads to the following 339 | examples for initial and terminal objects in \mynameref{def:funcategory}. 340 | 341 | \begin{example}[Terminal object][$\cat{Fun}$] 342 | \label{ex:terminal_object_fun} 343 | Let $\funcat{C}{D}$ is the functor category between $\cat{C}$ 344 | and $\cat{D}$. If $t \in \catob{D}$ is the 345 | \mynameref{def:terminal_object} in the category $\cat{D}$ then 346 | the 347 | \mynameref{def:const_functor} $\Delta_t$ is the 348 | \mynameref{def:terminal_object} in the category $\funcat{C}{D}$ 349 | \cite{bib:stackexchange:initial_terminal_in_fun_category}. 350 | \end{example} 351 | 352 | \begin{example}[Initial object][$\cat{Fun}$] 353 | \label{ex:initial_object_fun} 354 | Let $\funcat{C}{D}$ is the functor category between $\cat{C}$ 355 | and $\cat{D}$. If $i \in \catob{D}$ is the 356 | \mynameref{def:initial_object} in the category $\cat{D}$ then 357 | the 358 | \mynameref{def:const_functor} $\Delta_i$ is the 359 | \mynameref{def:initial_object} in the category $\funcat{C}{D}$ 360 | \cite{bib:stackexchange:initial_terminal_in_fun_category}. 361 | \end{example} 362 | 363 | 364 | \section{Operations with natural transformations} 365 | 366 | \mynameref{def:vertical_composition} is not the unique way to compose 367 | 2 functors. Another option is also possible. 368 | 369 | \begin{definition}[Horizontal composition] 370 | \label{def:horizontal_composition} 371 | \index{Natural transformation!Horizontal composition} 372 | If we have 2 pairs of functors. The first one $F,G: \cat{C} \to 373 | \cat{D}$ and another one $J,K: \cat{D} \tof \cat{E}$. We also have a 374 | natural transformation between each pair: $\alpha : F \tont 375 | G$ for the first one and $\beta : J \tont 376 | K$ for the second one. We can create a new transformation 377 | \[ 378 | \alpha \star \beta: F \circ J \tont G \circ K 379 | \] 380 | that is called \textit{horizontal composition}. Note that we use a 381 | special symbol $\star$ for the composition. 382 | \end{definition} 383 | 384 | \begin{remark}[Bifunctor in the category of functors] 385 | \label{rem:bifunctor_fun_cat} 386 | If we have the same pair of functors as in 387 | \cref{def:horizontal_composition} then we can consider the functors as 388 | \mynameref{def:object}s of 3 categories: $\cat{\mathcal{A}} = \left[\cat{C}, 389 | \cat{D}\right], \cat{\mathcal{B}} = \left[\cat{D}, 390 | \cat{E}\right]$ and $\cat{\mathcal{C}} = \left[\cat{C}, 391 | \cat{E}\right]$ 392 | 393 | We can construct a \mynameref{def:bifunctor} 394 | $\otimes: \cat{\mathcal{A}} \times \cat{\mathcal{B}} \tof \cat{\mathcal{C}}$ 395 | where for each pair of objects $F \in \catob{\mathcal{A}}, J \in 396 | \catob{\mathcal{B}}$ we get another object from $\cat{\mathcal{C}}$. 397 | We used the ordinary functor's composition as the operation for 398 | objects mapping. 399 | I.e. 400 | \[ 401 | \otimes: F \times G \to F \circ G \in \catob{\mathcal{C}}. 402 | \] 403 | 404 | The bifunctor is not just a map for objects. There is also a map 405 | between morphisms. Thus if we have 2 \mynameref{def:morphism}s: 406 | $\alpha : F \to G$ and $\beta : J \to K$ then we can construct the 407 | following mapping 408 | \[ 409 | \otimes: \alpha \times \beta \to \alpha \star \beta \in \cathom{\mathcal{C}}. 410 | \] 411 | 412 | As result we just introduced mapping $\otimes$ as a 413 | \mynameref{def:bifunctor} in the category of functors. 414 | \end{remark} 415 | 416 | \begin{definition}[Left whiskering] 417 | \label{def:lw} 418 | If we have 3 categories $\cat{B}, \cat{C}, \cat{D}$, 419 | \mynameref{def:functor}s $F,G: \cat{C} \tof \cat{D}$, $H: \cat{B} \to 420 | \cat{C}$ and \mynameref{def:nt} 421 | $\alpha: F \tont G$ then we can construct a new natural 422 | transformations: 423 | \[ 424 | \alpha H : F \circ H \tont G \circ H 425 | \] 426 | that is called \textit{left whiskering} of functor and natural 427 | transformation \cite{nlab:whiskering}. 428 | \end{definition} 429 | 430 | \begin{definition}[Right whiskering] 431 | \label{def:rw} 432 | If we have 3 categories $\cat{C}, \cat{D}, \cat{E}$, 433 | \mynameref{def:functor}s $F,G: \cat{C} \tof \cat{D}$, $H: \cat{D} \to 434 | \cat{E}$ and \mynameref{def:nt} 435 | $\alpha: F \tont G$ then we can construct a new natural 436 | transformations: 437 | \[ 438 | H \alpha : H \circ F \tont H \circ G 439 | \] 440 | that is called \textit{right whiskering} of functor and natural 441 | transformation \cite{nlab:whiskering}. 442 | \end{definition} 443 | 444 | \begin{definition}[Identity natural transformation] 445 | \label{def:idnt} 446 | If $F: \cat{C} \tof \cat{D}$ is a \mynameref{def:functor} then we can 447 | define \textit{identity natural transformation} 448 | $\idnt{F}$ that maps any \mynameref{def:object} 449 | $a \in \catob{C}$ into \mynameref{def:id} $\idm{F(a)} \in \cathom{D}$. 450 | \end{definition} 451 | 452 | \begin{remark}[Whiskering] 453 | \label{rem:whiskering} 454 | With \mynameref{def:idnt} we can redefine \mynameref{def:lw} and 455 | \mynameref{def:rw} via \mynameref{def:horizontal_composition} as follows. 456 | 457 | For left whiskering: 458 | \begin{equation} 459 | \label{eq:lw} 460 | \alpha H = \alpha \star \idnt{H} 461 | \end{equation} 462 | 463 | For right whiskering: 464 | \begin{equation} 465 | \label{eq:rw} 466 | H \alpha = \idnt{H} \star \alpha 467 | \end{equation} 468 | \end{remark} 469 | 470 | 471 | \section{Polymorphism and natural transformation} 472 | 473 | Polymorphism plays a certain role in programming languages. Category 474 | theory provides several facts about polymorphic functions which are 475 | very important. 476 | 477 | \begin{definition}[Parametrically polymorphic function] 478 | \index{Parametric polymorphism} 479 | \label{def:pp_function} 480 | Polymorphism is \textit{parametric} if all function instances behave uniformly 481 | i.e. have the same realization. The functions which satisfy the 482 | parametric polymorphism requirements are parametrically polymorphic. 483 | \end{definition} 484 | 485 | \begin{definition}[Ad-hoc polymorphism] 486 | \label{def:ad_hoc_polymorphism} 487 | Polymorphism is \textit{ad-hoc} if the function instances can behave 488 | differently dependently on the type they are being instantiated with. 489 | \end{definition} 490 | 491 | \begin{theorem}[Reynolds] 492 | \label{thm:reynolds} 493 | \mynameref{def:pp_function}s are \mynameref{def:nt}s 494 | \begin{proof} 495 | TBD 496 | \end{proof} 497 | \end{theorem} 498 | 499 | \subsection{$\cat{Hask}$ category} 500 | 501 | In Haskell most of functions are \mynameref{def:pp_function}s 502 | \footnote{really in the run-time the functions are not 503 | \mynameref{def:pp_function}s}. 504 | 505 | \begin{example}[Parametrically polymorphic function][$\cat{Hask}$] 506 | \label{ex:nt_hask} 507 | Consider the following function 508 | \begin{minted}{haskell} 509 | safeHead :: [a] -> Maybe a 510 | safeHead [] = Nothing 511 | safeHead (x:xs) = Just x 512 | \end{minted} 513 | The function is parametricaly polymorphic and by 514 | \mynameref{thm:reynolds} is \mynameref{def:nt} (see \cref{fig:nt_pp_hask}). 515 | 516 | \begin{figure} 517 | \centering 518 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 519 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 520 | sep=-2pt}] 521 | 522 | % the texts 523 | 524 | \node[ele,label=above:$a$] (a) at (0,2) {}; 525 | \node[ele,label=below:$b$] (b) at (0,0) {}; 526 | \node[ele,label=above:$\mbox{[a]}$] (af) at (5,2) {}; 527 | \node[ele,label=below:$\mbox{Maybe a}$] (ag) at (5,0) {}; 528 | \node[ele,label=above:$\mbox{[b]}$] (bf) at (7.5,2) {}; 529 | \node[ele,label=below:$\mbox{Maybe b}$] (bg) at (7.5,0) {}; 530 | 531 | \node[draw,fit= (a) (b),minimum width=2cm, minimum 532 | height=3.5cm] {} ; 533 | \node[draw,fit= (af) (ag) (bf) (bg),minimum width=6.5cm, minimum 534 | height=5.5cm] {} ; 535 | 536 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 537 | node[left]{$f$} (b); 538 | 539 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 540 | node[below]{$\mbox{fmap}_{[]}$} (bf); 541 | 542 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ag) to 543 | node[above]{$\mbox{fmap}_{Maybe}$} (bg); 544 | 545 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 546 | node[above]{$$} (af); 547 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 548 | [out=45,in=135,looseness=1] node[above]{$$} (bf); 549 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 550 | node[above]{$$} (ag); 551 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 552 | [out=-45,in=-135,looseness=1] node[above]{$$} (bg); 553 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (af) to 554 | node[left]{$\mbox{safeHead}_a$} (ag); 555 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bf) to 556 | node[right]{$\mbox{safeHead}_b$} (bg); 557 | \end{tikzpicture} 558 | \caption{Haskell parametric polymorphism as a natural transformation} 559 | \label{fig:nt_pp_hask} 560 | \end{figure} 561 | 562 | Therefore from the definition of the natural transformation 563 | \eqref{eq:nt_definition} we have 564 | \textbf{fmap f . safeHead = safeHead . fmap f}. I.e. it 565 | does not matter if we initially apply \textbf{fmap f} and 566 | then \textbf{safeHead} to the result or initially 567 | \textbf{safeHead} and then \textbf{fmap f}. 568 | 569 | The statement can be verified directly. For empty list we have 570 | \begin{minted}{haskell} 571 | fmap f . safeHead [] 572 | -- equivalent to 573 | fmap f Nothing 574 | -- equivalent to 575 | Nothing 576 | \end{minted} 577 | from other side 578 | \begin{minted}{haskell} 579 | safeHead . fmap f [] 580 | -- equivalent to 581 | safeHead [] 582 | -- equivalent to 583 | Nothing 584 | \end{minted} 585 | 586 | For a non empty list we have 587 | \begin{minted}{haskell} 588 | fmap f . safeHead (x:xs) 589 | -- equivalent to 590 | fmap f (Just x) 591 | -- equivalent to 592 | Just (f x) 593 | \end{minted} 594 | from other side 595 | \begin{minted}{haskell} 596 | safeHead . fmap f (x:xs) 597 | -- equivalent to 598 | safeHead (f x: fmap f xs ) 599 | -- equivalent to 600 | Just ( f x ) 601 | \end{minted} 602 | 603 | Using the fact that \textbf{fmap f} is an expensive 604 | operation if it is applied to the list we can conclude that the second 605 | approach is more productive. Such transformation allows compiler to 606 | optimize the code. 607 | \footnote{It is not directly applied to Haskell because it has lazy 608 | evaluation that can perform optimization before that one} 609 | \end{example} 610 | -------------------------------------------------------------------------------- /yoneda.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Yoneda's lemma} 3 | \label{sec:yoneda} 4 | Yoneda lemma is a fact about so called Hom functors. we shall start 5 | with the definition and examples for both 6 | \mynameref{def:cov_hom_functor} and \mynameref{def:con_hom_functor}. The 7 | definition and examples for Yoneda lemma will be provided after that. 8 | In the chapter we shall assume that the category $\cat{C}$ to be a 9 | \mynameref{def:localy_small_category}. 10 | 11 | \section{Hom functors} 12 | 13 | We are going to define the Hom functors. There are 2 hom functors: 14 | \mynameref{def:covariant_functor} and 15 | \mynameref{def:contravariant_functor}. For the 16 | \mynameref{def:cov_hom_functor} we pick up an object $a$ from 17 | $\cat{C}$ and consider the collection of morphisms from $a$ to an 18 | arbitrary object $x$ from the category. The collection is a 19 | \mynameref{def:set} as soon as $\cat{C}$ is a 20 | \mynameref{def:localy_small_category}. Therefore we can associate a 21 | set (object from \mynameref{def:setcategory}) with the object $x$ from the 22 | category $C$. 23 | 24 | The same approach is used for 25 | \mynameref{def:con_hom_functor}. But in the case we consider set of 26 | morphisms from an arbitrary object $x$ to the picked object $a$ i.e. 27 | we revert \mynameref{def:arrow}s in the case. 28 | 29 | \subsection{Covariant Hom functor} 30 | \begin{definition}[Covariant Hom functor] 31 | \label{def:cov_hom_functor} 32 | \index{Hom Functor!definition} 33 | Let $\cat{C}$ is a \mynameref{def:localy_small_category} and $a \in 34 | \catob{C}$. Consider \mynameref{def:functor} from $\cat{C}$ to the 35 | \mynameref{def:setcategory} defined by the following rules 36 | \begin{itemize} 37 | \item $\forall x \in \catob{C}$ define an object in the set category: 38 | $\catmset[C]{a}{x} \in \catob{Set}$ 39 | \item $\forall f: x \to y \in \cathom{C}$ define a function in the set category 40 | $\catmset[C]{a}{f}: \catmset[C]{a}{x} \to \catmset[C]{a}{y}$ as follows 41 | $\catmset[C]{a}{f} = \{f \circ g | g \in \catmset[C]{a}{x}\}$. 42 | \end{itemize} 43 | The \textit{covariant Hom functor} is denoted as $\catcovhom{C}{a}$. 44 | \end{definition} 45 | 46 | \begin{example}[Covariant Hom functor] 47 | \label{ex:cov_hom_functor} 48 | \begin{figure} 49 | \centering 50 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 51 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 52 | sep=-2pt}] 53 | 54 | % the texts 55 | \node at (-2,4) {$\cat{C}$}; 56 | 57 | \node[ele,label=right:$a$] (a) at (0,1.5) {}; 58 | \node[ele,label=below:$b$] (b) at (0,3) {}; 59 | \node[ele,label=above:$c$] (c) at (0,0) {}; 60 | \node[ele,label=left:$d$] (d) at (1.5,3) {}; 61 | 62 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 63 | [out=135,in=-135,looseness=20] node[left] {$\idm{a}$} 64 | (a); 65 | 66 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 67 | [out=135,in=45,looseness=20] node[above] {$\idm{b}$} 68 | (b); 69 | 70 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 71 | [out=-135,in=-45,looseness=20] node[below] {$\idm{c}$} 72 | (c); 73 | 74 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 75 | [out=45,in=-45,looseness=20] node[right] {$\idm{d}$} 76 | (d); 77 | 78 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 79 | [out=135,in=-135,looseness=0.5] node[left] {$f^{(b)}_1$} 80 | (b); 81 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 82 | [out=45,in=-45,looseness=0.5] node[right] {$f^{(b)}_2$} (b); 83 | 84 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 85 | [out=-135,in=135,looseness=0.5] node[left] {$f^{(c)}_1$} 86 | (c); 87 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 88 | [out=-45,in=45,looseness=0.5] node[right] {$f^{(c)}_2$} 89 | (c); 90 | 91 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 92 | [out=190,in=-190,looseness=2] node[left] {$f$} (c); 93 | 94 | 95 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 96 | [out=10,in=-10,looseness=3] node[right] {$g_1$} 97 | (c); 98 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 99 | [out=10,in=-10,looseness=5] node[right] {$g_2$} 100 | (c); 101 | 102 | 103 | \node[draw,fit= (a) (b) (c) (d),minimum width=6cm, minimum 104 | height=5.5cm] {} ; 105 | 106 | \end{tikzpicture} 107 | \caption{Covariant Hom functor $\catcovhom{C}{a}$ example. 108 | Category $\cat{C}$} 109 | \label{fig:cov_hom_functor} 110 | \end{figure} 111 | Consider category $\cat{C}$ in the \cref{fig:cov_hom_functor}. It 112 | consists of 4 objects: 113 | \[ 114 | \catob{C} = \{a,b,c,d\}. 115 | \] 116 | We are 117 | going to construct $\catcovhom{C}{a}$ functor and therefore are 118 | interested in the following sets of morphisms: 119 | \begin{eqnarray} 120 | \catmset[C]{a}{a} = \{\idm{a}\}, 121 | \nonumber \\ 122 | \catmset[C]{a}{b} = \{f_1^{(b)}, f_2^{(b)}\}, 123 | \nonumber \\ 124 | \catmset[C]{a}{c} = \{f_1^{(c)}, f_2^{(c)}, g_1 = f \circ f_1^{(b)}, 125 | g_2 = f \circ f_2^{(b)}\}, 126 | \nonumber \\ 127 | \catmset[C]{a}{d} = \emptyset. 128 | \nonumber 129 | \end{eqnarray} 130 | There is also a single \mynameref{def:morphism} $f$ between $b$ and $c$. 131 | 132 | \begin{figure} 133 | \centering 134 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 135 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 136 | sep=-2pt}] 137 | 138 | % the texts 139 | \node at (-2,4) {$\cat{Set}$}; 140 | 141 | \node[ele,label=right:$a'$] (a) at (0,1.5) {}; 142 | \node[ele,label=below:$b'$] (b) at (0,3) {}; 143 | \node[ele,label=above:$c'$] (c) at (0,0) {}; 144 | \node[ele,label=right:$\emptyset$] (d) at (1.5,1.5) {}; 145 | 146 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 147 | [out=135,in=-135,looseness=20] node[left] {$\idm{a'}$} 148 | (a); 149 | 150 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 151 | [out=135,in=45,looseness=20] node[above] {$\idm{b'}$} 152 | (b); 153 | 154 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 155 | [out=-135,in=-45,looseness=20] node[below] {$\idm{c'}$} 156 | (c); 157 | 158 | 159 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 160 | [out=190,in=-190,looseness=2] node[left] {$f'$} (c); 161 | 162 | 163 | \node[draw,fit= (a) (b) (c) (d),minimum width=6cm, minimum 164 | height=5.5cm] {} ; 165 | 166 | \end{tikzpicture} 167 | \caption{Covariant Hom functor $\catcovhom{C}{a}$ example. Category $\cat{Set}$} 168 | \label{fig:cov_hom_functor_set} 169 | \end{figure} 170 | 171 | The corresponding 172 | objects in the \mynameref{def:setcategory} is described in the 173 | \cref{fig:cov_hom_functor_set}: 174 | \begin{eqnarray} 175 | a' = \catmset[C]{a}{a} = \{\idm{a}\}, 176 | \nonumber \\ 177 | b' = \catmset[C]{a}{b} = \{f_1^{(b)}, f_2^{(b)}\}, 178 | \nonumber \\ 179 | c' = \catmset[C]{a}{c} = \{f_1^{(c)}, f_2^{(c)}, g_1, g_2\}, 180 | \nonumber \\ 181 | d' = \catmset[C]{a}{d} = \emptyset. 182 | \nonumber 183 | \end{eqnarray} 184 | 185 | The $\catcovhom{C}{a}$ does the following mapping between objects: 186 | \begin{eqnarray} 187 | a \tof \catmset[C]{a}{a} = a', 188 | \nonumber \\ 189 | b \tof \catmset[C]{a}{b} = b', 190 | \nonumber \\ 191 | c \tof \catmset[C]{a}{c} = c', 192 | \nonumber \\ 193 | d \tof \catmset[C]{a}{d} = \emptyset. 194 | \nonumber 195 | \end{eqnarray} 196 | The functor maps morphisms in addition to objects. There are mapping 197 | for trivial \mynameref{def:id}s: 198 | \begin{eqnarray} 199 | \idm{a} \tof \idm{a'}, 200 | \nonumber \\ 201 | \idm{b} \tof \idm{b'}, 202 | \nonumber \\ 203 | \idm{c} \tof \idm{c'}, 204 | \nonumber \\ 205 | \idm{d} \tof \idm{\emptyset}, 206 | \nonumber 207 | \end{eqnarray} 208 | and for a single non trivial morphism $f \tof f'$ that is defined by 209 | the following rules: 210 | \begin{eqnarray} 211 | f'(f_1^{(b)}) = g_1, 212 | \nonumber \\ 213 | f'(f_2^{(b)}) = g_2, 214 | \nonumber 215 | \end{eqnarray} 216 | i.e. the \mynameref{def:function_image} of $f'$ is a subset of 217 | $\catmset[C]{a}{c}$: 218 | \[ 219 | \Ima{f'} \subsetneq \catmset[C]{a}{c}. 220 | \] 221 | \end{example} 222 | 223 | \subsection{Contravariant Hom functor} 224 | If we revert \mynameref{def:arrow}s in the \cref{def:cov_hom_functor} then we can get 225 | a definition for \mynameref{def:contravariant_functor} as follows. 226 | \begin{definition}[Contravariant Hom functor] 227 | \label{def:con_hom_functor} 228 | Let $\cat{C}$ is a \mynameref{def:localy_small_category} and $a \in 229 | \catob{C}$. Consider \mynameref{def:functor} from $\cat{C}$ to the 230 | \mynameref{def:setcategory} defined by the following rules 231 | \begin{itemize} 232 | \item $\forall x \in \catob{C}$ define an object in the set category: 233 | $\catmset[C]{x}{a} \in \catob{Set}$ 234 | \item $\forall h: x \to y \in \cathom{C}$ define a function in the set category 235 | $\catmset[C]{h}{a}: \catmset[C]{y}{a} \to \catmset[C]{x}{a}$ as follows 236 | $\catmset[C]{h}{a} = \{g \circ h | g \in \catmset[C]{y}{a}\}$. 237 | \end{itemize} 238 | The \textit{contravariant Hom functor} is denoted as $\catconhom{C}{a}$. 239 | \end{definition} 240 | 241 | From the definition of \mynameref{def:contravariant_functor} follows 242 | that we can get it simply reverting \mynameref{def:arrow}s in the initial category. 243 | Lets do it for \cref{ex:cov_hom_functor} as follows 244 | \begin{example}[Contravariant Hom functor] 245 | \label{ex:con_hom_functor} 246 | \begin{figure} 247 | \centering 248 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 249 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 250 | sep=-2pt}] 251 | 252 | % the texts 253 | \node at (-2,4) {$\cat{D}$}; 254 | 255 | \node[ele,label=right:$a$] (a) at (0,1.5) {}; 256 | \node[ele,label=above:$b$] (b) at (0,0) {}; 257 | \node[ele,label=below:$c$] (c) at (0,3) {}; 258 | \node[ele,label=left:$d$] (d) at (1.5,0) {}; 259 | 260 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 261 | [out=135,in=-135,looseness=20] node[left] {$\idm{a}$} 262 | (a); 263 | 264 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 265 | [out=-135,in=-45,looseness=20] node[below] {$\idm{b}$} 266 | (b); 267 | 268 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 269 | [out=135,in=45,looseness=20] node[above] {$\idm{c}$} 270 | (c); 271 | 272 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 273 | [out=45,in=-45,looseness=20] node[right] {$\idm{d}$} 274 | (d); 275 | 276 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 277 | [out=135,in=-135,looseness=0.5] node[left] {$h^{(b)}_1$} 278 | (a); 279 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 280 | [out=45,in=-45,looseness=0.5] node[right] {$h^{(b)}_2$} (a); 281 | 282 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 283 | [out=-135,in=135,looseness=0.5] node[left] {$h^{(c)}_1$} 284 | (a); 285 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 286 | [out=-45,in=45,looseness=0.5] node[right] {$h^{(c)}_2$} 287 | (a); 288 | 289 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 290 | [out=190,in=-190,looseness=2] node[left] {$h$} (b); 291 | 292 | 293 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 294 | [out=10,in=-10,looseness=3] node[right] {$g_1$} 295 | (a); 296 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 297 | [out=10,in=-10,looseness=5] node[right] {$g_2$} 298 | (a); 299 | 300 | 301 | \node[draw,fit= (a) (b) (c) (d),minimum width=6cm, minimum 302 | height=5.5cm] {} ; 303 | 304 | \end{tikzpicture} 305 | \caption{Contravariant Hom functor $\catconhom{D}{a}$ example. Category $\cat{D}$} 306 | \label{fig:con_hom_functor} 307 | \end{figure} 308 | Consider category $\cat{D}$ in the \cref{fig:con_hom_functor}. It is 309 | similar to the category $\cat{C}$ from \cref{ex:cov_hom_functor} and 310 | has the same set of objects and morphisms but all morphisms are 311 | reverted i.e. $D = \cat{C}^{op}$. Therefore the category consists of 4 objects: 312 | \[ 313 | \catob{D} = \{a,b,c,d\}. 314 | \] 315 | We are 316 | going to construct $\catconhom{D}{a}$ functor and therefore are 317 | interested in the following sets of morphisms: 318 | \begin{eqnarray} 319 | \catmset[D]{a}{a} = \{\idm{a}\}, 320 | \nonumber \\ 321 | \catmset[D]{b}{a} = \{h_1^{(b)}, h_2^{(b)}\}, 322 | \nonumber \\ 323 | \catmset[D]{c}{a} = \{h_1^{(c)}, h_2^{(c)}, g_1 = h_1^{(b)} \circ h, 324 | g_2 = h_2^{(b)} \circ h\}, 325 | \nonumber \\ 326 | \catmset[D]{d}{a} = \emptyset. 327 | \nonumber 328 | \end{eqnarray} 329 | There is also a single \mynameref{def:morphism} $h$ between $c$ and $b$. 330 | 331 | \begin{figure} 332 | \centering 333 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 334 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 335 | sep=-2pt}] 336 | 337 | % the texts 338 | \node at (-2,4) {$\cat{Set}$}; 339 | 340 | \node[ele,label=right:$a'$] (a) at (0,1.5) {}; 341 | \node[ele,label=below:$b'$] (b) at (0,3) {}; 342 | \node[ele,label=above:$c'$] (c) at (0,0) {}; 343 | \node[ele,label=right:$\emptyset$] (d) at (1.5,1.5) {}; 344 | 345 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 346 | [out=135,in=-135,looseness=20] node[left] {$\idm{a'}$} 347 | (a); 348 | 349 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 350 | [out=135,in=45,looseness=20] node[above] {$\idm{b'}$} 351 | (b); 352 | 353 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 354 | [out=-135,in=-45,looseness=20] node[below] {$\idm{c'}$} 355 | (c); 356 | 357 | 358 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (b) to 359 | [out=190,in=-190,looseness=2] node[left] {$h'$} (c); 360 | 361 | 362 | \node[draw,fit= (a) (b) (c) (d),minimum width=6cm, minimum 363 | height=5.5cm] {} ; 364 | 365 | \end{tikzpicture} 366 | \caption{Contravariant Hom functor $\catconhom{D}{a}$ example. Category $\cat{Set}$} 367 | \label{fig:con_hom_functor_set} 368 | \end{figure} 369 | 370 | The corresponding 371 | objects in the \mynameref{def:setcategory} is described in the 372 | \cref{fig:con_hom_functor_set}: 373 | \begin{eqnarray} 374 | a' = \catmset[D]{a}{a} = \{\idm{a}\}, 375 | \nonumber \\ 376 | b' = \catmset[D]{b}{a} = \{f_1^{(b)}, f_2^{(b)}\}, 377 | \nonumber \\ 378 | c' = \catmset[D]{c}{a} = \{f_1^{(c)}, f_2^{(c)}, g_1, g_2\}, 379 | \nonumber \\ 380 | d' = \catmset[D]{d}{a} = \emptyset. 381 | \nonumber 382 | \end{eqnarray} 383 | 384 | The $\catconhom{D}{a}$ does the following mapping between objects: 385 | \begin{eqnarray} 386 | a \tof \catmset[D]{a}{a} = a', 387 | \nonumber \\ 388 | b \tof \catmset[D]{b}{a} = b', 389 | \nonumber \\ 390 | c \tof \catmset[D]{c}{a} = c', 391 | \nonumber \\ 392 | d \tof \catmset[D]{d}{a} = \emptyset. 393 | \nonumber 394 | \end{eqnarray} 395 | The functor maps morphisms in addition to objects. There are mapping 396 | for trivial \mynameref{def:id}s: 397 | \begin{eqnarray} 398 | \idm{a} \tof \idm{a'}, 399 | \nonumber \\ 400 | \idm{b} \tof \idm{b'}, 401 | \nonumber \\ 402 | \idm{c} \tof \idm{c'}, 403 | \nonumber \\ 404 | \idm{d} \tof \idm{\emptyset}, 405 | \nonumber 406 | \end{eqnarray} 407 | and for a single non trivial morphism $h \tof h'$ that is defined by 408 | the following rules: 409 | \begin{eqnarray} 410 | h'(h_1^{(b)}) = g_1, 411 | \nonumber \\ 412 | h'(h_2^{(b)}) = g_2, 413 | \nonumber 414 | \end{eqnarray} 415 | i.e. the \mynameref{def:function_image} of $h'$ is a subset of 416 | $\catmset[D]{c}{a}$: 417 | \[ 418 | \Ima{h'} \subsetneq \catmset[D]{c}{a}. 419 | \] 420 | \end{example} 421 | 422 | \subsection{Representable functor} 423 | \begin{definition}[Representable functor] 424 | \label{def:representable_functor} 425 | Let $\cat{C}$ is a \mynameref{def:localy_small_category}. 426 | The functor $F: \cat{C} \tof \cat{Set}$ is called 427 | \textit{representable} if it is naturally isomorphic (see 428 | \mynameref{def:ni}) to $\catcovhom{C}{a}$ for some object $a \in 429 | \catob{C}$. 430 | 431 | \textit{Representation} of $F$ is a pair $(a, \alpha)$ where 432 | \[ 433 | \alpha: \catcovhom{C}{a} \tont F 434 | \] 435 | is a \mynameref{def:ni}. 436 | \end{definition} 437 | 438 | \begin{example}[Representable functor][$\cat{Hask}$] 439 | \label{ex:representable_functor_hask} 440 | Consider a \mynameref{def:representable_functor} $F$. we shall mark it as a small 441 | letter \textbf{f} in the example. 442 | \footnote{There is a requirement from Haskell to use small but not 443 | capital letter for it.} 444 | \mynameref{def:representable_functor} is defined by a pair: $(a, 445 | \alpha)$ where $a$ is the object from $\cat{C}$ and $\alpha$ is a 446 | \mynameref{def:ni}. 447 | The first condition for $a$ can be written as follows in 448 | \mynameref{def:haskcategory} 449 | \begin{minted}{haskell} 450 | type Rep f :: * 451 | \end{minted} 452 | where \textbf{Rep f} is the type $a$ that represent our functor $f$. 453 | 454 | The second condition for \mynameref{def:ni} requires 2 455 | \mynameref{def:nt}s: 456 | \begin{eqnarray} 457 | \mathrm{tabulate} : \catcovhom{C}{a} \tont F, 458 | \nonumber \\ 459 | \mathrm{index} : F \tont \catcovhom{C}{a}. 460 | \nonumber 461 | \end{eqnarray} 462 | In Haskell the 2 functions can be written as follows 463 | \begin{minted}{haskell} 464 | tabulate :: (Rep f -> x) -> f x 465 | index :: f x -> Rep f -> x 466 | \end{minted} 467 | From 468 | \mynameref{thm:reynolds} we know that such functions are 469 | \mynameref{def:nt}s and therefore can be 2 parts of the required 470 | \mynameref{def:ni} $\alpha$. Combining these conditions together we 471 | can obtain the following definition for \mynameref{def:representable_functor} in 472 | \mynameref{def:haskcategory} 473 | \begin{minted}{haskell} 474 | class Representable f where 475 | type Rep f :: * 476 | tabulate :: (Rep f -> x) -> f x 477 | index :: f x -> Rep f -> x 478 | \end{minted} 479 | 480 | Consider the following type as a concrete example of the 481 | \mynameref{def:representable_functor} 482 | \begin{minted}{haskell} 483 | data Pair a = P a a 484 | \end{minted} 485 | The representation type for \textbf{Pair} is \textbf{Bool} 486 | \begin{minted}{haskell} 487 | instance Representable Pair where 488 | type Rep Pair = Bool 489 | 490 | index :: Pair a -> (Bool -> a) 491 | index (P x _) False = x 492 | index (P _ y) True = y 493 | 494 | tabulate :: (Bool -> a) -> Pair a 495 | tabulate generate = P (generate False) (generate True) 496 | \end{minted} 497 | 498 | \end{example} 499 | 500 | \begin{remark}[Functor logarithm] 501 | \index{Functor!logarithm} 502 | Consider category $\cat{C}$. \mynameref{def:morphism_set} 503 | $\catmset[C]{a}{x}$ is the same as the \mynameref{def:exponential} 504 | \footnote{TBD add the explanation for the fact}, i.e. 505 | \[ 506 | \catmset[C]{a}{x} \cong x^a. 507 | \] 508 | Therefore, formally, we can write 509 | \[ 510 | \catcovhom{C}{a} \cong \left(-\right)^a. 511 | \] 512 | If functor $F$ is a \mynameref{def:representable_functor} then 513 | \[ 514 | F \cong \catcovhom{C}{a} \cong \left(-\right)^a. 515 | \] 516 | Thus we can define the logarithm operation for a 517 | \mynameref{def:representable_functor} as follows 518 | \[ 519 | \log F = a. 520 | \] 521 | \end{remark} 522 | 523 | \section{Yoneda's lemma} 524 | 525 | \begin{lemma}[Yoneda] 526 | \label{lem:yoneda} 527 | Let $\cat{C}$ is a \mynameref{def:localy_small_category} and $F$ is a 528 | functor from $\cat{C}$ to $\cat{Set}$ 529 | i.e. 530 | \[ 531 | F \in \catob{\funcat{C}{Set}} 532 | \] 533 | and also we have 534 | \[ 535 | \catcovhom{C}{a} \in \catob{\funcat{C}{Set}}. 536 | \] 537 | Then 538 | \[ 539 | \catmset[\funcat{C}{Set}]{\catcovhom{C}{a}}{F} \cong F(a) 540 | \] 541 | \begin{proof} 542 | \begin{figure} 543 | \centering 544 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 545 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 546 | sep=-2pt}] 547 | 548 | \node at (-2,2.5) {$\cat{C}$}; 549 | 550 | % the texts 551 | \node[ele,label=above:$x$] (x) at (0,2) {}; 552 | \node[ele,label=below:$y$] (y) at (0,0) {}; 553 | 554 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (x) to 555 | node[left]{$f$} (y); 556 | 557 | \node[draw,fit= (x) (y),minimum width=4cm, minimum 558 | height=4cm] {} ; 559 | \end{tikzpicture} 560 | \caption{Category $\cat{C}$. We look at 2 objects $x$ and $y$ and a 561 | morphism $f$ between them} 562 | \label{fig:yoneda_proof_c} 563 | \end{figure} 564 | 565 | Lets start with 2 objects $x, y$ from category $\cat{C}$ and a 566 | morphism $f$ between the 2 objects \cref{fig:yoneda_proof_c}. 567 | 568 | \begin{figure} 569 | \centering 570 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 571 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 572 | sep=-2pt}] 573 | 574 | % the texts 575 | \node[ele,label=above:$\catmsetfig{C}{a}{x}$] (cx) at (0,3) {}; 576 | \node[ele,label=below:$F(x)$] (fx) at (0,0) {}; 577 | \node[ele,label=above:$\catmsetfig{C}{a}{y}$] (cy) at (3,3) {}; 578 | \node[ele,label=below:$F(y)$] (fy) at (3,0) {}; 579 | 580 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (cx) to 581 | node[below]{$\catmset[C]{a}{f}$} (cy); 582 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (fx) to 583 | node[above]{$F(f)$} (fy); 584 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (cx) to 585 | node[left]{$\alpha_x$} (fx); 586 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (cy) to 587 | node[right]{$\alpha_y$} (fy); 588 | \end{tikzpicture} 589 | \caption{Commutative diagram for components of natural 590 | transformation $\alpha_x$ and $\alpha_y$} 591 | \label{fig:yoneda_proof_commutative_diagram} 592 | \end{figure} 593 | 594 | Functor 595 | $\catcovhom{C}{a}$ maps $x$ into $\catmset[C]{a}{x}$ and $y$ into 596 | $\catmset[C]{a}{x}$. Functor $F$ maps the 2 objects into $F(x)$ and 597 | $F(y)$ respectively. There is a \mynameref{def:nt} $\alpha$ between 598 | the functors. I.e. $\alpha \in 599 | \catmset[\funcat{C}{Set}]{\catcovhom{C}{a}}{F}$. We are interested in 600 | 2 components of the natural transformations: 601 | \[ 602 | \alpha_x : \catmset[C]{a}{x} \to F(x) 603 | \] 604 | and 605 | \[ 606 | \alpha_y : \catmset[C]{a}{y} \to F(y). 607 | \] 608 | The components of natural transformation should satisfy the naturality 609 | conditions \eqref{eq:nt_definition} i.e. the commutative diagram 610 | \cref{fig:yoneda_proof_commutative_diagram} should commute. 611 | 612 | We can replace object $x$ with $a$ in $\catmset[C]{a}{x}$. The result 613 | set $\catmset[C]{a}{a}$ should contain \mynameref{def:id} $\idm{a}$. 614 | Lets look how the morphism is mapped by the commutative diagram from 615 | \cref{fig:yoneda_proof_commutative_diagram}. 616 | 617 | \begin{figure} 618 | \centering 619 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 620 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 621 | sep=-2pt}] 622 | 623 | % the texts 624 | \node[ele,label=above:$\idm{a}$] (cx) at (0,3) {}; 625 | \node[ele,label=below:$p$] (fx) at (0,0) {}; 626 | \node[ele,label=above:$f$] (cy) at (3,3) {}; 627 | \node[ele,label=below:$(F(f))(p)$] (fy) at (3,0) {}; 628 | 629 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (cx) to 630 | node[below]{$\catmset[C]{a}{f}$} (cy); 631 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (fx) to 632 | node[above]{$F(f)$} (fy); 633 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (cx) to 634 | node[left]{$\alpha_a$} (fx); 635 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (cy) to 636 | node[right]{$\alpha_y$} (fy); 637 | \end{tikzpicture} 638 | \caption{Mapping for $\idm{a}$. The identity morphism is mapped into 639 | $p \in F(a)$ i.e. $p = \alpha_a(\idm{a})$} 640 | \label{fig:yoneda_proof_idm} 641 | \end{figure} 642 | 643 | As we can see in \cref{fig:yoneda_proof_idm}, morphism $\alpha_a$ 644 | pick up an element $p$ of the set $F(a)$. There is an arbitrary 645 | element that is determined by $\alpha_a$. All others elements in 646 | \cref{fig:yoneda_proof_idm} is completely determined by the choice of 647 | $p$. From \cref{def:cov_hom_functor} we have 648 | \[ 649 | \catmset[C]{a}{f} = \{f \circ g | g \in \catmset[C]{a}{x}\} 650 | \] 651 | i.e. if $g = \idm{a}$ then 652 | \[ 653 | \catmset[C]{a}{f}\left(\idm{a}\right) = f 654 | \circ \idm{a} = f. 655 | \] 656 | From other side we have mapping $F(f): p \to q$ where 657 | $q = (F(f))(p)$. I.e. if we pick an arbitrary object $y \in \catob{C}$ 658 | when we can pick a morphism $f: a \to y$. This leads to the definition 659 | for an arbitrary component $\alpha_y$ of \mynameref{def:nt} $\alpha$ 660 | as soon as only one component $\alpha_a$ is defined: 661 | \[ 662 | \alpha_y(f) = (F(f))(p). 663 | \] 664 | Therefore from only one element $p \in F(a)$ we can got the 665 | \mynameref{def:nt} $\alpha \in 666 | \catmset[\funcat{C}{Set}]{\catcovhom{C}{a}}{F}$. We also can go in 667 | other direction i.e. $\alpha_a(\idm{a})$ will gives as an element $p$ 668 | from the set $F(a)$. 669 | \end{proof} 670 | \end{lemma} 671 | 672 | -------------------------------------------------------------------------------- /limits.tex: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | \chapter{Limits} 3 | 4 | \section{Definitions} 5 | 6 | \begin{definition}[Diagram of shape] 7 | \label{def:diagram_of_shape} 8 | \begin{figure}[H] 9 | \centering 10 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 11 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 12 | sep=-2pt}] 13 | 14 | % the texts 15 | 16 | \node at (0,0) {$I$}; 17 | \node at (0,3) {$C$}; 18 | 19 | \node[ele,label=below:$a_i^{(I)}$] (ac) at (1,0) {}; 20 | \node[ele,label=below:$a_j^{(I)}$] (bc) at (3,0) {}; 21 | \node[ele,label=above:$a_i^{(C)}$] (ad) at (1,3) {}; 22 | \node[ele,label=above:$a_j^{(C)}$] (bd) at (3,3) {}; 23 | 24 | \node[draw,fit= (ac) (bc),minimum width=3.5cm, minimum 25 | height=2cm] {} ; 26 | \node[draw,fit= (ad) (bd),minimum width=3.5cm, minimum 27 | height=2cm] {} ; 28 | 29 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 30 | node[below]{$g_{ij}^{(I)}$} (bc); 31 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 32 | node[above]{$g_{ij}^{(C)}$} (bd); 33 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 34 | node[left]{$g_i^{(C)} = F(a_i^{(I)})$} (ad); 35 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 36 | node[right]{$g_j^{(C)} = F(a_j^{(I)})$} (bd); 37 | \end{tikzpicture} 38 | \caption{Diagram of shape $F: \cat{I} \tof \cat{C}$. Objects 39 | $a_{i,j}^{(I)} \in \catob{I}$ are mapped to $a_{i,j}^{(C)} \in 40 | \catob{C}$. Morphisms $g_{ij}^{(I)} \in \cathom{I}$ are mapped to 41 | $g_{ij}^{(C)} \in \cathom{C}$} 42 | \label{fig:diagram_of_shape} 43 | \end{figure} 44 | 45 | Let $\cat{I}$ and $\cat{C}$ are 2 categories. The \textit{diagram of 46 | shape} $\cat{I}$ in $\cat{C}$ is a \mynameref{def:functor} 47 | (see \cref{fig:diagram_of_shape}) 48 | \[ 49 | F: \cat{I} \tof \cat{C} 50 | \] 51 | \end{definition} 52 | 53 | \begin{definition}[Index category] 54 | \label{def:indexcategory} 55 | Category $\cat{I}$ in the \cref{def:diagram_of_shape} is called 56 | \textit{Index category}. 57 | \end{definition} 58 | 59 | \subsection{Limit} 60 | 61 | \begin{definition}[Cone] 62 | \label{def:cone} 63 | \begin{figure}[H] 64 | \centering 65 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 66 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 67 | sep=-2pt}] 68 | 69 | % the texts 70 | 71 | \node at (0,0) {$I$}; 72 | \node at (0,3) {$C$}; 73 | 74 | \node[ele,label=left:$a_i^{(I)}$] (ac) at (1.5,0) {}; 75 | \node[ele,label=right:$a_j^{(I)}$] (bc) at (3.5,0) {}; 76 | \node[ele,label=left:$a_i^{(C)}$] (ad) at (1.5,3) {}; 77 | \node[ele,label=right:$a_j^{(C)}$] (bd) at (3.5,3) {}; 78 | \node[ele,label=above:$c$] (d) at (2.5,5) {}; 79 | 80 | \node[draw,fit= (ac) (bc),minimum width=4cm, minimum 81 | height=2cm] {} ; 82 | \node[draw,fit= (ad) (bd) (d),minimum width=5cm, minimum 83 | height=4cm] {} ; 84 | 85 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 86 | node[left]{$f^{(c)}_i$} (ad); 87 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 88 | node[right]{$f^{(c)}_j$} (bd); 89 | 90 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 91 | node[below]{$g_{ij}^{(I)}$} (bc); 92 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 93 | node[above]{$g_{ij}^{(C)}$} (bd); 94 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 95 | node[left]{$a_i^{(C)} = F(a_i^{(I)})$} (ad); 96 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 97 | node[right]{$a_j^{(C)} = F(a_j^{(I)})$} (bd); 98 | \end{tikzpicture} 99 | \caption{Cone $\catcone{c}{f}$} 100 | \label{fig:cone} 101 | \end{figure} 102 | Let $F$ is a \mynameref{def:diagram_of_shape} $\cat{I}$ in $\cat{C}$. 103 | A \textit{cone} to $F$ is an object $c \in \catob{C}$ with 104 | \mynameref{def:morphism}s $f^{c} = \left\{f_i^{c}: c \to 105 | a_i^{(C)}\right\}$, where $a_i^{(C)} = F(a_i^{(I)})$ 106 | indexed by objects from 107 | $\cat{I}$ (see \cref{fig:cone}). The cone is denoted as $\catcone{c}{f}$. 108 | \end{definition} 109 | 110 | \begin{definition}[Limit] 111 | \label{def:limit} 112 | \begin{figure}[H] 113 | \centering 114 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 115 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 116 | sep=-2pt}] 117 | 118 | % the texts 119 | 120 | \node at (0,0) {$I$}; 121 | \node at (0,7) {$C$}; 122 | 123 | \node[ele,label=left:$a_i^{(I)}$] (ac) at (1.5,0) {}; 124 | \node[ele,label=right:$a_j^{(I)}$] (bc) at (5.5,0) {}; 125 | \node[ele,label=left:$a_i^{(C)}$] (ad) at (1.5,3) {}; 126 | \node[ele,label=right:$a_j^{(C)}$] (bd) at (5.5,3) {}; 127 | \node[ele,label=above:$c$] (d) at (3.5,7) {}; 128 | \node[ele,label=below:$l$] (l) at (3.5,5) {}; 129 | 130 | \node[draw,fit= (ac) (bc),minimum width=6cm, minimum 131 | height=2.5cm] {} ; 132 | \node[draw,fit= (ad) (bd) (d) (l),minimum width=5cm, minimum 133 | height=5cm] {} ; 134 | 135 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 136 | node[right]{$u$} (l); 137 | 138 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 139 | node[left]{$f^{(c)}_i$} (ad); 140 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 141 | node[right]{$f^{(c)}_j$} (bd); 142 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 143 | node[right]{$f^{(l)}_i$} (ad); 144 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 145 | node[left]{$f^{(l)}_j$} (bd); 146 | 147 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 148 | node[below]{$g_{ij}^{(I)}$} (bc); 149 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 150 | node[below]{$g_{ij}^{(C)}$} (bd); 151 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 152 | node[left]{$a_i^{(C)} = F(a_i^{(I)})$} (ad); 153 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 154 | node[right]{$a_j^{(C)} = F(a_j^{(I)})$} (bd); 155 | \end{tikzpicture} 156 | \caption{Limit $\catcone{l}{f}$} 157 | \label{fig:limit} 158 | \end{figure} 159 | \textit{Limit} of \mynameref{def:diagram_of_shape} $F: \cat{I} \tof 160 | \cat{C}$ is a \mynameref{def:cone} $\catcone{l}{f}$ to $F$ such that for 161 | any other $\catcone{c}{f}$ to $F$ exists an unique morphism $u : c \to l$ 162 | such that $\forall a_i^{(I)} \in \catob{I}$ $f_i^{(l)} \circ u = 163 | f_i^{(c)}$ i.e. diagram shown on \cref{fig:limit} commutes. 164 | \end{definition} 165 | 166 | If we have 2 objects from $\cat{C}$ ($c_1, c_2 \in \catob{C}$) then we can have a lot of 167 | morphisms between the objects which form a set: 168 | $\catmset[C]{c_1}{c_2}$. There is a subset of $\catmset[C]{c_1}{c_2}$ 169 | that can be 170 | called as cone's morphisms. 171 | \begin{definition}[Morphisms of cones] 172 | \begin{figure} 173 | \centering 174 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 175 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 176 | sep=-2pt}] 177 | 178 | % the texts 179 | 180 | \node at (0,0) {$I$}; 181 | \node at (0,7) {$C$}; 182 | 183 | \node[ele,label=left:$a_i^{(I)}$] (ac) at (1.5,0) {}; 184 | \node[ele,label=right:$a_j^{(I)}$] (bc) at (5.5,0) {}; 185 | \node[ele,label=left:$a_i^{(C)}$] (ad) at (1.5,3) {}; 186 | \node[ele,label=right:$a_j^{(C)}$] (bd) at (5.5,3) {}; 187 | \node[ele,label=above:$c_1$] (d) at (3.5,7) {}; 188 | \node[ele,label=below:$c_2$] (l) at (3.5,5) {}; 189 | 190 | \node[draw,fit= (ac) (bc),minimum width=6cm, minimum 191 | height=2.5cm] {} ; 192 | \node[draw,fit= (ad) (bd) (d) (l),minimum width=5cm, minimum 193 | height=5cm] {} ; 194 | 195 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 196 | node[right]{$m$} (l); 197 | 198 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 199 | node[left]{$f^{(c_1)}_i$} (ad); 200 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 201 | node[right]{$f^{(c_1)}_j$} (bd); 202 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 203 | node[right]{$f^{(c_2)}_i$} (ad); 204 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 205 | node[left]{$f^{(c_2)}_j$} (bd); 206 | 207 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 208 | node[below]{$g_{ij}^{(I)}$} (bc); 209 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 210 | node[below]{$g_{ij}^{(C)}$} (bd); 211 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 212 | node[left]{$a_i^{(C)} = F(a_i^{(I)})$} (ad); 213 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 214 | node[right]{$a_j^{(C)} = F(a_j^{(I)})$} (bd); 215 | \end{tikzpicture} 216 | \caption{Morphism $m$ between 2 cones $\catcone{c_1}{f}$ and $\catcone{c_2}{f}$} 217 | \label{fig:conesmorphism} 218 | \end{figure} 219 | Let $c_1, c_2 \in \catob{C}$ are 2 objects from category $\cat{C}$ and 220 | $\catcone{c_1}{f}, \catcone{c_2}{f}$ are 2 \mynameref{def:cone}s. 221 | The morphism $m \in \catmset[C]{c_1}{c_2}$ is called as morphism of 222 | cones if $\forall i$ 223 | \[ 224 | f_i^{(c_1)} = f_i^{(c_2)} \circ m, 225 | \] 226 | i.e. the morphisms in \cref{fig:conesmorphism} commute. 227 | \end{definition} 228 | 229 | \begin{definition}[Category of cones to $F$] 230 | \label{def:category_of_cones} 231 | Let $F$ is a \mynameref{def:diagram_of_shape} $\cat{I}$ in $\cat{C}$. 232 | 233 | TBD 234 | 235 | The category of \mynameref{def:cone}s is denoted as $\Delta \downarrow 236 | F$ \cite{wiki:cone} 237 | \end{definition} 238 | 239 | \begin{remark}[Category of cones to $F$] 240 | \label{rem:category_of_cones} 241 | Let $F$ is a \mynameref{def:diagram_of_shape} $\cat{I}$ in $\cat{C}$ 242 | and $\Delta \downarrow F$ is the \mynameref{def:category_of_cones}. 243 | Then \mynameref{def:limit} is \mynameref{def:terminal_object} in the 244 | category. 245 | \end{remark} 246 | 247 | \subsection{Colimit} 248 | 249 | \begin{definition}[Cocone] 250 | \label{def:cocone} 251 | \begin{figure}[H] 252 | \centering 253 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 254 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 255 | sep=-2pt}] 256 | 257 | % the texts 258 | 259 | \node at (0,0) {$I$}; 260 | \node at (0,3) {$C$}; 261 | 262 | \node[ele,label=left:$a_i^{(I)}$] (ac) at (1.5,0) {}; 263 | \node[ele,label=right:$a_j^{(I)}$] (bc) at (3.5,0) {}; 264 | \node[ele,label=left:$a_i^{(C)}$] (ad) at (1.5,3) {}; 265 | \node[ele,label=right:$a_j^{(C)}$] (bd) at (3.5,3) {}; 266 | \node[ele,label=above:$c$] (d) at (2.5,5) {}; 267 | 268 | \node[draw,fit= (ac) (bc),minimum width=4cm, minimum 269 | height=2cm] {} ; 270 | \node[draw,fit= (ad) (bd) (d),minimum width=5cm, minimum 271 | height=4cm] {} ; 272 | 273 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 274 | node[left]{$f^{(c)}_i$} (d); 275 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bd) to 276 | node[right]{$f^{(c)}_j$} (d); 277 | 278 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 279 | node[below]{$g_{ij}^{(I)}$} (bc); 280 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 281 | node[above]{$g_{ij}^{(C)}$} (bd); 282 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 283 | node[left]{$a_i^{(C)} = F(a_i^{(I)})$} (ad); 284 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 285 | node[right]{$a_j^{(C)} = F(a_j^{(I)})$} (bd); 286 | \end{tikzpicture} 287 | \caption{Co-cone $\catcocone{c}{f}$} 288 | \label{fig:cocone} 289 | \end{figure} 290 | Let $F$ is a \mynameref{def:diagram_of_shape} $\cat{I}$ in $\cat{C}$. 291 | A \textit{co-cone} to $F$ is an object $d \in \catob{C}$ with 292 | \mynameref{def:morphism}s $f^{c} = \left\{f_i^{c}: 293 | a_i^{(C)} \to c \right\}$, where $a_i^{(C)} = F(a_i^{(I)})$ 294 | indexed by objects from 295 | $\cat{I}$ (see \cref{fig:cocone}). The co-cone is denoted as 296 | $\catcocone{c}{f}$. 297 | \end{definition} 298 | 299 | \begin{definition}[Colimit] 300 | \label{def:colimit} 301 | \begin{figure}[H] 302 | \centering 303 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 304 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 305 | sep=-2pt}] 306 | 307 | % the texts 308 | 309 | \node at (0,0) {$I$}; 310 | \node at (0,7) {$C$}; 311 | 312 | \node[ele,label=left:$a_i^{(I)}$] (ac) at (1.5,0) {}; 313 | \node[ele,label=right:$a_j^{(I)}$] (bc) at (5.5,0) {}; 314 | \node[ele,label=left:$a_i^{(C)}$] (ad) at (1.5,3) {}; 315 | \node[ele,label=right:$a_j^{(C)}$] (bd) at (5.5,3) {}; 316 | \node[ele,label=above:$c$] (d) at (3.5,7) {}; 317 | \node[ele,label=below:$l$] (l) at (3.5,5) {}; 318 | 319 | \node[draw,fit= (ac) (bc),minimum width=6cm, minimum 320 | height=2.5cm] {} ; 321 | \node[draw,fit= (ad) (bd) (d) (l),minimum width=5cm, minimum 322 | height=5cm] {} ; 323 | 324 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 325 | node[right]{$u$} (d); 326 | 327 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 328 | node[left]{$f^{(c)}_i$} (d); 329 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bd) to 330 | node[right]{$f^{(c)}_j$} (d); 331 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 332 | node[right]{$f^{(l)}_i$} (l); 333 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bd) to 334 | node[left]{$f^{(l)}_j$} (l); 335 | 336 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 337 | node[below]{$g_{ij}^{(I)}$} (bc); 338 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 339 | node[below]{$g_{ij}^{(C)}$} (bd); 340 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 341 | node[left]{$a_i^{(C)} = F(a_i^{(I)})$} (ad); 342 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 343 | node[right]{$a_j^{(C)} = F(a_j^{(I)})$} (bd); 344 | \end{tikzpicture} 345 | \caption{Co-Limit $\catcocone{l}{f}$} 346 | \label{fig:colimit} 347 | \end{figure} 348 | \textit{Co-Limit} of \mynameref{def:diagram_of_shape} $F: \cat{I} \tof 349 | \cat{C}$ is a \mynameref{def:cocone} $\catcocone{l}{f}$ to $F$ such that for 350 | any other $\catcocone{c}{f}$ to $F$ exists an unique morphism $u : l \to c$ 351 | such that $\forall a_i^{(I)} \in \catob{I}$ $u \circ f_i^{(c)} = 352 | f_i^{(l)}$ i.e. diagram shown on \cref{fig:colimit} commutes. 353 | \end{definition} 354 | 355 | \begin{definition}[Category of co-cones from $F$] 356 | \label{def:category_of_cocones} 357 | Let $F$ is a \mynameref{def:diagram_of_shape} $\cat{I}$ in $\cat{C}$. 358 | 359 | TBD 360 | 361 | The category of \mynameref{def:cocone}s is denoted as $F \downarrow 362 | \Delta$ \cite{wiki:cone} 363 | \end{definition} 364 | 365 | 366 | \begin{remark}[Category of co-cones] 367 | \label{rem:category_of_cocones} 368 | Let $F$ is a \mynameref{def:diagram_of_shape} $\cat{I}$ in $\cat{C}$ 369 | and $F \downarrow \Delta$ is the \mynameref{def:category_of_cocones}. 370 | Then \mynameref{def:colimit} is \mynameref{def:initial_object} in the 371 | category. 372 | \end{remark} 373 | 374 | \section{Cone as natural transformation} 375 | The \mynameref{def:cone} can be considered as a \mynameref{def:nt}. 376 | There are 2 functors between categories $\cat{I}$ and 377 | $\cat{C}$. The first one is the \mynameref{def:diagram_of_shape} $F: 378 | \cat{I} \tof \cat{C}$. The second one is the 379 | \mynameref{def:const_functor}: 380 | $\Delta_c: \cat{I} \tof \cat{C}$. The 381 | \mynameref{def:nt} $\Delta_c 382 | \tont F$, by the definition, is the set of \mynameref{def:morphism}s from $\cat{C}$ with 383 | additional relations that are same as conditions defined for 384 | the \mynameref{def:cone} $\catcone{c}{f}$. Therefore we can consider 385 | the \mynameref{def:cone} as a \mynameref{def:nt}. 386 | 387 | \section{Categorical constructions as limits} 388 | 389 | Different choice for category $\cat{I}$ gives different types of 390 | limits. There are several examples of such constructions below 391 | 392 | The empty category will give us the terminal object. The 393 | \mynameref{def:discrete_category} with 2 elements produces 394 | \mynameref{def:product} as the \mynameref{def:limit}. 395 | 396 | \subsection{Initial and terminal objects} 397 | 398 | If we choose \mynameref{def:empty_category} as the 399 | \mynameref{def:indexcategory} 400 | (see \cref{fig:initial_terminal_object_index_category}) 401 | then we can get 402 | \mynameref{def:terminal_object} as \mynameref{def:limit} and 403 | \mynameref{def:initial_object} as \mynameref{def:colimit}. 404 | 405 | \begin{figure}[H] 406 | \centering 407 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 408 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 409 | sep=-2pt}] 410 | 411 | % the texts 412 | 413 | \node at (0,0) {$I$}; 414 | \node [draw, thick, circle, minimum width=2.5cm] at (1.8,0) {}; 415 | 416 | \end{tikzpicture} 417 | \caption{Index category $I$ for initial and terminal objects. The 418 | category is empty} 419 | \label{fig:initial_terminal_object_index_category} 420 | \end{figure} 421 | 422 | \begin{example}[Limit][Terminal object] 423 | \index{Terminal object!Limit example} 424 | Lets choose \mynameref{def:empty_category} as the 425 | \mynameref{def:indexcategory} $\cat{I}$. 426 | \begin{figure}[H] 427 | \centering 428 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 429 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 430 | sep=-2pt}] 431 | 432 | % the texts 433 | 434 | \node at (0,0) {$I$}; 435 | \node at (0,3.5) {$C$}; 436 | 437 | \node[ele,label=above:$c$] (d) at (1.8,3.5) {}; 438 | \node[ele,label=below:$t$] (l) at (1.8,2.5) {}; 439 | 440 | \node [draw, thick, circle, minimum width=2.5cm] at (1.8,0) {}; 441 | \node[draw,fit= (d) (l),minimum width=2.5cm, minimum 442 | height=2.5cm] {} ; 443 | 444 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 445 | node[right]{$u$} (l); 446 | 447 | \end{tikzpicture} 448 | \caption{Terminal object $t$ as a limit} 449 | \label{fig:limit_terminal_object} 450 | \end{figure} 451 | The \mynameref{def:cone} consists from the apex $c$ only (see 452 | \cref{fig:limit_terminal_object}). 453 | The \mynameref{def:limit} 454 | will be \mynameref{def:terminal_object} in the category $\cat{C}$. 455 | \end{example} 456 | 457 | \begin{example}[Colimit][Initial object] 458 | \index{Initial object!Colimit example} 459 | Lets choose \mynameref{def:empty_category} as the 460 | \mynameref{def:indexcategory} $\cat{I}$. 461 | \begin{figure}[H] 462 | \centering 463 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 464 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 465 | sep=-2pt}] 466 | 467 | % the texts 468 | 469 | \node at (0,0) {$I$}; 470 | \node at (0,3.5) {$C$}; 471 | 472 | \node[ele,label=above:$c$] (d) at (1.8,3.5) {}; 473 | \node[ele,label=below:$i$] (l) at (1.8,2.5) {}; 474 | 475 | \node [draw, thick, circle, minimum width=2.5cm] at (1.8,0) {}; 476 | \node[draw,fit= (d) (l),minimum width=2.5cm, minimum 477 | height=2.5cm] {} ; 478 | 479 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 480 | node[right]{$u$} (d); 481 | 482 | \end{tikzpicture} 483 | \caption{Initial object $i$ as a colimit} 484 | \label{fig:colimit_initial_object} 485 | \end{figure} 486 | The \mynameref{def:cocone} consists from the apex $c$ only (see 487 | \cref{fig:colimit_initial_object}). 488 | The \mynameref{def:colimit} 489 | will be \mynameref{def:initial_object} in the category $\cat{C}$. 490 | \end{example} 491 | 492 | \subsection{Product and sum} 493 | 494 | If choose \mynameref{def:discrete_category} with 2 objects as the 495 | \mynameref{def:indexcategory} (see 496 | \cref{fig:limit_product_index_category}) then we can get 497 | \mynameref{def:product} 498 | as \mynameref{def:limit} and \mynameref{def:sum} as 499 | \mynameref{def:colimit}. 500 | 501 | \begin{figure}[H] 502 | \centering 503 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 504 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 505 | sep=-2pt}] 506 | 507 | % the texts 508 | 509 | \node at (0,0) {$I$}; 510 | 511 | \node[ele,label=left:$a^{(I)}$] (a) at (2,0) {}; 512 | \node[ele,label=right:$b^{(I)}$] (b) at (4,0) {}; 513 | 514 | \draw (a) to [out=-45,in=-135,looseness=20] node[below] 515 | {$\idm{a^{(I)}}$} (a); 516 | \draw (b) to [out=-45,in=-135,looseness=20] node[below] 517 | {$\idm{b^{(I)}}$} (b); 518 | 519 | 520 | \node[draw,fit= (a) (b),minimum width=5cm, minimum 521 | height=2.5cm] {} ; 522 | \end{tikzpicture} 523 | \caption{Index category $I$ for product and sum. It 524 | consists of 2 objects $a^{(I)}, b^{(I)}$ and 2 trivial (identity) 525 | morphisms $\idm{a^{(I)}}, \idm{b^{(I)}}$} 526 | \label{fig:limit_product_index_category} 527 | \end{figure} 528 | 529 | \begin{example}[Limit][Product] 530 | \index{Product!Limit example} 531 | Lets choose \mynameref{def:discrete_category} with 2 objects as the 532 | \mynameref{def:indexcategory} $\cat{I}$. 533 | \begin{figure}[H] 534 | \centering 535 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 536 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 537 | sep=-2pt}] 538 | 539 | % the texts 540 | 541 | \node at (0,0) {$I$}; 542 | \node at (0,7) {$C$}; 543 | 544 | \node[ele,label=left:$a^{(I)}$] (ac) at (1.5,0) {}; 545 | \node[ele,label=right:$b^{(I)}$] (bc) at (5.5,0) {}; 546 | \node[ele,label=left:$a$] (ad) at (1.5,3) {}; 547 | \node[ele,label=right:$b$] (bd) at (5.5,3) {}; 548 | \node[ele,label=above:$c$] (d) at (3.5,7) {}; 549 | \node[ele,label=below:$a \times b$] (l) at (3.5,4) {}; 550 | 551 | \node[draw,fit= (ac) (bc),minimum width=6cm, minimum 552 | height=2.5cm] {} ; 553 | \node[draw,fit= (ad) (bd) (d) (l),minimum width=7cm, minimum 554 | height=7cm] {} ; 555 | 556 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 557 | node[right]{$u$} (l); 558 | 559 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 560 | node[left]{$f^{(c)}_a$} (ad); 561 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (d) to 562 | node[right]{$f^{(c)}_b$} (bd); 563 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 564 | node[above]{$f^{(l)}_a$} (ad); 565 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 566 | node[above]{$f^{(l)}_b$} (bd); 567 | 568 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 569 | node[left]{$a = F(a^{(I)})$} (ad); 570 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 571 | node[right]{$b = F(b^{(I)})$} (bd); 572 | \end{tikzpicture} 573 | \caption{Product as a limit} 574 | \label{fig:limit_product} 575 | \end{figure} 576 | The 577 | \mynameref{def:diagram_of_shape} $F$ gives us the mapping into 2 578 | objects in the category $\cat{C}$ (see \cref{fig:limit_product}). The 579 | \mynameref{def:limit} of the 580 | \mynameref{def:diagram_of_shape} is the \mynameref{def:product} of the 581 | 2 objects in the category $\cat{C}$. 582 | \end{example} 583 | 584 | \begin{example}[Colimit][Sum] 585 | \index{Sum!Colimit example} 586 | Lets choose \mynameref{def:discrete_category} with 2 objects as the 587 | \mynameref{def:indexcategory} $\cat{I}$. 588 | \begin{figure}[H] 589 | \centering 590 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 591 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 592 | sep=-2pt}] 593 | 594 | % the texts 595 | 596 | \node at (0,0) {$I$}; 597 | \node at (0,7) {$C$}; 598 | 599 | \node[ele,label=left:$a^{(I)}$] (ac) at (1.5,0) {}; 600 | \node[ele,label=right:$b^{(I)}$] (bc) at (5.5,0) {}; 601 | \node[ele,label=left:$a$] (ad) at (1.5,3) {}; 602 | \node[ele,label=right:$b$] (bd) at (5.5,3) {}; 603 | \node[ele,label=above:$c$] (d) at (3.5,7) {}; 604 | \node[ele,label=below:$a \oplus b$] (l) at (3.5,4) {}; 605 | 606 | \node[draw,fit= (ac) (bc),minimum width=6cm, minimum 607 | height=2.5cm] {} ; 608 | \node[draw,fit= (ad) (bd) (d) (l),minimum width=7cm, minimum 609 | height=7cm] {} ; 610 | 611 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 612 | node[right]{$u$} (d); 613 | 614 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 615 | node[left]{$f^{(c)}_a$} (d); 616 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bd) to 617 | node[right]{$f^{(c)}_b$} (d); 618 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ad) to 619 | node[above]{$f^{(l)}_a$} (l); 620 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bd) to 621 | node[above]{$f^{(l)}_b$} (l); 622 | 623 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ac) to 624 | node[left]{$a = F(a^{(I)})$} (ad); 625 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bc) to 626 | node[right]{$b = F(b^{(I)})$} (bd); 627 | \end{tikzpicture} 628 | \caption{Sum as a colimit} 629 | \label{fig:colimit_sum} 630 | \end{figure} 631 | The 632 | \mynameref{def:diagram_of_shape} $F$ gives us the mapping into 2 633 | objects in the category $\cat{C}$ (see \cref{fig:colimit_sum}). The 634 | \mynameref{def:colimit} of the 635 | \mynameref{def:diagram_of_shape} is the \mynameref{def:sum} of the 636 | 2 objects in the category $\cat{C}$. 637 | \end{example} 638 | 639 | \subsection{Equalizer} 640 | 641 | If choose a \mynameref{def:category} with 2 objects as the 642 | \mynameref{def:indexcategory} (see 643 | \cref{fig:limit_equlizer_index_category}) and 2 \mynameref{def:morphism}s 644 | connecting one object with another then we can get equalizer 645 | as \mynameref{def:limit}. 646 | 647 | \begin{figure}[H] 648 | \centering 649 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 650 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 651 | sep=-2pt}] 652 | 653 | % the texts 654 | 655 | \node at (0,0) {$I$}; 656 | 657 | \node[ele,label=left:$a^{(I)}$] (a) at (2,0) {}; 658 | \node[ele,label=right:$b^{(I)}$] (b) at (4,0) {}; 659 | 660 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 661 | [out=45,in=135,looseness=1] node[above] {$f^{(I)}$} (b); 662 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 663 | [out=-45,in=-135,looseness=1] node[above] {$g^{(I)}$} (b); 664 | 665 | 666 | \draw (a) to [out=-45,in=-135,looseness=20] node[below] 667 | {$\idm{a^{(I)}}$} (a); 668 | \draw (b) to [out=-45,in=-135,looseness=20] node[below] 669 | {$\idm{b^{(I)}}$} (b); 670 | 671 | 672 | \node[draw,fit= (a) (b),minimum width=5cm, minimum 673 | height=2.5cm] {} ; 674 | \end{tikzpicture} 675 | \caption{Index category $I$ for equalizer. It 676 | consists of 2 objects $a^{(I)}, b^{(I)}$, 2 trivial (identity) 677 | morphisms $\idm{a^{(I)}}, \idm{b^{(I)}}$ and 2 additional morphisms 678 | $f^{(I)}, g^{(I)} \in \catmset[I]{a^{(I)}}{b^{(I)}}$} 679 | \label{fig:limit_equlizer_index_category} 680 | \end{figure} 681 | 682 | \begin{definition}[Equalizer] 683 | \label{def:equalizer} 684 | Lets choose a \mynameref{def:category} with 2 objects $a^{(I)}, 685 | b^{(I)}$ and 2 additional morphisms 686 | $f^{(I)}, g^{(I)} \in \catmset[I]{a^{(I)}}{b^{(I)}}$ as the 687 | \mynameref{def:indexcategory} $\cat{I}$ (see 688 | \cref{fig:limit_equlizer_index_category}). 689 | \begin{figure}[H] 690 | \centering 691 | \begin{tikzpicture}[ele/.style={fill=black,circle,minimum 692 | width=.8pt,inner sep=1pt},every fit/.style={ellipse,draw,inner 693 | sep=-2pt}] 694 | 695 | % the texts 696 | 697 | \node at (0,0) {$I$}; 698 | \node at (0,7) {$C$}; 699 | 700 | \node[ele,label=left:$a$] (a) at (1.5,3) {}; 701 | \node[ele,label=right:$b$] (b) at (5.5,3) {}; 702 | \node[ele,label=above:$c$] (c) at (3.5,7) {}; 703 | \node[ele,label=below:$eq$] (l) at (3.5,4.5) {}; 704 | 705 | 706 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 707 | [out=45,in=135,looseness=0.5] node[above] {$f$} (b); 708 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (a) to 709 | [out=-45,in=-135,looseness=0.5] node[above] {$g$} 710 | (b); 711 | 712 | 713 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 714 | node[left]{$f^{(c)}_a$} (a); 715 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 716 | node[right]{$f^{(c)}_b$} (b); 717 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 718 | node[above]{$f^{(l)}_a$} (a); 719 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (l) to 720 | node[above]{$f^{(l)}_b$} (b); 721 | 722 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (c) to 723 | node[right]{$u$} (l); 724 | 725 | \node[draw,fit= (a) (b) (c) (l),minimum width=7cm, minimum 726 | height=7cm] {} ; 727 | 728 | \node[ele,label=left:$a^{(I)}$] (ai) at (1.5,0) {}; 729 | \node[ele,label=right:$b^{(I)}$] (bi) at (5.5,0) {}; 730 | 731 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ai) to 732 | [out=45,in=135,looseness=0.5] node[above] {$f^{(I)}$} (bi); 733 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ai) to 734 | [out=-45,in=-135,looseness=0.5] node[above] {$g^{(I)}$} 735 | (bi); 736 | 737 | 738 | \node[draw,fit= (ai) (bi),minimum width=6cm, minimum 739 | height=2.5cm] {} ; 740 | 741 | 742 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (ai) to 743 | node[left]{$a = F(a^{(I)})$} (a); 744 | \draw[->,thick,shorten <=2pt,shorten >=2pt] (bi) to 745 | node[right]{$b = F(b^{(I)})$} (b); 746 | 747 | \end{tikzpicture} 748 | \caption{Equalizer} 749 | \label{fig:equlizer} 750 | \end{figure} 751 | The 752 | \mynameref{def:diagram_of_shape} $F$ gives us the mapping into 2 753 | objects and 2 morphisms in the category $\cat{C}$. The 754 | \mynameref{def:limit} of the 755 | \mynameref{def:diagram_of_shape} (see \cref{fig:equlizer}) is the 756 | \textit{equalizer}. The equalizer is denoted as $eq\left(f, g\right)$. 757 | \end{definition} 758 | 759 | The meaning of the \mynameref{def:equalizer} can be described in the 760 | \mynameref{def:setcategory} 761 | \begin{example}[Equalizer][$\cat{Set}$] 762 | \label{ex:equalizer_set} 763 | In the \mynameref{def:setcategory} equalizer determines a solution for the 764 | following equation 765 | \[ 766 | f(x) = g(x) 767 | \] 768 | 769 | We consider a 770 | 771 | TBD 772 | \end{example} 773 | -------------------------------------------------------------------------------- /cattheory.bib: -------------------------------------------------------------------------------- 1 | %% -*- coding:utf-8 -*- 2 | @book{feynman2010quantum, 3 | title={Quantum Mechanics and Path Integrals}, 4 | author={Feynman, R.P. and Hibbs, A.R. and Styer, D.F.}, 5 | isbn={9780486477220}, 6 | lccn={2010004550}, 7 | series={Dover Books on Physics}, 8 | url={https://books.google.ru/books?id=JkMuDAAAQBAJ}, 9 | year={2010}, 10 | publisher={Dover Publications} 11 | } 12 | 13 | @misc{ wiki:snellslaw, 14 | author = "{Wikipedia contributors}", 15 | title = "Snell's law --- {Wikipedia}{,} The Free Encyclopedia", 16 | year = "2019", 17 | howpublished = "\url{https://en.wikipedia.org/w/index.php?title=Snell%27s_law&oldid=908247962}", 18 | note = "[Online; accessed 20-August-2019]" 19 | } 20 | 21 | @misc{ wiki:least_action_principle, 22 | author = "{Wikipedia contributors}", 23 | title = "Principle of least action --- {Wikipedia}{,} The Free Encyclopedia", 24 | year = "2019", 25 | url = "https://en.wikipedia.org/w/index.php?title=Principle_of_least_action&oldid=894342906", 26 | note = "[Online; accessed 30-May-2019]" 27 | } 28 | @misc{ quora:monoidimportance, 29 | author = "{Lex Sheehan}", 30 | title = "What’s the significance of monoids?", 31 | year = "2017", 32 | url = "https://qr.ae/TWNHIi" 33 | } 34 | 35 | 36 | @misc{ wiki:coproduct, 37 | author = "{Wikipedia contributors}", 38 | title = "Coproduct --- {Wikipedia}{,} The Free Encyclopedia", 39 | year = "2019", 40 | url = "https://en.wikipedia.org/w/index.php?title=Coproduct&oldid=893649821", 41 | note = "[Online; accessed 5-May-2019]" 42 | } 43 | 44 | @misc{bib:scalable_program_arch, 45 | title = {Scalable program architectures}, 46 | author = {Gabriel Gonzalez}, 47 | year="2014", 48 | url = {http://www.haskellforall.com/2014/04/scalable-program-architectures.html} 49 | } 50 | 51 | @misc {bib:stackexchange:initial_terminal_in_fun_category, 52 | title = {Terminal and Initial objects in the category of functors}, 53 | author = {Enkidu (https://math.stackexchange.com/users/455216/enkidu)}, 54 | howpublished = {Mathematics Stack Exchange}, 55 | note = {URL:https://math.stackexchange.com/q/3033845 (version: 2018-12-10)}, 56 | eprint = {https://math.stackexchange.com/q/3033845}, 57 | url = {https://math.stackexchange.com/q/3033845} 58 | } 59 | 60 | @misc{bib:stackexchange:empty_category, 61 | title = {Does an(/the?) empty category exist?}, 62 | author = {user84563 (https://math.stackexchange.com/users/301130/user84563)}, 63 | howpublished = {Mathematics Stack Exchange}, 64 | note = {URL:https://math.stackexchange.com/q/1997015 (version: 2016-11-03)}, 65 | eprint = {https://math.stackexchange.com/q/1997015}, 66 | url = {https://math.stackexchange.com/q/1997015} 67 | } 68 | @misc{ wiki:cone, 69 | author = "{Wikipedia contributors}", 70 | title = "Cone (category theory) --- {Wikipedia}{,} The Free Encyclopedia", 71 | year = "2018", 72 | url = "https://en.wikipedia.org/w/index.php?title=Cone_(category_theory)&oldid=827711162", 73 | note = "[Online; accessed 10-November-2018]" 74 | } 75 | 76 | @misc{stanford:linear_logic, 77 | author = {Di Cosmo, Roberto and Miller, Dale}, 78 | title = {Linear Logic}, 79 | booktitle = {The Stanford Encyclopedia of Philosophy}, 80 | editor = {Edward N. Zalta}, 81 | url = {https://plato.stanford.edu/archives/win2016/entries/logic-linear/}, 82 | year = {2016}, 83 | edition = {Winter 2016}, 84 | publisher = {Metaphysics Research Lab, Stanford University} 85 | } 86 | 87 | @misc{github:galois_ivanmurashko, 88 | author = {Ivan Murashko}, 89 | title = {Lectures notes in Introduction to Galois Theory by 90 | Ekaterina Amerik}, 91 | year = {2016-2019}, 92 | publisher = {GitHub}, 93 | journal = {GitHub repository}, 94 | url = {https://github.com/ivanmurashko/courseragalois} 95 | } 96 | 97 | 98 | @misc{github:cattheory_ivanmurashko, 99 | author = {Ivan Murashko}, 100 | title = {Category Theory by Example}, 101 | year = {2018}, 102 | publisher = {GitHub}, 103 | journal = {GitHub repository}, 104 | url = {https://github.com/ivanmurashko/articles/tree/master/cattheory} 105 | } 106 | 107 | @misc{github:cattheory_cpp_examples, 108 | author = {{Ivan Murashko}, {Alexey Radkov}, {Marat Minshin}}, 109 | title = {C++ examples for Category Theory by Example book}, 110 | year = {2018}, 111 | publisher = {GitHub}, 112 | journal = {GitHub repository}, 113 | url = {https://github.com/CatTheoryByExample/cpp-examples} 114 | } 115 | 116 | @misc{github:cattheory_scala_examples, 117 | author = {{Ivan Murashko}, {Alexey Radkov}, {Marat Minshin}}, 118 | title = {Scala examples for Category Theory by Example book}, 119 | year = {2018}, 120 | publisher = {GitHub}, 121 | journal = {GitHub repository}, 122 | url = {https://github.com/CatTheoryByExample/scala-examples} 123 | } 124 | 125 | @misc{github:cattheory_hs_examples, 126 | author = {{Ivan Murashko}, {Alexey Radkov}, {Marat Minshin}}, 127 | title = {Haskell examples for Category Theory by Example book}, 128 | year = {2018}, 129 | publisher = {GitHub}, 130 | journal = {GitHub repository}, 131 | url = {https://github.com/CatTheoryByExample/hs-examples} 132 | } 133 | 134 | 135 | @book{bib:quantum_optics_mine, 136 | title={{Квантовая оптика}}, 137 | author={{Мурашко И. В.}}, 138 | url={https://github.com/ivanmurashko/lectures/blob/master/pdfs/qo.pdf}, 139 | year={2018} 140 | } 141 | 142 | @misc{ wiki:distributive_category, 143 | author = "{Wikipedia contributors}", 144 | title = "Distributive category --- {Wikipedia}{,} The Free Encyclopedia", 145 | year = "2018", 146 | url = "https://en.wikipedia.org/w/index.php?title=Distributive_category&oldid=851490594", 147 | note = "[Online; accessed 14-October-2018]" 148 | } 149 | 150 | @misc{bib:whatisaproof, 151 | title = {What is a Proof?}, 152 | author = {Tom Leighton and Ronitt Rubinfeld}, 153 | url = {http://web.mit.edu/neboat/Public/6.042/proofs.pdf}} 154 | 155 | 156 | @misc{bib:studycom:truefalse, 157 | title = {Writing and Classifying True, False and Open Statements in Math}, 158 | author = {Michael Quist}, 159 | url = {https://study.com/academy/lesson/writing-and-classifying-true-false-and-open-statements-in-math.html}} 160 | 161 | 162 | @misc{bib:stackexchange:terminalinmonoid, 163 | title = {Is the identity functor the terminal object of the category of endofunctors on $C$?}, 164 | author = {Qiaochu Yuan (https://math.stackexchange.com/users/232/qiaochu-yuan)}, 165 | howpublished = {Mathematics Stack Exchange}, 166 | note = {URL:https://math.stackexchange.com/q/6318 (version: 2010-10-08)}, 167 | eprint = {https://math.stackexchange.com/q/6318}, 168 | url = {https://math.stackexchange.com/q/6318}} 169 | 170 | @article{bib:Moggi91, 171 | author = {Eugenio Moggi}, 172 | title = {Notions of Computation and Monads}, 173 | journal = {Inf. Comput.}, 174 | volume = {93}, 175 | number = {1}, 176 | pages = {55--92}, 177 | year = {1991}, 178 | url = {http://fsl.cs.illinois.edu/pubs/moggi-1991-ic.pdf} 179 | } 180 | 181 | @book{bib:maclane98, 182 | title={Categories for the Working Mathematician}, 183 | author={Lane, S.M.}, 184 | isbn={9780387984032}, 185 | lccn={97045229}, 186 | series={Graduate Texts in Mathematics}, 187 | url={https://books.google.ru/books?id=eBvhyc4z8HQC}, 188 | year={1998}, 189 | publisher={Springer New York} 190 | } 191 | 192 | 193 | @misc{nlab:whiskering, 194 | author = {nLab authors}, 195 | title = {whiskering}, 196 | howpublished = {http://ncatlab.org/nlab/show/whiskering}, 197 | note = {Revision 11}, 198 | month = {sep}, 199 | year = {2018} 200 | } 201 | 202 | @misc{ wiki:russell_paradox, 203 | author = "{Wikipedia contributors}", 204 | title = "Russell's paradox --- {Wikipedia}{,} The Free Encyclopedia", 205 | year = "2018", 206 | url = "https://en.wikipedia.org/w/index.php?title=Russell\%27s_paradox&oldid=852430810", 207 | note = "[Online; accessed 29-July-2018]" 208 | } 209 | 210 | @misc{ wiki:zfc, 211 | author = "{Wikipedia contributors}", 212 | title = "Zermelo–Fraenkel set theory --- {Wikipedia}{,} The Free Encyclopedia", 213 | year = "2018", 214 | url = "https://en.wikipedia.org/w/index.php?title=Zermelo\%E2\%80\%93Fraenkel_set_theory&oldid=852467638", 215 | note = "[Online; accessed 29-July-2018]" 216 | } 217 | 218 | @article{bib:arxiv:Bob_Coecke_2008, 219 | title={Introducing categories to the practicing physicist}, 220 | author={Bob Coecke}, 221 | url={https://arxiv.org/abs/0808.1032}, 222 | year={2008} 223 | } 224 | 225 | 226 | @misc {bib:stackexchange:morphism:equality, 227 | title = {How should I think about morphism equality?}, 228 | author = {David Myers (https://math.stackexchange.com/users/142355/david-myers)}, 229 | howpublished = {Mathematics Stack Exchange}, 230 | note = {URL:https://math.stackexchange.com/q/1346167 (version: 2015-07-01)}, 231 | eprint = {https://math.stackexchange.com/q/1346167}, 232 | url = {https://math.stackexchange.com/q/1346167} 233 | } 234 | 235 | 236 | @article{bib:proofwiki:Empty_Mapping_is_Unique, 237 | title={Empty Mapping is Unique}, 238 | author={ProofWiki}, 239 | url={https://proofwiki.org/wiki/Empty_Mapping_is_Unique}, 240 | year={2018} 241 | } 242 | 243 | 244 | @article{bib:proofwiki:Injection_iff_Monomorphism_in_Category_of_Sets, 245 | title={Injection iff Monomorphism in Category of Sets}, 246 | author={ProofWiki}, 247 | url={https://proofwiki.org/wiki/Injection_iff_Monomorphism_in_Category_of_Sets}, 248 | year={2018} 249 | } 250 | 251 | @article{bib:proofwiki:Surjection_iff_Epimorphism_in_Category_of_Sets, 252 | title={Surjection iff Epimorphism in Category of Sets}, 253 | author={ProofWiki}, 254 | url={https://proofwiki.org/wiki/Surjection_iff_Epimorphism_in_Category_of_Sets}, 255 | year={2018} 256 | } 257 | 258 | 259 | @book{bib:milewski2018category, 260 | title={Category Theory for Programmers}, 261 | author={Milewski, B.}, 262 | url={https://github.com/hmemcpy/milewski-ctfp-pdf/releases/download/v0.7.0/category-theory-for-programmers.pdf}, 263 | year={2018}, 264 | publisher={Bartosz Milewski} 265 | } 266 | 267 | @article{bib:KeithConradFiniteFields, 268 | title = {Finite Fields}, 269 | author = {Keith Conrad}, 270 | url = {http://www.math.uconn.edu/~kconrad/blurbs/galoistheory/finitefields.pdf} 271 | } 272 | 273 | @article{bib:KeithConradTensorProduct1, 274 | title = {Tensor Poroducts}, 275 | author = {Keith Conrad}, 276 | url = {http://www.math.uconn.edu/~kconrad/blurbs/linmultialg/tensorprod.pdf} 277 | } 278 | 279 | @article{bib:KeithConradSeparability2, 280 | title = {Separability II}, 281 | author = {Keith Conrad}, 282 | url = {http://www.math.uconn.edu/~kconrad/blurbs/galoistheory/separable2.pdf} 283 | } 284 | 285 | @article{bib:KeithConradTraceNorm2, 286 | title = {Trace and Norm II}, 287 | author = {Keith Conrad}, 288 | url = {http://www.math.uconn.edu/~kconrad/blurbs/galoistheory/tracenorm2.pdf} 289 | } 290 | 291 | @article{bib:KenBrownPrimitiveElementTheorem, 292 | title = {The Primitive Element Theorem}, 293 | author = {Ken Brown}, 294 | url = {http://www.math.cornell.edu/~kbrown/6310/primitive.pdf} 295 | } 296 | 297 | 298 | @misc{ wiki:maxideal, 299 | author = "Wikipedia", 300 | title = "Maximal ideal --- Wikipedia{,} The Free Encyclopedia", 301 | year = "2016", 302 | url = "https://en.wikipedia.org/w/index.php?title=Maximal_ideal&oldid=704326783", 303 | note = "[Online; accessed 29-July-2016]" 304 | } 305 | 306 | @misc{ wiki:nilpotent, 307 | author = "Wikipedia", 308 | title = "Nilpotent --- Wikipedia{,} The Free Encyclopedia", 309 | year = "2016", 310 | url = "https://en.wikipedia.org/w/index.php?title=Nilpotent&oldid=727125150", 311 | note = "[Online; accessed 29-July-2016]" 312 | } 313 | 314 | @book{ribenboim2001classical, 315 | title={Classical Theory of Algebraic Numbers}, 316 | author={Ribenboim, P.}, 317 | isbn={9780387950709}, 318 | lccn={00040044}, 319 | series={Universitext}, 320 | url={https://books.google.ru/books?id=u5443xdaNZcC}, 321 | year={2001}, 322 | publisher={Springer New York} 323 | } 324 | 325 | @misc{ wiki:groupaction, 326 | author = "Wikipedia", 327 | title = "Group action --- Wikipedia{,} The Free Encyclopedia", 328 | year = "2016", 329 | url = "https://en.wikipedia.org/w/index.php?title=Group_action&oldid=735249701", 330 | note = "[Online; accessed 28-August-2016]" 331 | } 332 | 333 | @misc{ mathworld:groupfixedpoint, 334 | author = "Rowland, Todd", 335 | title = "Group Fixed Point.", 336 | year = "2016", 337 | url = "http://mathworld.wolfram.com/GroupFixedPoint.html", 338 | note = "From MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein. " 339 | } 340 | 341 | @misc{ wiki:normalsubgroup, 342 | author = "Wikipedia", 343 | title = "Normal subgroup --- Wikipedia{,} The Free Encyclopedia", 344 | year = "2016", 345 | url = "https://en.wikipedia.org/w/index.php?title=Normal_subgroup&oldid=737429252", 346 | note = "[Online; accessed 9-September-2016]" 347 | } 348 | 349 | @misc{ wiki:eulerfunction, 350 | author = "Wikipedia", 351 | title = "Euler's totient function --- Wikipedia{,} The Free Encyclopedia", 352 | year = "2016", 353 | url = "https://en.wikipedia.org/w/index.php?title=Euler\%27s_totient_function&oldid=736552571", 354 | note = "[Online; accessed 14-September-2016]" 355 | } 356 | 357 | @misc{ wiki:multiplicativegroup, 358 | author = "Wikipedia", 359 | title = "Multiplicative group of integers modulo n --- Wikipedia{,} The Free Encyclopedia", 360 | year = "2016", 361 | url = "https://en.wikipedia.org/w/index.php?title=Multiplicative_group_of_integers_modulo_n&oldid=739054442", 362 | note = "[Online; accessed 20-September-2016]" 363 | } 364 | 365 | @misc{ wiki:simpleextension, 366 | author = "Wikipedia", 367 | title = "Simple extension --- Wikipedia{,} The Free Encyclopedia", 368 | year = "2014", 369 | url = "https://en.wikipedia.org/w/index.php?title=Simple_extension&oldid=595508851", 370 | note = "[Online; accessed 20-September-2016]" 371 | } 372 | 373 | @misc{ wiki:group, 374 | author = "Wikipedia", 375 | title = "Subgroup --- Wikipedia{,} The Free Encyclopedia", 376 | year = "2016", 377 | url = "https://en.wikipedia.org/w/index.php?title=Subgroup&oldid=737399477", 378 | note = "[Online; accessed 23-September-2016]" 379 | } 380 | 381 | @misc{ wiki:linearmap, 382 | author = "Wikipedia", 383 | title = "Linear map --- Wikipedia{,} The Free Encyclopedia", 384 | year = "2016", 385 | url = "https://en.wikipedia.org/w/index.php?title=Linear_map&oldid=740065546", 386 | note = "[Online; accessed 24-September-2016]" 387 | } 388 | 389 | @misc{ wiki:rank, 390 | author = "Wikipedia", 391 | title = "Rank (linear algebra) --- Wikipedia{,} The Free Encyclopedia", 392 | year = "2016", 393 | url = "https://en.wikipedia.org/w/index.php?title=Rank_(linear_algebra)&oldid=739885289", 394 | note = "[Online; accessed 24-September-2016]" 395 | } 396 | 397 | @misc{ wiki:kernel, 398 | author = "Wikipedia", 399 | title = "Kernel (linear algebra) --- Wikipedia{,} The Free Encyclopedia", 400 | year = "2016", 401 | url = "https://en.wikipedia.org/w/index.php?title=Kernel_(linear_algebra)&oldid=735290769", 402 | note = "[Online; accessed 24-September-2016]" 403 | } 404 | 405 | @misc{ wiki:directsum, 406 | author = "Wikipedia", 407 | title = "Direct sum --- Wikipedia{,} The Free Encyclopedia", 408 | year = "2016", 409 | url = "https://en.wikipedia.org/w/index.php?title=Direct_sum&oldid=738351383", 410 | note = "[Online; accessed 24-September-2016]" 411 | } 412 | 413 | @misc{ wiki:directsummodules, 414 | author = "Wikipedia", 415 | title = "Direct sum of modules --- Wikipedia{,} The Free Encyclopedia", 416 | year = "2016", 417 | url = "https://en.wikipedia.org/w/index.php?title=Direct_sum_of_modules&oldid=730018916", 418 | note = "[Online; accessed 25-September-2016]" 419 | } 420 | 421 | @misc{ wiki:quotientgroup, 422 | author = "Wikipedia", 423 | title = "Quotient group --- Wikipedia{,} The Free Encyclopedia", 424 | year = "2016", 425 | url = "https://en.wikipedia.org/w/index.php?title=Quotient_group&oldid=726415849", 426 | note = "[Online; accessed 27-September-2016]" 427 | } 428 | 429 | @misc{ wiki:alteringgroup, 430 | author = "Wikipedia", 431 | title = "Alternating group --- Wikipedia{,} The Free Encyclopedia", 432 | year = "2016", 433 | url = "https://en.wikipedia.org/w/index.php?title=Alternating_group&oldid=736689793", 434 | note = "[Online; accessed 27-September-2016]" 435 | } 436 | 437 | @misc{ wiki:permutationgroups, 438 | author = "Wikibooks", 439 | title = "Abstract Algebra/Group Theory/Permutation groups --- Wikibooks{,} The Free Textbook Project", 440 | year = "2016", 441 | url = "https://en.wikibooks.org/w/index.php?title=Abstract_Algebra/Group_Theory/Permutation_groups&oldid=3070727", 442 | note = "[Online; accessed 27-September-2016]" 443 | } 444 | 445 | @misc{ wiki:paritypermutation, 446 | author = "Wikipedia", 447 | title = "Parity of a permutation --- Wikipedia{,} The Free Encyclopedia", 448 | year = "2016", 449 | url = "https://en.wikipedia.org/w/index.php?title=Parity_of_a_permutation&oldid=736707840", 450 | note = "[Online; accessed 28-September-2016]" 451 | } 452 | 453 | @misc{ wiki:commutator, 454 | author = "Wikipedia", 455 | title = "Commutator --- Wikipedia{,} The Free Encyclopedia", 456 | year = "2016", 457 | url = "https://en.wikipedia.org/w/index.php?title=Commutator&oldid=740207690", 458 | note = "[Online; accessed 30-September-2016]" 459 | } 460 | 461 | @misc{ wiki:commutatorsubgroup, 462 | author = "Wikipedia", 463 | title = "Commutator subgroup --- Wikipedia{,} The Free Encyclopedia", 464 | year = "2016", 465 | url = "https://en.wikipedia.org/w/index.php?title=Commutator_subgroup&oldid=737371946", 466 | note = "[Online; accessed 30-September-2016]" 467 | } 468 | 469 | @misc{ wiki:sylow, 470 | author = "Wikipedia", 471 | title = "Sylow theorems --- Wikipedia{,} The Free Encyclopedia", 472 | year = "2016", 473 | url = "https://en.wikipedia.org/w/index.php?title=Sylow_theorems&oldid=735518140", 474 | note = "[Online; accessed 1-October-2016]" 475 | } 476 | 477 | @misc{ wiki:glg, 478 | author = "Wikipedia", 479 | title = "General linear group --- Wikipedia{,} The Free Encyclopedia", 480 | year = "2016", 481 | url = "https://en.wikipedia.org/w/index.php?title=General_linear_group&oldid=738480571", 482 | note = "[Online; accessed 2-October-2016]" 483 | } 484 | @misc{ wiki:endomorphism, 485 | author = "Wikipedia", 486 | title = "Endomorphism --- Wikipedia{,} The Free Encyclopedia", 487 | year = "2016", 488 | url = "https://en.wikipedia.org/w/index.php?title=Endomorphism&oldid=726230579", 489 | note = "[Online; accessed 2-October-2016]" 490 | } 491 | 492 | @misc{ wiki:gsmodule, 493 | author = "Wikipedia", 494 | title = "Generating set of a module --- Wikipedia{,} The Free Encyclopedia", 495 | year = "2016", 496 | url = "https://en.wikipedia.org/w/index.php?title=Generating_set_of_a_module&oldid=732648521", 497 | note = "[Online; accessed 5-October-2016]" 498 | } 499 | 500 | @misc{ wiki:fgmodule, 501 | author = "Wikipedia", 502 | title = "Finitely generated module --- Wikipedia{,} The Free Encyclopedia", 503 | year = "2016", 504 | url = "https://en.wikipedia.org/w/index.php?title=Finitely_generated_module&oldid=735554374", 505 | note = "[Online; accessed 5-October-2016]" 506 | } 507 | 508 | @misc{ wiki:fractionfield, 509 | author = "Wikipedia", 510 | title = "Field of fractions --- Wikipedia{,} The Free Encyclopedia", 511 | year = "2016", 512 | url = "https://en.wikipedia.org/w/index.php?title=Field_of_fractions&oldid=720271734", 513 | note = "[Online; accessed 5-October-2016]" 514 | } 515 | 516 | @misc{ wiki:freemodule, 517 | author = "Wikipedia", 518 | title = "Free module --- Wikipedia{,} The Free Encyclopedia", 519 | year = "2016", 520 | url = "https://en.wikipedia.org/w/index.php?title=Free_module&oldid=699002213", 521 | note = "[Online; accessed 9-January-2016]" 522 | } 523 | 524 | @misc{ wiki:fgagroup, 525 | author = "Wikipedia", 526 | title = "Finitely generated abelian group --- Wikipedia{,} The Free Encyclopedia", 527 | year = "2016", 528 | url = "https://en.wikipedia.org/w/index.php?title=Finitely_generated_abelian_group&oldid=723506843", 529 | note = "[Online; accessed 3-June-2016]" 530 | } 531 | 532 | @misc{ wiki:dbf, 533 | author = "Wikipedia", 534 | title = "Degenerate bilinear form --- Wikipedia{,} The Free Encyclopedia", 535 | year = "2016", 536 | url = "https://en.wikipedia.org/w/index.php?title=Degenerate_bilinear_form&oldid=738751020", 537 | note = "[Online; accessed 10-September-2016]" 538 | } 539 | 540 | @misc{ wiki:dualspace, 541 | author = "Wikipedia", 542 | title = "Dual space --- Wikipedia{,} The Free Encyclopedia", 543 | year = "2016", 544 | url = "https://en.wikipedia.org/w/index.php?title=Dual_space&oldid=742901318", 545 | note = "[Online; accessed 6-October-2016]" 546 | } 547 | 548 | @misc{ wiki:localring, 549 | author = "Wikipedia", 550 | title = "Local ring --- Wikipedia{,} The Free Encyclopedia", 551 | year = "2016", 552 | url = "https://en.wikipedia.org/w/index.php?title=Local_ring&oldid=716779040", 553 | note = "[Online; accessed 23-April-2016]" 554 | } 555 | 556 | @article{bib:KeithConradLinearchar, 557 | title = {Linear independence of characters}, 558 | author = {Keith Conrad}, 559 | url = {http://www.math.uconn.edu/~kconrad/blurbs/galoistheory/linearchar.pdf} 560 | } 561 | 562 | @misc{ wiki:normalextrus, 563 | author = {Wikipedia}, 564 | title = {{"Нормальное расширение --- Википедия{,} свободная энциклопедия"}}, 565 | year = "2014", 566 | url = "http://ru.wikipedia.org/?oldid=65922374", 567 | } 568 | 569 | @misc{ wiki:abeliangroup, 570 | author = "Wikipedia", 571 | title = "Abelian group --- Wikipedia{,} The Free Encyclopedia", 572 | year = "2017", 573 | url = "https://en.wikipedia.org/w/index.php?title=Abelian_group&oldid=763791116", 574 | note = "[Online; accessed 5-February-2017]" 575 | } 576 | 577 | @misc{ wiki:finitegroup, 578 | author = "Wikipedia", 579 | title = "Finite group --- Wikipedia{,} The Free Encyclopedia", 580 | year = "2017", 581 | url = "https://en.wikipedia.org/w/index.php?title=Finite_group&oldid=759713845", 582 | note = "[Online; accessed 5-February-2017]" 583 | } 584 | 585 | @misc {mathstackexchange:discriminant3, 586 | title = {Using Vieta's theorem for cubic equations to derive the cubic discriminant}, 587 | author = {Qiaochu Yuan}, 588 | publisher = {Mathematics Stack Exchange}, 589 | note = {URL:http://math.stackexchange.com/q/103504 (version: 2012-01-29)}, 590 | eprint = {http://math.stackexchange.com/q/103504}, 591 | url = {http://math.stackexchange.com/q/103504} 592 | } 593 | 594 | @misc{ wiki:klein4group, 595 | author = "Wikipedia", 596 | title = "Klein four-group --- Wikipedia{,} The Free Encyclopedia", 597 | year = "2017", 598 | url = "https://en.wikipedia.org/w/index.php?title=Klein_four-group&oldid=759017274", 599 | note = "[Online; accessed 9-February-2017]" 600 | } 601 | 602 | @misc{ wiki:subgroups_of_cyclic_groups, 603 | author = "Wikipedia", 604 | title = "Subgroups of cyclic groups --- Wikipedia{,} The Free Encyclopedia", 605 | year = "2016", 606 | url = "https://en.wikipedia.org/w/index.php?title=Subgroups_of_cyclic_groups&oldid=744131880", 607 | note = "[Online; accessed 10-February-2017]" 608 | } 609 | 610 | @misc{ wiki:diagonalizable_matrix, 611 | author = "Wikipedia", 612 | title = "Diagonalizable matrix --- Wikipedia{,} The Free Encyclopedia", 613 | year = "2017", 614 | url = "https://en.wikipedia.org/w/index.php?title=Diagonalizable_matrix&oldid=764159566", 615 | note = "[Online; accessed 10-February-2017]" 616 | } 617 | 618 | @misc{ wiki:eigenvalues, 619 | author = "Wikipedia", 620 | title = "Eigenvalues and eigenvectors --- Wikipedia{,} The Free Encyclopedia", 621 | year = "2017", 622 | url = "https://en.wikipedia.org/w/index.php?title=Eigenvalues_and_eigenvectors&oldid=764288456", 623 | note = "[Online; accessed 10-February-2017]" 624 | } 625 | 626 | @misc{ wiki:ranknullity, 627 | author = "Wikipedia", 628 | title = "Rank–nullity theorem --- Wikipedia{,} The Free Encyclopedia", 629 | year = "2016", 630 | url = "https://en.wikipedia.org/w/index.php?title=Rank\%E2\%80\%93nullity_theorem&oldid=730054227", 631 | note = "[Online; accessed 15-February-2017]" 632 | } 633 | 634 | @misc{ wiki:directproduct, 635 | author = "Wikipedia", 636 | title = "Direct product of groups --- Wikipedia{,} The Free Encyclopedia", 637 | year = "2016", 638 | url = "https://en.wikipedia.org/w/index.php?title=Direct_product_of_groups&oldid=723991376", 639 | note = "[Online; accessed 19-February-2017]" 640 | } 641 | 642 | @book{book:kostrikin, 643 | title={{Введение в алгебру. ч. 3. Основные структуры алгебры}}, 644 | author={{Кострикин А. И.}}, 645 | isbn={978-5-94057-886-4}, 646 | year={2012}, 647 | publisher={{МЦНМО, Москва}} 648 | } 649 | 650 | @misc{ wiki:simplegroup, 651 | author = "Wikipedia", 652 | title = "Simple group --- Wikipedia{,} The Free Encyclopedia", 653 | year = "2016", 654 | url = "https://en.wikipedia.org/w/index.php?title=Simple_group&oldid=709515196", 655 | note = "[Online; accessed 1-March-2017]" 656 | } 657 | 658 | @misc{ wiki:correspondence, 659 | author = "Wikipedia", 660 | title = "Correspondence theorem (group theory) --- Wikipedia{,} The Free Encyclopedia", 661 | year = "2016", 662 | url = "https://en.wikipedia.org/w/index.php?title=Correspondence_theorem_(group_theory)&oldid=744531320", 663 | note = "[Online; accessed 2-March-2017]" 664 | } 665 | 666 | @misc{ wiki:grouphomomorphism, 667 | author = "Wikipedia", 668 | title = "Group homomorphism --- Wikipedia{,} The Free Encyclopedia", 669 | year = "2016", 670 | url = "https://en.wikipedia.org/w/index.php?title=Group_homomorphism&oldid=737886552", 671 | note = "[Online; accessed 4-March-2017]" 672 | } 673 | 674 | @MISC {mathstackexchange:sn, 675 | TITLE = {Why is $S_5$ generated by any combination of a transposition and a 5-cycle?}, 676 | AUTHOR = {Alexander Gruber}, 677 | HOWPUBLISHED = {Mathematics Stack Exchange}, 678 | NOTE = {URL:http://math.stackexchange.com/q/357673 (version: 2013-05-11)}, 679 | EPRINT = {http://math.stackexchange.com/q/357673}, 680 | URL = {http://math.stackexchange.com/q/357673} 681 | } 682 | 683 | @misc{ wiki:cyclicpermutation, 684 | author = "Wikipedia", 685 | title = "Cyclic permutation --- Wikipedia{,} The Free Encyclopedia", 686 | year = "2016", 687 | url = "https://en.wikipedia.org/w/index.php?title=Cyclic_permutation&oldid=755419947", 688 | note = "[Online; accessed 6-March-2017]" 689 | } 690 | 691 | @misc{ wiki:cyclicmodule, 692 | author = "Wikipedia", 693 | title = "Cyclic module --- Wikipedia{,} The Free Encyclopedia", 694 | year = "2016", 695 | url = "https://en.wikipedia.org/w/index.php?title=Cyclic_module&oldid=752351296", 696 | note = "[Online; accessed 13-March-2017]" 697 | } 698 | 699 | @misc{ groupwiki:generalaffinegroup, 700 | author = "Groupwiki", 701 | title = {"General affine group: $GA(1,5)$"}, 702 | year = "2017", 703 | url = "https://groupprops.subwiki.org/w/index.php?title=General_affine_group:GA(1,5)&oldid=45747", 704 | note = "[Online; accessed 15-March-2017]" 705 | } 706 | 707 | @misc{ groupwiki:s5structure, 708 | author = "Groupwiki", 709 | title = {"Subgroup structure of symmetric group:$S_5$"}, 710 | year = "2017", 711 | url = "https://groupprops.subwiki.org/w/index.php?title=Subgroup_structure_of_symmetric_group:S5&oldid=49180", 712 | note = "[Online; accessed 15-March-2017]" 713 | } 714 | 715 | @book{bib:lang, 716 | author = {Serge Lang}, 717 | title = {Algebra}, 718 | publisher = {Springer Science and Business Media}, 719 | edition = {3}, 720 | year = {2002}, 721 | isbn = {978-1-4613-0041-0}, 722 | series = {Graduate Texts in Mathematics}, 723 | url = "https://books.google.ru/books?id=eOUlBQAAQBAJ" 724 | } 725 | 726 | @misc{ wiki:primeideal, 727 | author = "Wikipedia", 728 | title = "Prime ideal --- Wikipedia{,} The Free Encyclopedia", 729 | year = "2017", 730 | url = "https://en.wikipedia.org/w/index.php?title=Prime_ideal&oldid=763442154", 731 | note = "[Online; accessed 29-March-2017]" 732 | } 733 | 734 | @MISC {mathstackexchange:cyclicmodule, 735 | TITLE = {Isomorphism and cyclic modules}, 736 | AUTHOR = {Kyle Miller}, 737 | HOWPUBLISHED = {Mathematics Stack Exchange}, 738 | NOTE = {URL:http://math.stackexchange.com/q/1003598 (version: 2014-11-03)}, 739 | EPRINT = {http://math.stackexchange.com/q/1003598}, 740 | URL = {http://math.stackexchange.com/q/1003598} 741 | } 742 | 743 | @misc{ wiki:dualbasis, 744 | author = "Wikipedia", 745 | title = "Dual basis --- Wikipedia{,} The Free Encyclopedia", 746 | year = "2016", 747 | url = "https://en.wikipedia.org/w/index.php?title=Dual_basis&oldid=748729591", 748 | note = "[Online; accessed 1-April-2017]" 749 | } 750 | 751 | @misc{ wiki:adjugatematrix, 752 | author = "Wikipedia", 753 | title = "Adjugate matrix --- Wikipedia{,} The Free Encyclopedia", 754 | year = "2017", 755 | url = "https://en.wikipedia.org/w/index.php?title=Adjugate_matrix&oldid=765833302", 756 | note = "[Online; accessed 3-April-2017]" 757 | } 758 | 759 | @MISC {mathstackexchange:tensorproduct, 760 | TITLE = {Tensor product of Galois extension and algebraic closure}, 761 | AUTHOR = {Starfall (http://math.stackexchange.com/users/326053/starfall)}, 762 | HOWPUBLISHED = {Mathematics Stack Exchange}, 763 | NOTE = {URL:http://math.stackexchange.com/q/2217402 (version: 2017-04-04)}, 764 | EPRINT = {http://math.stackexchange.com/q/2217402}, 765 | URL = {http://math.stackexchange.com/q/2217402} 766 | } 767 | 768 | @misc{ wiki:disjointunion, 769 | author = "Wikipedia", 770 | title = "Disjoint union --- Wikipedia{,} The Free Encyclopedia", 771 | year = "2017", 772 | url = "https://en.wikipedia.org/w/index.php?title=Disjoint_union&oldid=774047863", 773 | note = "[Online; accessed 13-April-2017]" 774 | } 775 | 776 | @MISC {mathstackexchange:cyclicgroupssubgroup, 777 | TITLE = {Subgroups of a cyclic group and their order.}, 778 | AUTHOR = {user58289}, 779 | HOWPUBLISHED = {Mathematics Stack Exchange}, 780 | NOTE = {URL:https://math.stackexchange.com/q/410389 (version: 2013-07-27)}, 781 | EPRINT = {https://math.stackexchange.com/q/410389}, 782 | URL = {https://math.stackexchange.com/q/410389} 783 | } 784 | 785 | @MISC {url:gap, 786 | TITLE = {GAP - Groups, Algorithms, Programming - 787 | a System for Computational Discrete Algebra}, 788 | URL = {https://www.gap-system.org/} 789 | } 790 | 791 | @article{bib:gap, 792 | title = {GAP - Reference Manual}, 793 | url = {https://www.gap-system.org/Manuals/doc/ref/chap0.html} 794 | } 795 | 796 | @misc{ proofwiki:fieldhomomorphism, 797 | author = "ProofWiki", 798 | title = "Definition: Field Homomorphism", 799 | year = "2017", 800 | url = "https://proofwiki.org/w/index.php?title=Definition:Field_Homomorphism&oldid=283682", 801 | note = "[Online; accessed 18-June-2017]" 802 | } 803 | 804 | @book{bib:baker, 805 | author = {Andrew Baker}, 806 | title = {An introduction to Galois theory}, 807 | year = {2013}, 808 | url = "http://www.maths.gla.ac.uk/~ajb" 809 | } 810 | --------------------------------------------------------------------------------