The Bernardi formula for non-transitive deformations of the braid arrangement

Bernardi has given a general formula for the number of regions of a deformation of the braid arrangement as a signed sum over boxed trees. We prove that each set of boxed trees which share an underlying (rooted labeled plane) tree contributes 0, +1, or -1 to this sum, and we give an algorithm for computing this value. For Ish-type arrangements, we further construct a sign-reversing involution which reduces Bernardi's signed sum to the enumeration of a set of (rooted labeled plane) trees. We conclude by explicitly enumerating the trees corresponding to the regions of Ish-type arrangements which are nested, recovering their known counting formula.


Introduction
Hyperplane arrangements, or collections of codimension-1 subspaces of a vector space (typically R n ) appear in many different mathematical contexts. For example, the elements of any finite Weyl group W can be interpreted as (compositions of) reflections across certain hyperplanes in R n . The resulting "Coxeter arrangement" then provides a geometric interpretation of the so-called "weak order" on W . This hyperplane arrangement also reappears in the representation theory of finite-dimensional algebras as the "stability diagram" of a "preprojective algebra". See [13].
A common problem in enumerative combinatorics is to count the connected components (called regions) of the complement of a hyperplane arrangement. In 1975, Zaslavsky showed that this can be done by plugging -1 into the characteristic polynomial of the arrangement [14]. This has helped motivate a large body of work aimed at computing the chacteristic polynomials of hyperplane arrangements. See e.g. [10,12,4]. Another method for counting the regions of a hyperplane arrangement is to establish a bijection with some well-known set of combinatorial objects. This approach has the advantage of offering a somewhat direct explanation as to why two sets of objects are enumerated by the same formula.
In a main result of [5], Bernardi gives a general formula for the number of regions of a certain type of hyperplane arrangement, called a deformation of the braid arrangement. This formula is a signed sum over so called boxed trees, which are partitions of the nodes of certain rooted labeled plane trees. (See Definition 10 below for the precise definition.) Under a condition known as transitivity (Definition 12), Bernardi further shows that the signed sum reduces to an enumeration, thereby recapturing and generalizing several known counting formulas. The aim of this paper is to reduce Bernardi's formula for arrangements which are not transitive. Our main result is an algorithm for computing the restriction of Bernardi's sum to the set of boxed trees sharing an underlying (rooted labeled plane) tree (see Theorem 30). We then reduce the signed sum to an enumeration for the class of Ish-type arrangements (Definition 4). This class notably contains the Ish arrangement, which is known to have its regions enumerated by the Cayley numbers (see [3] and the discussion in Section 2).
Date: October 8, 2021. 2020 Mathematics Subject Classification. 05A19. This is the final manuscript of an open-source paper published in The Electronic Journal of Combinatorics 28 (2021), no. 4. DOI: 10.37236/10233. 1. 1. Organization and Main Results. This paper is organized as follows: In Section 2, we review the relevant background and definitions. In Section 3, we study the contribution of all S-boxings (Definition 10) of a given (rooted labeled plane) tree to the signed sum of Bernardi and prove our first main theorem: Theorem 1 (Theorem 30, simplified version) . For an arbitrary deformation of the braid arrangement, the contribution of the set of boxed trees sharing an underlying (rooted labeled plane) tree to the formula of Bernardi is 0 or ±1. Moreover, there exists an algorithm for computing this contribution.
We believe the algorithm in Theorem 1 can be implemented in polynomial time. See Remark 32 for further discussion. We also note that trees with a contribution of −1 do not appear in the transitive case, but we suspect that they are ubiquitous in the non-transitive case. See Remark 34.
In Section 4, we define almost transitive arrangements (Definition 36) and specialize the result of Theorem 30 to these arrangements (Proposition 41). In Section 5, we further restrict to Ish-type arrangements (Definition 4). In this case, we consider four parameters for every tree contributing ±1 to the signed sum: the lower 1-length, lower inefficiency, upper 1-length, and upper inefficiency (Definitions 42 and 43). We then construct a series sign-reversing involutions allowing us to prove our second main theorem: Theorem 2 (Theorem 50). The regions of an Ish-type arrangement are equinumerous with the corresponding rooted labeled plane trees with lower 1-length, lower inefficiency, upper 1-length, and upper inefficiency all 0.
In Section 6, we prove our final main theorem, showing explicitly for any nested Ish arrangement (Definition 4) that our sign-reversing involutions reduce the Bernardi formula to the known counting formula of [1].
Theorem 3 (Theorem 53). Let A S be a nested Ish arrangement in R n . For 2 ≤ j ≤ n, let S 1,k be the set of hyperplanes in A S of the form x 1 − x k = s for some s ∈ R. Then the number of regions of A S is given by (1) r S = n k=2 (n + 1 + |S 1,k | − k).

Background
In this section, we recall notation, constructions, and background results that will be used in this paper. For detailed definitions and background pertaining to hyperplane arrangements, we refer readers to [11]. For the purposes of introduction, we follow much of the exposition in [5].
We consider hyperplane arrangements consisting of hyperplanes in R n of the form for some 1 ≤ i < j ≤ n and s ∈ Z. These are known as deformations of the braid arrangement, where the braid arrangement consists of {H i,j,0 } for all 1 ≤ i < j ≤ n. A common question about a hyperplane arrangement is the number of regions into which it divides R n , where a region is a connected component of the complement of the hyperplanes. Deformations of the braid arrangement include several families of hyperplane arrangements with historically known counting formulas for their number of regions. Examples include the braid arrangement, Shi arrangement [9], and Linial arrangement [8]. We refer to [5, for additional examples and references.
Consider a deformation of the braid arrangement A = {x i − x j = s} in R n . We identify A with the tuple of sets S = (S i,j ) 1≤i<j≤n , where for 1 ≤ i < j ≤ n, This hyperplane arrangement is then called the S-braid arrangement, and we write A = A S . The number of regions of A S is denoted r S . We likewise denote In this paper, we consider Ish-type arrangements as our prototypical example.
Definition 4. Let S be a tuple of sets as above such that 0 ∈ S i,j for all 1 ≤ i < j ≤ n and The Ish arrangement is defined in [2], and an example with n = 3 is shown in Figure 1. It is shown in [2] that, like those of the Shi arrangement, the regions of the Ish arrangement are enumerated by the Cayley numbers (n + 1) n−1 . The connection between the regions of the Ish arrangement and those of the Shi arrangement is further explored in [3,7], with [7] describing an explicit bijection between them. The more general Ish-type and nested Ish arrangements are introduced in [1] 1 . The authors of that paper prove that nested Ish arrangements are free, and use this fact to show their regions are enumerated by the formula in Equation 1.

The Bernardi Formula.
We now give an overview of the constructions and definitions in [5] that lay the foundation of this paper.
A rooted tree is a tree (a connected graph with no cycles) with some vertex designated as the root. If u and v are vertices of a rooted tree and the unique path from v to the root goes through u, we say v is above u and u is below v. If in addition u and v are connected by an edge, we say u is the parent of v and v is one of the children of u.
An arbitrary vertex in a rooted tree is a called a node if it has at least one child and is called a leaf otherwise. Under these notions, a rooted labeled tree is a rooted tree with the nodes labeled with distinct positive integers from 1 to the number of nodes.
In this paper, we consider rooted labeled plane trees. These are rooted labeled trees with a (leftto-right) ordering imposed on the children of each node. We draw rooted labeled plane trees with the root of the tree at the bottom, each child of a vertex above the original vertex, and the children of any vertex ordered from left to right. Given a node u, its cadet is its rightmost child that is also  Figure 2. A rooted labeled plane tree with 6 nodes. In this tree, the node 4 is the root, cadet(4) = 5, cadet(5) = 1, lsib(5) = 1, lsib(1) = 3, lsib(3) = 0, parent(6) = 5, and the node 1 is a right sibling of the node 6. a node (if one exists), and is denoted cadet (u). If v has parent u, we define the left siblings of v to be the children of u (nodes and leaves) which are to the left of v. We denote by lsib(v) (or lsib T (v) if we wish to emphasize the tree T ) the number of left siblings of v. We define right siblings and rsib(v) similarly. An example of these concepts is shown in Figure 2.
Notation 5. Let n and m be positive integers. We denote by T (m) (n) the set of rooted labeled plane trees with n nodes such that each node has m + 1 children.

Remark 6.
We can consider the tree in Figure 2 as an element of T (3) (6) by "adding right siblings". That is, the nodes 1, 3, and 6 are considered to each have 4 children (all leaves), the node 2 is considered to have 3 children (all leaves) which are to the right of 3, and the node 4 is considered to have 2 children (both leaves) to the right of 5. For any node v, we then observe that both cadet(v) (if it exists) and lsib(v) are the same in the tree drawn in Figure 2 and the "larger" tree in T (3) (6). We adopt this convention of "omitting right siblings" in many of our examples for improved readability.
For the remainder of this section, let us fix an arbitrary deformation of the braid arrangement A S . We then take n to be the dimension of A S and m as in Equation 3.

Remark 9.
We note that a cadet sequence is uniquely determined by the nodes it contains. Thus, depending on context, we will freely move between notating cadet sequences by (v 1 , . . . ,   Given a boxed tree (resp. S-boxed tree) (T, B), we will sometimes refer to B as a boxing (resp. S-boxing) of T and refer to the partition elements of B as boxes (resp. S-boxes). Examples of S-boxings are given in Example 22 below. Theorem 11. [5,Theorem 4.2] The number of regions r S of the arrangement A S is given by where |B| is the number of partition elements in B.
We refer to Equation 4 as the Bernardi formula. While the formula holds in general, there are many hyperplane arrangements with known explicit counting formulas (for example, the Ish arrangement). One of the main results in [5] is to recover such formulas when the set S satisfies a condition called transitivity. This beautifully unifies and expands upon many known results, in particular answering a question of Gessel  As stated in the theorem, Bernardi's proof involves the construction of a sign-reversing involution; that is, a bijection Φ : This makes the corresponding terms in the Bernardi formula "cancel out". We adopt a similar approach in Section 5. Observe that 1 ∈ S − 4,2 , 2 ∈ S − 2,1 , but 1 + 2 ∈ S − 4,1 . Therefore, for n ≥ 4, the Ish arrangement is not transitive.
Motivated by Theorem 13 and this remark, we wish to reduce Bernardi's formula to an enumeration when the assumption of transitivity is removed. We do this for Ish-type arrangements in Theorem 50, allowing us to recover the known explicit counting formula for nested Ish arrangements in Theorem 53.

The Contribution of a Tree
In this section, we define and characterize the contribution of a (rooted labeled plane) tree to the Bernardi formula. We fix for the remainder of this section an arbitrary deformation of the braid arrangement A S . As before, we let n be the dimension of A S and define m as in Equation 3.
Definition 15. Let T ∈ T (m) (n). For any sequence (v 1 , v 2 , . . . , v k ) of the nodes of T , define the last node of the sequence to be v k , and the first node of the sequence to be v 1 . We refer to k as the length of the sequence.
Definition 16. Let T ∈ T (m) (n). Define a maximal cadet sequence of T to be a cadet sequence (v 1 , v 2 , . . . , v k ) of T such that all the children of v k are leaves, and there is no node u for which cadet(u) = v 1 .
An example of these concepts is shown in Figure 3. Figure 3, the nodes of any rooted labeled plane tree can be uniquely partitioned into maximal cadet sequences. Indeed, since no two nodes can have the same cadet and each node has at most one cadet, we can complete any nonempty cadet sequence (in the forward and reverse directions) to a unique maximal cadet sequence. Possibly, such a sequence will contain only one node. A box is drawn around the nodes of each sequence (but this is not necessarily an S-boxing). The last node of the maximal cadet sequence in the blue/dashed box is 1, and the first node is 4.

Remark 17. As in
Given a (possibly maximal) cadet sequence of a rooted labeled plane tree, we can consider an S-boxing of the sequence as in Definition 10. More precisely, we have the following.
Definition 18. Let T ∈ T (m) (n) and let X be an arbitrary cadet sequence of T . Define an S-boxing of X to be a partition B of the nodes in X so that each Y ∈ B is an S-cadet sequence (of T ).
We are now prepared to define the contributions of a tree and a cadet sequence.
Definition 19. Let T ∈ T (m) (n) and let X be a (not necessarily maximal) cadet sequence of T . Let k be the length of X. Denote by U S (T ) and U S (X) the sets of S-boxings of T and X, respectively. We then define the contribution of T and the contribution of X as Observe that, by definition, the Bernardi formula (Equation 4) says that the number of regions of A S is the sum over T ∈ T (m) (n) of the contribution of T ; that is, Lemma 20. Let T ∈ T (m) (n). Then the contribution of T is equal to the product of the contributions of its maximal cadet sequences. Proof. Let X 1 , . . . , X t be the maximal cadet sequences of T . As any S-cadet sequence is necessarily contained in a maximal cadet sequence, choosing an S-boxing of T is equivalent to choosing an S-boxing of each maximal cadet sequence X i . That is, we can identify U S (T ) with the product V := U S (X 1 ) × · · · × U S (X t ). We then have which can be seen to be the product of the contributions of the maximal cadet sequences. Moreover, the maximal S-cadet sequences of the blue/dashed maximal cadet sequence are {4, 5} and {5, 1}, since {4, 5, 1} is not an S-cadet sequence.
Definition 23. Let T ∈ T (m) (n), and let X be a nonempty cadet sequence of T . We say that That is, any maximal cadet sequence can be uniquely partitioned into S-connected cadet sequences.
and let Y i be the set of cadet sequences containing v i and satisfying (1) in the definition of an S-connected cadet sequence. Since X ∈ Y i and Y i is closed under intersections, we see that Lemma 25. The contribution of a maximal cadet sequence is equal to the product of the contributions of its S-connected cadet sequences. Proof. Recall that any S-cadet sequence must be contained within a maximal S-cadet sequence, and any maximal S-cadet sequence must be contained within some S-connected cadet sequence.
Thus choosing an S-boxing of a maximal cadet sequence is equivalent to choosing an S-boxing of each of its S-connected cadet sequences. The result then follows using the same argument as in Lemma 20.
Example 26. Figure 4 shows a maximal cadet sequence and its maximal S-cadet sequences.
The valid S-boxings of the entire maximal cadet sequence are: for a contribution of We say a (not necessarily maximal) S-cadet sequence X precedes X j if the cadet of the last node in X is the last node in X j \ X j+1 .
Remark 29. We note that the condition parent(v 0 ) = 0 implies that X 0 reaches X 1 if X 2 \ X 1 contains a single node and X 0 does not reach any maximal S-cadet sequence otherwise. Likewise, the condition cadet(v k ) = 0 implies that X k ′ −1 reaches X k ′ if X k ′ \ X k ′ −1 contains a single node and X k ′ −1 does not reach any maximal S-cadet sequence otherwise.
We are now prepared to state the main result of this section.
by the following algorithm: be the first maximal S-cadet sequence reached by X i j but not reached by X i ℓ for ℓ < j, if such a maximal S-cadet sequence exists. If no such maximal S-cadet sequence exists, the algorithm fails. (3) If i j = k ′ , set t = j and terminate the algorithm. Now, if any step of this algorithm fails, the contribution of X is 0. Otherwise, the contribution of X is given by Before proving Theorem 30, we give a detailed example.
Example 31. Consider the setup of Example 28. The algorithm in Theorem 30 first defines X i 0 = X 0 . Then, the algorithm sets X i 1 = X 1 (see Remark 29) and X i 2 = X 2 . Now, since X 2 reaches only X 3 , which is also reached by X 1 , the algorithm fails at the j = 2 step. This means the contribution of X should be zero. We will show this by considering the possible S-boxings of X in cases.
(1) We first consider those S-boxings of X which contain {1}. We then have four subcases: (a) Let B be the set of S-boxings of X which contain both {1} and {2}. For B ∈ B we define a new S-boxing as follows: We observe that the association B → B ′ is an involution on B. Moreover, for all B ∈ B, the values of |B| and |B ′ | will differ by 1. We conclude that the S-boxings in B together contribute 0 to value of r S (X). (Note in particular that {2} does not precede any maximal S-cadet sequence. We will use this fact to generalize this argument in the proof of Theorem 30.) (b) Let C be the set of S-boxings of X which contain both {1} and {2, 3}. We will consider C later. (c) By replacing 3 and 4 with 5 and 6, reasoning analogous to case (1a) shows that the S-boxings of X containing both {1} and {2, 3, 4} together contribute 0 to r S (X). (d) By replacing 3 and 4 with 6 and 7, reasoning analogous to case (1a) shows that the S-boxings of X containing both {1} and {2, 3, 4, 5} together contribute 0 to r S (X). (2) Reasoning analogous to case (1a) shows that the S-boxings of X containing {1, 2} and together contribute 0 to r S (X). (We note that {1, 2} does not precede any maximal Scadet sequence.) (3) Let D be the set of S-boxings of X which contain {1, 2, 3}. Again, reasoning analogous to case (1a) shows that the S-boxings in C ∪ D contribute 0 to r S (X). Together, the casework above shows that r S (X) = 0, as desired.
We now formalize and extend the arguments from Example 31 to prove Theorem 30. The resulting proof uses ideas similar to that of [5,Theorem 4.6].
Proof of Theorem 30. We first claim that if X 2 \ X 1 contains more than a single node, then the algorithm fails and the contribution of X is 0. Indeed, suppose there exist two nodes v i , v i+1 ∈ X 1 \ X 2 . For an S-boxing B ∈ U S (X), we define a new S-boxing as follows: As this construction changes the number of maximal S-cadet sequences by 1, we have a signreversing involution on U S (X). In particular, the contribution of X is 0. Moreover, we recall that if X 2 \ X 1 contains more than a single node, then X 0 does not reach any maximal S-cadet sequence, so the algorithm fails in this case. Now let B ⊆ U S (X) be the set of S-boxings B of X for which every S-box in B except the last one (the one containing v k ) precedes some maximal S-cadet sequence X j for j ≤ k ′ .
We claim there is a sign-reversing involution on the S-boxings which are not in B. Indeed, let B be such an S-boxing and let Y ∈ B be the first S-box that does not precede any maximal S-cadet sequence. Let v the last node of Y . Now since Y does not precede any maximal S-cadet sequence, we have that cadet(v) and cadet(cadet(v)) are contained in X j \ X j+1 for some j. As before, we can then construct a sign-reversing involution by combing or splitting the S-boxes containing cadet(v) and cadet(cadet(v)).
We have thus far shown that the contribution of X is r S (X) = B∈B (−1) k−|B| . We wish to reduce this to the sum over a single S-boxing (of size t + 1).
We claim there is a bijection between B and the set of subsequences (X i 0 , . . . , X ir ) of (X 0 , X 1 , . . . , X k ′ +1 ) for which X i 0 = X 0 , X ir = X k ′ , and X i j reaches X i j+1 for all j. Moreover, we will show that the number of S-boxes of any B ∈ B is the same as the length (i.e., the value of r + 1) of the corresponding sequence.
For readability, we use X 1+i j for the maximal S-cadet sequence with index 1 + i j and X i j+1 for the maximal S-cadet sequence with index i j+1 (the maximal S-cadet sequence for which i has index j + 1).
First consider an S-boxing B = (Y 1 , . . . , Y r ) ∈ B. For 1 ≤ j ≤ r − 1, let X i j+1 be the maximal S-cadet sequence that Y j precedes. Let X i 0 = X 0 and X i 1 = X 1 . Note that X ir = X k ′ because v k ∈ X k ′ \ X k ′ −1 , so Y r must be contained within X k ′ , so the cadet of the last node in Y r−1 must be in X k ′ .
To see that X i j reaches X i j+1 , let v be the last node in Y j−1 . Then since Y j−1 precedes X i j , we have cadet(v) ∈ X i j \ X 1+i j . Moreover, we have cadet(v) ∈ Y j which means Y j ⊆ X i j . Now let u be the last node in Y j . Then since Y j precedes X i j+1 , we have cadet(u) ∈ X i j+1 \ X 1+i j+1 , and cadet (u) is also the largest indexed node with this property. Now, since the node u with this property is contained in Y j , it is contained in X i j , so X i j reaches X i j+1 by definition. Now consider a sequence (X i 0 , . . . , X ir ) so that X i 0 = X 0 , X ir = X k ′ , and X i j reaches X i j+1 for all j. For j ∈ [r − 1], define Y j to have last node u ∈ X i j so that cadet(u) ∈ X i j+1 \ X 1+i j+1 and cadet(cadet(u)) ∈ X 1+i j+1 . (Note that this is possible since X i j reaches X i j+1 .) Define the last node of Y r to be v k . Now that we have identified our remaining S-boxings with certain sequences of maximal S-cadet sequences, we wish to find a sign-reversing involution on all such sequences except the one generated by the algorithm. For such a sequence let (1 j ) denote the condition that X i j+2 is not reached by X i j , and let (2 j ) denote the condition that X i j+1 is the first S-box of the full sequence reached by X i j , but not by X i j−1 .
Suppose there is some smallest index q for which either (1 q ) is false or (2 q ) is false. If (2 q ) is false, we can insert X p after X i j such that X p is the smallest indexed S-box reached by X i j but not X i j−1 . This increases the length by 1 and makes (1 q ) false and (2 q ) true.
Otherwise, (2 q ) is true and (1 q ) is false. We can then delete X q+1 from the subsequence. This decreases the length by 1 and makes (2 q ) false. As these two operations are inverse to each other, we can consider only S-boxings B ∈ B corresponding to sequences satisfying (1 j ) and (2 j ) for all j. This leaves only the sequence generated by the algorithm.
We observe that Theorem 30, together with Lemmas 20 and 25, provide an algorithm for computing the contribution r S (T ) of any tree T ∈ T (m) (n).
Remark 32. We note that the unsimplified version of Bernardi's formula can only be computed in exponential time. (This essentially follows from needing to find all possible S-boxings of the given tree.) On the other hand, the complexity of our proposed algorithm appears to be at most O(n 2 log m). Indeed, the step which appears to be the most nontrivial is finding all of the maximal S-cadet sequences. To do this, let us suppose we are starting with a cadet sequence (v 1 , . . . , v k ). Then for each i, we denote by f (i) the smallest index for which (If none exists, we can set f (i) = k + 1.) Assuming a complexity of O(log m) to determine if a number is in a given set S − i,ℓ , we can compute the function f in O(n 2 log m). The longest S-cadet sequence starting at v i will then end at the vertex with index g(i) := min i≤ℓ≤f (i)−1 (f (ℓ) − 1). We see that g can be computed in O(n 2 ). It then remains to delete those S-sequences we have generated which are not maximal (it is possible they can be "extended downards"). This process can be done in O(n). Putting this together, we conclude that finding all of the maximal S-cadet sequences of a given cadet sequence has complexity at most O(n 2 log m).
In particular, the following corollaries make it easier to compute the contribution of many trees.
Corollary 33. In a tree with nonzero contribution, any maximal S-cadet sequence of size more than one must intersect some other maximal S-cadet sequence. Proof. Let X be a maximal S-cadet sequence which does not intersect some other maximal Scadet sequence. We observe that X is an S-connected cadet sequence. Moreover, if there exist two nodes v, cadet(v) ∈ X, then as in the proof of the theorem, we can construct a sign-reversing involution by combining or splitting the S-boxes containing v and cadet(v). Thus any such tree has contribution 0.
Remark 34. We observe that for transitive arrangements, no two distinct maximal S-cadet sequences intersect. Thus, in this case, S-connected cadet sequences and maximal S-cadet sequences are one and the same. This implies that the contribution of each S-connected cadet sequence (and by extension each tree) is either 0 or 1. (This fact was leveraged by Bernardi to prove Theorem 13. Indeed, in [5,Definition 4.5], the set T S in the statement of Theorem 13 is defined to be the set of trees T ∈ T (m) (n) for which every maximal S-cadet sequence consists of exactly one node.) On the other hand, we suspect that trees contributing -1 always exist for non-transitive arrangements.
Corollary 35. Let T ∈ T (m) (n) and let X = (v 1 , v 2 , . . . , v k ) be an S-connected cadet sequence of T with maximal S-cadet sequences X 1 , . . . , X k ′ (in increasing order of index of last node). Define Proof. The fact that |X 1 \ X 2 | = 1 is immediate from Remark 29 and Theorem 30. Moreover, by Theorem 30, there exists j < k ′ so that X j reaches X k ′ . Since the largest indexed node in X k ′ \ X k ′ +1 is v k , this means v k−1 ∈ X j and j = k ′ − 1.

Contributions for Almost Transitive Arrangements
In this section, we define almost transitive arrangements and show that Ish-type arrangements are almost transitive. We then further characterize the contributions of trees for almost transitive arrangements.
Definition 36. We say a hyperplane arrangement A S is almost transitive if for all distinct i, j, k ∈ [n] with 1 / ∈ {i, k} and for all nonnegative integers s ∈ S − i,j and t ∈ S − j,k , we have s + t / ∈ S − i,k . Remark 37. Since permuting the axes does not affect the number of regions of a hyperplane arrangement or the corresponding signed sum of trees, the condition 1 / ∈ {i, k} could be replaced with c / ∈ {i, k} for any fixed c ∈ [n].
Lemma 38. Any Ish-type arrangement is almost transitive.
Proof. Let A S be an Ish-type arrangement. We observe that S − i,j = {0} whenever 1 / ∈ {i, k}. Now let i, j, k ∈ [n] be distinct with 1 / ∈ {i, k} and let s / ∈ S − i,j and t / ∈ S − j,k be nonnegative integers. Note that 0 ∈ S − i,j ∩ S − j,k , so we must have s > 0 and t > 0. This means s + t / ∈ S − i,k = {0}, as desired.
This implies the result. (1) Any maximal cadet sequence of T not containing the node 1 does not contain any maximal S-cadet sequences of size greater than 1.
(2) In the maximal cadet sequence (v 1 , v 2 , . . . , v t ) containing the node 1 =: v j , there exist unique integers 0 ≤ i < j and 0 ≤ k < t − j so that: There are no other maximal S-cadet sequences. Furthermore, if T satisfies these conditions, then its contribution is given by r S (T ) = (−1) k+i .
Proof. Let T ∈ T (m) (n) have nonzero contribution. Then each of its maximal cadet sequences must contribute ±1 by Lemma 20. By Corollary 33, this means any maximal S-cadet sequence of size greater than 1 intersects another maximal S-cadet sequence, and so condition (1) is a direct consequence of Corollary 40. Now consider the maximal cadet sequence X = (v 1 , v 2 , . . . , v t ) containing 1 =: v j . Since we have already shown (1), we note that the contribution of X is equal to the contribution of T . Suppose X has maximal S-cadet sequences (X 1 , X 2 , . . . , X k ′ ) in increasing order of index of last node. As usual, define X 0 = {0} = X k ′ +1 . Since X is the union of its maximal S-cadet sequences, there exists some maximal S-cadet sequence X r which can be written X r = {v j−i , . . . , v j , . . . , v j+k } for some 0 ≤ i ≤ j and 0 ≤ k ≤ t − k. Thus the tree T satisfies (2b). Now by Corollary 40, we see that if a maximal S-cadet sequence X s intersects X r , then either the last node of X s is v j−1 or the first node of X s is v j+1 . This means X r−1 intersects X r if and only if either X r−1 has size greater than 1, X r+1 intersects X r if and only if X r+1 has size greater than 1, and no other maximal S-cadet sequence intersects X r . Moreover, if s < r − 1 or s > r + 1, then X s does not intersect any other maximal S-cadet sequence, and thus has size one. We have therefore shown that T satisfies (2a).
If j − i = 1 (so that r = 1), then Corollary 35 implies that X r+1 \ X r = {v j } and hence i = 0. Likewise, if j + k = t (so that r = k ′ ), then Corollary 35 implies that X r \ X r−1 = {v j } and hence k = 0.
We now show that if r = 1 then the first node of X r−1 is v j−i−1 and if r = t then the last node of X r+1 is v j+k+1 . Suppose r = 1 and observe that, for any s, if X s and X s+1 both have size 1, then X s reaches X s+1 and does not reach any other maximal S-cadet sequence. Thus by Theorem 30, we have a sequence (X 0 , X 1 , . . . , X r−2 , X r−1 ) where each maximal S-cadet sequence reaches the next. Thus the largest indexed node in X r−1 \ X r is v i−j−1 as desired. The result for X r+1 is completely analogous, observing that X r must reach X r+1 .
We have thus shown (2c) and (2d). Condition (2e) then follows immediately from the observation that the only possible maximal S-cadet sequences of size greater than 1 are those in (2b), (2c), and (2d). Now suppose T satisfies (1) and (2). We then see that the contribution of T is equal to the contribution of the maximal cadet sequence containing 1 and that this contribution is nonzero. Indeed, using the notation as above we see that (X 0 , X 1 , . . . , X k ′ ) is a valid output of the algorithm in Theorem 30. Furthermore, we have that As an example, the tree shown in Figure 5 has L l (T ) = 1 and L u (T ) = 0. (See Notation 44 and Example 45 below for an explanation of the caption.) We note the the lower and upper 1-length of a (rooted labeled plane) tree depend on the hyperplane arrangement A S , even though this is not reflected in our notation.

1-length and Inefficiency
In this section, we work exclusively with Ish-type arrangements. We recall from Lemma 38 that these arrangements are almost transitive. We therefore study the conditions outlined in Proposition 41 in detail. We do so using the notions of upper and lower 1-length and two additional parameters, which we define now.
Definition 43. Let A S be an Ish-type arrangement and Let T ∈ T (m) (n) and let (v 1 , . . . , v j , . . . , v t ) be the maximal cadet sequence of T which contains the node 1 =: v j . We say a node w of T is lower inefficient if w is a left sibling of 1 and lsib(w) / ∈ S − w,1 . Likewise, we say w is upper inefficient if parent(w) = 1, w is not the cadet of 1, and lsib(w) / ∈ S − 1,w . We denote by E l (T ) and E u (T ) the number of lower and upper inefficient nodes in T , respectively. We refer to these values as the lower inefficiency and upper inefficiency of T . We emphasize that, as with lower and upper 1-length, the lower and upper inefficiency of a (rooted labeled plane) tree depend on the hyperplane arrangement A S , even though this is not reflected in our notation.
Notation 44. We denote by S(e l , ℓ l , e u , ℓ u ) the set of trees T ∈ T (m) (n) with nonzero contribution so that E l (T ) = e l , L l (T ) = ℓ l , E u (T ) = e u , and L u (T ) = ℓ u . We note that S(e l , ℓ l , e u , ℓ u ) is necessarily empty if e l + ℓ l + e u + ℓ u ≥ n.
We now describe a series of sign-reversing involutions in order to reduce Bernardi's formula to the enumeration of the trees in S(0, 0, 0, 0). In particular, we will show that the trees with lower 1-length ℓ l = 0 (resp. upper 1-length ℓ u = 0) and lower (resp. upper) inefficiency 0 are in bijection with those of lower 1-length ℓ l − 1 (resp. upper 1-length ℓ u − 1) and nonzero lower (resp. upper) inefficiency.
We first fix some e l , ℓ l , e u , ℓ u with ℓ l = 0 and let T ∈ S(e l , ℓ l , e u , ℓ u ). We denote (v 1 , . . . , v j , . . . , v t ) the maximal cadet sequence of T containing the node 1 =: v j . Note that by Proposition 41, the fact that L l (T ) = ℓ l = 0 implies that j − ℓ l = 1. We now construct a new (rooted labeled plane) tree φ l (T ) as follows: (1) Delete all of the right siblings of the node v j−1 (which are necessarily leaves), and denote by s 1 , s 2 , . . . , s lsib(1) the left siblings of the node 1 (including leaves), indexed left to right. (2) Let c be the leftmost child of v j−2 . (Note that c may or may not be a node). Replace the edge from v j−2 to c with a pair of edges from v j−2 to a new node v ′ j−1 and from v ′ j−1 to c. to s i so that s i has i − 1 left siblings. (4) Delete the node v j−1 and all incident edges, relabel v ′ j−1 by v j−1 , and draw an edge from v j−2 to 1 so that 1 is the rightmost child of v j−2 . (5) Add and delete leaves as rightmost children where necessary so that every node has m + 1 children. The idea behind this construction is to move v j−1 from being in a maximal S-cadet sequence with 1 to being a lower inefficient node. An example is shown in Figure 6.

Now recall from Proposition 41(2) that both {v
This sum gives an upper bound on lsib T (1) + lsib T (v j−1 ), which means 1 (and hence every node) has at most m left siblings in φ l (T ). We conclude that φ l (T ) ∈ T (m) (n), as desired. Now note that v j−1 is lower inefficient in φ l (T ) since {v j−1 , v j } is an S-cadet sequence of T . Moreover, if a left sibling s i of 1 in T is a node, then s i is still a left sibling of 1 in φ l (T ) with lsib φ l (T ) (s i ) = lsib T (s i ). This means s i is lower inefficient in T if and only if it is lower inefficient in φ l (T ). We conclude that E l (φ l (T )) > E l (T ) = e l .
We now observe that (v 1 , . . . , v j−2 , v j , . . . , v t ) is a maximal cadet sequence of φ l (T ). It is straightforward to verify that the maximal S-cadet sequences of this cadet sequence are precisely those of (v 1 , . . . , v t ) in T with the node v j−1 removed. This means L l (φ l (T )) = L l (T ) − 1 = ℓ l − 1 and L u (φ l (T ) = L u (T ) = ℓ u . Moreover, if j + ℓ u = t, then the left siblings of v j+ℓu+1 are the same in both T and φ l (T ). This implies that E u (φ l (T )) = E u (T ) = e u .
It remains to show that no other maximal cadet sequence of φ l (T ) contains a maximal S-cadet sequence of size larger than 1. Indeed, consider the maximal cadet sequence of φ l (T ) which contains v j−1 . We note that v j−1 is a left sibling of 1, and hence is not the cadet of any node. Moreover, if v j−1 has a cadet, then this cadet must be c and we have lsib φ l (T ) (c) = 0 ∈ S − v j−1 ,c by construction. As no other nodes have their cadets or number of left siblings changed in moving from T to φ l (T ), this implies the result. Now let T ∈ ∪ n−1 b=e l +1 S(b, ℓ l − 1, e u , ℓ u ), and let (v 1 , . . . , v j , . . . , v t ) be the maximal cadet sequence of T containing the node 1 =: v j . Since E l (T ) = 0, it must be that j = 1. Now construct a new tree ψ e l l (T ) as follows: (1) Let w be the (e l +1)-th lower inefficient node of T (from the left). Denote by s 1 , s 2 , . . . , s lsib(w) the left siblings of w, indexed left to right. (2) Let c be the leftmost child of w. (Note that c may or may not be a node.) Delete all right siblings of c (necessarily leaves), and replace the edges from v j−1 to w and from w to c with an edge from v j−1 to c. (3) Delete the node w and all incident edges and replace the edge from v j−1 to 1 with edges from v j−1 to a new node again labeled w and this new node w to 1.  1, 0, 0), where A S is the Ish arrangement with n = 6. All leaves which do not have any nodes as left siblings have been omitted for clarity. We note that this gives an inverse to the construction in Figure 6.
(4) Delete the edges from v j−1 to s 1 , . . . , s lsib(w) and draw edges from w to s 1 , . . . , s lsib(w) so that the left siblings of 1 are s 1 , . . . , s lsib(w) in that order. (5) Add and delete leaves as rightmost children where necessary so that every node has m + 1 children. An example of this construction is shown in Figure 7. We emphasize that the parameter e l must be specified in the definition of ψ e l l . Indeed, this will allow us to accurately describe the bijections in our proof of Theorem 50.
Then ψ e l l (T ) ∈ S(e l , ℓ l , e u , ℓ u ). Proof. We first claim that ψ e l l (T ) is a well-defined member of T (m) (n). Indeed, we have that lsib ψ e l l (T ) (1) = lsib T (w), lsib ψ e l l (T ) (w) = lsib T (1) − lsib T (w), and lsib ψ T (w ′ ) = lsib T (w ′ ) for all other nodes w ′ . We conclude that every node has at most m left siblings in ψ e l l (T ) and thus ψ e l l (T ) ∈ T (m) (n) . We next observe that (v 1 , . . . , v j−1 , w, v j , . . . , v t ) is a maximal cadet sequence of ψ e l l (T ). It is straightforward to show that the maximal S-cadet sequences of this cadet sequence are precisely those of (v 1 , . . . , v j , . . . , v t ) in T with u appended to the maximal S-cadet sequence which ends with v j−1 and to the maximal S-cadet sequence which contains 1 = v j . This means L l (ψ e l l (T )) = L l (T ) + 1 = ℓ l and L u (ψ e l l (T )) = L u (T ) = ℓ u . Moreover, if j + ℓ u = t, then the left siblings of v j+ℓu+1 are the same in both T and ψ e l l (T ). This implies that E u (ψ e l l (T )) = E u (T ) = e u . Now, since no other nodes have their cadets or number of left siblings changed in moving from T to ψ e l l (T ), all other maximal S-cadet sequences of ψ e l l (T ) have size 1. Furthermore, the left siblings of 1 in ψ e l l (T ) are precisely those of u in T (in the same order). In particular, the lower inefficient nodes in ψ e l l (T ) correspond precisely with those lower inefficient nodes of T which are left of v, of which there are e l . This implies the result.
We now give "upper analogues" to the constructions φ l and ψ e l l . We remark that the proofs of Lemmas 48 and 49 below are similar to those of Lemmas 46 and 47.
Again fix some e l , ℓ l , e u , ℓ l , now with ℓ u = 0, and let T ∈ S(e l , ℓ l , e u , ℓ u ). We denote by (v 1 , . . . , v j , . . . , v t ) the maximal cadet sequence of T containing 1 =: v j . Note that by Proposition 41, the fact that L u (T ) = ℓ u = 0 implies that j + ℓ u = t. We now construct a new tree φ u (T ) as follows: (1) Delete all right siblings of the node v j+1 (necessarily leaves) and denote the left siblings of the node v j+2 by s 1 , . . . , s lsib(v j+2 ) , indexed left to right.  Figure 8. An example of the maps φ u and ψ 1 u , where A S is the nested Ish arrangement with n = 6 and S 1,j = {−j + 1, . . . , 0} for each j. The tree on the left is an element of S(0, 0, 1, 1) and the tree on the right is an element of S(0, 0, 2, 0). rightmost child of 1.) Likewise, delete the edge from v j+1 to v j+2 and draw an edge from 1 to v j+2 so that v j+2 is the rightmost child of 1.
(3) Add and delete leaves as rightmost children where necessary so that every node has m + 1 children. The idea behind the construction is to move v j+1 from being in a maximal S-cadet sequence with 1 to being an upper inefficient node. An example is show in Figure 8.
This sum gives an upper bound on lsib T (v j+1 ) + lsib T (v j+2 ), which means v j+1 (and hence every node) has at most m left siblings in φ u (T ). We conclude that φ u (T ) ∈ T (m) (n), as desired.
We now observe that (v 1 , . . . , v j , v j+2 , . . . , v t ) is a maximal cadet sequence of φ u (T ). It is straightforward to verify that the valid S-boxings of (v 1 , . . . , v j , v j+2 , . . . , v t ) in φ u (T ) are precisely those of (v 1 , . . . , v t ) in T with the node v j+1 removed. In particular, (v j−ℓ l , . . . , v j , v j+2 , . . . , v j+ℓu ) is the maximal S-cadet sequence of φ u (T ) which contains 1 = v j . This means L u (φ u (T )) = L u (T ) − 1 = ℓ u − 1 and L l (φ u (T ) = L l (T ) = ℓ l . Moreover, if j − ℓ l = 1, the left siblings of 1 = v j are the same in both T and φ u (T ). This means It remains to show that no other maximal cadet sequence of φ u (T ) contains a maximal S-cadet sequence of size larger than 1. Indeed, consider the maximal cadet sequence of φ u (T ) which contains v j+1 . We note that v j+1 is a left sibling of v j+2 , and hence is not the cadet of any node. Moreover, if v j+1 has a cadet, then this cadet was the leftmost child of v j+1 in T and has no left siblings in φ u (T ) by construction. As no other nodes have their cadets or number of left siblings changed in moving from T to φ l (T ), this implies the result. Now let T ∈ ∪ n−1 b=eu+1 S(e l , ℓ l , b, ℓ u − 1). Let (v 1 , . . . , v j , . . . , v t ) be the maximal cadet sequence of T containing 1 =: v j . Note that E u (T ) > 0 implies that j = t. Now construct a new tree ψ eu u (T ) as follows: (1) Let w be the (e u + 1)-th upper inefficient node of T (from the right). Delete all but the leftmost child of w.
(2) Fix λ = lsib(v j+1 ) − lsib(w) − 1 and denote the vertices which have w as a left sibling and v j+1 as a right sibling by s 1 , . . . , s λ , indexed left to right. (3) For each i ∈ [λ] in order, delete the edge from 1 to s i and draw an edge from w to s i so that s i has i left siblings. Likewise, delete the edge from 1 to v j+1 and draw an edge from w to v j+1 so that w has λ + 1 left siblings. (4) Add and delete leaves as right siblings where necessary so that every node has m+1 children. As before, we emphasize that the parameter e l must be specified in the definition of ψ e l l . An example is shown in Figure 8.
Proof. We first claim that ψ eu u (T ) is a well-defined member of T (m) (n). Indeed, we have that for all other nodes w ′ . We conclude that every node has at most m left siblings in φ u (T ) and φ u (T ) ∈ T (m) (n), as desired.
We now observe that (v 1 , . . . , v j , w, v j+1 , . . . , v t ) is a maximal cadet sequence of ψ eu u (T ). It is straightforward to verify that the valid S-boxings of this sequence are precisely those of (v 1 , . . . , v t ) in T with the node w appended to the maximal S-cadet sequence which starts with v j+1 and to the maximal S-cadet sequence which contains 1 = v j . This means L u (n). We note that if L l (T ) = 0, then φ l (T ) is defined. In this case, it is straightforward to show that ψ . . , E l (T ) − 1}. By replacing "lower" with "upper", the analogous statements hold for the compositions of φ u and ψ i u . Now for any e u and ℓ u , we define a sign-reversing involution ω l on e l ,ℓ l ,eu,ℓu:e l +ℓ l =0 S(e l , ℓ l , e u , ℓ u ) by We remark that this is indeed a sign-reversing operation since the maps φ l and ψ 0 l change the parameter ℓ l by 1 and preserve the parameter ℓ u . Moreover, the function ω l is an involution since for any T , the tree ψ 0 l (T ) contains no lower inefficient nodes. Thus we can reduce our equation to r S = eu+ℓu<n (−1) ℓu |S(0, 0, e u , ℓ u )|.

The Counting Formula for Nested Ish Arrangements
In this section, we show directly that for any nested Ish arrangement A S , the number of trees in S(0, 0, 0, 0) is equal to the known counting formula for number of regions of A S (Equation 1).
Lemma 51. Let A S be a nested Ish arrangement. Let T(S) be the set of rooted labeled plane trees with n nodes such that (1) The root is the node 1.
(3) Every other node has one child.
We will construct a bijection between T(S) and S(S). For k ∈ [n], consider the set of rooted labeled plane trees with n−k+1 nodes labeled 1, k+1, . . . , n. (Our convention when k = n is that the single node is labeled 1.) Let T k (S) of such trees which satisfy: (1) The root of the tree is 1.
(3) Every other node has one child.
(4) For j > k a node, either lsib(j) ∈ S − 1,j or rsib(j) ∈ S − j,1 . We note that T 1 (S) = T(S). Now for any tree T and any node k in T with a parent and exactly one child, we define extracting k as removing the node k from the tree and drawing an edge between its neighbors. Now let k > 1, let T ∈ T k−1 (S), and let T ′ be the tree obtained by extracting the node k from T . If k is a child of 1, then we see that lsib T ′ (child(k)) = lsib T (k) (and hence rsib T ′ (child(k)) = rsib T (k)). Moreover, for all other nodes j > k, we have that the number of left (and right) siblings of j does not change between T and T ′ . Thus since child(k) > k and A S is nested, T ′ ∈ T k (S). Now let T ∈ T(S). We associate T =: T 1 to a sequence a 2 , . . . , a n in S(S) as follows. For each k ∈ {2, 3, . . . , n} in order: (1) From the tree T k−1 , define if parent(k) = 1 and rsib(k) > m (−1, rsib(k)) if parent(k) = 1 and lsib(k) > m (2) Extract k from T k−1 to yield T k . We note that the second and third cases are indeed mutually exclusive, so this map is well-defined by the previous paragraph. See Example 52 below.
We next construct a map from S(S) to T(S). Let a 2 , a 3 . . . , a n be a sequence in S(S) and let T n be the tree consisting of a node labeled 1 with 2m + 2 children (all of which are leaves). For each k ∈ {n, n − 1, . . . , 2} in decreasing order, construct T k−1 from T k as follows: (1) If a k = (0, i), then i > k and there is a node labeled i in T k . Replace the edge from i to child(i) with edges from i to a new node labeled k and from k to child(i). Now let k ∈ [n] and let T k ∈ T k (S) be arbitrary. If k = 1, let a k ∈ A k be arbitrary and form a tree T k−1 using the above construction. We then see that extracting k from T k−1 yields T k and that a k is precisely as described in Equation 5. Likewise, if k = n extract k + 1 from T k to form a new tree T k+1 and define a k+1 as in Equation 5. We then see that adding a node k + 1 to T k+1 using the above construction yields precisely T k . We have thus given a bijection between T(S) and S(S).
Example 52. Let A S be the nested Ish arrangement with S 1,j = {0, 1, . . . , j − 2} for 1 = j ∈ [6]. Consider the tree T ∈ T(S) on the right in Figure 9. We see that 2 has more than m = 4 left siblings and 0 right siblings, meaning we associate to this tree a 2 = (−1, 0). Proceeding in this way, the sequence corresponding to this tree is given by: We now recover the known counting result of [1] for the number of regions of a nested Ish arrangement.
Theorem 53 (Theorem 3). Let A S be a nested Ish arrangement. Then the number of regions of A S is given by r S = n k=2 (n + 1 + |S 1,k | − k).
In particular, if A S is the (n-dimensional) Ish arrangement, then the number of regions is given by the Cayley formula: r S = (n + 1) n−1 .
Proof. By Theorem 50 and Lemma 51, we need only show that there is a bijection between S(0, 0, 0, 0) and T(S). Informally, given a tree T ∈ S(0, 0, 0, 0), we will construct a new tree as follows. If 1 is not the root of T , we first "flip" the edges pointing up from the parent of the node 1 so that they point down from 1. We then rotate everything below 1 counterclockwise until 1 is positioned as the root. See Figure 9 for an example. If, on the other hand, the node 1 is already . Leaves which lie to the right of 6, above 3, or above 5 are omitted from the left picture for clarity. Visually, the forward direction of this bijection can be seen as flipping the edges pointing up from 6 (or more generally from the parent of 1) so that they point down from 1, then rotating everything below 1 counterclockwise until 1 is positioned as the root.