4. For a sorting τ=(v1,v2,⋯,vn) of vertices in V, define fr:V→Z as follows: fr(v) equals the number of vertices adjacent to v that are ranked before v.
The following explains: fr is a good mapping.
In the calculation of ∑v∈Vfτ(v), each edge is counted exactly once, because if e∈E, let the two endpoints of e be u,v∈V, and u is ranked before v in τ, then e is counted once in fτ(v). Therefore,
v∈V∑fr(v)=∣E∣.
For any non-empty subset A⊆V (vertices in A are colored red, the rest are uncolored), take v∈A to be the vertex in A that is ranked first in the sorting τ. Then, by the definition of fτ and the selection of v, fΣ(v) does not exceed the number of uncolored vertices adjacent to v. Thus, fτ is a good mapping.
Conversely, if f:V→Z is any good mapping, the following explains: there must exist at least one sorting τ of vertices in V such that f=fr.
First, take A=V (as above, vertices in A are colored red, the rest are uncolored).
By condition (2), there exists v∈A such that
f(v)⩽0.
Choose any one of these points and denote it as v1.
Assume v1,v2,⋯,vk have been chosen, if k0.
Since v1 can be chosen arbitrarily, this results in at least n good mappings.
In general, G can be divided into several connected components G1,G2,⋯,Gk.
Since each vertex is connected to at least one other vertex, the number of vertices in each connected component is at least 2, let the number of vertices in these connected components be n1,n2,⋯,nk⩾2. For each connected component Gi(i=1,2,⋯,k), there are at least ni good mappings.
It is easy to see that combining the good mappings on each Gi results in a good mapping on G. Therefore,
m(G)⩾n1n2⋯nk⩾n1+n2+⋯+nk=n.
In summary, n⩽m(G)⩽n!.