In mathematics, Kruskal's tree theorem states that the set of finite trees over a well-quasi-ordered set of labels is itself well-quasi-ordered under homeomorphic embedding.
A finitary application of the theorem gives the existence of a fast-growing TREE function. TREE(3) is one of the largest simply defined finite numbers, dwarfing other large numbers such as Graham's number and googolplex.
The theorem was conjectured by Andrew Vázsonyi and proved by Joseph Kruskal (1960); a short proof was given by Crispin Nash-Williams (1963). It has since become a prominent example in reverse mathematics as a statement that cannot be proved in ATR0 (a second-order arithmetic theory with a form of arithmetical transfinite recursion).
In 2004, the result was generalized from trees to graphs as the Robertson–Seymour theorem, a result that has also proved important in reverse mathematics and leads to the even-faster-growing SSCG function, which dwarfs TREE.
The version given here is that proven by Kruskal (1960). All trees we consider are finite.
Given a tree with a root, and given vertices , , call a descendant of if the unique path from the root to contains , and call a child of if additionally the path from to is of length one (contains no other vertex).
Take to be a quasi-ordered (preordered) set. If , are rooted trees with vertices labeled in , we say that is inf-embeddable in and write if there is an injective map from the vertices of to the vertices of such that:
Kruskal's tree theorem then states:
The following is a corollary of the above; Nash-Williams (1963) provides a direct proof of this statement.
If , are unlabeled rooted trees, we say that is embeddable in and write if there is an injective map from the vertices of to the vertices of such that only the second and third of the above conditions hold:
Then:
For a countable label set , Kruskal's tree theorem can be expressed and proven using second-order arithmetic. However, like Goodstein's theorem or the Paris–Harrington theorem, some special cases and variants of the theorem can be expressed in subsystems of second-order arithmetic much weaker than the subsystems where they can be proved. This was first observed by Harvey Friedman in the early 1980s, an early success of the then-nascent field of reverse mathematics. In the case where the trees above are taken to be unlabeled (that is, in the case where has size one), Friedman found that the result was unprovable in ATR0, thus giving the first example of a predicative result with a provably impredicative proof. This case of the theorem is still provable by Π1
1-CA0, but by adding a "gap condition" to the definition of the order on trees above, he found a natural variation of the theorem unprovable in this system. Much later, the Robertson–Seymour theorem would give another theorem unprovable by Π1
1-CA0.
Ordinal analysis confirms the strength of Kruskal's theorem, with the proof-theoretic ordinal of the theorem equaling the small Veblen ordinal (sometimes confused with the smaller Ackermann ordinal). Kruskal's tree theorem itself proves that , the Feferman–Schütte ordinal, is well-founded; in particular, the inf-embeddable ordering on a countable label set contains a well-ordered chain of order type .
Suppose that is the statement:
All the statements are true as a consequence of Kruskal's theorem and Kőnig's lemma. For each , Peano arithmetic can prove that is true, but Peano arithmetic cannot prove the statement " is true for all ". Moreover, the length of the shortest proof of in Peano arithmetic grows phenomenally fast as a function of , far faster than any primitive recursive function or the Ackermann function, for example.[citation needed] The least for which holds similarly grows extremely quickly with .
Friedman defined the following function, which is a weaker version of the TREE function below. For a positive integer , take to be the largest so that we have the following:
Friedman computes the first few terms of this sequence as , , and . He also estimates to be less than 100, while suddenly explodes to a very large value. Any proof that exists in Peano arithmetic requires at least symbols, where is the unary version of the Ackermann function, but it can be proved to exist in ACA0 with at most 10,000 symbols.

By incorporating labels, Friedman defined a far faster-growing function. For a positive integer , take [a] to be the largest so that we have the following:
A finite version of Kruskal's theorem can be proven, which asserts that is finite for all . The TREE function eventually dominates every provably recursive function of the system ACA0 + Π1
2-BI. It grows far faster than on the fast-growing hierarchy; Friedman calculated the ordinal where and have similar growth rate (under affine transformation of input variables).
The sequence begins , ; before increases to a value so large that many other "large" combinatorial constants, such as Friedman's and Graham's number,[b] are surpassed by comparison. A lower bound for , and, hence, an extremely weak lower bound for , is ,[c] where is the single-argument version of Ackermann's function, defined as .
Friedman showed that is greater than the halting time of any Turing machine that can be proved to halt in ACA0 + Π1
2-BI with at most symbols,[d] where denotes tetration.