With tikz-cd:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}
\newcommand{\tricd}[3]{%
\begin{tikzcd}[
baseline={([yshift=-axis_height]mycd)},
ampersand replacement=&,
every matrix/.append style={
name=mycd,
nodes={inner sep=0pt, outer sep=2pt}
},
row sep=0pt, column sep=12pt
]
#1\ar[rr]\ar[to=mycd-2-2.west]&&#2\ar[to=mycd-2-2.east]\
&#3
\end{tikzcd}%
}
\begin{document}
whose objects are $\mathcal{P}$ morphisms to $Y$, with
(
\left{\tricd{X_i}{X}{Y}\right}
)\medskip
but not this:
(
\left{\tricd{X_i}{X}{Y_\text{long middle element}}\right}
)
\end{document}

P.S. = thanks to Qrrbrbirlbel for their solution to the vertical alignment problem.