Let $(X, \mathcal A, \mathcal A_n, \mu)$ be a $\sigma$-finite filtered measure space and let $X_n$, $n\in\mathbb N$ be a sequence of $\mathcal A_n$ measurable real valued functions. For a fixed Borel set $B\subset\mathbb R$ define $$ T(x)=\inf\{n\in\mathbb N:X_n(x)\in B\}, $$ and $T(x)=+\infty$ if $\{n\in\mathbb N:X_n(x)\in B\}=\emptyset$. Show that $T$ is a stopping time.
Define next $$ L(x)=0\lor\sup\{n\leq 5:X_n(x)\in B\}. $$ Show that $L$ is not a stopping time.
My attempt. Intuitively, I know that, using the definition A random variable $T$ is a stopping time (w.r.t. a filtration $\{\mathcal F_n\}$) if $\{T\leq n\}$ for every $n$ (in other words $\{T\leq n\}\in \mathcal F_n$ means asking if, from the information we have at time $n$, we know whether $T$ is less or equal to $n$ or not), $T$ is a stopping time and $L$ is not. But I don't know how to write it down formally. Can someone help me? Thank you