3

Consider the following

\documentclass{article}

\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\newtheorem{lem}{Lemma}

\begin{document}

\begin{lem}
    \begin{align}%
        \begin{split}%
            &\mathbb{P}_u(\tau^0=s, -R_{\tau^0}=z) =  \sum\limits_{k=0}^{u+s-z} \mathbb{P}( \tau^0>s-1, S_{s-1}=k)p_{u+s+z-k} \\
            & = \sum\limits_{k=0}^{u+s-z} p^{*(s-1)}_k p_{u+s+z-k}- \sum\limits_{k=u+1}^{u+s-z}  \sum\limits_{j=u+1}^{k} \frac{s-1+u-k}{s-1+u-j}p^{*(s-1+u-j)}_{k-j}   p^{*(j-u)}_j p_{u+s+z-k}
        \end{split}\nonumber
    \end{align}
\end{lem}

\end{document}
Sarah
  • 155

4 Answers4

3

This uses a further line, because the final formula is very wide.

If your text width allows it, you can move left the alignment point in the first line and perhaps avoid the need to split the last formula.

\documentclass{article}
%\usepackage{geometry}
\usepackage{amsthm,amsmath,amssymb}

\newtheorem{lem}{Lemma}

\begin{document}

\begin{lem}
\begin{equation}
\hspace{0pt}
\begin{aligned}[b]
\mathbb{P}_u(\tau^0=s&, -R_{\tau^0}=z)
=\sum_{k=0}^{u+s-z} \mathbb{P}( \tau^0>s-1, S_{s-1}=k)p_{u+s+z-k}
\\
&= \sum_{k=0}^{u+s-z} p^{*(s-1)}_k p_{u+s+z-k}
\\
&\qquad-\sum_{k=u+1}^{u+s-z} \sum_{j=u+1}^{k} \frac{s-1+u-k}{s-1+u-j}p^{*(s-1+u-j)}_{k-j}
    p^{*(j-u)}_j p_{u+s+z-k}
\end{aligned}
\hspace{10000pt minus 1fil}
\end{equation}
\end{lem}

\end{document}

I used a trick explained in exercise 19.8 of the text book. It's necessary to have a glob of zero glue at the beginning, in order that the alignment is flush left. The \hspace{100000pt minus 1fil} tricks TeX into thinking that the alignment is obnoxiously wide (but there is a lot of shrinkability to actually allow the typesetting).

See also https://tex.stackexchange.com/a/348745/4427

enter image description here

egreg
  • 1,121,712
2

If you want to have an effect like \raggedright you have to put the alignment character & at the first place of every line inside the split environment.

\documentclass{article}

\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\newtheorem{lem}{Lemma}

\begin{document}

\begin{lem}
    \begin{align}%
        \begin{split}%
            &\mathbb{P}_u(\tau^0=s, -R_{\tau^0}=z) =  \sum\limits_{k=0}^{u+s-z} \mathbb{P}( \tau^0>s-1, S_{s-1}=k)p_{u+s+z-k} \\
            & = \sum\limits_{k=0}^{u+s-z} p^{*(s-1)}_k p_{u+s+z-k}- \sum\limits_{k=u+1}^{u+s-z}  \sum\limits_{j=u+1}^{k} \frac{s-1+u-k}{s-1+u-j}p^{*(s-1+u-j)}_{k-j}   p^{*(j-u)}_j p_{u+s+z-k}
        \end{split}\nonumber
    \end{align}
\end{lem}

\end{document}

enter image description here

Bernard
  • 271,350
user1146332
  • 2,166
2

In your case I would consider the multline* math environment (defined by amsmath):

\documentclass{article}

\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{amssymb}
\newtheorem{lem}{Lemma}

\begin{document}
\begin{lem}
    \begin{multline*}
\mathbb{P}_u(\tau^0=s, -R_{\tau^0}=z) =  \sum\limits_{k=0}^{u+s-z} \mathbb{P}( \tau^0>s-1, S_{s-1}=k)p_{u+s+z-k}   \\
    = \sum\limits_{k=0}^{u+s-z} p^{*(s-1)}_k p_{u+s+z-k}-
      \sum\limits_{k=u+1}^{u+s-z} 
      \sum\limits_{j=u+1}^{k} \frac{s-1+u-k}{s-1+u-j}p^{*(s-1+u-j)}_{k-j}   p^{*(j-u)}_j p_{u+s+z-k}
    \end{multline*}
\end{lem}
\end{document}

enter image description here

Zarko
  • 296,517
  • Thanks for your answer. What is the advantage of multiline? – Sarah Apr 03 '20 at 18:21
  • 1
    @Sarah, if you compare code, you should notice, that my answer have shorter code, not bother with ampersands. It is defined for such a cases as is yours, i.e for equation which you cant write in one line. It enable break it (manually) in two lines which are not aligned at left side. – Zarko Apr 03 '20 at 18:39
  • Thank you for telling me:) – Sarah Apr 03 '20 at 21:10
2

With the help of geometry and mathtools, I propose these two variants:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{amsthm, amssymb}
\newtheorem{lem}{Lemma}

\usepackage{mathtools}

\begin{document}

\begin{lem}
\begin{multline} \mathbb{P}_u(\tau^0=s , -R_{\tau^0}=z) = \smash{\sum_{k=0}^{u+s-z}} \mathbb{P}( \tau^0>s-1, S_{s-1}=k)p_{u+s+z-k} \\ = \sum_{k=0}^{u+s-z} p^{*(s-1)}_k p_{u+s+z-k}-\!\! \sum_{k=u+1}^{u+s-z} \sum_{j=u+1}^{k} \frac{s-1+u-k}{s-1+u-j}p^{*(s-1+u-j)}_{k-j} p^{*(j-u)}_j p_{u+s+z-k}
\end{multline}
\end{lem}
\vskip2em

\begin{lem}$\mathbb{P}_u(\tau^0=s, -R_{\tau^0}=z) = \displaystyle\smash[b]{\smashoperator{\sum_{k=0}^{u+s-z}}} \mathbb{P}( \tau^0>s-1, S_{s-1}=k)p_{u+s+z-k}$
  \begin{equation} =\smashoperator{\sum_{k=0}^{u+s-z}} p^{*(s-1)}_k p_{u+s+z-k} -\!\! \sum_{k=u+1}^{u+s-z} \sum_{j=u+1}^{k} = \frac{s-1+u-k}{s-1+u-j}p^{*(s-1+u-j)}_{k-j} p^{*(j-u)}_j p_{u+s+z-k}
 \end{equation}
\end{lem}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Can you explain what the geomtry and mathtools package does in this context? – Sarah Apr 03 '20 at 19:16
  • 2
    Very gladly. geometry slighly increases the line width, since it uses smaller margins, which saves some space for the equation numbers, in case of long equations. – Bernard Apr 03 '20 at 19:37
  • 2
    As to mathtools, I initially used it because I introduced a multlined environment inside equation. This environment is not defined by amsmath, contrary to aligned or gathered, but I wasn't fully satisfied, so I didn't propose it. It also defines the \smashoperator command, which doesn't take into account the overflowing of the indices in the sum command, whence a better horizontal spacing – compare the spacing of the = w.r.t. Σ at the beginning of the 2nd line in each version: only the 2nd version uses this command. – Bernard Apr 03 '20 at 19:38
  • @Bernhard Very interesting. There is a lot I stillt have to learn. Thank you very much for your explanation:) – Sarah Apr 03 '20 at 21:25