A relationship between trees and Kelly-Mac Lane graphs
Eugenia Cheng
Department of Pure Mathematics
We give a precise description of combed trees in terms of Kelly-Mac~Lane graphs. We show that any combed tree is uniquely expressed as an allowable Kelly-Mac~Lane graph of a certain shape. Conversely, we show that any such Kelly-Mac~Lane graph uniquely defines a combed tree.
macros1.tex

\input{diagrams}

\newcommand{\op}{\ensuremath{\mbox{\hspace{1pt}{\scriptsize op}}}}
\newcommand{\set}{\ensuremath{\mbox{\bfseries Set}}}
\newcommand{\Set}{\ensuremath{\mbox{\bfseries Set}}}
\newcommand{\cat}[1]{\ensuremath{\mbox{\bfseries {\upshape {#1}}}}}
\newcommand{\free}[1]{\ensuremath{{\mathcal F} \hspace{-1.5pt}
    {#1}^{\op}}}
\newcommand{\freee}[1]{\ensuremath{{\mathcal F} \hspace{-1.5pt}
    {#1}}}
\newcommand{\elt}[1]{\ensuremath{\mbox{\upshape elt} \hspace{1pt} {#1}}}
\newcommand{\sfree}[1]{\ensuremath{{\mathcal F} \hspace{-1.5pt}
    {#1}^{\mbox{\hspace{1pt}{\tiny op}}}}}
\newcommand{\cl}[1]{\ensuremath{\mathcal {#1}}}
\newcommand{\bb}[1]{\ensuremath{\mathbb {#1}}}

\newcommand{\xxx}{\ensuremath{
    \mbox{elt}\hspace{1pt}Q \times_{{\mathcal
    F}\hspace{-1pt}S^{\mbox{{\tiny op}}}}{\mathcal
    F}\hspace{-1pt}X^{\mbox{{\scriptsize op}}}}}

\newcommand{\xx}[3]{\ensuremath{
\mbox{elt}\hspace{1pt}{#1} \times_{{\mathcal
F}\hspace{-1pt}{#2}^{\mbox{{\tiny op}}}}{\mathcal
F}\hspace{-1pt}{#3}^{\mbox{{\scriptsize op}}}}}

\newcommand{\xv}[1]{\ensuremath{{#1}_1,\ldots,{#1}_n}}
\newcommand{\xvr}[2]{\ensuremath{{#1}_1,\ldots,{#1}_{#2}}}
\newcommand{\pr}{{\bfseries Proof.  }}
\newcommand{\kml}{Kelly-Mac~Lane }

\newcommand{\vect}[3]{\renewcommand{\arraystretch}{0.5}\ensuremath{
    \left(\begin{array}{@{} c @{\hspace{0pt}}l @{}} {#1} \\
    \downarrow & {#2} \\ {#3} \end{array}\right)}}

\newcommand{\tomspan}[8]
{\begin{picture}(80,50)      %
\put(8,10){${#2}\vect{#3}{#4}{#1}$}  %  bottom left
\put(29.5,35){$\vect{#5}{#6}{#1}$}  %  top
\put(47,10){$\vect{#3}{#4}{#1}$}  %  bottom right

\put(29,35){\vector(-2,-3){10}}  %
\put(40,35){\vector(2,-3){10}}  %
\put(24,30){\makebox(0,0)[r]{${#7}$}} %  left
\put(45,30){\makebox(0,0)[l]{${#8}$}}%  right

\end{picture}}


\newcommand{\tensordot}{\ensuremath{\otimes \cdots \otimes}}




\newcommand{\lra}{\ensuremath{\longrightarrow}}
\newcommand{\map}[1]{\ensuremath{\stackrel{{#1}}{\lra}}}
\newcommand{\simarr}{\ensuremath{\stackrel{\sim}{\longrightarrow}}}
\newcommand{\sm}{symmetric multicategory{}}
\newcommand{\sms}{symmetric multicategories{}}
\newcommand{\topd}{$(\cl{E},T)$-operad}
\newcommand{\tmcat}{$(\cl{E},T)$-multicategory}
\newcommand{\tmcats}{$(\cl{E},T)$-multicategories{}}
\newcommand{\tqopd}{$(\cl{E}_Q,T_Q)$-operad}
\newcommand{\tqmcat}{$(\cl{E}_Q,T_Q)$-multicategory}
\newcommand{\Topd}{\ensuremath{(\cl{E}, T)\mbox{-\cat{Operad}}}}
\newcommand{\Tmcat}{\ensuremath{(\cl{E},
    T)\mbox{-\cat{Multicat}}}}
\newcommand{\Tqopd}{\ensuremath{(\cl{E}_Q,
    T_Q)\mbox{-\cat{Operad}}}}
\newcommand{\Tqmcat}{\ensuremath{(\cl{E}_Q,
    T_Q)\mbox{-\cat{Multicat}}}}
\newcommand{\st}{\ensuremath{(\cl{E},T)}}
\newcommand{\mcat}{multicategory }
\newcommand{\mcats}{multicategories }
\newcommand{\sqtq}{\ensuremath{(\cl{E}_Q, T_Q){}}}
\newcommand{\monic}{\ensuremath{\succ \hspace{-3pt}
    \longrightarrow}}
\newcommand{\tqplus}{\ensuremath{(\cl{E}_{Q^+},T_{Q^+})}}
\newcommand{\tqprime}{\ensuremath{({\cl{E}_Q}', {T_Q}')}}
\newcommand{\tpr}{\ensuremath{{T_Q}'}}
\newcommand{\tpl}{\ensuremath{T_{Q^+}}}
\newcommand{\cspl}{\ensuremath{\cl{E}_{Q^+}}}
\newcommand{\cspr}{\ensuremath{{\cl{E}_Q}'}}
\newcommand{\spl}{\ensuremath{S_{Q^+}}}
\newcommand{\spr}{\ensuremath{{S_Q}'}}
\newcommand{\iso}{isomorphism{}}
\newcommand{\uto}{up to isomorphism{}}
\newcommand{\tck}{\ensuremath{T(C^{(k)})}}
\newcommand{\catck}{\ensuremath{\bb{C}^{(k)}}}
\newcommand{\ck}{\ensuremath{C^{(k)}}}
\newcommand{\id}{\ensuremath{\mbox{\em id}}}
\newcommand{\qeed}{\hfill $\Box$}

\newcommand{\nspan}[5]
{\setlength{\unitlength}{1mm}
\begin{center}
\begin{picture}(30,30)(15,15)      %
\put(17,23){\makebox(0,0)[t]{${#1}$}}  %  bottom left
\put(32,37){\makebox(0,0)[b]{${#3}$}}  %  top
\put(45,23){\makebox(0,0)[t]{${#5}$}}  %  bottom right

\put(29,35){\vector(-1,-1){10}}  %
\put(33,35){\vector(1,-1){10}}  %
\put(23,32){\makebox(0,0)[r]{${#2}$}} %  left
\put(39,32){\makebox(0,0)[l]{${#4}$}}%  right

\end{picture}
\end{center}}

\newcommand{\ope}{\cat{Ope}}
\newcommand{\oset}{\cat{OSet}}
\newcommand{\pshf}[1]{\ensuremath{{#1}^{\op} \lra \cat{Set}}}
\newcommand{\pshfcat}[1]{\ensuremath{[{#1}^{\op},\cat{Set}]}}
\newcommand{\lope}[1]{\ensuremath{\cat{LOpe}_{#1}}}


\newcommand{\bpoint}[1]{
\begin{itemize}
\item {#1}	
\end{itemize}}

\newcommand{\bs}{\ensuremath{\backslash}}
macros2.tex



\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{definitions}[theorem]{Definitions}
\newtheorem{example}[theorem]{Example}
\newtheorem{examples}[theorem]{Examples}
\newtheorem{remarks}[theorem]{Remarks}

\newenvironment{prf}{\vspace{2ex}\begin{sloppypar}{\noindent\upshape
{\bfseries Proof. }}} {{\hspace*{\fill}
$\Box$}\end{sloppypar}\vspace{2ex}}

\newenvironment{prfof}[1]{\vspace{2ex}\begin{sloppypar}{\noindent
\upshape{\bfseries Proof of {#1}. }}} {{\hspace*{\fill}
$\Box$}\end{sloppypar}\vspace{2ex}}


\newcommand{\numroman}{\renewcommand{\labelenumi}{\roman{enumi})}}
\newcommand{\numarabic}{\renewcommand{\labelenumi}{\arabic{enumi})}}
\newcommand{\numAlph}{\renewcommand{\labelenumi}{\Alph{enumi}.}}
\newcommand{\pica}{\begin{center} \input}
\newcommand{\picz}{\end{center}}
\newcommand{\length}[1]{\setlength{\unitlength}{#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%



%\renewcommand{\labelenumi}{\roman{enumi})}

\newcommand{\bibref}{\renewcommand{\bibname}{References}}		% don't need if we're in article
\newcommand{\mybibstyle}{\bibliographystyle{alphanum}}

\newlength{\leng}
\newlength{\fontleng}
\newcommand{\sunit}{\setlength{\unitlength}{1mm}}
\newcommand{\setleng}[1]{\setlength{\leng}{#1}
    \setlength{\unitlength}{\leng}}
\newcommand{\setunit}[1]{\setlength{\unitlength}{#1}}

opics.tex

%This file contains commands for opic diags
%must be used in picture environment
%xcoord, ycoord, length measurement including mm


\newcommand{\gridit}{
\put(0,0){*} \put(0,10){*} \put(10,0){*}}

%%%%%%%%%%%%%a

\newcommand{\diaga}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{1.3\leng} %

\put(1,2){\line(1,0){5}} %
\put(1,3){\line(1,0){5}} %
\put(1,4){\line(1,0){5}} %
\put(1,5){\line(1,0){5}} %
\put(1,6){\line(1,0){5}} %
\put(4,0){\line(1,1){4}} %
\put(4,8){\line(1,-1){4}} }}



%%%%%%%%%%%%%b

\newcommand{\diagb}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{1.3\leng} %

\put(3,1){\line(0,1){5}} %
\put(4,1){\line(0,1){5}} %
\put(5,1){\line(0,1){5}} %
\put(6,1){\line(0,1){5}} %
\put(7,1){\line(0,1){5}} %
\put(1,4){\line(1,1){4}} %
\put(5,8){\line(1,-1){4}}}}

%%%%%%%%%%%%%c

\newcommand{\diagc}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(1,2){\line(1,0){5}} %
\put(1,3){\line(1,0){5}} %
\put(1,4){\line(1,0){5}} %
\put(1,1){\line(1,0){5}} %
\put(3.5,-1.5){\line(1,1){4}} %
\put(3.5,6.5){\line(1,-1){4}}}}

%%%%%%%%%%%%%%%%d

\newcommand{\diagd}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{0.7\leng} %

\put(0,6){\line(1,-2){3}} %
\put(2,7){\line(1,-2){3}} %
\put(4,8){\line(1,-2){3}} %
\put(6,9){\line(1,-2){3}} %
\put(0,0){\line(1,0){7}} %
\put(7,0){\line(2,3){4}}}}

%%%%%%%%%%%%%%%%e

\newcommand{\diage}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{0.7\leng} %

\put(0,-6){\line(1,2){3}} %
\put(2,-7){\line(1,2){3}} %
\put(4,-8){\line(1,2){3}} %
\put(6,-9){\line(1,2){3}} %
\put(0,0){\line(1,0){7}} %
\put(7,0){\line(2,-3){4}} }}

%%%%%%%%%%%%%%%%%f

\newcommand{\diagf}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}}}}


%%%%%%%%%%%%%%%%%g
\newcommand{\diagg}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(0,0)(2,1)(4,0) }}

%%%%%%%%%%%%%%%%%h

\newcommand{\diagh}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(0,0)(2,1)(4,0)   %
\qbezier(0,0)(2,2)(4,0) %
}}
%%%%%%%%%%%%%%%%%i

\newcommand{\diagi}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(0,0)(2,1)(4,0)   %
\qbezier(0,0)(2,2)(4,0) %
\qbezier(0,0)(2,3)(4,0) %
}}

%%%%%%%%%%%%%%%%%j
\newcommand{\diagj}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\qbezier(0,0)(2,2)(4,0) }}

%%%%%%%%%%%%%%%%%k
\newcommand{\diagk}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\qbezier(0,0)(2,1)(4,0)   %
\qbezier(0,0)(2,2)(4,0) %
}}

%%%%%%%%%%%%%%%%%l
\newcommand{\diagl}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\qbezier(0,0)(2,1)(4,0)   %
\qbezier(0,0)(2,2)(4,0) %
\qbezier(0,0)(2,3)(4,0) %
}}

%%%%%%%%%%%%%%%%%m
\newcommand{\diagm}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(2,3)(4,2)(4,0)}}



%%%%%%%%%%%%%%%%%n
\newcommand{\diagn}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(2,3)(4,2)(4,0)  %
\qbezier(2,3)(4.9,2.6)(4,0)  }}

%%%%%%%%%%%%%%%%%o
\newcommand{\diago}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(2,3)(4,2)(4,0)  %
\qbezier(2,3)(4.9,2.6)(4,0)  %
\qbezier(2,3)(5.6,3.4)(4,0)}}

%%%%%%%%%%%%%%%%%p

\newcommand{\diagp}[3]{

\put(#1,#2){

\setlength{\unitlength}{#3}  %
\fontsize{#3}{20}

\put(0,0){\makebox(0,0){$\equiv$}}  %
\put(0.35,0){\makebox(0,0){$\rangle$}}}}

%%%%%%%%%%%%%%%%%q

\newcommand{\diagq}[3]{

\put(#1,#2){

\setlength{\unitlength}{#3}  %

\qbezier(0.5,0)(2.5,0.5)(3,4)   %
\put(3,4){\makebox(0,0)[bc]{{\tiny $\Delta$}}} }}


%%%%%%%%%%%%%%%%%r
\newcommand{\diagr}[3]{

\put(#1,#2){\setlength{\leng}{#3}

\setlength{\unitlength}{1.4\leng}

\qbezier(0.5,0)(2.5,1)(3,4)   %
\put(0.5,-0){\makebox(0,0)[c]{{\tiny $\Delta$}}} }}

%%%%%%%%%%%%%%%%%%s

\newcommand{\diags}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagj{0}{0}{2\leng}     %
\diagj{7}{0}{2\leng}        %
\diagp{5.5}{0.5}{3\leng}}}


%%%%%%%%%%%%%%%%%%t

\newcommand{\diagt}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagk{0}{0}{2\leng}       %
\diagj{7}{0}{2\leng}         %
\diagp{5.5}{0.5}{3\leng} }}

%%%%%%%%%%%%%%%%%%u

\newcommand{\diagu}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagl{0}{0}{2\leng}       %
\diagj{7}{0}{2\leng}         %
\diagp{5.5}{0.5}{3\leng} }}

%%%%%%%%%%%%%%%%%%v

\newcommand{\diagv}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagf{0}{0}{2\leng}       %
\diagf{7}{0}{2\leng}         %
\diagp{5.5}{1.5}{3\leng} }}

%%%%%%%%%%%%%%%%%%w

\newcommand{\diagw}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagm{0}{0}{2\leng}       %
\diagf{7}{0}{2\leng}         %
\diagp{5.5}{1.5}{3\leng} }}

%%%%%%%%%%%%%%%%%%x

\newcommand{\diagx}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diago{0}{0}{2\leng}       %
\diagf{7.3}{0}{2\leng}         %
\diagp{6}{1.5}{3\leng} }}

%%%%%%%%%%%%%%%%%%y

\newcommand{\diagy}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diago{0}{0}{2\leng}       %
\diagf{7.4}{0}{2\leng}         %
\diagp{6.4}{1.5}{3\leng} }}


%%%%%%%%%%%%%%%%%%z

\newcommand{\diagz}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagg{0}{0}{2\leng}       %
\diagf{7}{0}{2\leng}         %
\diagp{5.5}{1.5}{3\leng} }}

%%%%%%%%%%%%%%%%%aa

\newcommand{\diagaa}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagh{0}{0}{2\leng}       %
\diagf{7}{0}{2\leng}         %
\diagp{5.5}{1.5}{3\leng} }}


%%%%%%%%%%%%%%%%%%ab

\newcommand{\diagab}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagi{0}{0}{2\leng}       %
\diagf{7}{0}{2\leng}         %
\diagp{5.5}{1.5}{3\leng} }}


%%%%%%%%%%%%%%%%%%%%ad

\newcommand{\diagad}[3]{

\put(#1,#2){

\setlength{\unitlength}{#3}  %

\qbezier(0.5,0)(2.5,-0.5)(3,-4)   %
\put(3,-4){\makebox(0,0)[t]{{\tiny $\nabla$}}}}}


%%%%%%%%%%%%%%%%%%%%ac

\newcommand{\diagac}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diags{0}{0}{\leng}       %
\diagt{0}{6}{\leng}         %
\diagt{9}{3}{\leng}    %
\diagq{9}{0.5}{\leng} %
\diagad{9}{6.2}{\leng}}}



%%%%%%%%%%%%%%%%%%%%ae

\newcommand{\diagae}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagac{0}{0}{\leng}       %
\diagt{0}{6}{\leng}         %
\diagu{28}{3}{\leng}    %
\diagc{22}{2.5}{\leng}}} %


%%%%%%%%%%%%%%%%%%%%af

\newcommand{\diagaf}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagv{0}{0}{\leng}       %
\diagv{17}{0}{\leng}         %
\diagc{12}{0}{\leng}}} %

%%%%%%%%%%%%%%%%%%%%ag


\newcommand{\diagag}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagw{0}{0}{\leng}       %
\diagy{17}{0}{\leng}         %
\diagc{12}{0}{\leng}    %
\diagu{-4.5}{5}{\leng}    %
\diagr{3}{2.5}{\leng}}} %


%%%%%%%%%%%%%%%%%%%%ah


\newcommand{\diagah}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagv{0}{0}{\leng}       %
\diagy{17}{0}{\leng}         %
\diagc{12}{0}{\leng}    %
\diagy{-5}{4.5}{\leng}    %
\diagr{2}{2.2}{\leng}}} %


%%%%%%%%%%%%%%%%%%%%ai

\newcommand{\diagai}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagv{0}{0}{\leng}       %
\diagab{17}{0}{\leng}         %
\diagc{12}{0}{\leng}    %
\diagab{-5}{4.5}{\leng}    %
\diagr{2}{2.2}{\leng}}} %


%%%%%%%%%%%%%%%%%%%%aj

\newcommand{\diagaj}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagz{0}{0}{\leng}       %
\diagab{17}{0}{\leng}         %
\diagc{12}{0}{\leng}    %
\diagu{-7.5}{-3}{\leng}    %
\diagq{1}{-2.5}{\leng}}} %


%%%%%%%%%%%%%%%%%ak
\newcommand{\diagak}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(2,3)(4.9,2.6)(4,0)}}


%%%%%%%%%%%%%%%%%al
\newcommand{\diagal}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(0,0)(2,2)(4,0) }}


%%%%%%%%%%%%%%%%%%am

\newcommand{\diagam}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagak{0}{0}{2\leng}       %
\diagf{7.3}{0}{2\leng}         %
\diagp{6}{1.5}{3\leng} }}


%%%%%%%%%%%%%%%%%%an

\newcommand{\diagan}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{2\leng} %

\diagal{0}{0}{2\leng}       %
\diagf{7.3}{0}{2\leng}         %
\diagp{6}{1.5}{3\leng} }}




%%%%%%%%%%%%%%%%%%%%as

\newcommand{\diagas}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %

\diagag{-15}{0}{\leng}       %
\diagae{-35}{25}{\leng}       %
\diaga{45}{10}{\leng}       %
\diagw{75}{7}{\leng}       %
\diagc{100}{7}{\leng}       %
\diagy{110}{7}{\leng}       %
\diagac{57}{20}{\leng}       %
\diagy{85}{-30}{\leng}       %
\diagd{75}{-12}{\leng}       %
\diage{115}{-7}{\leng}       %
\diagb{90}{-15}{\leng}       %


\qbezier(94,27)(92,15)(83.3,11.7)  %
\put(84,11.5){\makebox(0,0)[r]{{\tiny $\Delta$}}}

\qbezier(32.5,32)(29,26)(12,24)  %
\qbezier(12,24)(-9,21)(-13,13)  %
\put(-13,13){\makebox(0,0)[t]{{\scriptsize $\nabla$}}}}}


%%%%%%%%%%%%%%%%%%%%at

\newcommand{\diagat}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %

\diagah{-15}{25}{\leng}       %
\diagaf{-30}{0}{\leng}       %
\diaga{45}{10}{\leng}       %
\diagah{75}{7}{\leng}       %
\diagy{85}{-30}{\leng}       %
\diagd{75}{-12}{\leng}       %
\diage{115}{-7}{\leng}       %
\diagb{90}{-15}{\leng}       %

\qbezier(14.5,4)(14,8)(5,13)  %
\qbezier(5,13)(-4,19)(-4.5,26)  %
\put(-4,26){\makebox(0,0)[b]{{\scriptsize $\Delta$}}}}}

%%%%%%%%%%%%%%%%%%%%au

\newcommand{\diagau}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %

\diagai{-15}{25}{\leng}       %
\diagaf{-30}{0}{\leng}       %
\diaga{45}{10}{\leng}       %
\diagai{75}{7}{\leng}       %
\diagab{85}{-30}{\leng}       %
\diagd{75}{-12}{\leng}       %
\diage{115}{-7}{\leng}       %
\diagb{90}{-15}{\leng}       %

\qbezier(14.5,4)(14,8)(5,13)  %
\qbezier(5,13)(-4,19)(-4.5,26)  %
\put(-4,26){\makebox(0,0)[b]{{\scriptsize $\Delta$}}}}}


%%%%%%%%%%%%%%%%%%%%av

\newcommand{\diagav}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %

\diagaj{-15}{30}{\leng}       %
\diagae{-35}{-5}{\leng}       %
\diaga{45}{10}{\leng}       %
\diagz{75}{25}{\leng}       %
\diagc{100}{25}{\leng}       %
\diagab{110}{25}{\leng}       %
\diagac{57}{5}{\leng}       %
\diagab{85}{-30}{\leng}       %
\diagd{75}{-12}{\leng}       %
\diage{115}{-7}{\leng}       %
\diagb{90}{-15}{\leng}      %


\qbezier(79,24)(80,20)(86,18)  %
\qbezier(86,18)(92,16)(93,12)   %
\put(79,24){\makebox(0,0)[b]{{\tiny $\Delta$}}}

\qbezier(-19,23)(-18,15)(5,12)  %
\qbezier(5,12)(30,10)(31.5,3)  %
\put(-19,23){\makebox(0,0)[b]{{\scriptsize $\Delta$}}}}}

%%%%%%%%%%%%%%%%%aw

\newcommand{\diagaw}[3]{
\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{4\leng} %
\fontsize{3.8\leng}{15}

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}}
\put(0.3,1.6){$f$}   %
\put(3.4,1.6){$g$}   %
\put(2,-1){$\bar{g}$} %
\put(1.8,1){$\Downarrow$}

}}


%%%%%%%%%%%%%%%%%ax


\newcommand{\diagax}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{4\leng} %
\fontsize{3.8\leng}{15}

\diagam{0}{0}{2\leng}  %
\put(0.4,1.6){$f$}          %
\put(3.3,1.5){$\phi$}          %
\put(5.5,2.8){$u_{31}$} }}

%%%%%%%%%%%%%%%%%ay

\newcommand{\diagay}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{4\leng} %
\fontsize{3.8\leng}{15}

\diagan{0}{0}{2\leng}  %
\put(0.4,1.6){$f$}          %
\put(1.7,0.5){{\small $\bar\phi$}}          %
\put(5.5,2.8){$u_{32}$} }}

%%%%%%%%%%%%%%%%%az

\newcommand{\diagaz}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagay{0}{0}{\leng}  %
\diagax{0}{20}{\leng} %
\put(36.5,15){$\|$}     %
\put(36,4){$\phi_1$}   %
\put(36,24){$\phi_1$}  %
\put(7,6){$u_2$}  %
\put(7,24){$u_2'$} }}


%%%%%%%%%%%%%%%%%ba


\newcommand{\diagba}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagag{0}{0}{\leng}  %
\put(1,14){$\phi$}     %
\put(25,8){$u_{41}$}   %
\put(45,7){$\phi_1$}   %
\put(10,-2){$u_{31}$}     %

}}

%%%%%%%%%%%%%%%%%bb

\newcommand{\diagbb}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagah{0}{0}{\leng}  %
\put(10,-2){$\phi_2$}     %
\put(25,8){$u_{42}$}   %
\put(45,7){$\phi_1$}   %


   }}

%%%%%%%%%%%%%%%%%bc

\newcommand{\diagbc}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagai{0}{0}{\leng}  %
\put(10,-2){$\phi_2$}     %
\put(25,8){$u_{43}$}   %
\put(43,7){$\phi_3$}   %
}}

%%%%%%%%%%%%%%%%%bd

\newcommand{\diagbd}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagaj{0}{0}{\leng}  %
\put(-5,-11){$\bar\phi$}     %
\put(25,8){$u_{44}$}   %
\put(43,7){$\phi_3$}   %
\put(10,7){$u_{32}$}     %
}}


%%%%%%%%%%%%%%%%%be

\newcommand{\diagbe}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagae{0}{0}{\leng}  %
\put(47,15){$\phi$}

}}

%%%%%%%%%%%%%%%%%bf

\newcommand{\diagbf}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagas{0}{0}{\leng}  %
\put(12,40){$\phi$} %
\put(10,-6){$u_{41}$} %
\put(48,23){$u_{51}$} %
\put(103,17){$\phi_1$} %
\put(123,-15){$\phi_2$} %
\put(103,-12){$u_{52}$}  %


}}


%%%%%%%%%%%%%%%%%bg

\newcommand{\diagbg}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagat{0}{0}{\leng}  %
\put(-4,-7){$\phi_4$} %
\put(11,33){$u_{42}$} %
\put(48,23){$u_{54}$} %
\put(101,17){$\phi_3$} %
\put(123,-15){$\phi_2$} %
\put(103,-12){$u_{53}$}  %


}}

%%%%%%%%%%%%%%%%%bh

\newcommand{\diagbh}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagau{0}{0}{\leng}  %
\put(-4,-7){$\phi_4$} %
\put(11,33){$u_{43}$} %
\put(48,23){$u_{55}$} %
\put(101,17){$\phi_5$} %
\put(123,-15){$\phi_6$} %
\put(103,-12){$u_{56}$}  %
}}



%%%%%%%%%%%%%%%%%bi

\newcommand{\diagbi}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %
\fontsize{3.8\leng}{15}

\diagav{0}{0}{\leng}  %
\put(10,40){$u_{44}$} %
\put(11,-6){$\bar\phi$} %
\put(48,23){$u_{58}$} %
\put(103,35){$\phi_7$} %
\put(123,-15){$\phi_6$} %
\put(103,-12){$u_{57}$}  %
}}

%%%%%%%%%%%%%%%%%%%%%%%%bj
%has to be 1mm

\newcommand{\diagbj}[3]{

\put(#1,#2){ \setlength{\leng}{#3} %
\setlength{\unitlength}{1.2\leng} %
\setlength{\fontleng}{\leng}   %
\fontsize{\fontleng}{15}

\put(3.5,0){\line(-3,2){3}} %
\put(4,0.5){\line(-3,2){3}} %
\put(3.35,0){\makebox(0,0)[c]{$\underline{\hspace{0.5em}}$}}  %
\put(4.1,0.65){\makebox(0,0)[c]{$\mid$}}  }}

%%%%%%%%%%%%%%%%%%%%%%%%bk
%has to be 1mm

\newcommand{\diagbk}[3]{

\put(#1,#2){ \setlength{\leng}{#3} %
\setlength{\unitlength}{1.2\leng} %
\setlength{\fontleng}{\leng}   %
\fontsize{\fontleng}{15}

\put(-3.5,0){\line(3,2){3}} %
\put(-4,0.5){\line(3,2){3}} %
\put(-3.35,0.0){\makebox(0,0)[c]{$\underline{\hspace{0.5em}}$}}  %
\put(-4,0.65){\makebox(0,0)[c]{$\mid$}}  }}

%%%%%%%%%%%%%%%%%%%%%%%onetwo
%unary 2-cell

\sunit

\newcommand{\onetwo}[8]{

\put(#1,#2){ \setlength{\leng}{#3} %
\setlength{\unitlength}{\leng} %

\diagj{0}{0}{6\leng} %
\put(-1,0){\makebox(0,0)[r]{#4}} %
\put(26,0){\makebox(0,0)[l]{#5}} %
\put(12,7){\makebox(0,0)[b]{#6}} %
\put(12,-2){\makebox(0,0)[t]{#7}} %
\put(12,2.5){\makebox(0,0)[c]{$\Downarrow$}}  %
\put(14,2.5){\makebox(0,0)[l]{#8}} }}

%%%%%%%%%%%%%%%%%%%%%%%onetwob
%unary 2-cell with no arrow drawn

\sunit

\newcommand{\onetwob}[8]{

\put(#1,#2){ \setlength{\leng}{#3} %
\setlength{\unitlength}{\leng} %

\diagj{0}{0}{6\leng} %
\put(-1,0){\makebox(0,0)[r]{#4}} %
\put(26,0){\makebox(0,0)[l]{#5}} %
\put(12,7){\makebox(0,0)[b]{#6}} %
\put(12,-2){\makebox(0,0)[t]{#7}} %
\put(12,2.5){\makebox(0,0)[c]{#8}}   }}




%%%%%%%%%%%%%%%%%%%%%%%%bl

\newcommand{\diagbl}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{.4\leng} %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(0,0){\line(1,0){40}}}}


%%%%%%%%%%%%%%%%%%%%%%%%bm

\newcommand{\diagbm}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{\leng} %

\diagbl{0}{0}{\leng}  %
\diagp{21}{3}{6\leng}  %
\diagbl{26}{0}{\leng}}}

%%%%%%%%%%%%%%%%%%%%%%%%bn

\newcommand{\diagbn}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{1.2\leng} %
\fontsize{3.5\leng}{15}

\put(5,0){\vector(1,0){10}}  %
\put(10,9){\makebox(0,0)[c]{.}}  %
\put(10,3.5){\makebox(0,0)[c]{$\Downarrow$}}}} %

%%%%%%%%%%%%%%%%%%%%%%%nulltwo
%nullary 2-cell

\sunit

\newcommand{\nulltwo}[6]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{1.2\leng} %
\fontsize{3.5\leng}{15}

\put(5,0){\vector(1,0){10}}  %
\put(10,9){\makebox(0,0)[c]{.}}  %
\put(10,3.5){\makebox(0,0)[c]{$\Downarrow$}}

\fontsize{11pt}{15} %
\put(4,0){\makebox(0,0)[r]{#4}}  %
\put(16.5,0){\makebox(0,0)[l]{#4}}  %
\put(10,-2){\makebox(0,0)[t]{#5}}  %
\put(12,3.5){\makebox(0,0)[l]{#6}}  %


}} %


%%%%%%%%%%%%%%%%%%%%%%%onecell
% 1-cell

\sunit

\newcommand{\onecell}[6]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{1.2\leng} %

\put(4,0){\makebox(0,0)[r]{#4}}  %
\put(16.5,0){\makebox(0,0)[l]{#5}}  %
\put(10,1.5){\makebox(0,0)[b]{#6}}  %

\put(5,0){\vector(1,0){10}}}}  %

%%%%%%%%%%%%%%%%%threetwo
%labelled 3-ary 2-cells for specifically p.22 (no scaling possible)

\newcommand{\threetwo}[9]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\diagbl{0}{0}{\leng}  %

\put(-2,-1){\makebox(0,0)[c]{#1}}  %
\put(2,9){\makebox(0,0)[c]{#2}}  %
\put(15,9){\makebox(0,0)[c]{#3}}  %
\put(19,-1){\makebox(0,0)[c]{#4}}  %

\put(0,5){\makebox(0,0)[c]{#5}}  %
\put(8.5,11){\makebox(0,0)[c]{#6}}  %
\put(17,5){\makebox(0,0)[c]{#7}}  %
\put(8.5,-3){\makebox(0,0)[c]{#8}}  %

\put(8.5,4){\makebox(0,0)[c]{$\Downarrow$}}  %
\put(11,4){\makebox(0,0)[c]{#9}} }} %

%%%%%%%%%%%%%%%%%threetwob
%labelled 3-ary 2-cells for specifically p.22 (no scaling possible)

\newcommand{\threetwob}[9]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\diagbl{0}{0}{\leng}  %

\put(-2,-1){\makebox(0,0)[c]{#1}}  %
\put(2,9){\makebox(0,0)[c]{#2}}  %
\put(15,9){\makebox(0,0)[c]{#3}}  %
\put(19,-1){\makebox(0,0)[c]{#4}}  %

\put(0,5){\makebox(0,0)[c]{#5}}  %
\put(8.5,11){\makebox(0,0)[c]{#6}}  %
\put(17,5){\makebox(0,0)[c]{#7}}  %
\put(8.5,-3){\makebox(0,0)[c]{#8}}  %

\put(8.5,4){\makebox(0,0)[c]{#9}}   }} %

%%%%%%%%%%%%%%%%%%%%%%%%bo

\newcommand{\diagbo}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{0.4\leng} %

\diagp{68}{12}{6\leng}

\begin{picture}(100,40)
\put(0,0){

\begin{picture}(50,30)      %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,1){10}}  %
\put(20,30){\line(1,-1){10}}  %
\put(30,20){\line(1,0){15}}  %
\put(45,20){\line(1,-2){5}}  %
\put(40,0){\line(1,1){10}}  %
\put(0,0){\line(1,0){40}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
%\put(20,10){\makebox(0,0){$a$}}  %
%\put(42,12){\makebox(0,0){$b$}}  %
%\put(20,23){\makebox(0,0){$c$}}  %

\end{picture}}

\put(80,0){
\begin{picture}(50,30)      %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,1){10}}  %
\put(20,30){\line(1,-1){10}}  %
\put(30,20){\line(1,0){15}}  %
\put(45,20){\line(1,-2){5}}  %
\put(40,0){\line(1,1){10}}  %
\put(0,0){\line(1,0){40}}  %
%\put(25,10){\makebox(0,0){$d$}}  %

\end{picture}}


\end{picture}}}

%%%%%%%%%%%%%%%%%%%%%%%%boo

\newcommand{\diagboo}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{0.4\leng} %

\diagp{68}{12}{6\leng}

\begin{picture}(100,40)
\put(0,0){

\begin{picture}(50,30)      %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,1){10}}  %
\put(20,30){\line(1,-1){10}}  %
\put(30,20){\line(1,0){15}}  %
\put(45,20){\line(1,-2){5}}  %
\put(40,0){\line(1,1){10}}  %
\put(0,0){\line(1,0){40}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(0,0){\line(3,2){30}} 
\put(40,0){\line(1,4){5}}

\end{picture}}

\put(80,0){
\begin{picture}(50,30)      %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,1){10}}  %
\put(20,30){\line(1,-1){10}}  %
\put(30,20){\line(1,0){15}}  %
\put(45,20){\line(1,-2){5}}  %
\put(40,0){\line(1,1){10}}  %
\put(0,0){\line(1,0){40}}  %
%\put(25,10){\makebox(0,0){$d$}}  %

\end{picture}}


\end{picture}}}


%%%%%%%%%%%%%%%%%%%%%%%%threethree

\newcommand{\threethree}[5]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{0.4\leng} %

\diagp{68}{12}{6\leng} %
\put(70,20){\makebox(0,0)[b]{#5}}


\begin{picture}(100,40)
\put(0,0){

\begin{picture}(50,30)      %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,1){10}}  %
\put(20,30){\line(1,-1){10}}  %
\put(30,20){\line(1,0){15}}  %
\put(45,20){\line(1,-2){5}}  %
\put(40,0){\line(1,1){10}}  %
\put(0,0){\line(1,0){40}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(20,10){\makebox(0,0){#3}}  %
\put(42,12){\makebox(0,0){#2}}  %
\put(21,23){\makebox(0,0){#1}}  %

\end{picture}}

\put(80,0){
\begin{picture}(50,30)      %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,1){10}}  %
\put(20,30){\line(1,-1){10}}  %
\put(30,20){\line(1,0){15}}  %
\put(45,20){\line(1,-2){5}}  %
\put(40,0){\line(1,1){10}}  %
\put(0,0){\line(1,0){40}}  %
\put(25,10){\makebox(0,0){#4}}  %

\end{picture}}



\end{picture}}}




%%%%%%%%%%%%%%%%%%%%%%%%bp

\newcommand{\diagbp}[3]{

\put(#1,#2){\setlength{\leng}{#3}
\setlength{\unitlength}{0.4\leng} %

\begin{picture}(40,30)      %

\put(0,0){\line(1,4){5}}  %
\put(5,20){\line(3,2){15}}  %
%\put(20,30){\line(3,-2){15}}  %

\qbezier[2](26,31)(29,28)(32,25) %

\put(35,20){\line(1,-4){5}}  %
\put(0,0){\line(1,0){40}}  %

\put(20,13){\makebox(0,0){$\Downarrow$}}  %

\end{picture}}}

%%%%%%%%%%%%%%%%%%%%%%%three
%labelled 3-arrow

\sunit

\newcommand{\three}[4]{
\put(#1,#2){ \setlength{\leng}{#3} %
\setlength{\unitlength}{\leng} %
\diagp{0}{0}{6\leng}  %
\put(0,4){\makebox(0,0)[b]{#4}} }}

%%%%%%%%%%%%%%%%%%%%%%%nullthree
%nullary 3-cell

\sunit

\newcommand{\nullthree}[3]{

\put(0,0){ \setlength{\leng}{1mm} %
\setlength{\unitlength}{\leng} %

\onecell{0}{0}{\leng}{}{}{#1}   %
\three{24}{2}{\leng}{#3}  %
\onetwo{31}{0}{0.7\leng}{}{}{#1}{#1}{#2}

 }}

 %%%%%%%%%%%%%%%%%%%%%%%nullthreeb
%nullary 3-cell with no 2-arrow drawn

\sunit

\newcommand{\nullthreeb}[3]{

\put(0,0){ \setlength{\leng}{1mm} %
\setlength{\unitlength}{\leng} %

\onecell{0}{0}{\leng}{}{}{#1}   %
\three{24}{2}{\leng}{#3}  %
\onetwob{31}{0}{0.7\leng}{}{}{#1}{#1}{#2}

 }}



%%%%%%%%%%%%%%%%%%%%%%%twotwo
%2-ary 2-cell

\sunit

\newcommand{\twotwo}[7]{

\put(0,0){ \setlength{\leng}{1mm} %
\setlength{\unitlength}{\leng} %
\diagf{0}{0}{4\leng}  %
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,6){\makebox(0,0)[br]{#4}}   % 1-cells
\put(14,6){\makebox(0,0)[bl]{#5}}  %
\put(8,-2){\makebox(0,0)[t]{#6}}  %

\put(8,5){\makebox(0,0)[c]{$\Downarrow$}}  %
\put(9,5){\makebox(0,0)[l]{#7}}  %
}}

%%%%%%%%%%%%%%%%%%%%%%%twotwob
%2-ary 2-cell with no arrow drawn

\sunit

\newcommand{\twotwob}[7]{

\put(0,0){ \setlength{\leng}{1mm} %
\setlength{\unitlength}{\leng} %
\diagf{0}{0}{4\leng}  %
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,6){\makebox(0,0)[br]{#4}}   % 1-cells
\put(14,6){\makebox(0,0)[bl]{#5}}  %
\put(8,-2){\makebox(0,0)[t]{#6}}  %

\put(8,5){\makebox(0,0)[c]{#7}}  %

}}

%%%%%%%%%%%%%%%%%assleft
%2-pd of 2 triangles, 1-cells labelled

\newcommand{\assleft}[5]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(0,0){\line(1,0){40}}   %
\put(10,20){\line(3,-2){30}}}

\put(0,5){\makebox(0,0)[c]{#1}}  %
\put(8.5,11){\makebox(0,0)[c]{#2}}  %
\put(17,5){\makebox(0,0)[c]{#3}}  %
\put(8.5,-3){\makebox(0,0)[c]{#5}}  %

\put(8.5,3.3){\makebox(0,0)[c]{#4}}   }}


%%%%%%%%%%%%%%%%%assright
%2-pd of 2 triangles, 1-cells labelled

\newcommand{\assright}[5]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(0,0){\line(1,0){40}}   %
\put(0,0){\line(3,2){30}}}

\put(0,5){\makebox(0,0)[c]{#1}}  %
\put(8.5,11){\makebox(0,0)[c]{#2}}  %
\put(17,5){\makebox(0,0)[c]{#3}}  %
\put(8.5,-3){\makebox(0,0)[c]{#5}}  %

\put(8.5,3.3){\makebox(0,0)[c]{#4}}   }}

%%%%%%%%%%%%%%%%%assrightb
%2-pd of 2 triangles, 2-cells labelled

\newcommand{\assrightb}[2]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(0,0){\line(1,0){40}}   %
\put(0,0){\line(3,2){30}}}

\put(5,5){\makebox(0,0)[c]{#1}}  %

\put(10,2.5){\makebox(0,0)[c]{#2}}   }}

%%%%%%%%%%%%%%%%%assleftb
%2-pd of 2 triangles, 2-cells labelled

\newcommand{\assleftb}[2]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %

\put(0,0){\line(1,2){10}}  %
\put(10,20){\line(1,0){20}}  %
\put(30,20){\line(1,-2){10}}  %
\put(0,0){\line(1,0){40}}   %
\put(10,20){\line(3,-2){30}}}

\put(11,5){\makebox(0,0)[c]{#1}}  %

\put(5.5,2.5){\makebox(0,0)[c]{#2}}   }}


%%%%%%%%%%%%%%%%%%%%%%%%%diagbq

\newcommand{\diagbq}[5]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %

\onetwob{0}{0}{\leng}{#1}{#1}{#2}{#3}{#5}
\put(12,21){\makebox(0,0)[c]{.}}  %
\put(12,15.5){\makebox(0,0)[c]{$\Downarrow$}} %
\put(14,15.5){\makebox(0,0)[l]{#4}}  }}

%%%%%%%%%%%%%%%%%%%%%%%%%diagbr

\newcommand{\diagbr}[9]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %

\diagal{0}{0}{4\leng}
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,6){\makebox(0,0)[br]{#4}}   % 1-cells
\put(14,6){\makebox(0,0)[bl]{#5}}  %
\put(8,-2){\makebox(0,0)[t]{#7}}  %

\put(8,7){\makebox(0,0)[c]{#8}}  %

\put(10,3.3){\makebox(0,0)[bl]{#6}}  %
\put(8,1.6){\makebox(0,0)[c]{#9}}  %
}}

%%%%%%%%%%%%%%%%%bs
\newcommand{\diagbs}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(2,3)(4.9,2.6)(4,0)}}



%%%%%%%%%%%%%%%%%%%%%%%%%diagbt

\newcommand{\diagbt}[9]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %

\diagbs{0}{0}{4\leng}
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,6){\makebox(0,0)[br]{#4}}   % 1-cells
\put(12,4){\makebox(0,0)[c]{#6}}  %
\put(8,-2){\makebox(0,0)[t]{#7}}  %

\put(8,6){\makebox(0,0)[c]{#9}}  %

\put(15,6){\makebox(0,0)[c]{#8}}  %
\put(17,9){\makebox(0,0)[bl]{#5}}  %
}}

%%%%%%%%%%%%%%%%%bu
\newcommand{\diagbu}[3]{

\put(#1,#2){
\setlength{\unitlength}{#3} %

\put(0,0){\line(1,0){4}}  %
\put(0,0){\line(2,3){2}}  %
\put(4,0){\line(-2,3){2}} %
\qbezier(2,3)(-0.9,2.6)(0,0)}}

%%%%%%%%%%%%%%%%%%%%%%%%%%bv

\newcommand{\diagbv}[9]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %

\diagbu{0}{0}{4\leng}
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,3){\makebox(0,0)[c]{#5}}   % 1-cells
\put(13,6){\makebox(0,0)[bl]{#6}}  %
\put(8,-2){\makebox(0,0)[t]{#7}}  %

\put(8,6){\makebox(0,0)[c]{#9}}  %

\put(2,7){\makebox(0,0)[c]{#8}}  %
\put(0,8){\makebox(0,0)[br]{#4}}  %
}}

%%%%%%%%%%%%%%%%%%%%%%%bw

\newcommand{\diagbw}[8]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %

\twotwob{#1}{#2}{#3}{#4}{#5}{#6}{#8} %
\diagbj{-6}{10}{\leng}   %
\put(-9,16){.}   %
\put(-3,13){\makebox(0,0)[bl]{#7}} %
}}

%%%%%%%%%%%%%%%%%%%%%%%bx

\newcommand{\diagbx}[8]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %

\twotwob{#1}{#2}{#3}{#4}{#5}{#6}{#8} %
\diagbk{22}{10}{\leng}   %
\put(25,15){.}   %
\put(18,13){\makebox(0,0)[br]{#7}} %
}}

%%%%%%%%%%%%%%%%%%%%%%%%%diagby
%for sticking to any of the triangles

\newcommand{\diagby}[2]{

\setlength{\leng}{#1}
\setlength{\unitlength}{\leng} %
\qbezier(0,0)(8,-8)(16,0)      %
\put(8,-2){\makebox(0,0)[c]{#2}} }

%%%%%%%%%%%%%%%%%%%%%%%%%diagbz

\newcommand{\diagbz}[1]{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %
\put(0,0){
\setlength{\unitlength}{4\leng} %
\qbezier(0,0)(2,-4)(4,0) }}
\put(8,-6.5){\makebox(0,0)[c]{#1}}  %
}

%%%%%%%%%%%%%%%%%%%%%%%%%diagca

\newcommand{\diagca}{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %
\put(0,0){
\setlength{\unitlength}{4\leng} %
\qbezier(2,3)(6.7,4.1)(4,0)}}}

%%%%%%%%%%%%%%%%%%%%%%%%%diagcb

\newcommand{\diagcb}{

\put(0,0){\setlength{\leng}{1mm}
\setlength{\unitlength}{\leng} %
\put(0,0){
\setlength{\unitlength}{4\leng} %
\qbezier(2,3)(-2.7,4.1)(0,0)}} }


%%%%%%%%%%%%%%%%%cc

\newcommand{\diagcc}[4]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(0,0)(20,13)(40,0) %
\put(20,13){\makebox(0,0)[c]{#1}}
\put(20,2.4){\makebox(0,0)[c]{#4}}}  %
\put(10,4){\makebox(0,0)[c]{#3}}  %
\put(5.5,4){\makebox(0,0)[c]{#2}} %
}}

%%%%%%%%%%%%%%%%%cd

\newcommand{\diagcd}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(0,0)(20,-13)(40,0) %
\put(20,-3){\makebox(0,0)[c]{#1}}}  %
 }}

%%%%%%%%%%%%%%%%%ce

\newcommand{\diagce}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(0,0)(20,-28)(40,0) %
\put(20,-10){\makebox(0,0)[c]{#1}}}  %
 }}

%%%%%%%%%%%%%%%%%cf

\newcommand{\diagcf}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(0,0)(-8,18)(10,20) %
\put(2,12){\makebox(0,0)[c]{#1}}}  %
 }}

%%%%%%%%%%%%%%%%%cg

\newcommand{\diagcg}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(40,0)(48,18)(30,20) %
\put(38,12){\makebox(0,0)[c]{#1}}}  %
 }}

 %%%%%%%%%%%%%%%%%ch

\newcommand{\diagch}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(40,0)(58,23)(30,20) %
\put(45,14){\makebox(0,0)[c]{#1}}}  %
 }}

 %%%%%%%%%%%%%%%%%ci

\newcommand{\diagci}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(10,20)(20,34)(30,20) %
\put(20,23){\makebox(0,0)[c]{#1}}}  %
 }}

 %%%%%%%%%%%%%%%%%cj

\newcommand{\diagcj}[2]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(0,0)(10,20)(30,20) %
\put(11,16){\makebox(0,0)[c]{{\tiny #1}}} %
\put(15,14){\makebox(0,0)[c]{{\small #2}}} %
}}}

%%%%%%%%%%%%%%%%%ck

\newcommand{\diagck}[2]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(40,0)(30,20)(10,20) %
\put(29,16){\makebox(0,0)[c]{{\tiny #1}}} %
\put(25,14){\makebox(0,0)[c]{{\small #2}}} %
}}}

%%%%%%%%%%%%%%%%%cl

\newcommand{\diagcl}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\put(20,28){\makebox(0,0)[c]{$\Downarrow$}} %
\put(20,37){\makebox(0,0)[c]{.}}
\put(25,28){\makebox(0,0)[c]{#1}} %
}}}

%%%%%%%%%%%%%%%%%cm

\newcommand{\diagcm}{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\put(10,20){\line(1,1){10}}  %
\put(30,20){\line(-1,1){10}}

 }}}

 %%%%%%%%%%%%%%%%%mtwo
% m-ary 2-cell

\newcommand{\mtwo}[5]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){ \setlength{\unitlength}{.4\leng} %
\put(0,0){\line(1,0){40}}  %
\put(0,0){\line(1,4){5}}  %
\put(5,20){\line(1,1){10}}  %
\put(40,0){\line(-1,4){5}}  %

%
\put(0,12){\makebox(0,0)[r]{#1}}  %
\put(8,27){\makebox(0,0)[br]{#2}}  %
\put(40,12){\makebox(0,0)[l]{#3}}  %
\put(20,-2){\makebox(0,0)[t]{#4}}  %
\put(20,15){\makebox(0,0)[c]{$\Downarrow$}}  %
\put(23,15){\makebox(0,0)[l]{#5}}  %
\qbezier[2](23,30)(28,27)(33,24)

 }}}

 %%%%%%%%%%%%%%%%%mtwob
% m-ary 2-cell without arrow

\newcommand{\mtwob}[5]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){ \setlength{\unitlength}{.4\leng} %
\put(0,0){\line(1,0){40}}  %
\put(0,0){\line(1,4){5}}  %
\put(5,20){\line(1,1){10}}  %
\put(40,0){\line(-1,4){5}}  %

%
\put(0,12){\makebox(0,0)[r]{#1}}  %
\put(8,27){\makebox(0,0)[br]{#2}}  %
\put(40,12){\makebox(0,0)[l]{#3}}  %
\put(20,-2){\makebox(0,0)[t]{#4}}  %
\put(20,15){\makebox(0,0)[c]{#5}}  %
\qbezier[2](23,30)(28,27)(33,24)

 }}}

 %%%%%%%%%%%%%%%%%cn

\newcommand{\diagcn}[1]{

\put(0,0){\setlength{\leng}{1.3mm}
\setlength{\unitlength}{\leng} %

\put(0,0){
\setlength{\unitlength}{.4\leng} %
\qbezier(0,0)(-18,23)(10,20) %
\put(-3,14){\makebox(0,0)[c]{#1}}}  %
 }}


%%%%%%%%%%%%%%%%%%%%%%%%%diagcz

\newcommand{\diagcz}[1]{

\setlength{\leng}{#1}
\setlength{\unitlength}{\leng} %

\put(0,0){\line(1,0){16}}}



%%%%%%%%%%%%%%%%%%%%%%%%%diagco

\newcommand{\diagco}[2]{

\setlength{\leng}{#1}
\setlength{\unitlength}{\leng} %

\put(0,0){\line(1,0){16}} %
\qbezier(0,0)(8,8)(16,0)  %
\put(8,2){\makebox(0,0)[c]{#2}}}


%%%%%%%%%%%%%%%%%%%%%onetwo

\newcommand{\onetwoc}[5]{

\put(0,0){ \setlength{\leng}{1mm} %
\setlength{\unitlength}{\leng} %

\diagj{0}{0}{6\leng} %
\put(0,0){ \setlength{\unitlength}{6\leng}
\put(0,0){  %
\qbezier(0,0)(2,-2)(4,0) }}
\put(12,7){\makebox(0,0)[b]{#1}} %
\put(7,0){\makebox(0,0)[b]{#2}} %
\put(12,2.5){\makebox(0,0)[c]{#4}}
\put(12,-7){\makebox(0,0)[t]{#3}} %
\put(12,-3){\makebox(0,0)[c]{#5}}

 }}


%%%%%%%%%%%%%%%%%%%%%%%%%scaleby
%for sticking to any of the triangles

\newcommand{\scaleby}[1]{
\setlength{\unitlength}{\leng} %
\qbezier(0,0)(8,-8)(16,0)      %
\put(8,-2){\makebox(0,0)[c]{#1}} }

%%%%%%%%%%%%%%%%%%%%%%%%%%scalebv

\newcommand{\scalebv}[9]{

\put(0,0){
\setlength{\unitlength}{\leng} %

\diagbu{0}{0}{4\leng}
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,3){\makebox(0,0)[c]{#5}}   % 1-cells
\put(13,6){\makebox(0,0)[bl]{#6}}  %
\put(8,-2){\makebox(0,0)[t]{#7}}  %

\put(8,6){\makebox(0,0)[c]{#9}}  %

\put(2,7){\makebox(0,0)[c]{#8}}  %
\put(0,8){\makebox(0,0)[br]{#4}}  %
}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalebt

\newcommand{\scalebt}[9]{

\put(0,0){
\setlength{\unitlength}{\leng} %

\diagbs{0}{0}{4\leng}
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,6){\makebox(0,0)[br]{#4}}   % 1-cells
\put(13,3.5){\makebox(0,0)[c]{#6}}  %
\put(8,-2){\makebox(0,0)[t]{#7}}  %

\put(8,6){\makebox(0,0)[c]{#9}}  %

\put(15,6){\makebox(0,0)[c]{#8}}  %
\put(17,9){\makebox(0,0)[bl]{#5}}  %
}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalebr

\newcommand{\scalebr}[9]{

\put(0,0){
\setlength{\unitlength}{\leng} %

\diagal{0}{0}{4\leng}
\put(-1,-1){\makebox(0,0)[tr]{#1}}   % 0-cells
\put(8,14){\makebox(0,0)[b]{#2}}  %
\put(18,-1){\makebox(0,0)[tl]{#3}}  %

\put(3,6){\makebox(0,0)[br]{#4}}   % 1-cells
\put(14,6){\makebox(0,0)[bl]{#5}}  %
\put(8,-2){\makebox(0,0)[t]{#7}}  %

\put(8,7){\makebox(0,0)[c]{#8}}  %

\put(10,3){\makebox(0,0)[bl]{#6}}  %
\put(8,1){\makebox(0,0)[c]{#9}}  %
}}

%%%%%%%%%%%%%%%%%%%%%%%%%scaleco

\newcommand{\scaleco}[1]{

\setlength{\unitlength}{\leng} %

\put(0,0){\line(1,0){16}} %
\qbezier(0,0)(8,8)(16,0)  %
\put(8,2){\makebox(0,0)[c]{#1}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecp

\newcommand{\scalecp}{

\put(0,0){
\setlength{\unitlength}{\leng} %
\put(0,0){\line(1,0){40}} %
\put(0,0){\line(0,1){20}} %
\put(0,20){\line(2,1){20}} %
\put(20,30){\line(2,-1){20}} %
\put(40,0){\line(0,1){20}}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecq

\newcommand{\scalecq}{

\put(0,0){
\setlength{\unitlength}{0.3\leng} %

\put(20,90){\line(0,1){20}}      %
\put(40,90){\line(0,1){20}}      %
\put(80,90){\line(0,1){20}}      %

\put(20,90){\line(1,0){60}}      %
\put(20,90){\line(1,-1){30}}     %
\put(80,90){\line(-1,-1){30}}    %
\put(50,40){\line(0,1){20}}      %
\put(60,104){\makebox[0pt]{$\cdots$}} }}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecr

\newcommand{\scalecr}[5]{

\put(0,0){
\setunit{0.3\leng} %
\scalecq
\put(20,114){\makebox[0pt]{#1}}   %
\put(40,114){\makebox[0pt]{#2}}   %
\put(80,114){\makebox[0pt]{#3}}   %
\put(50,76){\makebox(0,0){#5}}      % label in the middle
\put(45,38){\makebox(0,0)[t]{#4}}  }} % label at the bottom

%%%%%%%%%%%%%%%%%%%%%%%%%scalecs

\newcommand{\scalecs}[9]{

\put(0,0){
\setunit{0.3\leng} %
\put(20,0){ \scalecq
\put(20,114){\makebox[0pt]{#4}}   %
\put(40,114){\makebox[0pt][r]{#5}}   %
\put(80,114){\makebox[0pt]{#6}}   %
\put(50,76){\makebox(0,0){#9}}      % label in the middle
\put(50,36){\makebox(0,0)[t]{#7}}} \setunit{0.2\leng}
\put(39.8,124){\setleng{0.67\leng} \scalecr{#1}{#2}{#3}{}{#8}}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalect

\newcommand{\scalect}[4]{
\setlength{\unitlength}{0.3\leng} %

\put(20,0){\line(0,1){20}} %
\put(20,20){\line(-2,3){20}} %
\put(20,20){\line(2,3){20}}  %
\put(0,50){\line(1,0){40}}  %
\put(0,50){\line(0,1){20}}  %
\put(40,50){\line(0,1){20}} %

\put(15,0){\makebox(0,0)[r]{#3}} %
\put(0,75){\makebox(0,0)[b]{#1}}  %
\put(40,75){\makebox(0,0)[b]{#2}}  %
\put(20,40){\makebox(0,0)[c]{#4}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecu

\newcommand{\scalecu}[3]{
\setlength{\unitlength}{0.3\leng} %

\put(20,0){\line(0,1){20}} %
\put(20,20){\line(-2,3){20}} %
\put(20,20){\line(2,3){20}}  %
\put(0,50){\line(1,0){40}}  %
\put(20,50){\line(0,1){20}} %

\put(15,0){\makebox(0,0)[r]{#2}} %
\put(20,75){\makebox(0,0)[b]{#1}}  %
\put(20,40){\makebox(0,0)[c]{#3}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecv

\newcommand{\scalecv}[6]{
\put(3,0){\scalect{}{#3}{#4}{#6}} %
\put(-1.5,21){\setleng{0.75\leng} \scalecu{#1}{#2}{#5}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecw

\newcommand{\scalecw}[6]{
\put(3,0){\scalect{#2}{}{#4}{#6}} %
\put(10.5,21){\setleng{0.75\leng} \scalecu{#1}{#3}{#5}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecx

\newcommand{\scalecx}[6]{
\put(0,12){\scalect{#1}{#2}{#3}{#5}} %
\put(1.5,-2.5){\setleng{0.75\leng} \scalecu{}{#4}{#6}}}

%%%%%%%%%%%%%%%%%%%%%%%%%scalecy

\newcommand{\scalecy}[7]{
\put(-9,0){\scalecr{#1}{#2}{#3}{#4}{#6}} %
\put(1.5,-2.5){\setleng{0.75\leng} \scalecu{}{#5}{#7}}}

%fff

pub6.tex
%%%che12
\documentclass[a4paper,11pt]{article}

\input pubsettings

\begin{document}




\title{A relationship between trees and Kelly-Mac Lane graphs}
\author{Eugenia Cheng\\ \\Department of Pure Mathematics, University
of Cambridge\\E-mail: e.cheng@dpmms.cam.ac.uk}
\date{October 2002}
\maketitle



\begin{abstract}

We give a precise description of combed trees in terms of Kelly-Mac~Lane
graphs.  We show that any combed tree is uniquely expressed as an allowable
Kelly-Mac~Lane graph of a certain shape.  Conversely, we show that any such
Kelly-Mac~Lane graph uniquely defines a combed tree.  

\end{abstract}


\setcounter{tocdepth}{3}
\tableofcontents

\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}

In this paper we show how trees may be expressed as allowable Kelly-Mac~Lane
graphs of a certain shape.  

The trees in question are those arising in \cite{bd1} and \cite{che7}
to express configurations for composing higher-dimensional cells in
the theory of opetopic $n$-categories.  Kelly-Mac~Lane graphs are introduced in
\cite{km1} to study coherence for symmetric monoidal closed
categories.  The main result of this paper states that a tree is {\em
precisely} an allowable Kelly-Mac~Lane graph of shape
	\[X_{m_1} \tensordot X_{m_k} \lra X_{(\sum\nolimits_i
	m_i-k+1)}\]
where each $m_i \geq 0$ and for any $m \geq 0$ we write
	\[X_m = [1^{\otimes m},1].\]
	
We begin, in Section~\ref{loopsap}, by giving a minimal account of
the theory of Kelly-Mac~Lane graphs, including no more than what is
required for the purposes of this paper.  We refer the reader
to \cite{km1} for the full details, noting that for the purposes of
this work we consider only the strict monoidal case.

We then recall the trees in question, as defined in \cite{che7}.  We
give an informal description in Section~\ref{treeback}, and in
Section~\ref{treeformal} the formal description that paves the way
for the ensuing results.  In Section~\ref{treegraph} we show how to
express a tree as a graph, not {\em a priori} allowable, and in
Section~\ref{treecomp} we characterise tree composition in this new
framework.  

This enables us to prove, in Section~\ref{every}, that the graph of a
tree is allowable.  Finally, in Section~\ref{all}, we show that every
allowable graph of the correct shape is a tree, giving the main result
of this work.

\subsection*{Further work}
\numarabic

\begin{enumerate}

\item The trees in question arise in the `slice' construction
described in \cite{bd1} and \cite{che7} in the construction of
opetopes and definition of opetopic $n$-category.  Thus the new way of
expressing trees as described in this paper can be used to give a
description of the category of opetopes; this is described in
\cite{che13}.  

\item Blute(\cite{blu1}) has established a relationship between Kelly-Mac~Lane
graphs and the proof nets of Linear Logic, so the material in the
present work should in turn give a relationship between opetopes and
proof nets.

\item Finally we note that the allowable Kelly-Mac~Lane graphs are the
morphisms of the free symmetric monoidal closed category on one
object.  Although we do not need to use this fact in this paper, it
should give a more abstract approach to this material, the
significance of which is currently unclear.  

\end{enumerate}


\bigskip {\bfseries Acknowledgements}

This work was supported by a PhD grant from EPSRC.  I would like to thank
Martin Hyland and Tom Leinster for their support and guidance.

\section{Background on Kelly-Mac~Lane Graphs} \label{loopsap}

In this section we give a brief account of the theory of
Kelly-Mac~Lane graphs.  Note that we will only be concerned with the
strict monoidal version for the purposes of this paper.  

In \cite{km1}, Kelly and Mac Lane study
coherence for symmetric monoidal closed categories.  In brief, a
symmetric monoidal closed category is a symmetric monoidal
category $\cl{C} = (\cl{C}, \otimes, I, a, b, c)$ equipped, in
addition, with a functor
    \[ [\ ,\ ]:\cl{C}^{\op}\times\cl{C} \lra \cl{C}\]
and natural transformations
    \[d = d_{AB}:A \lra [B, A \otimes B]\]
    \[e = e_{AB}:[A,B]\otimes A \lra B\]
satisfying certain axioms.  (Here $a$, $b$ and $c$ are the natural
isomorphisms for associativity, unit and symmetric action
respectively.) In particular we have a natural isomorphism
    \[\pi: \cl{C}(A \otimes B, C) \lra \cl{C} (A, [B,C]).\]
Kelly and Mac Lane refer to such categories simply as {\em closed
categories} and we do the same.

Kelly and Mac Lane introduce a notion of graph which enables a
partial solution to the question: when does a diagram in a closed
category commute?   In fact we are not concerned with the
coherence question here, so we only give the construction of the
graphs and state one theorem from \cite{km1} which will later be
useful.

Kelly and Mac Lane define a category $G$ whose objects are {\em
shapes} and whose morphisms are {\em graphs}; this is seen to be a
closed category.  They then define a subcategory whose morphisms
are the {\em allowable morphisms}.  These are defined as precisely
those morphisms of $G$ demanded by the symmetric monoidal closed
structure.



\subsection{Shapes}
\numarabic

We define {\em shapes} by the following inductive rules:
\begin{enumerate}
\item $I$ is a shape
\item 1 is a shape
\item if $S$ and $T$ are shapes then so is $S \otimes T$
\item if $S$ and $T$ are shapes then so is $[S,T]$
\end{enumerate}

Thus shapes are formal objects built from 1, $I$, $\otimes$ and
$[\ ,\ ]$.

We assign to each shape $T$ a {\em variable set} $v(T)$ which may
be considered as a list of $+$'s and $-$'s, defined inductively as
follows:

\begin{enumerate}
\item $v(I) = \emptyset$
\item $v(1) = \{+\}$
\item $v(T \otimes S) = v(T) \coprod v(S)$
\item $v([T,S]) = v(T)^{\op} \coprod v(S)$
\end{enumerate}

Here $\coprod$ is the concatenation of lists and $v(T)^{\op} $ is
$v(T)$ with all signs reversed.  Kelly and Mac Lane write
    \[v(T) \coprod v(S) = v(T) \hat{+} v(S)\]
    \[v(T)^{\op}  \coprod v(S) = v(T) \tilde{+} v(S)\]
and call these the {\em ordered sum} and {\em twisted sum}
respectively.  The sign of each variable is called its {\em
variance}.

In fact we only need the strict monoidal version of this theory.
That is, we put
    \[(T\otimes S) \otimes R = T \otimes (S \otimes R)\]
and
    \[T \otimes I = T.\]

For example,
     \[ [\ [1,1] \otimes 1\otimes 1 \ , \ I \ ] \otimes 1\]
is a shape with
    \[v(T) = \{+,-,-,-,+\}.\]



\subsection{Graphs} \label{graphs}

A {\em graph} $T \lra S$ is defined to be a fixed point free
pairing of the variables in $T$ and $S$ such that paired elements
have opposite variances in $v(T)^{\op}  \coprod v(S)$.  (Kelly and
Mac Lane refer to such paired elements as ``mates''.)
Equivalently, this is a bijection between the $+$'s and the $-$'s
in $v(T)^{\op}  \coprod v(S)$.

For example, the following is a graph
    \[ [ \ [1,1] \otimes 1 \otimes 1 \ , \ I \ ] \ \otimes \ 1
    \lra [ \ 1\otimes1 \ , \ 1\otimes [1,1] \ ]\]
showing variances: \pica pic52.lp .\picz

Graphs are composed in the obvious way, so that shapes and graphs
form a category $G$.  Moreover, $G$ has the structure of a closed
category as follows.  $\otimes$ and $[\ ,\ ]$ are defined on
graphs in the obvious way, and the constraints are given by the
following graphs:

\input pic65b.lp \input pic70b.lp

\input pic66b.lp \input pic71b.lp

\input pic67b.lp \input pic72b.lp

\input pic68.lp
 \input pic73b.lp

\input pic69.lp \input pic74b.lp .

The diagrams on the right give variances, showing that these are
indeed graphs; note that in the twisted sum the variances of the
domain are reversed.  For the strict monoidal version we have
$a=1$ and $b=1$.

Observe that we realise \kml graphs as pictorial graphs by joining
paired objects up with an edge.  In the diagrams above, the objects
are in fact shapes, so the drawn edges in fact represent multiple
edges as necessary.

In fact there is a notion of graphs labelled in a category \bb{C}
(see \cite{che13}); these are the morphisms of a category which we
will call $K\bb{C}$.  Then the graphs above may be considered as
graphs labelled in the category \cat{1}.  So for consistency we write
$G = K\cat{1}$.


\subsection{Allowable morphisms}

The {\em allowable morphisms} are then defined to be the smallest
class of morphisms of $K\cat{1}$ satisfying the following
conditions:

\begin{enumerate}
\item For any $T,S,R$ each of the following morphisms is in the
class:
\[ \begin{array}{rcl}
    1 & : & T \lra T \\
    a & : & (T\otimes S) \otimes R \lra T \otimes (S \otimes R)\\
    a^{-1} & : & T \otimes (S \otimes R) \lra (T \otimes S) \otimes
    R\\
    b & : & T \otimes I \lra T\\
    b^{-1} & : & T \lra T \otimes I\\
    c & : & T \otimes S \lra S \otimes T.
\end{array}\]

\item For any $T, S$ each of the following morphisms is in the
class:
\[ \begin{array}{rcl}
    d & : & T \lra [S,T\otimes S]\\
    e & : & [T,S] \otimes T \lra S.
\end{array} \]

\item If $f: T\lra T'$ and $g:S\lra S'$ are in the class so is
    \[f\otimes g: T\otimes S \lra T' \otimes S'.\]

\item If $f:T \lra T'$ and $g:S \lra S'$ are in the class then so is
    \[[f,g] : [T',S] \lra [T,S'].\]

\item If $f: T \lra S$ and $g:S \lra R$ are in the class then so is
$gf: T \lra R$.

\end{enumerate}

We write $A\cat{1}$ for the category of shapes and allowable
morphisms.

The main theorem of \cite{km1} that we use is as follows:

\begin{theorem} \label{noloops}
If $f:T \lra S$ and $g:S \lra R \ \in G$ are allowable then they
are compatible, that is, composing them gives no closed loops.
\end{theorem}

For the proof (an induction over structure), see \cite{km1}.

\subsection{Duality} \label{duality}

Since $K\cat{1}$ is closed, given any graph
    \[\xi:S \otimes T \lra U \ \in K\cat{1}\]
there is a unique dual
    \[\bar{\xi}:S \lra [T,U]\]
so in particular, given a graph
    \[\alpha:S\lra T\]
there is a unique dual
    \[\bar{\alpha}: I \lra [S, T].\]
We will eventually be concerned with graphs of the form
    \[\alpha: A_1 \tensordot A_k \lra B;\]
it is sometimes convenient or indeed necessary to use the dual
    \[\bar{\alpha} : I \lra [\ A_1 \tensordot A_k \ , \ B \ ]\]
and we may refer to either of these graphs as $\alpha$ when the
exact form is not relevant.





\sunit
\section{Informal description of trees} \label{treeback}

We consider unlablled, `combed' trees, with ordered nodes.  For
example the following is a tree:


\begin{center}
\input pic01.lp .
\end{center}

\renewcommand{\labelenumi}{\roman{enumi})}

Explicitly, a tree $T=(T, \rho, \tau)$ consists of
\begin{enumerate}
\item A planar tree $T$
\item A permutation $\rho \in \cat{S}_l$ where $l=$ number of leaves of
$T$
\item A bijection $\tau: \{\mbox{nodes of $T$}\} \lra \{1, 2,
\ldots, k\}$ where $k=$ number of nodes of $T$; equivalently an
ordering on the nodes of $T$.
\end{enumerate}

%Then, given a category \bb{C} a {\em labelled tree} consists of
%\begin{enumerate}
%\item A tree $(T, \rho, \tau)$
%\item For each edge of the tree a morphism in \bb{C}, considered to
%be pointing `down' towards the root of the tree.
%\end{enumerate}

Note that there is a `null tree' with no nodes
\begin{center}
\input pic53.lp .
\end{center}

%so for each morphism $f \in \bb{C}$ there is a labelled tree
%
%\begin{center}
%\input pic54.lp
%.\end{center}

\section{Formal description of trees}
\label{treeformal}

In this section we give a formal description of the above trees,
characterising them as connected
graphs with no closed loops (in the conventional sense of `graph'). 
This enables us, in Section~\ref{treegraph}, to express a tree as a
morphism in $K\cat{1}$; it also enables us, in Section~\ref{all}, to
show that all {\em allowable} graphs of the correct shape arise in
this way.

We consider a tree with $k$ nodes $N_1, \ldots, N_k$ where $N_i$
has $m_i$ inputs and one output. Let $N$ be a node with
$(\sum\limits_i m_i )- k+1$ inputs; $N$ will be used to represent
the leaves and root of the tree.

Then a tree is given by a bijection
    \[\coprod_i\{\mbox{inputs of $N_i$}\} \coprod \{\mbox{output of $N$}\} \lra
    \coprod_i\{\mbox{output of $N_i$}\} \coprod \{\mbox{inputs of
    $N$}\}\]
since each input of a node is either connected to a unique output
of another node, or it is a leaf, that is, input of $N$. Similarly
each output of a node is either attached to an input of another
node, or it is the root, that is, output of $N$.

We express this formally as follows.

\begin{lemma} \label{tree1}
Let $T$ be a tree with nodes $N_1, \ldots, N_k$, where $N_i$ has
inputs $\{x_{i1}, \ldots, x_{im_i}\}$ and output $x_i$.  Let $N$
be a node with inputs $\{z_1, \ldots, z_l\}$ and output $z$, with
    \[l=(\sum\limits_{i=1}^k m_i) - k +1.\]
    Then $T$ is given by a
bijection
    \[\alpha \ : \ \coprod_i\{x_{i1},\ldots, x_{im_i}\} \coprod \{z\} \lra
    \coprod_i\{x_i\} \coprod \{z_1, \ldots, z_l\}.\]
\end{lemma}

\begin{prf}  We construct the bijection $\alpha$.

Consider $x_{ij}$ on the left hand side.  This is the $j$th input
of $N_i$, which is either
\begin{enumerate}
\item joined to the output of a unique $N_r$, in which case
$\alpha(x_{ij})=x_r$, or
\item the $p$th leaf of the tree, in which case
$\alpha(x_{ij})=z_p$.
\end{enumerate}  Finally, $z$ is the root of the tree, so must be
the output of a unique $N_r$, so $\alpha(z)=x_r$.

For the inverse, consider $x_r$ on the right hand side.  This is
the output of the $r$th node, so is either
\begin{enumerate}
\item joined to the $j$th input of a unique $N_i$, in which case
$\alpha^{-1}(x_r) = \alpha(x_{ij})$, or
\item is the root of the tree, in which case $\alpha^{-1}(x_r)=z$.
\end{enumerate}

Each $z_r$ is a leaf of the tree, so must be the $j$th input of a
unique $N_i$, so $\alpha^{-1}(z_r)=x_{ij}$.

$\alpha^{-1}$ thus defined is inverse to $\alpha$, so $\alpha$ is
a bijection.

Note that if $k=0$ we have the null tree with no nodes; then $l=1$
and $N$ has one input $z_1$.  Then the bijection $\alpha$ is given
by $\alpha(z)=z_1$.

\end{prf}

For example, consider \pica pic21.lp \input
pic22.lp \input pic23.lp .\picz  Then a tree \pica
pic24.lp \picz is given by the following bijection:

\[\begin{array}{rcl}
    \{x_1, x_2, x_3, y_1, y_2, z\} & \lra & \{x,y,z_1, z_2, z_3,
    z_4\}\\
    x_1 & \longmapsto & z_1 \\
    x_2 & \longmapsto & z_3 \\
    x_3 & \longmapsto & z_4 \\
    y_1 & \longmapsto & x \\
    y_2 & \longmapsto & z_2 \\
    z & \longmapsto & y .\\
    \end{array}\]

For the converse, every such bijection gives a graph, but it is
not necessarily a tree.  For example

\[\begin{array}{rcl}
    x_1 & \longmapsto & y \\
    x_2 & \longmapsto & z_3 \\
    x_3 & \longmapsto & z_4 \\
    y_1 & \longmapsto & x \\
    y_2 & \longmapsto & z_2 \\
    z & \longmapsto & z_1 \\
    \end{array}\]
gives the following graph: \pica pic25.lp .\picz  So we need to
ensure that the resulting graph has no closed loops; the use of
the `formal' node $N$ then ensures connectedness.  We express this
formally as follows.

\begin{lemma} \label{loopspropb}
Let $N_1, \ldots, N_k, N$ be nodes where $N_i$ has inputs
$\{x_{i1}, \ldots, x_{im_i}\}$ and output $x_i$, and $N$ has
inputs $\{z_1, \ldots, z_l\}$ and output $z$, with
$l=(\sum\limits_{i=1}^k m_i) - k +1$. Let $\alpha$ be a bijection
    \[\coprod_i\{x_{i1},\ldots, x_{im_i}\} \coprod \{z\} \lra
    \coprod_i\{x_i\} \coprod \{z_1, \ldots, z_l\}.\]
Then $\alpha$ defines a graph with nodes $N_1, \ldots, N_k$.
\end{lemma}

\begin{lemma} \label{loopspropb2}
Let $\alpha$ be a graph as above.  Then $\alpha$ has a closed loop
if and only if there is a non-empty sequence of indices
    \[\{t_1 , \ldots, t_n \} \subseteq \{1, \ldots, k\}\]
such that for each $2 \leq j \leq n$
    \[\alpha( x_{t_jb_j})=x_{t_{j-1}} \]
for some $1 \leq b_j \leq m_j$, and
    \[\alpha(x_{t_1b_1})= x_{t_n}\]
for some $1 \leq b_1 \leq m_1$.  \end{lemma}

\begin{prf} A closed loop in $\alpha$ is a sequence of nodes
    \[\{N_{t_1}, \ldots, N_{t_n}\}\]
such that for each $2 \leq j \leq n$, $N_{t_j}$ is joined to
$N_{t_{j-1}}$, and also $N_{t_1}$ is joined to $N_{t_n}$.

That is, for each $2 \leq j \leq n$, some leaf of $N_{t_j}$ is
joined to the root of $N_{t_{j-1}}$, and also some leaf of
$N_{t_1}$ is joined to $N_{t_n}$. This is precisely the case
described formally in the Lemma, with the $b_j$ giving the leaves
in question.
\end{prf}

For example in the above case we have
\[\begin{array}{rrcl}
    \alpha : &x_{11} & \longmapsto & x_2 \\
    &x_{12} & \longmapsto & z_3 \\
    &x_{13} & \longmapsto & z_4 \\
    &x_{21} & \longmapsto & x_1 \\
    &x_{22} & \longmapsto & z_2 \\
    &z & \longmapsto & z_1 \\
    \end{array}\]
which has a loop given by indices $\{1,2\}$, since
    \[ \alpha(x_{21}) = x_1 \mbox{\ \ and \ \ } \alpha(x_{11}) = x_2.\]

Note that a graph with no nodes cannot satisfy the above condition
since the sequence $\{N_{t_1}, \ldots, N_{t_n}\}$ is required to
be non-empty.


\begin{corollary} \label{loopspropb3}
A tree with nodes $N_1, \ldots, N_k$ is precisely a bijection
$\alpha$ as in Lemma~\ref{loopspropb}, such that there is no
sequence of indices as in Lemma~\ref{loopspropb2}.
\end{corollary}

\begin{prf} $\alpha$ defines a graph; this is a tree if and only if there is
no closed loop. Note that if $k=0$ we have a bijection
    \[\alpha: \{z\} \lra \{z_1\}\]
that is, the null tree.  \end{prf}



\section{Trees as morphisms in $K\cat{1}$}
\label{treegraph} We now show how trees may be expressed as
graphs.  Here we consider unlabelled trees; the labelled version
follows easily.

Let \cat{1} be the category with just one object and one
(identity) morphism.  We write the single object of \cat{1} as
$1$.  Then we express a node of a tree as the following object in
$K\cat{1}$
    \[X_m = [1 \otimes \ldots \otimes 1, 1] = [1^{\otimes m}, 1]\]
where $m$ is the number of inputs of the node.

%Given any permutation $\sigma \in \cat{S}_m$, there is a morphism
%    \[\sigma: 1^{\otimes m} \map{\sim} 1^{\otimes m} \ \in
%    K\cat{1}\]
%given by composing symmetries.
%
%This induces a morphism
%    \[[\sigma, 1]: X_m \lra X_m\]
%which may be regarded as permuting the inputs of the corresponding
%node.


Now consider a tree $T$ with (ordered) nodes $N_1, \ldots N_k$
where $N_i$ has $m_i$ inputs.  We show that this tree may be
represented as a morphism
    \[X_{m_1} \otimes \ldots \otimes X_{m_k} \map{\xi_T} X_l \ \in \
    K\cat{1}\]
using the formal description of trees as in
Section~\ref{treeformal}.

\begin{lemma} \label{tree2}
Let $T$ be a tree with $N_1, \ldots, N_k$ be nodes where $N_i$ has
inputs $\{x_{i1}, \ldots, x_{im_i}\}$ and output $x_i$.  Then $T$
is given by a morphism
    \[\xi_T : X_{m_1} \otimes \ldots \otimes X_{m_k} \lra X_l \ \in \
    K\cat{1}\]
where $l=(\sum\limits_{i=1}^k m_i) - k +1$. Note that if $k=0$
then the left hand side of the above expression becomes $I$.
\end{lemma}

\begin{prf}
Recall that a graph $\xi_T$ as above is precisely a bijection from
the $-$'s to the $+$'s in the twisted sum
    \[v(X_{m_1} \otimes \ldots \otimes X_{m_k}) \tilde{+} v(X_l).\]
By Lemma~\ref{tree1}, $T$ is given by a bijection
    \[\coprod_i\{x_{i1},\ldots, x_{im_i}\} \coprod \{z\} \lra
    \coprod_i\{x_i\} \coprod \{z_1, \ldots, z_l\}.\]
Observe that the elements of the left hand side of this expression
are precisely the $-$'s in the twisted sum above, and those of the
right hand side are precisely the $+$'s. \end{prf}

As in Section~\ref{treeformal}, the idea is that a tree is
constructed by identifying each node output with the node input to
which it is joined, unless it is the root; similarly each input is
identified with a node output unless it is a leaf.  This
identification gives the mates in the graph $\xi_T$, where the
codomain $X_l$ is representing the leaves and the root of the tree
$T$.

For example the following tree as described in
Section~\ref{treeformal}
\begin{center}
\input pic02.lp
\end{center}
is be expressed as the following morphism in $K\cat{1}$
\begin{center}
\input pic03.lp
\end{center}
and the following representation giving variances shows that this
is indeed a graph:
\begin{center}
\input pic04.lp
\end{center}
Formally, the graph for a tree $T$ as above is given as follows.
We write
    \[X_{m_i} = [\ A_{i1} \otimes \ldots \otimes
    A_{im_i}\ ,\  A_i\ ] \]
    \[X_l=[\ B_1, \otimes \ldots \otimes B_l, \
    , \ B\ ]\]
where each $A_{ij}, A_i, B_i, B = 1$ and in the twisted sum we
have variances
    \[\begin{array}{rl}
    v(A_{ij}) = +, & v(A_i) = -\\
    v(B_p) = -, & v(B) = +.
    \end{array}\]
Then the graph $\xi_T$ is given as follows.

\begin{itemize}
\item considering node inputs
\end{itemize}
For each $i,j$, either
\begin{enumerate}
\item the $j$th input of $N_i$ is joined to the output of
$N_r$, say, in which case $A_{ij}$ is the mate of $A_r$, or
\item the $j$th input of $N_i$ is the $p$th leaf of the tree $T$,
in which case $A_{ij}$ is the mate of $B_p$ in $\xi_T$.
\end{enumerate}

\begin{itemize}
\item considering node outputs
\end{itemize}
For each $r$, either
\begin{enumerate}
\item the output of $N_r$ is the root of the tree, in which case $B_r$ is the
mate of $B$, or
\item the output of $N_r$ is joined to the $j$th input of $N_i$,
say, in which case $A_r$ is the mate of $A_{ij}$.
\end{enumerate}

Note that the null tree \pica pic53.lp \picz is a graph $I
\map{\xi} X_1$ as follows: \pica pic55.lp .\picz

So we have shown that every tree is given by a graph in
$K\cat{1}$; in Section~\ref{every} we show that any such graph is
allowable.  The proof is by induction, and the following section
enables us to makes the induction step.

\section{Composition of trees} \label{treecomp}

We now discuss two ways of composing trees:

\numarabic
\begin{enumerate}
\item {\em leaf-root composition} in which a leaf of one tree is
attached to the root of another, for example \pica pic05.lp \picz
\item {\em node-replacement composition} in which a node of one
tree is replaced by another tree, for example \pica pic06.lp \picz
\end{enumerate}

In the first case the inputs of the tree are considered to be the
leaves, and the output the root; note that an issue of
node-ordering arises, so that this `composition' is not
associative.  However, it facilitates the induction argument in
Section~\ref{every}, which is why we discuss it here.

In the second case the inputs are the nodes, and the output a node
with one input edge for each leaf of the tree.  This form of
composition is used in later work (\cite{che13}) when we describe the
construction of opetopes in the framework of Kelly-Mac~Lane graphs.  

We show how each of these forms of composition arises for trees
represented as graphs as in Section~\ref{treegraph}

Recall that a tree is expressed as a morphism
    \[X_{m_1}\otimes \cdots \otimes X_{m_k} \lra X_l \ \in K\cat{1}.\]
Now in general, given any morphisms in $K\cat{1}$
    \[B_1 \tensordot B_n \map{f} A_p\]
    \[A_1 \tensordot A_m \map{g} A\]
for some $1 \leq p \leq m$, we may form the composite
    \[f\circ(1 \tensordot 1 \otimes g \otimes 1 \tensordot 1)\]
which we write as
    \[g\circ_p f:A_1 \tensordot A_{j-1} \otimes B_1 \tensordot B_n
    \otimes A_{p+1} \tensordot A_m \lra A.\]
Note that if $p$ is evident from the context we simply write
$g\circ f$.  %%%question2 do we ever actually do that?

This composition gives node-replacement composition of trees.
Consider trees $S, T$ with graphs
    \[\xi_S: X_{s_1} \tensordot X_{s_n} \lra X_l\]
    \[\xi_T: X_{t_1} \tensordot X_{t_m} \lra X_k\ .\]
Then S may be composed at the $p$th node of $T$ if the number of
leaves of $S$ equals the number of inputs of the $p$th node, that
is, if $X_l=X_{t_p}$.  Then the graph for the composite tree is
given by
    \[\xi_S \circ_p \xi_T.\]

For example as above, suppose we have $p=2$ and \pica pic07.lp
\picz then we express this with graphs as follows \pica pic08.lp
\picz

In fact, considering the dual forms $\bar{\xi}_S$ and
$\bar{\xi}_T$, we see that this composite may also be expressed by
means of a `composition graph' $\xi$ as follows.  We have
    \[\bar{\xi}_S: I \lra [X_{s_1} \tensordot X_{s_n} \ , \ X_l]\]
    \[\bar{\xi}_T: I \lra [X_{t_1} \tensordot X_{t_m} \ , \ X_k].\]
Then $\xi$ is a graph
\[\begin{array}{c}[X_{t_1} \tensordot X_{t_m}\ , \ X_k]
    \otimes [X_{s_1} \tensordot X_{s_n} \ , \ X_l] \\
    \downarrow \\
    \mbox{\hspace{0mm}}[X_{t_1} \tensordot X_{t_{p-1}} \otimes X_{s_1}
    \tensordot X_{s_n} \otimes X_{t_{p+1}} \tensordot X_{t_m} \ , \ X_k]
\end{array}\]
where $X_l$ is joined to $X_{t_p}$ in the domain, and for all
other $j$, $X_j$ in the domain is joined to $X_j$ in the codomain.


\bigskip

We now consider leaf-root composition.  Consider trees $S,T$ as
above.  We seek to attach the root of $S$ to the $q$th leaf of
$T$, and we adopt the convention that the nodes of $S$ are then
listed before those of $T$ in the final tree.

This is achieved in $K\cat{1}$ by placing the graphs $\xi_S$ and
$\xi_T$ side by side, that is, taking their tensor product, and
composing the result with a `composition graph' that joins up the
correct leaf and root as required.  We write
    \[X_l=[A_1 \tensordot A_l, A]\]
    \[X_k=[B_1 \tensordot B_k, B]\]
    \[X_{l+k-1}=[C_1 \tensordot C_{l+k-1},C]\]
and the `composition graph' as
    \[\xi:X_l \otimes X_k \lra X_{l+k-1}.\]
The idea is that the leaves of $S$ are inserted into the list of
leaves of $T$ at the $q$th place to give
    \[[B_1 \tensordot B_{q-1} \otimes A_1 \tensordot A_l \otimes
    B_{q+1} \tensordot B_k\ ,\ B]\]
so the composition graph $\xi$ is given as follows: \numroman

\begin{enumerate}
\item the mate of $A$ is $B_q$
\item the mate of $B$ is $C$
\item for $1\leq i \leq l$ the mate of $A_i$ is $C_{q+i-1}$
\item for $1\leq i \leq q-1$ the mate of $B_i$ is $C_i$
\item for $q+1 \leq i \leq k$ the mate of $B_i$ is $C_{l+i-1}$.
\end{enumerate}

For example, suppose we have $q=2$ with \pica pic10.lp \picz then
this is represented by the following graph in $K\cat{1}$: \pica
pic11.lp \input pic12.lp \picz

Note that we could adopt a different convention for ordering the
nodes of the composite tree, using $\xi_T \otimes \xi_S$.  Of
course, neither convention yields an associative composition, but
since we are not at this time trying to form a category (or
multicategory) of such trees, we do not pursue this matter here.

\section{The graph of a tree is allowable}
\label{every}

We have shown how any tree is represented by a graph.  We now show
that any such graph is {\em allowable}.

\begin{proposition} \label{loopspropa}
Given a tree $T$ as above, the graph $\xi_T$ is allowable.
\end{proposition}

\begin{prf}
By induction on the height of trees.  Here the height of a tree is
the maximum number of nodes on any path from a leaf to the root. A
tree of height 0 is the null tree \pica pic53.lp \picz represented
by the graph \pica pic13.lp \picz which is the morphism
    \[I \map{d_{I1}} [1, I\otimes 1] = [1,1]\]
which is allowable.

A tree of height 1 is just a node \pica pic14.lp \picz which is
represented by an identity graph \pica pic15.lp \picz which is
allowable.

A tree of height $h \ge 1$ may be considered as a composite
\length{1.3mm} \pica pic16.lp \picz where the $T_i$ are subtrees
of $T$; by construction they have height $\le h$.  So by induction
each of these is represented by an allowable graph. \length{0.9mm}

It is therefore sufficient to show that leaf-root composition of
allowable graphs gives an allowable graph.  Note that leaf-root
composition as defined in Section~\ref{treecomp} will not
necessarily give the correct node ordering on the final tree;
however, this can be achieved by composing with symmetries as
necessary.  This will not affect the allowability of the graph
since symmetries are allowable graphs, and composites of allowable
graphs are allowable.

Furthermore, since tensors and composites of allowable graphs are
allowable, it is sufficient to show that all `composition graphs'
$\xi$ as defined in Section~\ref{treecomp} are allowable.

Since any permutation may be written as a composite of
transpositions, and is therefore allowable, we may assume without
loss of generality that $q=1$ in the composition.  So it is
sufficient to show that any graph $\xi$ of the following form is
allowable.  Writing
    \[X_{m_1}=[A_1 \tensordot A_{m_1}, A]\]
    \[X_{m_2}=[B_1 \tensordot B_{m_2}, B]\]
    \[X_{m_1 + m_2 -1}=[C_1 \tensordot C_{m_1 + m_2 -1},C]\]
then
    \[\xi:X_{m_1} \otimes X_{m_2} \lra X_{m_1 + m_2 -1}\]
is given as follows. \numroman

\begin{enumerate}
\item the mate of $A$ is $B_1$
\item the mate of $B$ is $C$
\item for all $1\leq i \leq m_1$ the mate of $A_i$ is $C_i$
\item for $2 \leq i \leq m_2$ the mate of $B_i$ is $C_{m_1 + i -1}$.
\end{enumerate}

So $\xi$ has the form \pica pic17.lp \picz

Writing
    \[A_1 \tensordot A_{m_1} = \bar{A}\]
    \[B_2 \tensordot B_{m_2} = \bar{B}\]
we may abbreviate this as \pica pic18.lp \picz which may be
written as the following composite of allowable graphs: \pica
pic19.lp
\input pic20.lp \picz so $\xi$ is allowable as required.
\end{prf}


\section{Every allowable graph is a tree} \label{all}

We have seen that every tree is represented by a unique graph, and
that this graph is allowable. In this section we prove the
converse, that every allowable graph of the correct shape
represents a unique tree.

We now use the characterisation of trees as in
Section~\ref{treeformal}.  As in that section, for the converse we
see that every morphism
    \[X_{m_1}\otimes \cdots \otimes X_{m_k} \lra X_l \ \in K\cat{1}\]
gives a graph but that it is not necessarily a tree; we need to
ensure that the resulting graph has no closed loops.  We copy
Lemmas~\ref{loopspropb} and \ref{loopspropb2}, ``translating''
them into the language of closed categories.  Note that the word
`graph' is used in the ordinary sense; for clarity we refer to
Kelly-Mac~Lane graphs as `morphisms in $K\cat{1}$'.


\begin{lemma} \label{tree3}
Let $N_1, \ldots, N_k$ be nodes where $N_i$ has inputs
    \[\{A_{i1}, \ldots, A_{im_i}\}\]
and output $x_i$.  Let $\xi$ be a morphism
    \[\xi:X_{m_1} \otimes \ldots \otimes X_{m_k} \lra X_l \ \in \
    K\cat{1}\]
where $l=(\sum\limits_{i=1}^k m_i) - k +1$. Then $\xi$ defines a
graph with nodes $N_1, \ldots, N_k$. \end{lemma}

\begin{lemma} \label{tree4}
Let $\xi$ be a graph as above.  Then $\xi$ has a closed loop if
and only if there is a non-empty set of indices
    \[\{t_1 , \ldots, t_n \} \subseteq \{1,\ldots, k\}\]
such that for each $2 \leq j\leq n$ the mate of $A_{t_{j-1}}$
under $\xi$ is $A_{t_jb_j}$ and the mate of $A_{t_n}$ is
$A_{t_1b_1}$ for some $1 \leq b_j \leq m_j$. \end{lemma}


\begin{proposition} \label{loopspropd}
If there is a set of indices $\{t_1, \ldots t_n\}$ as above then
$\xi$ is not allowable.  \end{proposition}

\begin{corollary} Let $\xi$ be a morphism as above.  Then $\xi$ is
a tree if and only if it is allowable. \end{corollary}

To prove this we will use Theorem~\ref{noloops} (Theorem~2.2 of
\cite{km1}) which states that if two composable morphisms are
allowable then they are compatible, that is, composing them does
not result in any closed loops.  So to show that $\xi$ as above is
not allowable, we aim to construct an allowable morphism $\eta$
such that $\eta$ and $\xi$ are not compatible.  The following
lemma provides us with such a morphism.

\begin{lemma} \label{loopsprope}
Write $X_k = [A_1 \tensordot A_k, A]$ with $A_i, A=1$ and let $1
\leq p \leq k$.

Then there is an allowable morphism
    \[ \theta_p: [A_1 \tensordot A_{p-1} \otimes A_{p+1} \tensordot A_k, I]
    \lra X_k\]
with graph \pica pic26.lp .\picz \end{lemma}

\begin{prf} Write $Y=A_1 \tensordot A_{p-1} \otimes A_{p+1} \tensordot A_k$.
Since symmetries are allowable, it is sufficient to exhibit an
allowable morphism
    \[[Y,I] \lra [Y\otimes 1, 1]\]
with underlying graph \pica pic27.lp .\picz  We have the following
composite of allowable morphisms: \pica pic28.lp \picz which has
the underlying graph as required; since composites of allowable
morphisms are allowable, the composite is allowable.  \end{prf}

\begin{prfof}{Proposition~\ref{loopspropd}} To show that
    \[\xi: X_{m_1} \tensordot X_{m_k} \lra X_l\]
is not allowable we construct an allowable morphism
    \[\eta: T \lra X_{m_1} \tensordot X_{m_k}\]
such that $\eta$ and $\xi$ are not compatible, that is, composing
them produces a closed loop.

We aim to construct $\eta$ in such a way that for each $1\leq j
\leq n$ the mate of $A_{t_j}$ is $A_{t_jb_j}$ so that in the
composite graph we have the following closed loop: \pica pic29.lp
.\picz  We use morphisms of the form $\theta_p$ as given in
Lemma~\ref{loopsprope}.

Put $T=Y_1 \tensordot Y_k$ where
\[Y_i = [A_{t_j1}, \tensordot A_{t_j(b_j-1)} \otimes
    A_{t_j(b_j+1)} \tensordot A_{t_jm_i}\ ,\ I]\]
if $i=t_j$ for some $1\leq j \leq n$, and
    \[Y_i = X_{m_i}\]

We define $\eta$ as a tensor product
    \[f_1 \tensordot f_k\ :\ Y_1 \tensordot Y_k\  \lra\ X_{m_1}
    \tensordot X_{m_k}\]
where
    \[f_i = \left\{ \begin{array} {l@{\extracolsep{3em}}l}
    \theta_{b_j} & \mbox{if $i=t_j$ for some $1\leq j \leq n$}\\
    1 & \mbox{otherwise} \end{array} \right. \]
By Lemma~\ref{loopsprope} each $f_i$ is allowable, so $\eta$ is
allowable.

Since the mate of $A_{t_j}$ under $\theta_{b_j}$ is $A_{t_jb_j}$
we have a closed loop as  above, so $\eta$ and $\xi$ are not
compatible.  Since $\eta$ is allowable, it follows from
Theorem~\ref{noloops} that $\xi$ is not allowable.
\end{prfof}

Finally we sum up the results of this section in the following
proposition.


\begin{proposition} \label{loopspropg}
A tree is  a unique morphism of the form
    \[X_{m_1} \tensordot X_{m_k} \lra X_l \in K\cat{1}\]
and this morphism is allowable.  Conversely, any such allowable
morphism represents a unique tree.
\end{proposition}

%\begin{prf}  We have seen (Section~\ref{treegraph}) that a tree is
%represented as a unique morphism of the above form, and
%Proposition~\ref{loopspropa} states that this graph is allowable.
%
%Conversely, we have seen above that a morphism $\xi$ of the given
%form represents a unique graph.  %%%question4 have we really
%By Proposition~\ref{loopspropd}, if this graph is not a tree then
%$\xi$ is not allowable, so if $\xi$ is allowable then the graph it
%represents must be a tree.  \end{prf}

\begin{corollary} \label{loopsproph}
A tree is a unique allowable morphism of the form
    \[I \lra [X_{m_1} \tensordot X_{m_1}, X_l] \in K\cat{1}.\]
Conversely, any such allowable morphism represents a unique tree.
\end{corollary}

\begin{prf} Follows from the closed structure of $K\cat{1}$.
\end{prf}

In order to make Proposition~\ref{loopspropg} and
Corollary~\ref{loopsproph} more precise, we seek an equivalence
between a `category of trees' and a `category of allowable
morphisms'.  In fact, trees of this form arise naturally by
considering configurations for composing arrows of a symmetric
multicategory.  That is, they arise from the `slicing' process as
defined in \cite{bd1} and \cite{che7}; the trees then appear
as arrows of the multicategory $I^{2+}$, and so as objects of
$I^{3+}$, forming a category $\bb{C}_3$.

So we may consider the slice construction using the
representation in closed categories.  In considering this for
constructing trees, we in fact deal with all the machinery used in
constructing $k$-opetopes for all $k\geq 0$, since these are
formed by iterating the construction.  This is the subject of
\cite{che13}.  


\addcontentsline{toc}{section}{References}
\bibliography{bib0209}




\nocite{kl1}

\nocite{js1} 

\nocite{shu1}

\nocite{mel2}

\nocite{laf1}

\nocite{gir1}





\end{document}

pubsettings.tex

\input{macros1}
\input{macros2}
\input{opics}
\input{settings1}

%\mybibstyle

\bibliographystyle{plain}

settings1.tex
%%%%%%%%%%%%%%%%%%%%%%%%% use packages 


\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsmath}
%\usepackage{amsthm}
\usepackage{fancyheadings}
\usepackage{latexcad}



pub6.bbl
\begin{thebibliography}{10}

\bibitem{bd1}
John Baez and James Dolan.
\newblock Higher-dimensional algebra {I}{I}{I}: $n$-categories and the algebra
  of opetopes.
\newblock {\em Adv. Math.}, 135(2):145--206, 1998.
\newblock Also available via {\tt http://math.ucr.edu/home/baez}.

\bibitem{blu1}
R.~Blute.
\newblock Linear logic, coherence and dinaturality.
\newblock {\em Theoretical Computer Science}, 115:3--41, 1993.

\bibitem{che13}
Eugenia Cheng.
\newblock The theory of opetopes via {K}elly-{M}ac~{L}ane graphs, October 2002.
\newblock E-print {\tt math.CT/0304288}.


\bibitem{che7}
Eugenia Cheng.
\newblock Weak $n$-categories: opetopic and multitopic foundations, October
  2002.
\newblock E-print {\tt math.CT/0304277}.


\bibitem{gir1}
Jean-Yves Girard.
\newblock Linear logic: its syntax and semantics.
\newblock In Laurent~Regnier, Jean-Yves~Girard, Yves~Lafont, editors, {\em
  Advances in Linear Logic}, volume 222 of {\em LMS}, pages 1--42. Cambridge
  University Press, 1995.

\bibitem{js1}
Andr{\'e} Joyal and Ross Street.
\newblock Braided tensor categories.
\newblock {\em Advances in Mathematics}, 102:20--78, 1983.

\bibitem{kl1}
G.~Kelly and M.~Laplaza.
\newblock Coherence for compact closed categories.
\newblock {\em Journal of Pure and Applied Algebra}, 19:193--213, 1980.

\bibitem{km1}
G.~M. Kelly and S.~{Mac Lane}.
\newblock Coherence in closed categories.
\newblock {\em Journal of Pure and Applied Algebra}, 1(1):97--140, 1971.

\bibitem{laf1}
Yves Lafont.
\newblock From proof-nets to interaction nets.
\newblock In Laurent~Regnier Jean-Yves~Girard, Yves~Lafont, editor, {\em
  Advances in Linear Logic}, volume 222 of {\em LMS}, pages 225--247. Cambridge
  University Press, 1995.

\bibitem{mel2}
Paul-Andr\'{e} Melli\`{e}s.
\newblock On double categories and multiplicative linear logic, June 1999.
\newblock to appear in Mathematical Structures in Computer Science.

\bibitem{shu1}
Mei~Chee Shum.
\newblock {\em Tortile Tensor Categories}.
\newblock PhD thesis, Macquarie University, New South Wales, November 1989.

\end{thebibliography}
