It is not difficult to show that the conditions of the Erdős–Gallai theorem are necessary for a sequence of numbers to be graphic. The requirement that the sum of the degrees be even is the
handshaking lemma, already used by Euler in his 1736 paper on the
bridges of Königsberg. The inequality between the sum of the k largest degrees and the sum of the remaining degrees can be established by
double counting: the left side gives the numbers of edge-vertex adjacencies among the k highest-degree vertices, each such adjacency must either be on an edge with one or two high-degree endpoints, the k(k-1) term on the right gives the maximum possible number of edge-vertex adjacencies in which both endpoints have high degree, and the remaining term on the right upper bounds the number of edges that have exactly one high degree endpoint. Thus, the more difficult part of the proof is to show that, for any sequence of numbers obeying these conditions, there exists a graph for which it is the degree sequence. The original proof of was long and involved. cites a shorter proof by
Claude Berge, based on ideas of
network flow. Choudum instead provides a proof by
mathematical induction on the sum of the degrees: he lets t be the first index of a number in the sequence for which d_t > d_{t+1} (or the penultimate number if all are equal), uses a case analysis to show that the sequence formed by subtracting one from d_t and from the last number in the sequence (and removing the last number if this subtraction causes it to become zero) is again graphic, and forms a graph representing the original sequence by adding an edge between the two positions from which one was subtracted. consider a sequence of "subrealizations", graphs whose degrees are upper bounded by the given degree sequence. They show that, if
G is a subrealization, and
i is the smallest index of a vertex in
G whose degree is not equal to
di, then
G may be modified in a way that produces another subrealization, increasing the degree of vertex
i without changing the degrees of the earlier vertices in the sequence. Repeated steps of this kind must eventually reach a realization of the given sequence, proving the theorem. ==Relation to integer partitions==