There are at least kmn edges colored in the most used color. We delete the remaining edges and prove that there exists a connected component with at least m+n vertices in the remaining graph. The idea is to consider all the connected components. If each one has less than m+n vertices, then the graph is too fragmented and it's impossible to have too many (at least kmn) edges even if all edges are present in every connected component. It boils down to prove a certain inequality.
Lemma. Let x,y be two positive real numbers and ℓ,k; ℓ≥k be natural numbers. Let xi,yi,i=1,2,…,ℓ satisfy the following conditions.
xi≥0,yi≥0,xi+yi≤(x+y)/k,i=1,2,…,ℓ;
i=1∑ℓxi=x,i=1∑ℓyi=y.(1)
Then it holds
i=1∑ℓxiyi≤kxy.
The equality is reached only if xi=x/k,yi=y/k,i=1,2,…,k; xi=yi=0,i>k.
Proof. Let us denote f(x,y):=∑i=1ℓxiyi, where x=(x1,…,xℓ), y=(y1,…,yℓ). The conditions in (1) determine a compact set, hence f attains its maximum value on it, say, at the points xi′,yi′,i=1,2,…,ℓ. We can assume x1′≥x2′≥⋯≥xℓ′. We shall prove that yi′ are also in decreasing order. Let us assume on the contrary that yi′<yi+1′. Set
xi=xi+1:=(xi′+xi+1′)/2;yi=yi+1:=(yi′+yi+1′)/2.
Then (Chebyshev inequality)
xiyi+xi+1yi+1>xi′yi′+xi+1′yi+1′.
But it contradicts the maximality of xi′,yi′,i=1,…,ℓ. Next, if x1′+y1′<(x+y)/k we can similarly set x1:=x1′+ε,x2:=x2′−ε;y1:=y1′+δ,x2:=x2′−δ for sufficiently small ε,δ≥0 and get a larger value of f. Therefore, x1′+y1′=(x+y)/k.
Let k′ be the largest index for which xk′>0 and yk′>0. In the same way we can see that xi′+yi′=(x+y)/k,i=1,2,…,k′. Hence, k′≤k. Assume that k′<k and yi=0,i>k′. We modify x′,y′ as follows. Set
xi:=xi′,yi:=yi′,i=1,2,…,k′−1;xk′:=xk′′,yk′:=yk′′−ε,xk′+1:=(x+y)/k,yk′+1:=ε.
For i>k′+1 we set yi=0, and the values of xi,i>k′+1 are irrelevant providing they comply with (1). Since xk′<(x+y)/k, it can be seen that f(x,y)>f(x′,y′) which contradicts the maximality of x′,y′.
Thus, k′=k. We prove that xi′=x/k,yi′=y/k,i=1,2,…,k. Assume on the contrary it doesn't hold and let j be the first index for which xj′=x/k. WLOG let xj′<x/k. Then there exists i>j for which xi′>x/k. This means xi′>xj′ and thus the sequence x1′,x2′,…,xk′ is not decreasing, contradiction. To recap, we established that xi′=x/k,yi′=y/k,i=1,2,…,k. In this case f(x′,y′)=kxy, and Lemma 1 is proved. □
Back to the problem. The number of all edges of K is k2mn, hence there is a color, say, white such that at least kmn edges are colored white. We delete all edges colored in a color other than white. We'll prove that in the remaining graph K′, there exists a connected component with at least m+n vertices. Assume on the contrary it is not true. Denote the connected components of K′ by G(Ai,Bi), i=1,2,…,ℓ and let ∣Ai∣=mi,∣Bi∣=ni,i=1,2,…,ℓ. We have
i=1∑ℓmi=km,i=1∑ℓni=kn,mi+ni<m+n.
According to Lemma 1,
i=1∑ℓmini<kmn
which contradicts the choice of the white color. This means that for at least one index i it holds mi+ni≥m+n.