For what exactly we need that the submartingale is a finite sequence in theorem 6.7.3 of Ash's book? I want to check if my understanding of the following proof is correct. The following is a slight rephrasing of a theorem of Ash's probability book:

6.7.3 Theorem. Let $\{X_n:n=1,\ldots ,m\}$ a submartingale and let $T_1,T_2,\ldots $ an increasing sequence of stopping times for the $\mathscr{F}_n$ (that is, $\{\omega :T_n(\omega )\leqslant j\}\in \mathscr{F}_j$ for each $n$, and each $T_n$ take values in $\{1,\ldots ,m\}$). Now let $$\mathscr{F}_{T_i}:=\{A\in \mathscr{F}: A\cap \{\omega :T_i(\omega )\leqslant k\}\in \mathscr{F}_k\}$$ Then the $X_{T_n}$ form a submartingale respect to the $\mathscr{F}_{T_n}$.

There we defines $X_{T}(\omega ):=X_n(\omega )$ whenever $T(\omega )=n$. Now the proof:

Set $Y_n:=X_{T_n}$ and note that $$\int_{\Omega }|X_{T_n}|\mathop{}\!d P=\sum_{k=1}^m\int_{\{\omega : T_n(\omega )=k\}}|X_k|\mathop{}\!d P\leqslant \sum_{k=1}^m\mathrm{E}[|X_k|]<\infty\tag1 $$ As the $T_n$ increases with $n$ so does $\mathscr{F}_{T_n}$. Now if $A\in \mathscr{F}_{T_n}$ then we must show that $\int_{A}Y_{n+1}\mathop{}\!d P\geqslant \int_{A}Y_n\mathop{}\!d P$. Since $A=\bigcup_{j}A\cap \{T_n=j\}$ it suffices to replace $A$ in the integral by $D_j:=A\cap \{T_n=j\}$, wich belong to $\mathscr{F}$.
Now note that if $k>j$ then $T_n=j$ implies $T_{n+1}\geqslant j$, hence $$\int_{D_j}Y_{n+1}\mathop{}\!d P=\sum_{i=j}^k\int_{D_j\cap \{T_{n+1}=i\}}Y_{n+1}\mathop{}\!d P+\int_{D_j\cap \{T_{n+1}>k\}}Y_{n+1}\mathop{}\!d P\tag2$$ so
$$\int_{D_j}Y_{n+1}\mathop{}\!d P=\sum_{i=j}^k\int_{D_j\cap \{T_{n+1}=i\}}X_i\mathop{}\!d P+\int_{D_j\cap \{T_{n+1}>k\}}X_k\mathop{}\!d P-\int_{D_j\cap \{T_{n+1}>k\}}(X_k-Y_{n+1})\mathop{}\!d P\tag3$$ and from the definitions its easy to see that $$\int_{D_j\cap \{T_{n+1}\geqslant k\}}X_k\mathop{}\!d P\geqslant \int_{D_j\cap \{T_{n+1}\geqslant k\}}X_{k-1}\mathop{}\!d P\tag4$$ Then by a finite recursion we find that $$\int_{D_j}Y_{n+1}\mathop{}\!d P\geqslant \int_{D_j\cap \{T_{n+1}\geqslant j\}}X_j\mathop{}\!d P-\int_{D_j\cap \{T_{n+1}>k\}}(X_k-Y_{n+1})\mathop{}\!d P\tag5$$
Now $\{T_{n+1}>k\}$ is empty for $k\geqslant m$. Finally, $D_j\cap \{T_{n+1}\geqslant j\}=D_j$ since $D_j\subset \{T_{n}=j\}$, and $X_j=Y_n$ in $D_j$. Thus $$\int_{D_j}Y_{n+1}\mathop{}\!d P\geqslant \int_{D_j}Y_n\mathop{}\!d P\tag6$$

This means that $-\int_{D_j\cap \{T_{n+1}>k\}}(X_k-Y_{n+1})\mathop{}\!d P>0$, what is a consequence of $\{X_n\}$ being a submartingale, ok. But this is my question: for what exactly was used that $\{X_n\}$ was a finite sequence? Just to prove that the $Y_j\in L^1(P)$? It seems that it is used for a different step, as Ash says just after the end of this proof

Theorem 6.7.3 extends immediately to the case of an infinite sequence if
each $T_n$ is bounded, that is, for each $n$ there is a positive constant $K_n$ such that $T_n \le K_n$ a.e. The same proof may be used; the key point is that $\{T_{n+1} > k\}$ is still empty for sufficiently large $k$.

This seems to imply that the finiteness of the sequence $\{X_k\}$ is used in the conclusion (6) from (5), that is, that the RHS of (5) is finite or so. It is not so clear. Can someone clarify it?
 A: Lots of typos in the question---just to point out a couple:

*

*"...$\{\omega :T_n(\omega )\leqslant j\}\in \mathscr{F}_n...$" should be "...$\{\omega :T_n(\omega )\leqslant j\}\in \mathscr{F}_j$...".


*"...$X_{T}(\omega ):=T(\omega )$..." should be "...$X_{T}(\omega ):=X_{T(\omega )}(\omega)$...".
Now to answer your question:

...where exactly was the assumption that $m < \infty$ (in $\{X_n:n=1,\ldots ,m\}$) used in the
argument?

The answer is nowhere, really. Note that the argument only involves two adjacent elements $Y_{n+1} = X_{T_{n+1}}$ and $Y_{n} = X_{T_{n}}$. This would remain the same regardless whether $m$ is finite or infinite.
Rather, the key to the argument is the assumption that the sequence of stopping times $\{ T_n \}$ is bounded. For example, the assumption you mention that $T_n < K_n\;\; a.s.$ would suffice (where the sequence $K_n$ may diverge to $\infty$).
Under the assumption that $T_n < K_n\;\; a.s.$, the same argument goes through verbatim for a submartingale $\{  X_n \}_{n \geq 1}$:
Proof:
Integrability of $Y_n$ holds exactly the same as before:
$$
\int |Y_n| dP = \sum_{j = 1}^{K_n} \int_{\{T_n = j\}} |X_{j}| dP < \infty.
$$
Let $A \in \mathscr{F}_{T_n}$, then $A\stackrel{(1)}{=}\bigsqcup\limits_{j=1}^{K_n } A\cap \{T_n=j\}$. Therefore it suffices to consider
$$
D_j = A \cap \{T_n=j\}
$$
for some $1 \leq j \leq K_n$. So $Y_n \cdot 1_{D_j} = X_{T_j} \cdot 1_{D_j}$.
On the other hand,
$$
\int_{ D_j } Y_{n+1} dP \stackrel{(2)}{=} 
\sum_{i = j }^{K_{n+1}} \int_{ D_j  \cap \{ T_{n+1} = i \} } Y_{n+1} dP
= \sum_{i = j }^{K_{n+1}} \int_{ D_j  \cap \{ T_{n+1} = i \} } X_i dP
\geq  \int_{ D_j } X_j dP = \int_{ D_j } Y_{n} dP. 
$$
End of Proof.
With the additional assumption that $\{  X_n \}_{n \geq 1}$ is, say, dominated by an $Z \in L^1_+$, i.e. $|X_n| \leq Z \; a.s.$, each element of the stopping time sequence $\{ T_n \}$ can be allowed to be unbounded:

*

*$\int |Y_n| dP = \sum\limits_{j = 1}^{\infty} \int_{\{T_n = j\}} |X_j| dP \leq \int Z dP < \infty$.


*"$\stackrel{(1)}{=}$" becomes $A = \bigsqcup\limits_{j=1}^{\infty } A\cap \{T_n=j\}$. Therefore it still suffices to consider
$$
D_j = A \cap \{T_n=j\}.
$$


*"$\stackrel{(2)}{=} $" becomes $\int\limits_{ D_j } Y_{n+1} dP =
\sum\limits_{i = j }^{\infty} \int\limits_{ D_j  \cap \{ T_{n+1} = i \} } Y_{n+1} dP$. Now, for each finite $m$,
$$
\sum\limits_{i = j }^{m} \int\limits_{ D_j  \cap \{ T_{n+1} = i \} } Y_{n+1} dP
\geq \sum\limits_{i = j }^{m} \int\limits_{ D_j  \cap \{ T_{n+1} = i \} } Y_{n} dP.
$$
So the submartingale property follows from the Dominated Convergence Theorem.
One can probably construct counterexamples where the $L^1$-dominated condition does not hold, each $T_n$ is unbounded, and $\{ X_{T_n} \}$ is no longer a submartingale.
