Cayley's formula

Tags: #theorem

Statement

The number of labellings of a tree on n vertices is nn2

Proof 1: induction

We prove the more general result: define

Fn(x1,,xn)=T labellingi=1nxidegT(i)1

Then, we shall prove the claim that

Fn(x1,,xn)=(x1++xn)n2

and then the statement follows by setting all xi=1.

We shall show this via induction. One can manually verify that this is true for n=1. Define Gn(x1,,xn)=Fn(x1,,xn)(x1++xn)n2. It suffices to show that Gn=0 identically. By this lemma, it suffices to show that Gn|xi=0=0 for each i. WLOG let i=n and consider

Gn(x1,,xn1,0)=Tx1degT(1)1xn1degT(n1)10degT(n)1(x1++xn1)n2

note that the only terms that survive in the summation are those where the degree of n is exactly 1. In other words, when n is a leaf. Then, we note that Tn is a tree with n1 vertices, and so we may rewrite this as

=T,j(k=1n1xkdegT(k)1)xj(x1++xn1)n2

where T ranges over labelled trees on n1 vertices and j ranges over the vertices of these trees. In particular, j symbolizes the vertex to which n is connected to. Note that we have to add one more to the degree of xj since attaching n will add one more to its degree.

But we note that

=Fn1(x1,,xn1)(x1++xn1)(x1++xn1)n2

which yields the result as desired after applying the induction hypothesis.

As a corollary to this proof, number of labellings on a tree with given degrees

Proof 2: Prüfer's Coding

We build a bijection between trees with codes, which are sequences (c1,,cn2) each elements of {1,,n} as follows (it is clear that the number of such codes is nn2):

  1. Find the minimal leaf l of T (ie. the leaf with the least number as its labelling)
  2. Let c such that (l,c) is the edge incident to l
  3. Record c (the label thereof)
  4. Erase (l,c)
  5. Repeat the above steps n2 times.

Note that for i[n], the number of times that i appears in the code is degT(i)1.
i gets recorded whenever we erase an edge connected to it, and we have to remove all those other edges before we erase i itself.

Decoding: given a sequence C=(c1,,cn2)[n]n2 and let L={1,,n}

  1. Find the minimum element lL that is not in C
  2. Let c be the first element of C
  3. Draw the edge (l,c)
  4. Remove l from L and c from C
  5. Repeat the above n2 times
  6. Connect the remaining 2 elements of L by an edge

By the observation above, these tow are inverse to each other.

As a corollary to this proof, number of labellings on a tree with given degrees

Example

Say we have this tree
Pasted image 20260404135115.png|300
We would record:

min leaf 2 3 4 6 5 1
code 8 1 5 5 1 8

Proof 3 (Eğecioğlu-Remmel)

We shall build a bijection between labelled trees and maps f:[n][n] such that f(1)=1 and f(n)=n. The bijection will have a similar feel to that of records is Sterlingian.
Note that there are nn2 such functions since we have n choices for each input that is not 1,n.

Given a tree T on n vertices

Note that since the number to the left of n and 1 are always right to left minimas, 1 and 15 will always have a self loop. There is always one arrow leaving each vertex and thus it's a well-defined function.

Given a function f:[n][n]:

  1. Draw a graph that corresponds to the function
    1. This will consist of periodic (cycles) and preperiodic points
  2. You can place the periodic cycles in a line at the top with the preperiodic points below them
  3. Arrange all cycles such that the smallest of them is on the right
  4. Arrange each cycle such that they are decreasing
  5. Erase the arrows and draw the appropriate edges to create the tree

Example

The tree:
20260403_134539.jpg|500
and the resulting function:
20260403_135126.jpg|500