I'm trying to prove that for any simple graph $G=(|E|,|V|, f)$
$|E| \leq (|V| - k + 1)(|V| - k) /2$
Where |E| - number of edges, |V| - number of vertices, and k - number of components.
Attempt at solution:
$$ν(G) = |E| - |V| + k(G) \geq 0$$
$$|E| \geq |V| - k$$
$$|E| + 1 \geq |V| - k + 1$$
$$(|E| + 1) (|V| -k) \geq (|V| - k + 1) (|V| -k)$$
$$(|E| + 1) (|V| -k) /2 \geq(|V| - k + 1) (|V| -k) /2$$
I know, that $(|V| -k) /2$ is always a positive number and if we remove it, we will lessen the left side. If we remove $+1$, we will lessen it even more. However, there is no guarantee, that we will lessen it enough to turn the sign the other way.
I really hope someone could help me.