4

I would like to typeset, using xypic, the triangle identities from the definition of adjoint functors in category theory. My problem is with creating the double arrow connecting the hypotenuse and the opposite corner.

enter image description here

Here's the (completely trivial) part I can do myself, which is everything but the double arrows: \xymatrix{ C\ar[r]^{F}\ar[dr]_{1_{C}} & D\ar[d]^{G} & & D\ar[dr]^{1_{D}}\ar[d]_{G}\\ & C & & C\ar[r]_{F} & D }

There is supposedly a way of creating such "pasting diagrams" in xypic, but I haven't found any clear instructions anywhere; I know the command \compositemap is somehow involved but I could not figure out how to use it.

4
5
+50

I do not use xy anymore, as it is not that easy and powerful as . I hope, this solution will help you as well:

% arara: pdflatex

\documentclass{article}
\usepackage{tikz-cd}

\begin{document}    
\[\begin{tikzcd}[row sep=3em]
C \arrow{r}{F} \arrow[""{name=foo}]{dr}[swap]{1_C} & D \arrow{d}{G} \arrow[Rightarrow, from=foo, swap, near start, "\eta"]& D \arrow{d}[swap]{G} \arrow[""{name=bar, below}]{dr}{1_D} & \\
& C & C \arrow{r}[swap]{F} \arrow[Rightarrow, to=bar, swap, near start, "\varepsilon"] & D
\end{tikzcd}\]
\end{document}

enter image description here


As you wished, here is a solution with xy. It is quite hacky. Using the examples mentioned by Sigur would be better, I guess. But as xy is able to manage empty matrix entries, I used this in order to point arrows to where I want. The double amount of matrix nodes is necessary though.

% arara: pdflatex

\documentclass{article}
\usepackage[%
,all
%,cmtip % recommended, but I do not know how to get it to work for the double arrow
]{xy}

\begin{document}    
\[\xymatrix@R=4mm @C=4mm{ 
    C\ar[rr]^{F} \ar[ddrr]_{1_{C}} & & D \ar[dd]^{G} & & D \ar[ddrr]^{1_{D}} \ar[dd]_{G} & & \\ 
    &\ar@2{->}[ur]_{\eta} & & & & & \\
    & & C & & C \ar@2{->}[ur]_{\varepsilon} \ar[rr]_{F} & & D 
}\]
\end{document}

enter image description here

4
  • Thanks for your tikz solution, but I would also much like an xy solution as it is a lot easier to use in LyX.
    – Exterior
    Dec 12 '14 at 11:57
  • @Exterior You can just copy my code in to your TeX-File. Even in LyX. As you have not even provided one single letter of code, it is not very likely to get help for this (quite hard in xy, if you are interested). This is not a "we-code-for-free"-page. Sorry, but I down-voted your question until it gets some improvement by you.
    – LaRiFaRi
    Dec 12 '14 at 12:01
  • 1
    I understand. I can of course put up the code for the triangles, but that's really pretty trivial in xypic and the problem is entirely with the 2-arrows. At any rate, I'll add the code for the triangles.
    – Exterior
    Dec 12 '14 at 12:04
  • @Exterior See my update
    – LaRiFaRi
    Dec 12 '14 at 12:34
6

Another xy-pic solution with a different approach:

\documentclass{article}
\usepackage[all]{xy}

\begin{document}
\[
\xymatrix{ 
  C\ar[r]^{F}\ar[dr]_{1_{C}} & D\ar[d]^{G}\ar@{<=}[dl]+<22pt>^>>>{\eta} & & D\ar[dr]^{1_{D}}\ar[d]_{G}                      & \\ 
                             & C                                        & & C\ar[r]_{F}\ar@{=>}[ur]-<22pt>_>>>{\varepsilon} & D 
}
\]
\end{document} 

Output:

enter image description here

1
  • +1. Still though, I would like to see the "right" answer using \compositemap.
    – Exterior
    Dec 14 '14 at 9:38
1

I just looked at the same thing and tried to use the 2cell feature in xy-pic. After reading the reference manual, I think the "right" solution is the following

\documentclass[border=10pt]{standalone}
\usepackage[all,2cell]{xy}
\UseAllTwocells

\begin{document}
\[
\xymatrix{C\drtwocell\omit{^<-2>\eta}\ar_{1_C}[dr]\ar^F[r]&D\ar^G[d]&
D\drtwocell\omit{^<2>\varepsilon}\ar^{1_D}[dr]\ar_G[d]&\\
&C&C\ar_F[r]&D}
\]
\end{document}

The code reads as \drtwocell\omit{^<-2>\eta}, where \omit says we will omit the two curved arrows, the ^ specifies the direction of the 2-cell, and <-2> nudges the label (otherwise it will be at the center point).

Output:

enter image description here

There is a problem: you cannot specify which side the label is on with respect to the 2-cell. It seems that this is not implemented, so perhaps this is the best we can do without some other hacks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.