# amsthm's \qedhere in a proof ending in a displayed cases array

Is there a sensible way to get the QED box produced by \qedhere aligned with the last line of the cases environment in a situation as in the examples below?

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\begin{document}
\begin{proof}
This is a proof ending in a displayed \verb|cases| envirnoment, and without
the \verb|\qedhere|.
$\begin{cases} 1, & \text{in the first case;} \\ 2, & \text{in the second case;} \\ 3, & \text{in the third case,} \end{cases}$
\end{proof}

\begin{proof}
This is a proof ending in a displayed \verb|cases| envirnoment, and with
the \verb|\qedhere| at the very end.
$\begin{cases} 1, & \text{in the first case;} \\ 2, & \text{in the second case;} \\ 3, & \text{in the third case,} \end{cases} \qedhere$
\end{proof}

\begin{proof}
This is a proof ending in a displayed \verb|cases| envirnoment, and with
the \verb|\qedhere| in the last line of that.
$\begin{cases} 1, & \text{in the first case;} \\ 2, & \text{in the second case;} \\ 3, & \text{in the third case,} \qedhere \end{cases}$
\end{proof}
\end{document}


The same thing will happen in a proof ending in a displayed gathered environment, or any of the -ed variants.

-
(I know one can always rephrase to avoid ending the proof in a display, and thereby dissolve the issue—but I'd like to know if one can do this sensibly anyways!) –  Mariano Suárez-Alvarez Jul 2 '12 at 5:14
I'd say it's by design: a cases environment is vertically centered with respect to the formula axis. If the cases are not equally important, they shouldn't be in a cases environment, I think. –  egreg Jul 2 '12 at 9:05

retrieve this file. it illustrates a number of situations in which a marker is wanted at the end of something, including non-proofs, and \qedhere doesn't do what is wanted. one of the examples shows how to "move" the qed box to the last line when cases is the last element of the proof-ending display.
Thank you! ${}$ –  Mariano Suárez-Alvarez Jul 2 '12 at 16:56