% This file: (find-LATEX "2019J-ops-categories.tex")
%       See: (find-LATEX "2020J-ops-new.tex")
% (defun c () (interactive) (find-LATEXsh "lualatex -record 2019J-ops-categories.tex" :end))
% (defun d () (interactive) (find-pdf-page "~/LATEX/2019J-ops-categories.pdf"))
% (defun e () (interactive) (find-LATEX "2019J-ops-categories.tex"))
% (defun u () (interactive) (find-latex-upload-links "2019J-ops-categories"))
% (find-pdf-page   "~/LATEX/2019J-ops-categories.pdf")
% (find-sh0 "cp -v  ~/LATEX/2019J-ops-categories.pdf /tmp/")
% (find-sh0 "cp -v  ~/LATEX/2019J-ops-categories.pdf /tmp/pen/")
%   file:///home/edrx/LATEX/2019J-ops-categories.pdf
%               file:///tmp/2019J-ops-categories.pdf
%           file:///tmp/pen/2019J-ops-categories.pdf
% http://angg.twu.net/LATEX/2019J-ops-categories.pdf
% (find-LATEX "2019.mk")

% «.classifier-intro»		(to "classifier-intro")
% «.classifier-big-figure-defs»	(to "classifier-big-figure-defs")
% «.classifier-big-figure»	(to "classifier-big-figure")
% «.Set-PA»			(to "Set-PA")
% «.Set-PA-logic»		(to "Set-PA-logic")
% «.Set-PA-morphisms»		(to "Set-PA-morphisms")


\directlua{tf_push("2019J-ops-categories.tex")}

\def\dnto{{\downarrow}}
\def\sfJ{\mathsf{J}}



%   ____      _       
%  / ___|__ _| |_ ___ 
% | |   / _` | __/ __|
% | |__| (_| | |_\__ \
%  \____\__,_|\__|___/
%                     
% «classifier-intro»  (to ".classifier-intro")
% (jonp 26 "classifier-intro")
% (joe     "classifier-intro")

\section{Categories, toposes, sheaves}

In this section I will explain {\sl very, very briefly} how to adapt
what we saw about J-operators to toposes. The first big diagram that
we will try to understand is the in one in
Figure \ref{fig:classifier-big} below, that shows in its upper part a
structure $((P,A),Q) \squigbij (H,J)$ with a 2CG with question marks
and its associated ZHA with J-operator, and in its lower part the
classifier $Ω$ of the topos $\Set^{(P,A)}$ and the local operator
$j:Ω→Ω$ that is associated to $Q$ and $J$. This big diagram shows how
to define the classifier and the local operator, and in
sec.\ref{kan-extensions} we will see another big diagram that shows
how to define sheaves and sheafification.

I will omit some technical details --- a very readable reference for
them is \cite{McLarty}, chapters 13 and 22. I learned most of them
from \cite{BellLST}, though.

\newpage

% (find-books "__cats/__cats.el" "mclarty")
% (find-books "__cats/__cats.el" "bell")


% As in sec.\ref{qms-and-slashings}, this ``associated to'' in a sense
% that will be explained soon.

% (jopp 2 "qms-and-slashings")
% (jos    "qms-and-slashings")

% \bsk

% «classifier-big-figure-defs»  (to ".classifier-big-figure-defs")
% (jonp 27 "classifier-big-figure-defs")
% (joe     "classifier-big-figure-defs")
% From:
% (clap 1 "PAQ-HJ-Om-j-big-figure")
% (cla    "PAQ-HJ-Om-j-big-figure")

% (elzp 15 "classifier")
% (elz     "classifier")
% (find-dn6 "zhas.lua" "MixedPicture-cuts" "addcutssub =")
% (find-dn6 "zhas.lua" "MixedPicture-zha" "zhalrf0 =")

%L -- Define the components of the
%L -- internal views of Om and j.
%L
%L myspec = "1232RL1"
%L mycuts = "c 32/10 012|3"
%L mytop  = v"35"
%L lr_to_lr_or_dot = "lr -> lr:below(mytop) and lr:lr() or '..'"
%L 
%L foo_Om = function (top, opts)
%L     mytop = v(top)           -- set global var
%L     mpnew(opts, myspec):zhalrf0(lr_to_lr_or_dot)
%L                        :print():output()
%L   end
%L foo_j = function (top, opts)
%L     mytop = v(top)           -- set global var
%L     mpnew(opts, myspec):addcutssub(mytop, mycuts)
%L                        :zhalrf0(lr_to_lr_or_dot)
%L                        :print():output()
%L   end
%L
%L foo_j("32", {zdef="j.3_"});     foo_j("13", {zdef="j._3"})
%L foo_j("20", {zdef="j.2_"});     foo_j("02", {zdef="j._2"})
%L foo_j("10", {zdef="j.1_"});     foo_j("01", {zdef="j._1"})
%L 
%L foo_Om("32", {zdef="Om.3_"});   foo_Om("13", {zdef="Om._3"})
%L foo_Om("20", {zdef="Om.2_"});   foo_Om("02", {zdef="Om._2"})
%L foo_Om("10", {zdef="Om.1_"});   foo_Om("01", {zdef="Om._1"})
%L 
%L -- Bonus: define the ZHA with cuts (H,J)
%L -- that generates our 2CGQ ((P,A),Q), the topos
%L -- Set^{(P,A)}, and the modality j on it.
%L --
%L foo_j("33", {zdef="H,J 33"})
%L 
%L -- ...and its version without cuts:
%L mpnew({zdef="H 33"}, myspec):addlrs():print():output()
%L 
%L 
%L -- Define our TCGs.
%L -- \tcg{(P,A),Q} is small,
%L -- \tcg{Om} and \tcg{j} are very big.
%L -- See: (find-dednat6 "extra-modules.tex" "TCGs" "dimension parameters")
%L
%L tdims_mini = TCGDims {h=30,  v=25,  q=15, crh=12, crv=7, qrh=5}
%L tdims_mini = TCGDims {h=35,  v=25,  q=15, crh=12, crv=7, qrh=5}
%L tdims_mini = TCGDims {h=35,  v=25,  q=15, crh=10, crv=7, qrh=5}
%L tdims_mini = TCGDims {h=32,  v=25,  q=15, crh=9,  crv=7, qrh=5}
%L tdims_mini = TCGDims {h=32,  v=25,  q=15, crh=8,  crv=7, qrh=5}
%L tdims_big  = TCGDims {h=110, v=110,       crh=30, crv=45}
%L tspec_mini = TCGSpec.new("33; 32, 13", "?.?", "??.")
%L tspec_big  = TCGSpec.new("33; 32, 13")
%L tcg_PA     = TCGQ.newdsoa(tdims_mini, tspec_big,
%L                           {tdef="(P,A) 33", meta="1pt p"},
%L                               "     h v p lr q"
%L                            -- "B QB h v p lr q"
%L                          )
%L tcg_PAQ    = TCGQ.newdsoa(tdims_mini, tspec_mini,
%L                           {tdef="(P,A),Q 33", meta="1pt p"},
%L                               "     h v p lr q"
%L                            -- "B QB h v p lr q"
%L                          )
%L tcg_j      = TCGQ.newdsoa(tdims_big, tspec_big,
%L                           {tdef="j", meta="1pt p"},
%L                           -- "B h v p"
%L                              "h v p"
%L                          )
%L tcg_Om     = TCGQ.newdsoa(tdims_big, tspec_big,
%L                           {tdef="Om", meta="1pt p"},
%L                           -- "B h v p"
%L                              "h v p"
%L                          )
%L
%L -- Like :lrs(), but by hand.
%L -- See: (find-dednat6 "dednat6/tcgs.lua" "TCGQ" "lrs =")
%L
%L tcg_Om:Lput(3, "\\zha{Om.3_}");  tcg_Om:Rput(3, "\\zha{Om._3}")
%L tcg_Om:Lput(2, "\\zha{Om.2_}");  tcg_Om:Rput(2, "\\zha{Om._2}")
%L tcg_Om:Lput(1, "\\zha{Om.1_}");  tcg_Om:Rput(1, "\\zha{Om._1}")
%L
%L tcg_j:Lput(3, "\\zha{j.3_}");    tcg_j:Rput(3, "\\zha{j._3}")
%L tcg_j:Lput(2, "\\zha{j.2_}");    tcg_j:Rput(2, "\\zha{j._2}")
%L tcg_j:Lput(1, "\\zha{j.1_}");    tcg_j:Rput(1, "\\zha{j._1}")
%L
%L tcg_j:output()
%L tcg_Om:output()
%L tcg_PAQ:output()
%L tcg_PA:output()
%
%
%
% «classifier-big-figure»  (to ".classifier-big-figure")
% (jonp 27 "classifier-big-figure")
% (joe     "classifier-big-figure")
%
\pu
\begin{figure}[h]
  $ % \hspace{-40pt}
  \begin{array}{ccc}
  ((P,A),Q) = \tcg{(P,A),Q 33}
    & 
    & (H,J) = \zha{H,J 33}
    \\ \\
  Ω = \scalebox{0.9}{$\tcg{Om}$} &
    &
    j = \scalebox{0.9}{$\tcg{j}$} \\
    \\
  \end{array}
  $
  \caption{The classifier and a local operator in a particular case}
  \label{fig:classifier-big}
\end{figure}



\newpage

%  ____       _     /\    ______     _  __  
% / ___|  ___| |_  |/\|  / /  _ \   / \ \ \ 
% \___ \ / _ \ __|      | || |_) | / _ \ | |
%  ___) |  __/ |_       | ||  __/ / ___ \| |
% |____/ \___|\__|      | ||_| ( )_/   \_\ |
%                        \_\   |/       /_/ 
%
% «Set-PA»  (to ".Set-PA")
% (jonp 28 "Set-PA")
% (joe     "Set-PA")

\subsection{Toposes of the form $\Set^{(P,A)}$}
\label{Set-PA}

%L kite  = ".1.|2.3|.4.|.5."
%L six   = ".1..|2.3.|.4.5|..6."
%L mp = MixedPicture.new({def="dagKite", meta="s", scale="5pt"}, z):zfunction(kite):output()
%L mp = MixedPicture.new({def="dagSix",  meta="s", scale="4.5pt"}, z):zfunction(six):output()
\pu

In sec.2 of \cite{OchsPH1} we established that the same bullet diagram
--- say, $\dagKite{•}{•}{•}{•}{•}$ --- could be intepreted as subset
of $\Z^2$, as a DAG, or as poset, depending on the context. Now we
will do something similar for graphs whose nodes are labeled. A
diagram like this
%
% (vgsp 14 "first-gm")
% (vgs     "first-gm")
%
%L sesw = {[" w"]="↙",  [" e"]="↘"}
%
%R local B, F, RG = 3/       1             \, 3/      F_1            \, 3/      !Gt            \
%R                   |    w     e          |   |    w     e          |   |    w     e          |
%R                   | 2           3       |   |F_2         F_3      |   |G_2         G_3      |
%R                   |    e     w     e    |   |    e     w     e    |   |    e     w     e    |
%R                   |       4           5 |   |      F_4         F_5|   |      G_4         G_5|
%R                   |          e     w    |   |          e     w    |   |          e     w    |
%R                   \             6       /   \            F_6      /   \             1       /
%R
%R local A, G, LF = 3/ 2           3       \, 3/G_2         G_3      \, 3/F_2         F_3      \
%R                   |    e     w     e    |   |    e     w     e    |   |    e     w     e    |
%R                   \       4           5 /   \      G_4         G_5/   \      F_4         F_5/
%R
%R B :tozmp({zdef="pB",  scale="7pt", meta="s p"}):addcells(sesw):output()
%R F :tozmp({zdef="pF",  scale="7pt", meta="s p"}):addcells(sesw):output()
%R RG:tozmp({zdef="pRG", scale="7pt", meta="s p"}):addcells(sesw):output()
%R A :tozmp({zdef="pA",  scale="7pt", meta="s p"}):addcells(sesw):output()
%R G :tozmp({zdef="pG",  scale="7pt", meta="s p"}):addcells(sesw):output()
%R LF:tozmp({zdef="pLF", scale="7pt", meta="s p"}):addcells(sesw):output()
%R
%R B :tozmp({zdef="pB0", scale="10pt", meta="  "}):addcells(sesw):output()
%R F :tozmp({zdef="pF0", scale="10pt", meta="  "}):addcells(sesw):output()
%R
%R local Bargs = 3/      #1             \
%R                |    w     e          |
%R                |#2          #3       |
%R                |    e     w     e    |
%R                |      #4          #5 |
%R                |          e     w    |
%R                \            #6       /
%R
%R Bargs:tozmp({def="pBargs#1#2#3#4#5#6", scale="11pt", meta="p"}):addcells(sesw):output()
%
\pu
$$\zha{pB0}
$$
%
is interpreted as a DAG by default, but in this section it will be
also be interpreted as a (posetal) category in some contexts. We will
keep the same notation: if $(P,A)$ is a DAG then we will denote
$(P,A)$ ``regarded as a category'' by $(P,A)$.

A functor $F$ from a category $(P,A)$ to $\Set$ can be drawn as a
diagram with the same shape as $(P,A)$. If we draw the internal view
of $F:(P,A)→\Set$ over its internal view as in the introduction
of \cite{OchsPH1} we get this diagram:
%
%D diagram F6-int-ext
%D 2Dx     100    +75
%D 2D  100 I1 --> I2
%D 2D
%D 2D  +40 E1 --> E2
%D 2D
%D ren I1 I2 ==> \left(\zha{pB0}\right) \left(\zha{pF0}\right)
%D ren E1 E2 ==> (P,A)    \Set
%D
%D (( I1 I2 |->
%D    E1 E2  -> .plabel= a F
%D
%D ))
%D enddiagram
%D
$$\pu
  \diag{F6-int-ext}
$$
%
The `$\diagxyto/|->/$' in it stands for a bunch of
`$\diagxyto/|->/$'s, one for each object and one for each morphism.

We will only draw the upper-right part of diagrams like the one above.
With this convention, an object $F∈\Set^{(P,A)}$ can be drawn as:
%
$$
  F \;\; = \;\; \pBargs{F_1}{F_2}{F_3}{F_4}{F_5}{F_6}
$$

% (elep 6 "elephant-A2.1.3")
% (ele    "elephant-A2.1.3")

Every category of the form $\Set^{(P,A)}$ where $(P,A)$ is a finite
graph is a topos --- see \cite{EA}, example A2.1.3 --- so categories
of the form $\Set^{(P,A)}$ are toposes whose objects can be drawn as
$(P,A)$-shaped diagrams.



%  ____       _     /\    ______     _  __    _             _      
% / ___|  ___| |_  |/\|  / /  _ \   / \ \ \  | | ___   __ _(_) ___ 
% \___ \ / _ \ __|      | || |_) | / _ \ | | | |/ _ \ / _` | |/ __|
%  ___) |  __/ |_       | ||  __/ / ___ \| | | | (_) | (_| | | (__ 
% |____/ \___|\__|      | ||_| ( )_/   \_\ | |_|\___/ \__, |_|\___|
%                        \_\   |/       /_/           |___/        
%
% «Set-PA-logic»  (to ".Set-PA-logic")
% (jonp 29 "Set-PA-logic")
% (joe     "Set-PA-logic")

\subsection{The logic of toposes of the form $\Set^{(P,A)}$}

%L -- Define the components of the
%L -- internal views of Om and j.
%L
%L myspec = "1232RL1"
%L tdims_mini = TCGDims {h=32,  v=25,  q=15, crh=8,  crv=7, qrh=5}
%L tdims_big  = TCGDims {h=110, v=110,       crh=30, crv=45}
%L tspec_PAQ  = TCGSpec.new("33; 32, 13", "?.?", "??.")
%L tspec_PA   = TCGSpec.new("33; 32, 13")
%L tcg_PAQ    = TCGQ.newdsoa(tdims_mini, tspec_mini,
%L                           {tdef="(P,A),Q", meta="1pt p"},
%L                               "     h v p lr q"
%L                            -- "B QB h v p lr q"
%L                          )
%L tcg_j      = TCGQ.newdsoa(tdims_big, tspec_big,
%L                           {tdef="j", meta="1pt p"},
%L                           -- "B h v p"
%L                              "h v p"
%L                          )
%L tcg_Om     = TCGQ.newdsoa(tdims_big, tspec_big,
%L                           {tdef="Om", meta="1pt p"},
%L                           -- "B h v p"
%L                              "h v p"
%L                          )


The terminal object $1∈\Set^{(P,A)}$ is:
%
$$\def\u{\{*\}}
  1 \;\; = \;\; \pBargs{\u}{\u}{\u}{\u}{\u}{\u}
$$
%
and we can obtain all its subobjects by replacing some of the
`$\{*\}$'s in it by empty sets. If we rewrite each $\{*\}$ as 1 and
each $∅$ as 0 and use a more compact notation, then $1
= \dagSix111111$ and:
%
% (ph1p 25 "topologies-on-ZSets")
% (ph1     "topologies-on-ZSets")
%
$$\Sub(1) = \left\{
  \dagSix000000,
  \dagSix000001,
  \dagSix000011,
  \dagSix000101,
  \dagSix000111,
  \dagSix001111,
  \dagSix010101,
  \dagSix010111,
  \dagSix011111,
  \dagSix111111
  \right\}
$$
%
The Heyting Algebra of subobjects of 1 when $(P,A)
= \dagSix{•}{•}{•}{•}{•}{•}$ is essentially the same as the order
topology $\Opens_A(P)$ that we saw in sec.12 of \cite{OchsPH1}! This
holds for all graphs, and when $(P,A)$ is a 2CG --- for example, when
%
$$ (P,A) \;\; = \;\; \tcg{(P,A) 33} $$
%
we can abbreviate the result further using the ideas is sec.15
of \cite{OchsPH1}:
%
% (ph1p 28 "topologies-on-2CGs")
% (ph1     "topologies-on-2CGs")
%
$$ \Sub(1)
   \;\; = \;\;
   \Opens \tcg{(P,A) 33}
   \;\; = \;\;
   \zha{H 33}
$$

So: the ``logic'' of a topos of the form $\Set^{(P,A)}$ --- i.e., its
Heyting Algebra of subobjects of the terminal --- is exactly the
topology $\Opens_A(P)$.



\newpage

%  ____       _     /\    ______     _  __                         _         
% / ___|  ___| |_  |/\|  / /  _ \   / \ \ \   _ __ ___  _ __ _ __ | |__  ___ 
% \___ \ / _ \ __|      | || |_) | / _ \ | | | '_ ` _ \| '__| '_ \| '_ \/ __|
%  ___) |  __/ |_       | ||  __/ / ___ \| | | | | | | | |  | |_) | | | \__ \
% |____/ \___|\__|      | ||_| ( )_/   \_\ | |_| |_| |_|_|  | .__/|_| |_|___/
%                        \_\   |/       /_/                 |_|              
%
% «Set-PA-morphisms»  (to ".Set-PA-morphisms")
% (jonp 30 "Set-PA-morphisms")
% (joe     "Set-PA-morphisms")
% \subsection{Morphisms in a topos $\Set^{(P,A)}$}
\subsection{Morphisms as natural transformations}

If $F$ and $G$ are objects of a category $\Set^\catA$ and $T:F→G$ is a
morphism between them then $F$ and $G$ are functors and $T:F→G$ is a
natural transformation, and T has to obey a ``naturalness condition''
that says that for every morphism $v:B→C$ in $\catA$ a certain
``obvious'' square must commute. We can draw that condition as the
commutativity of the middle square below,
%
%D diagram sqcond-1
%D 2Dx     100 +30   +30  +30    +45
%D 2D  100 B   FB -> GB   x |--> rx
%D 2D      |   |     |    -      -
%D 2D      |   |     |    |      v
%D 2D  +22 v   v     v    v      drx
%D 2D  +8  C   FC -> GC   dx |-> rdx
%D 2D
%D 2D  +20     F --> G
%D 2D
%D ren rx drx ==> (TB)(x) (Gv∘TB)(x)
%D ren dx rdx ==> (Fv)(x) (TC∘Fv)(x)
%D
%D (( B C -> .plabel= l v
%D    F G -> .plabel= a T
%D
%D    FB GB -> .plabel= a TB
%D    FB FC -> .plabel= l Fv
%D    GB GC -> .plabel= r Gv
%D    FC GC -> .plabel= a TC
%D
%D    x rx |-> rx drx |->
%D    x dx |-> dx rdx |->
%D ))
%D enddiagram
%D
$$\pu
  \diag{sqcond-1}
$$
%
and as the domain of $F$ and $G$ is $\Set$ we can express that
naturality as
%
$$∀(v:B→C). \, ∀x∈FB. \, (Gv∘TB)(x) = (TC∘Fv)(x)$$
%
and represent that as the square at the right above.

\msk

We will often draw these morphisms/natural transformations like this,
%
$$\pBargs{F_1}{F_2}{F_3}{F_4}{F_5}{F_6}
  \diagxyto/->/<250>^{T}
  \pBargs{F_1}{F_2}{F_3}{F_4}{F_5}{F_6}
$$
%
leaving the category $\catA$ implicit. The `$\diagxyto/->/^{T}$' is a
pack of six functions between sets, $T_1:F_1→G_1$, $\ldots$,
$T_6:F_6→G_6$ --- compare with the meaning of the `$\diagxyto/|->/$'
in sec.\ref{Set-PA}.

\msk

The definition of the local operator $j:Ω→Ω$ in
Figure \ref{fig:classifier-big} is a natural transformation written in
a very compact form. In that example $j_{3▁}(21) = 32$.


\directlua{tf_pop()}



% Local Variables:
% coding: utf-8-unix
% ee-tla: "joe"
% End:
