Understanding the proof of Snell Envelope Optimal Stopping Time I am trying to understand the proof of the optimal stopping of Snell Envelope. (on Pg 22)
A Snell Envelope is defined as follows: 
Let $Y_n$ be an adapted process to $\mathcal{F}_n$ with finite expectation, defined as follows: 
\begin{array}{l}{X_{N}=Y_{N}} \\ {X_{n}=\max \left(Y_{n}, E\left(X_{n+1} | \mathcal{F}_{n}\right)\right), \quad 0 \leq n \leq N-1}\end{array}
The stopping time is given by the random variable $\nu=\inf \left\{n \geq 0, X_{n}=Y_{n}\right\}$. 
An important step in the proof is that $\nu$ makes the sequence $X_{n}^{\nu}$ a martingale. 
Proof (for the sake of completion): 
First, we note that $\{\nu=n\}=\left\{X_{0}>Y_{0}\right\} \cap \ldots \cap\left\{X_{n-1}>Y_{n-1}\right\} \cap\left\{X_{n}=Y_{n}\right\} \in \mathcal{F}_{n}$
Next, $X^{n}_{\nu}$ can be written as the following: 
$$
X_{n}^{\nu}=X_{0}+\sum_{j=1}^{n} 1_{\{j \leq \nu\}}\left(X_{j}-X_{j-1}\right)
$$
Therefore, for any $X^{n+1}_{\nu} - X^{n}_{\nu} $ can be written as following:  $$
X_{n+1}^{\nu}-X_{n}^{\nu}=1_{\{n+1 \leq \nu\}}\left(X_{n+1}-X_{n}\right)
$$
Taking conditional expectations on both sides, we have \begin{align}
E\left(X_{n+1}^{\nu}-X_{n}^{\nu} | \mathcal{F}_{n}\right) & =1_{\{n+1 \leq \nu\}} E\left(X_{n+1}-X_{n} | \mathcal{F}_{n}\right) \\
&= =\left\{\begin{array}{ll}{0} & {\text { if } \nu \leq n \text { since the indicator vanishes }} \\ {0} & {\text { if } \nu>n \text { since in such a case } X_{n}=E\left(X_{n+1} | \mathcal{F}_{n}\right)}\end{array}\right.
\end{align}
Using this, it is also proved that $X_{0}=E\left(Y_{\nu} | \mathcal{F}_{0}\right)=\sup _{\tau \in [0, N]} E\left(Y_{\tau} | \mathcal{F}_{0}\right)$
The thing that confuses is that $\nu$ itself is a random variable. So, I am not sure I understand the meaning of the sequence $X^{\nu}_{n}$
Here are my understandings based on the above proof. Can you please clarify if they are correct? 


*

*The meaning of $X^{\nu}_{n}$ is martingale : For a given stopping time $\nu = t_1$, all the sequences $X_n$ that stop at $t_1$ when applied Snell Envelope strategy, form a martingale. 

*The meaning of $E\left(Y_{\nu} | \mathcal{F}_{0}\right)=\sup _{\tau \in [0, N]} E\left(Y_{\tau} | \mathcal{F}_{0}\right)$ : For a given stopping time $\nu = t_1$, for all the sequences $X_n$ that stop at $t_1$ when applied Snell Envelope strategy, the value of $E(Y_t)$ is highest at $t = t_1$.

 A: The definition of Snell envelope is somewhat convoluted. We will demystify it.
Think of the $X_n$ defined in the starting, as $X_N = Y_N$ and $X_n = \max\{Y_n, E[X_{n+1} | \mathcal F_{n}]\}$ as just some $N$ random variables, ordered $X_0,X_1,...,X_N$. The only thing is that we define $X_0,X_1,...$ in reverse order, rather than the usual increasing order. So $X_0,...,X_n$ is a stochastic process, but only on $\{0,...,N\}$ for some $N$.
The reason why we do this, is because of proposition 2.5.1, which says the following : $X_0,...,X_N$, as defined, are $\mathcal F_n$ adapted, satisfy the supermartingale property for the indices $0,...,N-1$ (because beyond this, the $X_i$ are not even defined), and is the smallest possible sequence to dominate $Y_n$. This explains why it is called an "envelope" : it covers
the $Y_n$ from the top.
However, it would be nicer if $X_0,X_1,...$ was a martingale on $\{0,1,...\}$, and also enveloped $Y_n$.
Our plan on achieving this is outlined in remark 2.5.1. What does it say? Well, choose the $N$ carefully, and once the $N$ is chosen, the process will become constant after that.
How do we choose the $N$? Using a stopping time.
More precisely, define $\nu = \inf\{n \geq 0 : X_n = Y_n\}$. 
Now, for each $\omega$, we have $\nu(\omega)$ is some number $N$ depending on $\omega$. What we do is this : for each $\omega$, stop the sequence $X_n(\omega)$ at the $N$ depending on $\omega$. Then, after that, keep the process constant.
In other words, we have the following definition of the Snell envelope of $X_n$.

Let $Y_n$ be a $F_n$ adapted process. Define the Snell envelope $X^\nu_n$ of $Y_n$ as :
  $$
X^\nu_n(\omega) :=
\begin{cases}
Y_{\nu(\omega)} & n \geq \nu(\omega)\\
\max\{Y_n(\omega),E[X_{n+1}|\mathcal F_n](\omega)\} & n < \nu(\omega)
\end{cases}
$$

So, for each $\omega$, the process doesn't change for that $\omega$ after $\nu(\omega)$, it is stopped.

The meaning of $X^\nu_n$ is a martingale.

Is two things. The first, that $X^\nu_n$ is adapted to $\mathcal F_n$ : for each for each $m$, we have that $\mathcal F_m$ contains all the information about $\{X^\nu_1,...,X^\nu_m\}$.
The second, that $E[X^\nu_{m+1} - X^\nu_m | \mathcal F_m]=0$ for all $m$ i.e. that it has martingale-type increments. 
The construction does not apply for all stopping times $\nu$ : only for this particular one.

The meaning of $E[Y_\nu | \mathcal F_0] = \sup_{\tau \in [0,N]} E[Y_\tau | \mathcal F_0]$.

The supremum is over all stopping times, not over numbers in $[0,N]$. Indeed, what it says is this : if I take any stopping time $\tau$ which takes values only in $[0,N]$, and consider the quantity $E[Y_\tau | \mathcal F_0]$, then the largest this can be, is exactly $E[Y_\nu | \mathcal F_0]$. So, in some sense, $\nu$ "envelopes" every bounded stopping time : at each bound, it gives the maximum possible expectation.
I think this author has not written the material well, so you should continue to clarify until you are satisfied.

EDIT : I think the reason why the text is a little hard to understand is that it is translated, possibly from Spanish or something, since I did see a few exercises in a different language to English.
Coming to your points in the comment, the point is that $Y_\nu$ is a random variable, defined by $Y_\nu(\omega) = Y_{\nu(\omega)}(\omega)$. This has finite expectation(I am sure you can see why), so you can define $E[Y_\nu | \mathcal F_0]$.
If you notice, the fact that $X^\nu_n$ is a martingale, is used only to prove that $X_0 = E[Y_{\nu} |\mathcal F_0]$, which is the first equality. 
What you mention in the comments is the second equality i.e. that of $E[Y_\nu | \mathcal F_0]$ and $\sup_\tau E[Y_\tau | \mathcal F_0]$. Here, if you notice, the author uses the fact that $X_n^\tau$ is a supermartingale, if $X_n$ is, where $X_0,...,X_N$ is like how the author defined(remember the author has not focused on each $\omega$ : for this argument he has used the $\omega$-less $X_0,...,X_N$ which he defined at the starting of the section, which he showed is a supermartingale. Now stopping that using any $\tau$ also gives a supermartingale). 
As  for the second question, the answer is yes, with the author-defined $X_0,...,X_N$ it will be true for any $\tau$ taking values in $[0,N]$ that $X_0 \geq E[X_\tau | \mathcal F_0]$.
