# Commuting diagram with elements

\begin{tikzcd}
0\arrow{r} & A \arrow{d} \arrow{r} & B \arrow{d} \arrow{r} & C \arrow{d} \arrow{r} & 0\\
0\arrow{r} & K \arrow{r} & L \arrow{r} & M \arrow{r} & 0\\
\end{tikzcd}


The code above gives the following picutre:

I would like to write 'elements' next to the objects now and arrows between them, as in the following drawing. How do I do that?

Just make extra rows.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{cd}
\begin{document}
\begin{tikzcd}[contains/.style = {draw=none,"\in" description,sloped}]
&                               & y \ar[d,contains] \ar[r,mapsto] \ar[ddd,mapsto,bend right] & x \ar[d,contains]   \\
0\ar[r] & A \ar[d] \ar[r,crossing over] & B \ar[d] \ar[r]                                            & C \ar[d] \ar[r] & 0 \\
0\ar[r] & K \ar[r,crossing over]        & L \ar[r]                                                   & M \ar[r]        & 0 \\
& v \ar[r,mapsto]               & z \ar[u,contains]                                                                \\
\end{tikzcd}
\end{document}