Definition of total variation According to wikipedia, the total variation of the real-valued function $f$, defined on an interval $[a,b]\subset \mathbb{R}$, is the quantity
$$V_b^a=\sup_{P\in\mathcal{P}}\sum_{i=0}^{n_P-1}\left | f(x_{i+1})-f({x_i)}\right |$$
where $\mathcal{P}= \left \{P=\{x_0,\ldots, x_{n_P}\} \mid P \text{ is a partition of } [a,b]\right \}$.
According to my professor, the total variation is the quantity
$$V_b^a=\limsup_{\delta(P)\to 0}\sum_{i=0}^{n_P-1}\left | f(x_{i+1})-f({x_i)}\right |$$
where $\delta(P)=\max_k (x_k-x_{k-1})$.
Why are the two definitions equivalent?
 A: Let $V_1$ be the first, $V_2$ be the second. Clearly $V_1 \ge V_2$ just because the $\sup$ is taken over all partitions, including those for which the mesh size goes to zero.
Suppose $P$ is a partition and $\sigma(P) = \sum_{i=0}^{n_P-1}\left | f(x_{i+1})-f({x_i)}\right| $. If $P'$ is a refinement of $P$ (that is, $P \subset P'$), we have $\sigma(P) \le \sigma(P')$. Hence we must have $V_2 \ge \sigma(P)$ for any $P$.
Now suppose $\epsilon>0$ and $P$ is a partition such that $\sigma(P) > V_1 -\epsilon$. Then we have $V_2 \ge \sigma(P) > V_1 -\epsilon$. Since $\epsilon >0$ was arbitrary, we have $V_2 \ge V_1$, and so $V_1 =V_2$.
A: The two are equivalent when $f$ is continuous but not in general. To see this let $f(x) := 1_{\{x = r\}}$ where $r \in [0,1]$ is irrational i.e. the function which is $1$ at $r$ but $0$ elsewhere. Then by the sup definition of variation we have $\text{Var}^{\sup} (f) = 2$, but for the sequence of partitions $\{ \frac{i}{2^n}: 0 \leq i \leq n \}_{n \in \mathbb{N}}$ we have $\text{Var}^{\lim} = \limsup_{n \rightarrow \infty} 0 = 0$.
A proof in the continuous case is the following. Let $(Q_n)_{n = 1}^{\infty}$ be a sequence of partitions with $\vert Q_n\vert \rightarrow 0$ i.e. whose mesh size goes to $0$. For any finite partition, define
$$ \text{Var}^{P}(f) := \sum_{t_i \in P} \vert f(t_{i+1}) - f(t_i) \vert $$
for a finite partition $P$ of $[0,1]$, let $n_P$ denote the number of elements in $P$, and let
$$ \vert P \vert = \max_{P} \vert t_{i+1} - t_i \vert .$$
We will show that the limit of $\text{Var}^{Q_n}(f)$ exists and coincides with $\text{Var}^{\sup}(f)$.
Of course $\text{Var}^{\sup}(f) \geq \text{Var}^{\limsup}(f)$ (which is generally true).
For the other direction, we want to show that for every finite partition $P$ and any $\varepsilon > 0$ there exists an $n \geq 0$ s.t. for all $Q_m$ with $m \geq n$
we have
$$ \text{Var}^{P}(f) := \sum_{t_i \in P} \vert f(t_{i+1}) - f(t_i) \vert \leq \text{Var}^{Q_m}(f) + \varepsilon $$
and thus
$$ \text{Var}^{P}(f) := \sum_{t_i \in P} \vert f(t_{i+1}) - f(t_i) \vert \leq \inf_{m \geq n} \text{Var}^{Q_m}(f) + \varepsilon $$
and
$$ \text{Var}^{P}(f) := \sum_{t_i \in P} \vert f(t_{i+1}) - f(t_i) \vert \leq \lim_{n \rightarrow} \inf_{m \geq n} \text{Var}^{Q_m}(f) = \liminf_{n \rightarrow \infty} \text{Var}^{Q_n}(f)$$
Then taking the $\sup_{P}$ gives
$$ \text{Var}^{\sup}(f) \leq \text{Var}^{\liminf}(f) \leq \text{Var}^{\limsup}(f) \leq \text{Var}^{\sup}(f). $$
So let $P$ be an arbitrary finite partition of $[0,1]$ and let $\varepsilon > 0$ be arbitrary. Then choose $n \geq 0$ s.t. $\delta := \vert Q_n \vert$ small enough s.t. for any $x,y \in [0,1]$ with $\vert x - y \vert < \delta$ we have
$$ \vert f(x) - f(y) \vert < C := \frac{\varepsilon}{2 n_P}$$
Then
\begin{align}
\text{Var}^{P}(f) &= \sum_{P} \vert f(t_{i+1}) - f(t_i) \vert \\
&\leq \sum_{P \cup Q_n} \vert f(t_{i+1}) - f(t_i) \vert \\
&\leq \sum_{Q_n} \vert f(t_{i+1}) - f(t_i) \vert + \sum_{t^P \in P} \vert f(q_{t-}) - f(t^P) \vert + \vert f(t^P) - f(q_{t+}) \vert \\
&\leq \text{Var}^{Q_n}(f) + n_P 2 C = \text{Var}^{Q_n}(f) + \varepsilon ,
\end{align}
where in line 3 for every $t^P$ in the partition $P$, the points $q_{t-}$ and $q_{t+}$ are the next points in $Q_n$ which lie to the left and right of $t^p$, respectively.
