In a paper I'm writing, I end a proof with a displayed equation that has some cases in it. The relevant code looks something like the following:
\[f(x) = \begin{cases}
2x & \text{if $x<0$}\\
7 & \text{if $x=0$}\\
1-x & \text{if $x>0$}
\end{cases} \]
\end{proof}
What I want to happen is for the amsthm "tombstone" to be placed on the right-hand side of the page aligned with the "1-x" line. I think this should be possible by placing a \qedhere in an appropriate place, but I can't seem to figure out where (I've tried all the obvious choices, and they all give me incorrect behavior).

casesline, not with the tippy tail end of the brace. (on the other hand, withamsthmand\qedhere, it sits on the baseline with the$f(x)$, so i apologize for casting stones.) – barbara beeton Aug 04 '11 at 17:34