It is known that a random series
$$
\sum\_{n\geq 1} X\_n
$$
whose terms $X\_n$ are independent converges a.s. if and only if it converges in probability.


Is it true that a martingale $(Y\_n)$ converges a.s. if and only if it converges in probability? If not, are there any counter-examples? Thanks.



Martingales converging in probability but not a.s
$\newcommand{\N}{\mathbb N}\newcommand{\si}{\sigma}\newcommand{\F}{\mathcal{F}}\newcommand{\Om}{\Omega}\newcommand{\Z}{\mathbb{Z}}$A counterexample can be obtained as follows. Let $T\_1,T\_2,\dots$ be independent (say) geometrically distributed random variables with fast growing means, say with $ET\_i=2^i$.


Let $Y\_n=0$ for $0\le n\le T\_1$. For time moments $n$ after that, let the values of $Y\_n$ coincide with the positions of a simple random walk $W^{(1)}\_\cdot$ starting from $0$ at time $T\_1$ -- but only till the time, say $\nu\_1$, of the first return of $W^{(1)}\_\cdot$ to $0$. This is the first "step".


After this, let $Y\_\cdot$ stay at $0$ for time $T\_2$. After that, let the values of $Y\_n$ coincide with the positions of a simple random walk $W^{(2)}\_\cdot$ starting in state $0$ at time $\nu\_1+T\_2$ -- but only till the time, say $\nu\_2$, of the first return of $W^{(2)}\_\cdot$ to $0$, where $W^{(2)}\_\cdot$ is independent of $W^{(1)}\_\cdot$. This is the second "step".


Continue doing such "steps" indefinitely (assuming that the walks are independent of the $T\_j$'s). Thus, we get a martingale $(Y\_n)$, with respect to a certain filtration of $\sigma$-algebras. The walks occur increasingly rarely; they start at very uncertain times (with standard deviations $\asymp2^i$ and corresponding very flat distributions); and the walks last comparatively short times. Therefore, for any given large time moment $n$, $P(Y\_n\ne0)$ is small. So, $Y\_n\to0$ in probability.


However, because the walks occur infinitely many times, clearly $Y\_n\not\to0$ almost surely.




---


Here are formal details.


**Construction:** Let $T\_1,T\_2,\dots$ be independent geometrically distributed random variables (r.v.'s) (defined on some probability space $(\Om,\F,P)$) with means $ET\_i=1/p\_i$, where $0<p\_i<1/2$ and
\begin{equation\*}
 \sum\_{i\in\N}p\_i^{1/2}<\infty. \tag{1}
\end{equation\*}
So,
\begin{equation\*}
 P(T\_i=t)=p\_i q\_i^{t-1}\,1(t\in\N) \tag{2}
\end{equation\*}
for real $t$, where $q\_i:=1-p\_i$.


Let $R\_1,R\_2,\dots$ be independent Rademacher r.v.'s (defined on the same probability space $(\Om,\F,P)$) that are independent of the $T\_i$'s; so, $P(R\_i=1|(T\_j))=1/2=P(R\_i=-1|(T\_j))$ for all $i\in\N$.


Define (the starting times of the walks) $S\_1,S\_2,\dots$ and (the finishing times of the walks) $F\_0,F\_1,F\_2,\dots$ by the following recursion:
\begin{equation\*}
 F\_0:=0
\end{equation\*}
and, for $k\in\N$,
\begin{equation\*}
 S\_k:=F\_{k-1}+T\_k,\quad F\_k:=\inf\{n\in\N\colon n>S\_k,W^{(k)}\_n=0\}, \tag{3}
\end{equation\*}
where
\begin{equation\*}
 W^{(k)}\_n:=\sum\_{i\in\N}R\_i\,1(S\_k<i\le n). \tag{3a}
\end{equation\*}
Note that $F\_0=0<\infty$ and $F\_k=\min\{n\in\N\colon n>S\_k,W^{(k)}\_n=0\}<\infty$ for all $k\in\N$ almost surely (a.s.), because the simple random walk is recurrent. So, $S\_k<\infty$ for all $k\in\N$ a.s.


Now, for all $n\in\N$ let
\begin{equation\*}
 Y\_n:=\sum\_{k\in\N}1(S\_k<n\le F\_k)W^{(k)}\_n. \tag{4}
\end{equation\*}
Note that a.s. at most one summand in (4) is nonzero, since $S\_k=F\_{k-1}+T\_k>F\_{k-1}$ a.s. for all $k\in\N$.


To complete the construction, for each $n\in\N$ let
\begin{equation\*}
 \F\_n:=\si(R\_1,\dots,R\_n,\{1(T\_k\le j)\colon k\in\N,j\in\N,j\le n\}), 
\end{equation\*}
the $\si$-algebra generated by $R\_1,\dots,R\_n,\{1(T\_k\le j)\colon k\in\N,j\in\N,j\le n\}$. Clearly, $(\F\_n)\_{n\in\N}$ is a filtration.


**Showing that $((Y\_n,\F\_n))\_{n\in\N}$ is a martingale:**
Abusing notation as is commonly done, for a r.v. $X$ let us write $X\in\F\_n$ to mean that $X$ is $\F\_n$-measurable. Then obviously $1(F\_0\le n)=1(0\le n)\in\F\_0:=\{\Om,\emptyset\}\subseteq\F\_1$ for all $n\in\N$. Using now the relations
\begin{equation\*}
 1(S\_k\le n)=\sum\_{j=1}^{n-1}1(T\_k=j)1(F\_{k-1}\le n-j),
\end{equation\*}
$1(T\_k=j)=1(T\_k\le j)-1(T\_k\le j-1)$, and
\begin{equation\*}
 \{F\_k\not\le n\}=
\bigcap\_{m=1}^n\Big(\{S\_k\not\le m-1\}\cup\Big\{\sum\_{i=1}^m R\_i\,1(S\_k\le i-1)\ne0\Big\}\Big)
\end{equation\*}
for natural $k,j$ (which follow by (3) and (3a)), we conclude by induction on $k$ that
\begin{equation\*}
 \{S\_k\le n\}\in\F\_n,\quad \{F\_k\le n\}\in\F\_n \tag{5}
\end{equation\*}
for all natural $k,n$.


Hence, by (4) and (3a), the sequence $(Y\_n)\_{n\in\N}$ is adapted to the filtration $(\F\_n)\_{n\in\N}$. Moreover, by (4), for all $n\in\N$ we have
\begin{equation\*}
Y\_{n+1}-Y\_n=\sum\_{k\in\N}R\_{n+1}\,1(S\_k\le n,F\_k\not\le n); 
\end{equation\*}
also, $R\_{n+1}$ is independent of $\F\_n$. So, in view of (5), $((Y\_n,\F\_n))\_{n\in\N}$ is a martingale.


**Showing that $Y\_n\to0$ in probability (as $n\to\infty$):** By (4),
\begin{equation\*}
 1(Y\_n\ne0\}=\sum\_{k\in\N}1(S\_k<n\le F\_k) \tag{6}
\end{equation\*}
and hence
\begin{equation\*}
 P(Y\_n\ne0\}=\sum\_{k\in\N}P(S\_k<n\le F\_k). \tag{7}
\end{equation\*}
Here and in what follows, $n$ and $k$ are natural numbers.
Next, consider the duration
\begin{equation\*}
 D\_k:=F\_k-S\_k
\end{equation\*}
of the $k$th walk. Since the $R\_i$'s are independent and independent of the $T\_j$'s,
the r.v.'s $D\_1,D\_2,\dots$ are independent and independent of the $T\_j$'s, and the $T\_j$'s are also independent. So, the r.v.'s $T\_1,D\_1,T\_2,D\_2,\dots$ are independent.
Also,
\begin{equation\*}
 S\_k=T\_1+\sum\_{j=2}^k(D\_{j-1}+T\_j). \tag{8}
\end{equation\*}
So, $S\_k$ and $D\_k$ are independent and hence  

\begin{equation\*}
 P(S\_k<n\le F\_k)=\sum\_{d\in\N}P(D\_k=d)P(S\_k<n\le S\_k+d). 
\end{equation\*}
Using (8) and the independence of $T\_1,D\_1,T\_2,D\_2,\dots$, for all $d\in\N$ we have
\begin{equation\*}
 P(S\_k<n\le S\_k+d)=
 P(n-d\le S\_k<n)\le\sup\_{m\in\Z} P(m-d\le T\_k<m)
=\sum\_{t=1}^d p\_kq\_k^{t-1}. 
\end{equation\*}
So,
\begin{equation\*}
\begin{aligned}
 P(S\_k<n\le F\_k)&\le\sum\_{d\in\N}P(D\_k=d)\sum\_{t=1}^d p\_kq\_k^{t-1} \\ 
 &=\sum\_{t\in\N}^d p\_kq\_k^{t-1}\sum\_{d=t}^\infty P(D\_k=d) \\ 
 &=\sum\_{t\in\N}^d p\_kq\_k^{t-1}P(D\_k\ge t) \\ 
 &=\sum\_{t\in\N}^d p\_kq\_k^{t-1}P(D\_1\ge t) \\ 
 &\le\sum\_{t\in\N} p\_kq\_k^{t-1}ct^{-1/2}, 
\end{aligned}
\end{equation\*}
since, by (say) the reflection principle, $P(D\_1\ge t)\le ct^{-1/2}$ for $t\in\N$. Here and in what follows, $c$ denotes various universal positive real constants. Therefore and because $0<p\_k<1/2$,
\begin{equation\*}
\begin{aligned}
 P(S\_k<n\le F\_k)&\le 2c\sum\_{t\in\N} p\_k(1-p\_k)^t t^{-1/2} \\ 
 &\le 2cp\_k \sum\_{t\in\N} e^{-p\_k t}t^{-1/2} \\ 
 &\le 2cp\_k \int\_0^\infty e^{-p\_k t}t^{-1/2}\,dt =cp\_k^{1/2}. 
\end{aligned}
\tag{9}
\end{equation\*}


Also, for each $k\in\N$, $P(S\_k<n\le F\_k)\le P(F\_k\ge n)\to0$ (as $n\to\infty$), since $F\_k<\infty$ a.s. So, by (7), for each $K\in\N$,
\begin{equation\*}
 \limsup\_n P(Y\_n\ne0\}\le \limsup\_n \sum\_{k=K}^\infty cp\_k^{1/2}.
\end{equation\*}
Letting now $K\to\infty$ and recalling (1), we see that $\limsup\_n P(Y\_n\ne0\}=0$ and hence $Y\_n\to0$ in probability (as $n\to\infty$).


**Noting that $Y\_n\not\to0$ a.s. (as $n\to\infty$):** It follows (say by (6)) that $|Y\_{S\_k+1}|=1$ for all $k\in\N$. Also, $S\_k\to\infty$ a.s. as $k\to\infty$. So, $Y\_n\not\to0$ a.s. (as $n\to\infty$).


