This lemma is used in the context of online convex optimisation. It is sometimes called the 'Be the Leader Lemma'.


> **Lemma:**
Suppose $f_1,f_2,\ldots,f_N$ are real valued functions with the same domain. Define each $F_n = f_1 + \ldots + f_n$ and let $y_n$ be a minimiser of $F_n$. Then we have $\sum_{i=1}^N f_i(y_i) \le \sum_{i=1}^N f_i(x)$ for all $x$ in the domain.

At first glance I couldn't see any reason this should be true. Obviously if we have more control over the various inputs we can get the sum smaller. For example if each $y_n$ was a minimiser of $f_n$ the result would be obvious. But that's not how the $y_n$ are defined. In fact each $y_n$ seems to only depend very weakly on the function we're plugging it into, and weaker still as we make $n$ larger.

In the online optimisation context we receive *enemy* convex functions $f_1,f_2,\ldots$ with the same (compact convex) domain and we must select inputs $x_1,x_2,\ldots$ for $f_1,f_2,\ldots$ respectively. The catch is we must select each $x_{n+1}$ knowing **only** $x_1,x_2,\ldots, x_n$ and $f_1,f_2,\ldots, f_n$ and **without knowing** the function $f_{n+1}$ we're going to plug $x_{n+1}$ into.
Our goal is to make the limit $\frac{1}{n}\sum_{i=1}^n \big (f_i(x_i) - f_i(x) \big )$ tend to zero for each $x$ in the domain as $n \to \infty$.

Since each $y_{n+1}$ in the lemma requires us to *look ahead in time* to see $f_{n+1}$, we cannot use the lemma directly to get a valid strategy. But there are some strategies which you can prove are valid by comparing them to the 'Be the Leader strategy'.

The proof of the lemma is surprisingly short. It uses induction and I find it completely unenlightening. 

Suppose the lemma holds for some value of $N$. That is to say

$\sum_{i=1}^N f_i(y_i) \le \sum_{i=1}^N f_i(x)$ for all $x$ in the domain.

Next we add $f_{N+1}(x)$ to both sides:


$\sum_{i=1}^N f_i(y_i) + f_{N+1}(x) \le \sum_{i=1}^{N+1} f_i(x)$ for all $x$ in the domain.

In particular we have 


$\sum_{i=1}^N f_i(y_i) + f_{N+1}(y_{N+1}) \le \sum_{i=1}^{N+1} f_i(y_{N+1})$.

But since $y_{N+1}$ minimises the right-hand-side we can replace it with any $x$ in the domain to get.

$\sum_{i=1}^{N+1} f_i(y_i) \le \sum_{i=1}^{N+1} f_i(x)$ for all $x$ in the domain.

This doesn't clear up the problems with the intuition about how each $y_n$ depends only very weakly on $f_n$. Can anyone see a way to prove the lemma without using induction? Perhaps by bundling together the $n$ many leapfrogging optimisations into a single optimisation of a function with some sort of complex domain?

The Be The Leader Lemma makes no assumptions about the domain or about the functions. In particular it does not require $f_i$ be continuous. If it allows for a more transparent proof, feel free to assume for example the functions $f$ are continuous and the domain is some compact convex subset of some $\mathbb R^M$.