4. Let $f(x)=(x+a)(x+b)$ (where $a, b$ are given positive real numbers), and $n \geqslant 2$ be a given integer. For non-negative real numbers $x_{1}, x_{2}, \cdots, x_{n}$ satisfying
$$
x_{1}+x_{2}+\cdots+x_{n}=1
$$

find the maximum value of
$$
F=\sum_{1 \leq i<j \leq n} \min \left\{f\left(x_{i}\right), f\left(x_{j}\right)\right\}
$$

(Leng Gangsong)
4. Solution 1
$$
\begin{array}{l}
\min \left\{f\left(x_{i}\right), f\left(x_{j}\right)\right\} \\
=\min \left\{\left(x_{i}+a\right)\left(x_{i}+b\right),\left(x_{j}+a\right)\left(x_{j}+b\right)\right\} \\
\leqslant \sqrt{\left(x_{i}+a\right)\left(x_{i}+b\right)\left(x_{j}+a\right)\left(x_{j}+b\right)} \\
\leqslant \frac{1}{2}\left[\left(x_{i}+a\right)\left(x_{j}+b\right)+\left(x_{i}+b\right)\left(x_{j}+a\right)\right] \\
\quad=x_{i} x_{j}+\frac{1}{2}\left(x_{i}+x_{j}\right)(a+b)+a b,
\end{array}
$$

Then \( F \leqslant \sum_{1 \in i<j \leqslant n} x_{i} x_{j}+\frac{a+b}{2} \sum_{1 \in i<j \leqslant n}\left(x_{i}+x_{j}\right)+C_{n}^{2} \cdot a b \)
$$
\begin{aligned}
= & \frac{1}{2}\left[\left(\sum_{i=1}^{n} x_{i}\right)^{2}-\sum_{i=1}^{n} x_{i}^{2}\right]+ \\
& \frac{a+b}{2}(n-1) \sum_{i=1}^{n} x_{i}+\mathrm{C}_{n}^{2} \cdot a b \\
= & \frac{1}{2}\left(1-\sum_{i=1}^{n} x_{i}^{2}\right)+\frac{n-1}{2}(a+b)+\mathrm{C}_{n}^{2} \cdot a b \\
\leqslant & \frac{1}{2}\left[1-\frac{1}{n}\left(\sum_{i=1}^{n} x_{i}\right)^{2}\right]+\frac{n-1}{2}(a+b)+\mathrm{C}_{n}^{2} \cdot a b \\
= & \frac{1}{2}\left(1-\frac{1}{n}\right)+\frac{n-1}{2}(a+b)+\frac{n(n-1)}{2} a b \\
= & \frac{n-1}{2}\left(\frac{1}{n}+a+b+n a b\right) .
\end{aligned}
$$

When \( x_{1}=x_{2}=\cdots=x_{n}=\frac{1}{n} \), the equality holds. Therefore, the maximum value of \( F \) is \( \frac{n-1}{2}\left(\frac{1}{n}+a+b+n a b\right) \).

Solution 2 Prove the following more general proposition by induction on \( n \).

Proposition For non-negative real numbers \( x_{1}, x_{2}, \ldots, x_{n} \) satisfying \( x_{1}+x_{2}+\cdots+x_{n}=s \) (where \( s \) is any fixed non-negative real number),
$$
F=\sum_{1 \text { xi<j<jधn }} \min \left\{f\left(x_{i}\right), f\left(x_{j}\right)\right\}
$$

the maximum value is achieved when \( x_{1}=x_{2}=\cdots=x_{n}=\frac{s}{n} \).
In fact, by the symmetry of \( F \), we can assume \( x_{1} \leqslant x_{2} \leqslant \cdots \leqslant x_{n} \). Note that \( f(x) \) is monotonically increasing on the set of non-negative real numbers. Then
$$
F=(n-1) f\left(x_{1}\right)+(n-2) f\left(x_{2}\right)+\cdots+f\left(x_{n-1}\right) .
$$

When \( n=2 \), \( F=f\left(x_{1}\right) \leqslant f\left(\frac{s}{2}\right) \), with equality when \( x_{1}=x_{2} \).
Assume the proposition holds for \( n \), consider the case for \( n+1 \).
For \( x_{2}+x_{3}+\cdots+x_{n+1}=s-x_{1} \), by the induction hypothesis,
$$
F \leqslant n f\left(x_{1}\right)+\frac{1}{2} n(n-1) f\left(\frac{s-x_{1}}{n}\right)=g\left(x_{1}\right),
$$

where \( g(x) \) is a quadratic function in \( x \) with the coefficient of the quadratic term being \( 1+\frac{n-1}{2 n^{2}} \), and the coefficient of the linear term being
$$
a+b-\frac{n-1}{2 n}\left(a+b+\frac{2 s}{n}\right) .
$$

Thus, the axis of symmetry is
$$
\begin{array}{l}
\frac{\frac{n-1}{2 n}\left(a+b+\frac{2 s}{n}\right)-a-b}{2+\frac{n-1}{n^{2}}} \leqslant \frac{s}{2(n+1)} \\
\Leftrightarrow[2(n-1) s-2 n(n+1)(a+b)](n+1) \\
\leqslant s\left(2 n^{2}+n-1\right),
\end{array}
$$

Clearly, the left side of the inequality \( <2\left(n^{2}-1\right) s< \) the right side.
Therefore, when \( x_{1}=\frac{s}{n+1} \), \( g\left(x_{1}\right) \) achieves its maximum value.
Thus, when \( F \) achieves its maximum value,
$$
x_{2}=x_{3}=\cdots=x_{n+1}=\frac{s-x_{1}}{n}=\frac{s}{n+1}=x_{1} \text {. }
$$

By mathematical induction, the proposition is proved.