Fist I observe function $f(x)=x^2$ in the figure as following

I found that when $x_1 \ge y_1$ and $x_2 \le y_2$ $\Rightarrow$ $AB \ge CD$ $\Rightarrow$ $$\frac{f(x_1)+f(x_2)}{2}-f(\frac{x_1+x_2}{2}) \ge \frac{f(y_1)+f(y_2)}{2}-f(\frac{y_1+y_2}{2})$$ (1).

**Note that:** When $x_1+x_2=y_1+y_2$ the inequality (1) is Karamata inequality (with case n=2)

$$f(x_1)+f(x_2) \ge f(y_1)+f(y_2)$$

From above observation, I am looking for a proof of a conjecture generalization of Karamata inequality as following:

Let $I$ be an interval of the real line and let $f$ denote a real-valued, convex function defined on $I$. If $x_1, . . . , x_n$ and $y_1, . . . , y_n$ are numbers in $I$ such that:

- $x_1 \ge x_2 \ge x_3...\ge x_n,$ and $y_1 \ge y_2 \ge y_3...\ge y_n$

~~2.x_1+x_2+...+x_i \ge y_1+y_2+...+y_i for i=1,...,n-1 and~~

~~3. x_n \le y_n~~

2'. $x_1+...+x_i \ge y_1+...+y_i$ and $x_{i+1}+...+x_n \le y_{i+1}+...+y_n$ for $i=1,...,n-1$ then

$$\frac{f(x_1)+f(x_2)+...+f(x_n)}{n}-f(\frac{x_1+x_2+...+x_n}{n}) \ge \frac{f(y_1)+f(y_2)+...+f(y_n)}{n}-f(\frac{y_1+y_2+...+y_n}{n}) $$

The inequality holds with equality if and only if $x_i=y_i$ for all $i \in {1, 2,...,n}$