Ubiquity of synonymity: almost all large binary trees are not uniquely identified by their spectra or their immanantal polynomials

Background There are several common ways to encode a tree as a matrix, such as the adjacency matrix, the Laplacian matrix (that is, the infinitesimal generator of the natural random walk), and the matrix of pairwise distances between leaves. Such representations involve a specific labeling of the vertices or at least the leaves, and so it is natural to attempt to identify trees by some feature of the associated matrices that is invariant under relabeling. An obvious candidate is the spectrum of eigenvalues (or, equivalently, the characteristic polynomial). Results We show for any of these choices of matrix that the fraction of binary trees with a unique spectrum goes to zero as the number of leaves goes to infinity. We investigate the rate of convergence of the above fraction to zero using numerical methods. For the adjacency and Laplacian matrices, we show that the a priori more informative immanantal polynomials have no greater power to distinguish between trees. Conclusion Our results show that a generic large binary tree is highly unlikely to be identified uniquely by common spectral invariants.


Background
Tree shape theory furnishes numerical statistics about the structure of a tree [1,2]. (Because we are interested in applications of tree statistics to trees that describe the structure of branching events in evolutionary histories, we will, for convenience, always take the term tree without any qualifiers to mean a rooted, binary tree without any branch length information or labeling of the vertices.) Such statistics have two related uses. Firstly, they can be used in an attempt to tell whether two trees are actually the same and, secondly, they can be used to indicate the degree of similarity between two trees with respect to some criterion.
Examples of the latter use are the testing of hypotheses about macroevolutionary processes and the detection of bias in phylogenetic reconstruction. Historically, numerical statistics for such purposes have attempted to capture the notion of the balance of a tree, which is the degree to which daughter subtrees are the same size.
The balance is typically measured by ad-hoc formulae that are often selected for statistical power to distinguish between two different distributions on trees [3,4]. In previous work we investigated the possibility of describing the shape of the tree using a list of numbers rather than just a single number [5,6].
A mathematically "canonical" approach to finding a list of such numbers is to use information derived from matrix representations of the trees. We first describe the matrix representations of a tree that we will consider.
In algebraic graph theory [7], the basic matrix associated to a graph is the adjacency matrix A(G), whose ij th entry is one if i and j are connected by an edge, and zero otherwise. From a probabilistic point of view, the more natural matrix to associate with a graph is the Laplacian matrix L (G), which is the infinitesimal generator of the natural random walk on the graph and is given by A(G) -D(G), where D(G) is the diagonal matrix of vertex degrees. It is clear that a graph can be recovered from either its adjacency of Laplacian matrix. Some authors, such as [8], define the Laplacian to be D(G) -1/2 L(G)D(G) 1/2 . Note that this difference is not relevant if one is only considering characteristics of the matrix L such as eigenvalues that are invariant under similarity transformations.
Readers in the phylogenetics community may be more familiar with the pairwise distance matrix [1,9]. The distance matrix P given a leaf-labeling 1, . . ., n has as its ij th entry the length of the path between leaf i and leaf j. Any leaf-labeled tree is uniquely determined by its distance matrix. These matrices have also been extensively studied as discrete metric spaces [10,11].
The definition of the adjacency and Laplacian matrices requires a numbering of the vertices, while the definition of the distance matrix requires a numbering of the leaves. Because we are considering unlabeled trees (that is, we identify trees that are equivalent in the usual sense of graph-theoretic isomorphism), we are only interested in tree statistics that are invariant under renumbering. Algebraically, this means that we are only interested in features of the associated matrix that are unaffected by similarity transformations via a permutation matrix. The most obvious such statistics are the eigenvalues.
The adjacency and Laplacian matrices and their eigenvalues are familiar objects in the area of spectral graph theory [7,8,12]. The eigenvalues of the adjacency matrix tend to contain combinatorial information about the graph, such as bounds on the chromatic number. The eigenvalues of the Laplacian give information of a more geometric flavor, such as the equivalent of the surface area to volume ratio of subgraphs of a graph. As well as having connections to the theory of random walks on graphs, the Laplacian eigenvalues can be used to define the expander graphs, an important class of graphs that have applications in coding theory. Therefore, it would not be too surprising if the these eigenvalues were a convenient way to summarize information about a tree, thus giving a nice collection of tree statistics.
Similarly, it seems plausible that the eigenvalues of the pairwise distance matrix could contain quite a lot of information about the tree that could be used to compare trees. Moreover, although the distance matrix formally contains the same information as the adjacency or Laplacian matrices, the transformation that takes the distance matrix to one of the other two is distinctly non-linear, and hence there is no reason to believe that there is any simple connection between the corresponding eigenvalues.
We demonstrate below that not only do there exist pairs of trees that have the same spectrum as another tree for the adjacency, Laplacian, and distance matrices, but that this is the rule rather than the exception as the trees become large, in the sense that the fraction of trees with a given number of leaves that have a unique adjacency, Laplacian, or distance spectrum goes to zero as the number of leaves goes to infinity.
The basic methodology that we use to prove this result was first established in [13] and developed in [14] for general (that is, not necessarily bifurcating) graphtheoretic trees in the case of the adjacency and Laplacian matrices. The present paper provides the first results of this type concerning rooted bifurcating trees, as well as the first examination of such results for the pairwise distance matrix. The key idea is to establish that certain pairs of trees T 1 and T 2 have the following exchange property for a given matrix representation: that exchanging T 1 for T 2 as subtrees of a given tree does not change the spectrum for that matrix representation. This is a stricter requirement than simply having the same spectrum ( Figure 1). It then becomes a matter of showing that the number of trees with a given number of leaves is asymptotically of larger order than the number of trees with the same number of leaves that don't have a particular subtree. For this we build on the generating function argument used in [15] for asymptotic estimates of the number of unlabeled rooted bifurcating trees (see the section Asymptotic numbers of trees).
One possible explanation for this phenomenon is that two diagonalizable matrices have the same spectrum if they are similar via an arbitrary similarity transformation rather than just via a permutation transformation, and this suggests considering features of a matrix that are invariant under permutation similarities but not more general ones. We will now describe a feature of a matrix, its immanantal polynomial, that has this property.
The immanant is a generalization of the determinant. Recall that the determinant of a matrix A = (a ij ) is given by  where the sum is over the symmetric group of permutations of {1, 2,..., n} and sgn(s) is the sign of the permutation s.
The function sgn is a particular example of a character of an irreducible representation of the symmetric group. It would take us too far afield to define these notions here, but excellent treatments may be found in [16][17][18][19]. We note, however, that the irreducible characters are constant on the conjugacy classes of the symmetric group (recall that two permutations belong to the same conjugacy class if and only if they have the same cycle structure) and they form a basis for the vector space of functions with this property (the class functions).
Our use of characters is simply to define the immanant of a matrix A for the irreducible character χ. A discussion of immanants may be found in [20,21]. The immanantal polynomial for a character c of a matrix is the corresponding generalization of the characteristic polynomial; that is, it is the polynomial Because the characters are class functions, an immanantal polynomial is invariant under similarity by permutation matrices, but it will not typically be invariant under more general similarities.
Unfortunately, as we show in Lemma 2, for either the adjacency or Laplacian matrix the following two conditions on a pair of trees are equivalent: • the spectra are equal, • the immanantal polynomials are equal for all irreducible characters.
Consequently, the immanantal polynomials for the adjacency and Laplacian matrices provide no more distinguishing power than the spectra and, in particular, a vanishing fraction of large trees have a unique set of immanantal polynomials for these matrices. We do not know if the same fact is true for the immanantal polynomials of the distance matrix.
Our main result is thus the following. Theorem 1. Let t n be the number of trees with n leaves. For either the adjacency, Laplacian, or pairwise distance matrix, let l n be the number of trees with n leaves that do not share their spectrum with another tree. Then, the fraction l n /t n goes to zero as n goes to infinity. For the adjacency and Laplacian matrices, the same result holds if we replace the spectrum by the complete set of immanantal polynomials.
The rate of convergence of the fraction in Theorem 1 is also of interest. If it is extremely slow then the existence of trees with shared spectra may not be practically relevant for the construction of informative tree shape statistics. We investigate this matter numerically towards the end of the paper.
Several other research groups have investigated problems that are related to, but different from, those investigated here. Steyaert and Flajolet [22] investigate the occurrences of subtrees in the case of "planar" trees, i.e. trees that are equipped with an order of subtrees at every internal node. These planar trees are substantially easier to analyze: for example, there is a nice closed form generating function for the numbers of such trees (the Catalan numbers). In contrast, the generating function for the number of trees considered here is only given as the solution of a functional equation and there is no closed form expression for the numbers of such trees. Graham and Lovasz [23] investigate the spectra of distance matrices of trees, but their distance matrices are defined in terms of vertex-to-vertex distances, rather than the leaf-to-leaf definition. The leaf-to-leaf distance matrix is a principal sub-matrix of the vertex-to-vertex one, and there are interlacing relations between the spectrum of a matrix and one of its principal submatrices (2). However it is not a priori the case that if two matrices have the same spectrum, then the principal submatrices with the same rows and columns will also have the same spectrum. In a similar vein, the vertex-tovertex distance matrix can be constructed from the leafto-leaf distance, but the construction involves considering whether certain linear inequalities hold and so it isn't a procedure that will, a priori, transform spectra in a simple way.
More recently, Bhamidi, Evans, and Sen [24] have proven that, subject to weak general conditions, many ensembles of random trees have the property that, with probability converging to one as the number of leaves goes to infinity, a realization shares its spectrum with another tree. Their conditions are easiest to check when the ensemble can be embedded in a general continuoustime branching process where individuals give birth to a possibly random number of offspring at the arrival times of a point process up to a possibly infinite death time, and those offspring go on to behave as independent copies of their parent. This particular framework covers examples such as random recursive trees, linear preferential attachment trees, uniform rooted unordered labeled trees, and Yule trees. However, we have been unable to embed the ensemble considered here in a suitable continuous-time branching process or otherwise check the general conditions of [24].
The computer code used in this paper was written in OCaml [25] and has been made available at http://github. com/matsen/ubiquity_synonymity, along with the results produced by this code.
Algebraic preliminaries concerning spectra and immanantal polynomials Equality of adjacency and Laplacian spectra implies equality of immanantal polynomials In order to prove results for the adjacency and Laplacian matrices simultaneously, we define for a tree T and arbitrary real numbers y and z the generalized Laplaciañ L(T) := yD(T) + zA(T) (recall that A(T) is the adjacency matrix and D(T) is the diagonal matrix of vertex degrees). We define the corresponding generalized Laplacian immanantal polynomial of the tree T with r vertices to be for an irreducible character c of the symmetric group S r .
The generalized Laplacian immanantal polynomial can be computed in a simple combinatorial fashion as follows. Define a k-matching to be a set of k pairwise disjoint edges of the tree (that is, a set of edges such that no two share a common vertex). Let M k (T) denote the set of k-matchings on the tree T. We think of an edge as a pair of vertices, so when we use the notation i ∈ p for a vertex i and a matching p, we mean that i is not one of the ends of any edge in p. Let C k denote the conjugacy class of the symmetric group S r consisting of permutations that are the product of k disjoint transpositions, and write χ(C k ) for the common value of the character c on such permutations. The following lemma appears in [14] and is included for completeness. Lemma 1. The generalized Laplacian immanantal polynomial of the tree T for the character c is given by The matrix entries m ij are zero unless i = j or there is an edge between i and j. If the permutation s has a cycle of length 3 or greater, then corresponding term in (1) must be zero because otherwise the tree would have a loop. Therefore we need only consider permutations that are products of disjoint transpositions where, moreover, each transposition exchanges the two vertices of an edge. Such a permutation is equivalent in an obvious way to a k-matching for some k, and the lemma follows. Proof. One direction is trivial: if two trees have the same generalized Laplacian immanantal polynomial for all characters, then their generalized Laplacians have the same characteristic polynomial and hence the same spectrum.
Conversely, if the generalized Laplacians of two trees have the same spectrum, then the characteristic polynomials of the generalized Laplacians are the same. Lemma 1 in the case c = sgn, the fact that sgn(C k ) = ±1 ≠ 0 for all k, and the fact that two equal polynomials have the same coefficients imply that the quantity is the same for both trees for all k. Another application of Lemma 1 completes the proof.

A sufficient condition for two trees to have the same adjacency or Laplacian spectrum
We use the phylogenetic rather than graph-theoretic definition of a subtree as follows. Define the distal vertex of an edge to be the vertex farthest from the root that touches that edge. Then, a subtree of a given rooted tree is what results from separating an edge from its distal vertex, which then becomes the root of the subtree.
Recall that M k (T) is the set of k-matchings of the tree T. Let N k (T) be the set of k-matchings where the chosen edges do not contact the root. Define The following lemma is implicit in [14], but again we include a proof for completeness. Lemma 3. Let S 1 and S 2 be trees with the same number of leaves. If P k (S 1 ) = P k (S 2 ) and Q k (S 1 ) = Q k (S 2 ) for all k, then any tree with S 1 as a subtree has the same generalized Laplacian spectrum as the tree obtained by substituting S 2 for S 1 .
Proof. Let T 1 be a tree with S 1 as a subtree, and write T 2 for the tree obtained by substituting S 2 for S 1 .
Denote by e 0 the edge that connects the rest of T 1 (resp. T 2 ) to the root of S 1 (resp. S 2 ).
We differentiate between two types of k-matchings of T i : those that contain e 0 and those that do not. Note that a k-matching of T i that does not contain e 0 restricts to an ℓ-matching of S i for some ℓ, and all matchings of S i arise via such a restriction. Similarly, a k-matching of T i that does contain e 0 restricts to an ℓmatching of S i with the property that the root of S i does not belong to any edge in the matching, and all matchings of S i with this property arise via such a restriction.
Consider the formula for the characteristic polynomial of the generalized Laplacian matrix that comes from Lemma 1 with c = sgn. Apply this formula to T 1 and T 2 . The assumption P k (S 1 ) = P k (S 2 ) (resp. Q k (S 1 ) = Q k (S 2 )) ensures that the matchings that do not include (resp. do include) e 0 make the same contribution to the respective characteristic polynomials.
The trees depicted in Figure 1 (b) are the smallest pair of rooted bifurcating trees satisfying the criteria of this lemma. The verification of this fact was done by computer, and the corresponding P k and Q k polynomials are available in the code repository.
A sufficient condition for two trees to have the same distance matrix spectrum We first recall an identity for determinants of partitioned matrices. If (2) Lemma 4. Form two trees T 1 and T 2 by gluing the roots of trees S 1 and S 2 with distance matrices A 1 and A 2 onto the same leaf of a common tree R. Write a i for the column vector of distances from the leaves of S i to the root of S i . Suppose that the following pairs of matrices have the same spectra (where ' denotes transpose): and where 1 is a column vector with each entry 1. Then, the distance matrices of T 1 and T 2 have the same spectrum.
Proof. Write B for the distance matrix of R. Then, B has the partitioned form where B is the distance matrix of the tree obtained from R by deleting the last leaf, b is the column vector of distances from the other leaves of R to the last leaf. Assume without loss of generality that this last leaf is the attachment point of the S i .
Denote by D i the distance matrix of T i . Observe that Hence, by (2), D i has the characteristic polynomial Using (2) again, we see that a partitioned matrix of the form where g and h are column vectors, has characteristic polynomial and the result follows. It was verified by computer that the trees in Figure 1 (b) are the smallest such that have distance matrices A i and vectors a i satisfying the criteria of this lemma. The corresponding characteristic polynomials are available in the code repository. We note with surprise that the smallest pair of trees with the exchange property for the distance matrix are the same as the smallest pair with the exchange property for the generalized Laplacian; this is a curiosity for which we do not have an explanation.

Asymptotic numbers of trees
As outlined in the Introduction, the proof of Theorem 1 follows immediately from Lemma 2, Lemma 3, Lemma 4, the existence of the trees in Figure 1 (b), and the following result. Proposition 1. Let T be a rooted tree. Let t n be the number of trees with n leaves. Let s n be the number of such trees that do not contain T as a rooted subtree. Then, the fraction s n /t n goes to zero as n goes to infinity.
Proof. Suppose that T has a leaves. Let f (x) := ∞ i=1 t i x i and f a (x) := ∞ i=1 s i x i denote the generating functions for t n and s n , respectively. Write r for the radius of convergence of the power series f and r a for the radius of convergence of the power series f a . Note that r ≤ r a < 1.
It is shown in [26] that r = 0.402698 ... and lim n→∞ n 3/2 ρ n t n = η, where h = 0.7916032 ... (see [27] for an asymptotic expansion of t n that extends this result and [28][29][30][31] for reviews of general methods for determining asymptotic numbers of trees of various sorts from a knowledge of the functional equations that their generating functions solve). Since s n is o(a -n ) for any 0 <a <r a , it follows that s n /t n is o(b n ) for any b > r/r a , and the proposition will hold if we can show that r <r a .
For the sake of completeness and because it serves as a good introduction to the derivation of the functional equation satisfied by the generating function of s n , we first derive the well-known functional equation satisfied by the generating function of the t n . See the comments after the proof of the lemma for some remarks about the history of the latter generating function.
These expressions are equivalent to the statement where t n/2 is set to zero if n is odd. From (3) the generating function f satisfies the functional equation It will be convenient to consider the function g: = 1f, which satisfies the functional equation It is shown in [15] that: • The radius of convergence r is strictly positive.
• The functional equation (4) has a unique solution in the whole complex plane, and this solution agrees with our power series in {x ℂ: |x| <r}.
• If, with a slight abuse of notation, we also denote this solution by g, then g(r) = 0.
• The point r is the only zero of g within {x ℂ : | x| < 1}.
It is clear from the power series that g is continuous and decreasing on [0, r) and g(0) = 1. Hence g is strictly positive on [0, r).
As observed in [15], these observations suggest a method for computing r. Put h( and q n := w n−1 • w n−2 · · · • w 0 , so that each function q n is strictly increasing on [-2, +∞) and q 1 ≤ q 2 ≤ .... In particular, lim n ∞ q n (y) exists in ℝ ∪ {+∞} for each y [-2, +∞). Moreover, lim n→∞ q n (h 2 (x)) = lim n→∞ (h(x 2 n )) 2 1−n = lim n→∞ (g(x 2 n )) for 0 <x < 1. Therefore Conveniently, (3) holds with s n in place of t n for all n except for n = a; in this case one simply adds two to the right hand side of the equation to make up for the fact that s a = t a -1. Hence f a satisfies the functional equation.
It is clear that g a is continuous and decreasing on [0, r a ) and g a (0) = 1. Following the arguments in [15], the functional equation (6) has a unique solution in the whole complex plane, and this solution agrees with our power series in {x ℂ: |x| <r a }. Moreover, analogues of the other properties of g obtained in [15] hold for g a .
for 0 <x < 1, and, in particular, It therefore suffices to show that the function y ↦ lim n ∞ q n (y) is strictly increasing on (-ε, +∞) for some 0 <ε < 2.
Observe that the derivative of q n satisfies For k ≥ 1, so that x → w k (x) is non-decreasing for x > 0. For y (-ε, +∞), and hence lim inf Taking 0 <ε < 1, the proof will be completed by demonstrating for any x > 1 that Taking the logarithm gives and this series clearly converges by the ratio test.
In relation to Proposition 1, we note from [13] that the number of rooted strictly bifurcating trees without a given subtree is asymptotically smaller than the number of all graph-theoretic trees (see also [32] for more about the enumeration of general trees without a given subtree), but this is not enough for our purposes. We needed to show that it is asymptotically smaller than the space of all rooted strictly bifurcating trees. The generating function for t n seems first to have been investigated in [15] in connection with enumerating "types of arrangements" in a commutative but non-associative algebra, such as a 1 (a 2 (a 3 a 4 )) or (a 1 a 2 )(a 3 a 4 ); these are identical to rooted bifurcating trees in the "Newick" format [1]. The recursion behind the generating function has been re-discovered independently several times such as in [33] -see [34] for a discussion and several further references. We remark that numerically iterating the quantity q n of the proof converges quickly to the value of r -1 calculable by other means [26,35]. We also observe that the methods of [27][28][29][30][31] can be used to show, in the notation of the proof, that lim n→∞ n 3/2 ρ n a s n = η a for some positive constant h a and hence lim n ∞ (r a /r) n (s n /t n ) = h a /h, but we don't pursue this matter here.

Numerical experiments
Proposition 1 says nothing about the rate of convergence of the fraction. Here we investigate this rate using computation. The characteristic polynomials for the generalized Laplacian were calculated via a doublyrecursive algorithm to enumerate matchings. The characteristic polynomials for the distance matrices were calculated via the Leverrier-Faddeev algorithm [36]. Table 1 shows that the fraction of trees with unique spectra does not go to zero very quickly. We can't compute this fraction for large numbers of leaves, but we can get some idea of the convergence by using the recursion relation corresponding to the generating function (5). Figure 2 shows the number of trees that do not have one of two subtrees of size seventeen as a subtree. This is an actual fraction that can be used with Proposition 1 in order to prove Theorem 1 for the generalized Laplacian matrix. Figure 2 shows that this fraction converges extremely slowly, despite the fact that as shown above it is asymptotically equivalent to b n for some 0 <b < 1. It is important to note, however, that this fraction is probably a very crude upper bound on the fraction of trees that share a spectrum with another tree. As can be seen in Table 1, the actual number not sharing a spectrum goes down considerably more quickly, though it is probably still the case that the vast majority of trees of intermediate size should have their own spectra.

Conclusions
Spectral invariants of matrix formulations of trees are a natural way to quantify the shape of phylogenetic trees. However, in this paper we show that a complete classification of tree shapes using common spectral invariants of generalized Laplacian and distance matrices is not possible. For either of these choices of matrix we show that the fraction of binary trees with a unique spectrum goes to zero as the number of leaves goes to infinity, but the rate of convergence of the above fraction to zero appears to be slow. For the adjacency and Laplacian matrices, we show that the a priori more informative immanantal polynomials have no greater power to distinguish between trees.