[proofplan]
We define successive entry times $S_k$ (when the process drops below $a$) and exit times $T_k$ (when it rises above $b$), and express the sum of stopped increments $\sum_k (X_{\min\{T_k, n\}} - X_{\min\{S_k, n\}})$ in terms of completed upcrossings and a possible incomplete crossing. The supermartingale property ensures that each stopped increment has non-positive expectation, while completed upcrossings contribute at least $b - a$ each and the incomplete crossing is bounded below by $-(X_n - a)^-$.
[/proofplan]
[step:Define the upcrossing stopping times]
Write $N = N_n([a, b], X)$ for the number of completed upcrossings of $[a, b]$ by time $n$. Define the successive entry and exit times inductively:
\begin{align*}
S_1 &= \inf\{k \geq 0 : X_k \leq a\}, \\
T_1 &= \inf\{k \geq S_1 : X_k \geq b\}, \\
S_{j+1} &= \inf\{k \geq T_j : X_k \leq a\}, \\
T_{j+1} &= \inf\{k \geq S_{j+1} : X_k \geq b\},
\end{align*}
with the convention $\inf \varnothing = \infty$. Each $S_j$ and $T_j$ is a stopping time with respect to $(\mathcal{F}_k)_{k \geq 0}$ (verifiable by induction: $\{S_1 \leq k\} = \bigcup_{i=0}^k \{X_i \leq a\} \in \mathcal{F}_k$, and so on). The number of completed upcrossings is $N = \max\{j : T_j \leq n\}$.
[/step]
[step:Decompose the sum of stopped increments into completed and incomplete upcrossings]
Consider the sum of increments over the upcrossing intervals, stopped at time $n$:
\begin{align*}
\Sigma := \sum_{k=1}^{n} \bigl(X_{\min\{T_k, n\}} - X_{\min\{S_k, n\}}\bigr).
\end{align*}
The sum has at most $n$ terms (we [set](/page/Set) $S_k = T_k = n$ for $k$ large enough that $S_k > n$, contributing zero). We split $\Sigma$ according to whether the $k$-th upcrossing is completed by time $n$:
\begin{align*}
\Sigma = \underbrace{\sum_{k=1}^{N} (X_{T_k} - X_{S_k})}_{\text{completed upcrossings}} + \underbrace{(X_n - X_{S_{N+1}}) \, \mathbb{1}_{\{S_{N+1} \leq n\}}}_{\text{incomplete upcrossing}}.
\end{align*}
For each completed upcrossing ($k \leq N$), $X_{T_k} \geq b$ and $X_{S_k} \leq a$, so $X_{T_k} - X_{S_k} \geq b - a$. Therefore the completed portion is at least $N(b - a)$.
For the incomplete portion, on $\{S_{N+1} \leq n\}$ we have $X_{S_{N+1}} \leq a$, hence $X_n - X_{S_{N+1}} \geq X_n - a$. Since $X_n - a$ may be negative, we bound:
\begin{align*}
(X_n - X_{S_{N+1}}) \, \mathbb{1}_{\{S_{N+1} \leq n\}} \geq -(X_n - a)^- \, \mathbb{1}_{\{S_{N+1} \leq n\}} \geq -(X_n - a)^-.
\end{align*}
Combining: $\Sigma \geq N(b - a) - (X_n - a)^-$.
[guided]
The decomposition tracks what happens across the upcrossing intervals. Each completed upcrossing $[S_k, T_k]$ witnesses the process rising from at most $a$ to at least $b$, contributing an increment of at least $b - a$. The potentially incomplete upcrossing (the process has entered below $a$ at time $S_{N+1}$ but has not yet exited above $b$ by time $n$) contributes $X_n - X_{S_{N+1}}$, which could be negative.
The bound $(X_n - X_{S_{N+1}}) \mathbb{1}_{\{S_{N+1} \leq n\}} \geq -(X_n - a)^-$ works as follows: on $\{S_{N+1} \leq n\}$, we have $X_{S_{N+1}} \leq a$, so $X_n - X_{S_{N+1}} \geq X_n - a$. If $X_n \geq a$, this is non-negative, and the bound $\geq -(X_n - a)^- = 0$ holds. If $X_n < a$, then $X_n - a < 0$ and $X_n - X_{S_{N+1}} \geq X_n - a = -(a - X_n) = -(X_n - a)^-$. On $\{S_{N+1} > n\}$, the left side is zero, and the right side $-(X_n - a)^- \leq 0$, so the inequality holds as well.
[/guided]
[/step]
[step:Apply the supermartingale property to bound $\mathbb{E}[\Sigma] \leq 0$]
For each $k$, the times $\min\{S_k, n\} \leq \min\{T_k, n\}$ are bounded stopping times (both at most $n$). Since $X$ is a supermartingale, the [Optional Stopping Theorem](/theorems/1153) for supermartingales gives:
\begin{align*}
\mathbb{E}[X_{\min\{T_k, n\}}] \leq \mathbb{E}[X_{\min\{S_k, n\}}]
\end{align*}
for each $k$ (this uses the supermartingale version of optional stopping for bounded stopping times: the stopped process is a supermartingale, so expectations decrease). Summing over $k = 1, \ldots, n$:
\begin{align*}
\mathbb{E}[\Sigma] = \sum_{k=1}^{n} \bigl(\mathbb{E}[X_{\min\{T_k, n\}}] - \mathbb{E}[X_{\min\{S_k, n\}}]\bigr) \leq 0.
\end{align*}
[/step]
[step:Combine the bounds to obtain the upcrossing inequality]
From the lower bound $\Sigma \geq N(b - a) - (X_n - a)^-$ and the upper bound $\mathbb{E}[\Sigma] \leq 0$:
\begin{align*}
0 \geq \mathbb{E}[\Sigma] \geq (b - a) \, \mathbb{E}[N] - \mathbb{E}[(X_n - a)^-].
\end{align*}
Rearranging:
\begin{align*}
(b - a) \, \mathbb{E}[N_n([a, b], X)] \leq \mathbb{E}[(X_n - a)^-].
\end{align*}
[guided]
The upcrossing inequality converts information about the *expectations* of a supermartingale into information about the *oscillation* of its sample paths. Each upcrossing of $[a, b]$ contributes at least $b - a$ to the increment sum, but the supermartingale property forces the total expected increment to be non-positive. These two constraints are in tension, and the resolution is that the expected number of upcrossings cannot exceed $\mathbb{E}[(X_n - a)^-] / (b - a)$.
The bound $\mathbb{E}[(X_n - a)^-]$ arises from the incomplete upcrossing term. Note that $(X_n - a)^- = \max(a - X_n, 0) \leq |X_n| + |a|$, so an $L^1$-bounded supermartingale has uniformly bounded upcrossing expectations: $\mathbb{E}[N_n([a, b], X)] \leq (\sup_n \mathbb{E}[|X_n|] + |a|) / (b - a)$.
[/guided]
[/step]