(Proof-check) Alternative formula for the total variation Good morning! 
I'm reposting a message I posted a bit earlier because it was quite messy and I wanted to make it clearer.
I have a continuously differentiable function $f$ on $[a,b]$, and I am trying to prove the following equality: 
$\sup\limits_{\mathcal{P}} \displaystyle\sum_i |f(t_{i+1}) - f(t_i)| = \lim\limits_{||\mathcal{P}|| \to 0} \displaystyle\sum_i |f(t_{i+1}) - f(t_i)|$, where $\mathcal{P}$ ranges over the set of partitions, and the $t_i$'s are "tag-points" (ie, each $t_i$ belongs to the $i+1$-th interval of the partition).
I've already shown that $\sup\limits_{\mathcal{P}} \displaystyle\sum_i |f(t_{i+1}) - f(t_i)| = \displaystyle\int_a^b |f'(x)| \mathrm{d}x$, and it is obvious that $\lim\limits_{||\mathcal{P}|| \to 0} \displaystyle\sum_i |f(t_{i+1}) - f(t_i)| \leq \sup\limits_{\mathcal{P}} \displaystyle\sum_i |f(t_{i+1}) - f(t_i)|$. So I tried to show the second side of the inequality, but I think there might be a mistake in my reasoning, so I wanted to ask for some proof-checking. Here is how I went about it:

$|f'|$ is continuous, so its integral can be written as a limit of Riemann sums:
\begin{align*}
    \displaystyle\int_a^b |f'(x)| \mathrm{d}x &= \lim\limits_{n \to +\infty} \displaystyle\sum_{i = 0}^{n-1} \dfrac{b-a}{n}|f'(a_i)| \, \, \left(a_i := a + \dfrac{i}{n}(b-a)\right) \\
    &= \lim\limits_{n \to +\infty} \displaystyle\sum_i |f(a_i + \dfrac{b-a}{n}) - f(a_i) + o(\dfrac{1}{n})| \\
    &\leq \lim\limits_{n \to +\infty} \displaystyle\sum_i |f(a_i + \dfrac{1}{n}) - f(a_i)| = \lim\limits_{||\mathcal{P}|| \to 0} \displaystyle\sum_{t_i \in \mathcal{P}} |f(t_{i+1}) - f(t_i)|
\end{align*}
Now, the step I think is dodgy is the last one. I think it makes sense, because since $f$ is Riemann-integrable, two of its Riemann sums with a mesh going to $0$ should be equal, but I'm not $100\%$ sure, so I'm asking just in case :)
 A: Set $S = \sup_\mathcal{P} \sum_\mathcal{P} |f(t_i)-f(t_{i-1})|$ and let $\epsilon > 0$. By definition of the supremum you may find a partition $\mathcal{P}$ so that $$S - \sum_\mathcal{P} |f(t_i)-f(t_{i-1})| < \epsilon$$ Now if you take any finer partition $\mathcal{P}' \supset \mathcal{P}$, then $$S - \sum_{\mathcal{P}'} |f(t_i')-f(t_{i-1}')| < \epsilon \qquad (\star)$$
Now note, that $I = \lim\limits_{\|P\| \to 0} \sum |f(t_i)-f(t_{i-1})|$  exists and is unique (see https://math.stackexchange.com/a/2047959/72031)  and by $(\star)$ we obtain, $S < I + \epsilon$ for all $\epsilon >0$ and thus $S \leq I$ as wanted.
A: When you are dealing with partitions of a closed interval and limit of things dependent on a partition you need to make yourself aware about the limit process involved here.
Essentially there are two ways to define a limit. One is where the limit is taken by refining partitions and another is by using partitions of smaller and smaller norms. Both these are different limit processes and may generate different results. More details are available in this answer.
Next note that the proof you seek can be divided into two stages. First you show that the supremum of sums in question is also the limit of such sums as partitions are made finer and finer (this is easy and based on definition of supremum and definition of limit via refinement). Then you show that the limit via refinement and limit via norm tending to zero are equal in this case. This is guaranteed in case of sums related to variation of a function provided the function is continuous. A detailed proof is available here.
Second step is to use mean value theorem and convert the sum in question into a Riemann sum for $|f'|$ and note that the integral is the limit of Riemann sums as norm of partition tends to $0$. This way the proof is complete.
