> [!definition]
>
> Let $(x_n)$ be a bounded [[Sequence|sequence]], this means that it has upper bounds or lower bounds. Define a sequence of [[Set|sets]] $A_n = \{x_k: k \ge n\}$. Let $(y_n)$ be a new sequence of [[Supremum and Infimum|supremum and infimum]] with $y_n = \sup A_n$ or $y_n = \inf A_n$. Note that these sets are nested: $A_n \supseteq A_{n + 1} \forall n$, meaning that $\sup A_n$ is a decreasing sequence, and $\inf A_n$ is an increasing sequence, bounded from below and above by each other. By the [[Monotone Convergence Theorem for Sequences|monotone convergence theorem]], the [[Limit|limits]] $\limv{n}\sup A$ and $\limv{n} \inf A$ both exist, and are known as the **limit superior** and **limit inferior** of the sequence.
> $
> \limsup_{n \to \infty} A = \limv{n}\sup A_n \quad
> \liminf_{n \to \infty} A = \limv{n}\inf A_n
> $
>
> Let $(x_n)$ be an unbounded sequence, then $\limsup x_n$ and $\liminf x_n$ are respectively $\infty$ and $-\infty$ based on the direction in which it is unbounded. If it is [[Properly Divergent Sequence|properly divergent]], then $\limsup x_n = \liminf x_n$.
> [!theorem]
>
> Let $(x_n)$ be a bounded sequence. Then, it converges to $x$ if and only if $\limsup x_n = x = \liminf x_n$.
>
> *Proof*. Let $(A_n)$ be a sequence of sets with $A_n = \{x_k: k \ge n\}$. Then,
> $
> A_1 \supseteq A_2 \supseteq A_3 \supseteq \cdots
> $
> Meaning that $\inf A_n$ is an increasing bounded sequence, and that $\sup A_n$ is a decreasing bounded sequence. Both exists. Let $y_n = \sup A_n$, and $\lim \sup x_n = y$. Let $z_n = \inf A_n$ and $\lim \inf x_{n} = z$.
>
> Suppose that $\limv{n} x_n = x$. Let $\varepsilon > 0$, then $\exists N \in \nat$, where $|x_n - x| < \frac{\varepsilon}{2} \forall n \ge N$ (or $x - \frac{\varepsilon}{2} < x_n < x + \frac{\varepsilon}{2}$).
>
> Then for all $n \ge N$, $\sup A_n \le x + \frac{\varepsilon}{2}$ and $\inf A_n \ge x - \frac{\varepsilon}{2}$ by definition of the limit points, giving
> $
> x - \frac{\varepsilon}{2} \le \inf A_n \le x_n \le \sup A_n \le x + \frac{\varepsilon}{2}
> $
> But then, $x - \frac{1}{2} \le \inf A_n \le x + \frac{\varepsilon}{2}$, $x - \frac{1}{2} \le \sup A_n \le x + \frac{\varepsilon}{2}$. By definition of limits
> $
> \liminf_{n \to \infty} x_n = \limsup_{n \to \infty} x_n = \limv{n} x_n
> $
>
> Suppose that $\liminf_{n \to \infty} x_n = \limsup_{n \to \infty} x_n = x$. Let $\varepsilon > 0$ be arbitrary, then $\exists N \in \nat$, where $\forall n \ge N$, $|\sup A_n - x| \lt \varepsilon$ and $|\inf A_n| \lt \varepsilon$.
> $
> x - \varepsilon \le \inf A_n \le x_n \le \sup A_n \le x + \varepsilon
> $
> Then for all $n \ge N$, $|x_n - x| < \varepsilon$. By definition of limits,
> $
> \liminf_{n \to \infty} x_n = \limsup_{n \to \infty} x_n = \limv{n} x_n
> $
> [!theorem]
>
> Let $\seq{x_n}$ be a sequence. If $a \le x_n \le b$ eventually, then
> $
> a \le \liminf_{n \to \infty}x_n \le \limsup_{n \to \infty} \le b
> $
> [!theorem] Limit Laws
>
> Limit superior and inferior are convergent, and therefore can be used for arithmetics. However note that whenever a negation operation happens, they must be flipped.
> - $\overline{\limv{n}}x_n = -\underline{\limv{n}}(-x_n)$
> - For $c \ge 0$, $\overline{\limv{n}}cx_n = c\overline{\limv{n}}x_n$.
> - For $c < 0$, $\overline{\limv{n}}cx_n = c\underline{\limv{n}}x_n$
>
> In addition, the limit superior and inferior do not behave identically to regular limits when the sequence is divergent, namely the following are equal when the sequence converges (or when you're lucky):
> - $\overline{\limv{n}}(x_n + y_n) \le \overline{\limv{n}}x_n + \overline{\limv{n}}y_n$
> - $\underline{\limv{n}}(x_n + y_n) \ge \underline{\limv{n}}x_n + \underline{\limv{n}}y_n$
> [!theorem]
>
> Let $\seq{x_n}$ be a non-negative, convergent sequence and $\seq{y_n}$ be a bounded non-negative sequence, then
> $
> \limsup_{n \to \infty}x_ny_n = \lim_{n \to \infty}x_n \cdot \limsup_{n \to \infty}y_n
> $
> *Proof*. Let $x = \limv{n}x_n$, and split the product as
> $
> x_ny_n = xy_n + (x_n - x)y_n
> $
> then the latter sequence converges to $0$, and
> $
> \begin{align*}
> \limsup_{n \to \infty}x_ny_n &= x \cdot \limsup_{n \to \infty}y_n
> \end{align*}
> $
> [!question] Theorem
>
> Let $(x_n)$ be a bounded sequence, then every step towards the limit superior and inferior only excludes a finite amount of elements in the sequence.
> $
> \begin{align*}
> \overline{\limv{n}} &= \inf \bracs{t: |\bracs{n: x_n > t}| < \aleph_0} \\
> \underline{\limv{n}} &= \sup \bracs{t: |\bracs{n: x_n < t}| < \aleph_0}
> \end{align*}
> $
> In other words, the limit superior and inferior are the *limits* of the *eventual* bounds to the sequence (they become bounds by neglecting a finite amount of elements).
>
> This is a rephrasing of *limit superior is the limit inferior of the upper bounds, limit inferior is the limit superior of the lower bounds*.
>
> *Proof.* Denote $A = \bracs{t: |\bracs{n: x_n > t}| < \aleph_0}$ to be the set of eventual upper bounds of $(x_n)$. Note that this set is non-empty ($\sup x_n \in A$) and bounded from below by $\inf x_n$, which allows $\inf A$ to exist.
>
> Take the $\inf A$ and subtract it by $\varepsilon$, this gives a number that is not an eventual upper bound of $A$. Then, there exists an infinite number of $(x_n)$ where they are greater than $\inf A - \varepsilon$. Therefore, the limit superior must be greater than or equal to $\inf A$.
>
> However, let $t \in A$ and let $n_t$ be $\max \bracs{n: x_n > t}$, then $\overline{\limv{n}}x_n \le \sup \bracs{x_n: n > n_t} \le t$. Therefore the limit superior is a lower bound of $A$, $\overline{\limv{n}}x_n \le \inf A$. Therefore, $\overline{\limv{n}}x_n = \inf A$.
>
> The reverse can be proven by swapping the symbols.