我有这个图表
\begin{tikzcd}
& N \arrow[twoheadrightarrow]{d}{\pi}\\
R^{\bigoplus\mathcal{I}} \arrow{r}{\gamma} \arrow{ur}{\beta} & M
\end{tikzcd}
现在我想在图中定义 $\gamma$ 和 $\beta$。我的意思是,我想用以下公式替换图中的 $\gamma$ 和 $\beta$
\begin{array}{rcl}
\gamma \colon R^{\bigoplus\mathcal{I}} & \longrightarrow & M\\
e_{i} & \longmapsto & \gamma(e_{i})
\end{array}
和
\begin{array}{rcl}
\beta \colon R^{\bigoplus\mathcal{I}} & \longrightarrow & N\\
e_{i} & \longmapsto & g_{i}
\end{array}
最后,我还想补充一点
\begin{array}{rcl}
\pi^{-1} \colon M & \longrightarrow & N\\
\gamma(e_{i}) & \longmapsto & g_{i}
\end{array}
(这意味着原像,obv $\pi$ 可能不是双射的)有什么想法吗?(当替换箭头时,我想将箭头的名称保留在箭头上方)。我希望此图检查 $R^{\bigoplus\mathcal{I}}$(\mathcal{I} 上的自由模块)是否为射影模块。
答案1
为了好玩,一个与psmatrix
环境有关的解决方案,来自pstricks
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{pst-node}
\begin{document}
%
\[
\everypsbox{\scriptstyle}
\psset{arrows=->, arrowinset=0.15, linewidth=0.4pt, nodesep=3pt, labelsep=2pt, rowsep=1.2cm, colsep=1.5cm, shortput=nab}
\begin{psmatrix}
%%%nodes
& [name=N] N \\%
R^{ \oplus \mathcal{I}}\pnode{R} & [name=M] M
\end{psmatrix}
%%% arrows
\ncline{2,1}{1,2}\naput[npos=0.45,labelsep =0pt]{\beta }
\ncline{2,1}{2,2}^{\gamma }
\ncline{1,2}{2,2}_{\pi }
%%%%
\psset{arrows=|->,offset =2.5ex}
\ncline{2,1}{1,2}
\uput{4ex}[125]{45}(R){e_i}
\uput{2ex}[140]{45}(N){g_i}
%%%
\ncline[offset=-2ex]{2,1}{2,2}
\uput{1ex}[-110]{0}(R){e_i}
\uput{1ex}[-60]{0}(M){\gamma (e_i)}
%%%
\ncline[linestyle=dashed, arrows=<-|]{1,2}{2,2}\naput[npos=0.43]{\pi^{-1}}
\uput{2ex}[r]{0}(N){g_i}
\]
\end{document}
答案2
只要添加一个,ampersand replacement
您就可以使用这些数组。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[column sep=8em,ampersand replacement=\&]
\& N \arrow[twoheadrightarrow,d,"\pi"]\\
R^{\bigoplus\mathcal{I}} \arrow[r,"{\begin{array}{rcl}
\gamma \colon R^{\bigoplus\mathcal{I}} & \longrightarrow & M\\
e_{i} & \longmapsto & \gamma(e_{i})
\end{array}}" swap]
\arrow[ur,"{\begin{array}{rcl}
\beta \colon R^{\bigoplus\mathcal{I}} & \longrightarrow & N\\
e_{i} & \longmapsto & g_{i}
\end{array}}" sloped] \& M \arrow[u,twoheadrightarrow,bend right=80,"{\begin{array}{rcl}
\pi^{-1} \colon M & \longrightarrow & N\\
\gamma(e_{i}) & \longmapsto & g_{i}
\end{array}}" swap]
\end{tikzcd}
\end{document}
答案3
为复杂的事情定义一个宏:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\newcommand{\funcdef}[5]{%
\mbox{\scriptsize$
\begin{aligned} #1\colon #2 & \longrightarrow #3 \\[-1ex] #4 &\longmapsto #5 \end{aligned}
$}%
}
\begin{document}
\begin{tikzcd}[column sep=8em]
& N \arrow[twoheadrightarrow,d,"\pi"]\\
R^{\bigoplus\mathcal{I}}
\arrow[r,"\funcdef{\gamma}{R^{\bigoplus\mathcal{I}}}{M}{e_{i}}{\gamma(e_{i})}"']
\arrow[ur,"\funcdef{\beta}{R^{\bigoplus\mathcal{I}}}{N}{e_{i}}{g_{i}}" sloped] &
M \arrow[u,twoheadrightarrow,bend right=80,"\funcdef{\pi^{-1}}{M}{N}{\gamma(e_{i})}{g_{i}}"']
\end{tikzcd}
\end{document}