Proof: Inequality in Mercer's theorem In the outline of the Mercer's theorem proof there is an inequality assumed without any explanation:
$$\sum_{i=0}^{\infty} \lambda_i \vert e_i(t) e_i(s) \vert \le \sup_{x \in [a,b]} \vert K(x,x)\vert^2$$
Why does this need to hold?
 A: The Parseval-Bessel Theorem leads to
$$f= \sum_{j=1}^\infty  (f,e_j)\, e_j~~ \text{for every }~~f\in L^2(a,b) \tag{1}$$
This implies linearity and continuity along with the fact that $Ke_j =\lambda_je_j$ that
$$ T_Kf =Kf =\sum_{j=1}^\infty  \lambda_j\,(f,e_j)\, e_j~~ \text{for every }~~f\in L^2(a,b) \tag{2}$$
Hence, one can carefully check to start with finite summation and Bessel inequality
$$ (Kf,f)= \sum_{j=1}^\infty  \lambda_j\,|(f,e_j)|^2 \tag{3}$$
We also set the Kernel
$$K_n(t,s) = \sum_{j=1}^{n} \lambda_j e_j(t) e_j(s)\tag{Kn}$$
then,
$$TK_nf(t) = \sum_{j=1}^{n} \lambda_j e_j(t) \int_{a}^{b}f(s)e_j(s)\,ds = \sum_{j=1}^{n} \lambda_j (f\, ,e_j)e_j(t) $$
hence, $$ (K_nf,f)= \sum_{j=1}^{n} \lambda_j |(f\, ,e_j)|^2.$$
Next we consider the truncated Kernel
$$ R_n(t,s) =K(t,s)- \sum_{j=1}^n \lambda_j\,e_j(t)\, e_j(s)\tag{4}$$
It derives from the foregoing that
$$ (R_nf,f)= \sum_{j=n+1}^\infty  \lambda_j\,|(f,e_j)|^2\ge 0~~\text{for every }~~f\in L^2(a,b) \tag{5}$$
i.e $(R_nf,f)\ge0$ then there is one result claiming that $R_n(t,t)\ge0$ for almost every $t\in(a,b)$
which leads to
$$ R_n(t,t) =K(t,t)- \sum_{j=1}^n \lambda_j\,e_j(t)\, e_j(t)\ge 0 \tag{6}$$
ie
$$ \sum_{j=1}^n \lambda_j\,e_j(t)\, e_j(t)\le K(t,t) \tag{7}$$
This holds true for abitratry $n\in\mathbb{N}$. whence,
$$ \sum_{j=1}^\infty \lambda_j\,e_j(t)\, e_j(t)\le \sup_{t\in [a,b]} K(t,t) $$
Applying Cauchy-Schwartz inequality we get,
\begin{split}
\Big|\sum_{j=1}^\infty \lambda_j\,e_j(s)\, e_j(t)\Big|^2 &\le& \Big(\sum_{j=1}^\infty \lambda_j\,e_j(s)\, e_j(s)\Big ) \Big(\sum_{j=1}^\infty \lambda_j\,e_j(t)\, e_j(t)\Big)\\
&\le& \sup_{t\in [a,b]} K^2(t,t)
\end{split}
Prove of the Claim in the complex case
suppose there is $x_0$ such that $K(x_0,x_0)<0$ then there are $c,d $
such that
$a\le c<x_0<d\le b$ with
$\mathcal{Re}(K(x,y) )\le0$ for every $(x,y)\in (c,d)\times(c,d)$ (this use the continuity of K at $x_0$!)
taking $f= \chi_{(c,d)}$ one check that,
$$0\le (Kf,f) = \iint_{(c,d)\times(c,d)}K(t,s)dt\,ds <0 \tag{8}$$
contradiction.
