\hideLIPIcs

CNRS, INSA Lyon, UCBL, LIRIS, UMR5205, F-69622 Villeurbanne, France CNRS, INSA Lyon, UCBL, LIRIS, UMR5205, F-69622 Villeurbanne, France CNRS, INSA Lyon, UCBL, LIRIS, UMR5205, F-69622 Villeurbanne, France \ccsdesc[100]Theory of computation → Distributed algorithms

How local constraints influence network diameter and applications to LCL generalizations

Nicolas Bousquet    Laurent Feuilloley    Théo Pierron
Abstract

In this paper, we investigate how local rules enforced at every node can influence the topology of a network. More precisely, we establish several results on the diameter of trees as a function of the number of nodes, as listed below. These results have important consequences on the landscape of locally checkable labelings (LCL) on unbounded degree graphs, a case in which our lack of knowledge is in striking contrast with that of bounded degree graphs, that has been intensively studied recently.

First, we show that the diameter of a tree can be controlled very precisely by a local checker (that is, a distributed decision algorithm that accepts a graph iff all nodes accept locally), granted that its checkability radius is allowed to be at least 2222 (and that the target diameter is not too close to n𝑛nitalic_n). As a corollary, we prove that the gaps in the landscape of LCLs (in bounded-degree graphs) basically disappear in unbounded degree graphs.

Second, we prove that for checkers at distance 1, the maximum diameter can only be trivial (constant or linear), while the minimum diameter can in addition be Θ(logn)Θ𝑛\Theta(\log n)roman_Θ ( roman_log italic_n ) and Θ(n1/k)Θsuperscript𝑛1𝑘\Theta(n^{1/k})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ) for k𝑘k\in\mathbb{N}italic_k ∈ blackboard_N. These functions interestingly coincide with the known regimes for LCLs.

Third, we explore computational restrictions of local checkers. In particular, we introduce a class of checkers, that we call degree-myopic, that cannot distinguish perfectly the degrees of their neighbors. With these checkers, we show that the maximum diameter can only be O(1)𝑂1O(1)italic_O ( 1 ), Θ(n)Θ𝑛\Theta(\sqrt{n})roman_Θ ( square-root start_ARG italic_n end_ARG ), Θ(logn/loglogn)Θ𝑛𝑛\Theta(\log{n}/\log\log n)roman_Θ ( roman_log italic_n / roman_log roman_log italic_n ), Θ(logn)Θ𝑛\Theta(\log{n})roman_Θ ( roman_log italic_n ), or Ω(n)Ω𝑛\Omega(n)roman_Ω ( italic_n ). Since gaps do appear in the maximum diameter, one can hope that an interesting LCL landscape exists for restricted local checkers.

In addition to the LCL motivation, we hope that our distributed lenses can help give a new point of view on how global structures, such as living beings, can be maintained by local phenomena; understanding the trade-off between the power of the checking and the possible resulting shapes.

keywords:
Locally checkable labelings, network diameter, local checkers, LOCAL model, unbounded-degree graphs

1 Introduction

1.1 Questions and motivations

A general question in distributed computing is: how well can we control global parameters of a system if we can only check it partially and in a distributed manner? Here, we are interested in the following graph-oriented version of this question: How do local constraints influence the shape of a network? More precisely, if we define a set of rules to be satisfied at every node of the network, what are the networks that satisfy these rules? What properties do they have? And conversely, if we want to ensure a given global property, can we obtain it by only enforcing local constraints?

In this paper, we focus on a concrete version of the question, where the networks are (colored) graphs, and in particular trees, and the global parameter studied is the diameter. Before we discuss our motivations and how our perspective differs from previous work, let us introduce some vocabulary. A local checker is a local algorithm run at every node of the network, that outputs a binary decision accept/reject, only based on a neighborhood at constant distance around itself. A network (or equivalently a graph) is globally accepted if every node locally accepts. For example, a local checker that checks if the number of neighbors of the node at hand is at most ΔΔ\Deltaroman_Δ accepts exactly all the graphs of maximum degree at most ΔΔ\Deltaroman_Δ.

Main motivation: Going beyond bounded-degree for LCLs

The most popular problems in the study of locality, in the sense of the LOCAL model, are called locally checkable labelings or LCLs for short, introduced in the 90s [15]. The main characteristic of these problems is that their outputs can be checked locally. For example, to verify that a coloring is correct, every node simply checks that the color it has received as output is different from the ones of its neighbors. There are also three finiteness requirements: the number of possible outputs, of possible inputs, and the maximum degree ΔΔ\Deltaroman_Δ must be bounded by a constant (i.e. independent of the number of nodes n𝑛nitalic_n). Therefore, an LCL can be described by a finite list of correct neighborhoods. In the case of coloring, this list is made of the following neighborhoods: a node of color c𝑐citalic_c with at most ΔΔ\Deltaroman_Δ neighbors, each of them being of a color different from c𝑐citalic_c.

After a decade of intense research, we now have a good understanding of the complexity of computing a solution of an LCL problem in the LOCAL model. More precisely, we know the landscape of complexities for these problems: roughly, we know what are the functions f𝑓fitalic_f for which there exists an LCL whose optimal algorithm has complexity f(n,Δ)𝑓𝑛Δf(n,\Delta)italic_f ( italic_n , roman_Δ ). For example, we know that there is no LCL whose complexity in the LOCAL model lies between ω(logn)𝜔superscript𝑛\omega(\log^{*}n)italic_ω ( roman_log start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT italic_n ) and o(logn)𝑜𝑛o(\log n)italic_o ( roman_log italic_n ) [8].

A natural question is: can we generalize this theory by relaxing the finiteness requirements? The case of bounded degree and unbounded number of labels has been explored in [11], with the fractional coloring problem111There are actually two definitions of fractional coloring, the second one enforcing a bounded number of labels, see e.g. [5, 4].. Here we are interested in the other direction: going beyond bounded degree. (This question was very recently tackled by [13] as we discuss later.)

Let us now illustrate why the diameter of the network plays a key role in the context of LCL complexities. In the bounded-degree case, two key complexities for deterministic algorithms are Θ(n)Θ𝑛\Theta(n)roman_Θ ( italic_n ) and Θ(logn)Θ𝑛\Theta(\log n)roman_Θ ( roman_log italic_n ). The problems of complexity Θ(n)Θ𝑛\Theta(n)roman_Θ ( italic_n ) are called global problems; they are generally the ones where, in a path, the two endpoints have to coordinate their outputs, which requires them to run for Ω(n)Ω𝑛\Omega(n)roman_Ω ( italic_n ) rounds (and O(n)𝑂𝑛O(n)italic_O ( italic_n ) is enough for any problem in the LOCAL model). The problems of complexity Θ(logn)Θ𝑛\Theta(\log n)roman_Θ ( roman_log italic_n ) are typically the ones where the hardest instances locally look like complete regular trees, and intuitively each node needs to see a leaf to be able to decide its output. Therefore, what dictates the complexity for these two cases is, respectively, the maximum and the minimum diameter of trees of bounded degree, which are respectively order of n𝑛nitalic_n and logn𝑛\log nroman_log italic_n. Note that for these observations, restricting to trees is not problematic, since everything holds in trees. In general, trees are essential in the LCL theory, which justifies why we focus on these graphs; for example, the key technique of round elimination (see [17] and references therein) basically works only in trees.222Another motivations for restricting to trees is that, under some restrictions, if some graph accepted by our generalization of LCL’s contains cycles, then the resulting diameters are trivial, as proved at the end of the paper.

By understanding the diameters of trees accepted by local checkers that are not simply checking that the degree is below ΔΔ\Deltaroman_Δ, we want to pave the way of a complexity landscape beyond bounded degree. Hence, the first type of questions we want to investigate is the following.

Question 1.

For a given local checker, what is the minimum and maximum diameter of the accepted graphs, as a function of n𝑛nitalic_n?

Also, since it seems too optimistic to hope for a nice landscape in general graphs, we want to explore which restrictions are worth studying in the future. For example, restrictions for which there are gaps in the possible maximum and minimum diameter.

Question 2.

What are natural classes of local checkers such that there are gaps in the landscape of maximum and/or the minimum diameter of graphs accepted by such checkers (e.g. diameters that are impossible to obtain)?

Let us now quickly summarize the approach and results of [13], on this question of understanding complexity landscape beyond bounded-degree. First, the authors sketch how one can create problems of arbitrary complexity between constant and Θ(logn)Θ𝑛\Theta(\log n)roman_Θ ( roman_log italic_n ), when the degree is unbounded, by using a problem of complexity O(logΔn)𝑂subscriptΔ𝑛O(\log_{\Delta}n)italic_O ( roman_log start_POSTSUBSCRIPT roman_Δ end_POSTSUBSCRIPT italic_n ) and then ignoring a specific number of adjacent edges at each node to artificially reduce the degree ΔΔ\Deltaroman_Δ. Second, they restrict the scope in two ways: (1) they study only binary labeling problems (that consist in selecting edges, like in the matching problem), where (2) the constraints are structurally simple (roughly, in a proper labeling, the number of selected (resp. non-selected) edges around every node has to be either smaller than a constant, or polynomially large in the degree). In this setting, they can characterize precisely what happens in the logarithmic regime, thanks to a degree-aware variant of the rake-and-compress technique. Our approach is quite orthogonal, as we study the structure of the graphs and do not discuss what are the problems that are solved or the generic algorithms that could be used. Nevertheless, the general story has a similar flavor: we will show in a different, more general and precise way how arbitrary complexities can be obtained, and then restrict to a setting where gaps reappear.

Second motivation: Maintaining global structure locally

Our second motivation is a more exploratory one. We would like to propose a new perspective on how structures can be maintained without centralized monitoring. In other words, we want to explore how simple local rules on small-scale entities shape larger-scale objects. One can think of a crude modeling of living beings, or of self-organizing swarm of robots.

From this perspective, our motivation for studying the diameter is that it is maybe the most basic characteristic of a shape, and the one for studying trees is that these are simple shape that appear in Nature.

Now, instead of starting from a checker and analyzing the possible diameters, we want to start from some target diameter (as a function of n𝑛nitalic_n), e.g. one that would have benefits for the global entity, and ask whether we can have a local checker that maintains this diameter.

Question 3.

Given some function f𝑓fitalic_f, can we design a local checker such that the accepted n𝑛nitalic_n-vertex graphs have diameter f(n)𝑓𝑛f(n)italic_f ( italic_n )?

Also, since it is unrealistic in Nature or in robots to have unlimited local computation, we refine Question 3, by considering the complexity of the local checking.

Question 4.

Given some function f𝑓fitalic_f, can we design a local checker with limited computational capabilities, such that the accepted n𝑛nitalic_n-vertex graphs have diameter f(n)𝑓𝑛f(n)italic_f ( italic_n )?

The rest of the introduction is organized as follows: in Subsection 1.2 we introduce the precise definitions, in Subsections 1.3 and 1.4 we review our results and techniques for general and restricted checkers, respectively. In Subsection A, we review additional related work.

1.2 Model and definitions

The graphs/trees considered in this paper are simple and loopless. They can be vertex colored, with a constant number of colors. Remember that the diameter of a graph is the length of the largest shortest path between two nodes, in terms of number of edges. Inspired by the definition of LCLs and by our biological motivation, we consider anonymous networks, e.g. the nodes do not have identifiers.

Definition 1.1 (View of a node).

The view at distance d𝑑ditalic_d of a node v𝑣vitalic_v in a graph G𝐺Gitalic_G is the subgraph of G𝐺Gitalic_G, that contains all nodes at distance at most d𝑑ditalic_d from v𝑣vitalic_v, and all the edges with at least one endpoint at distance at most d1𝑑1d-1italic_d - 1 from v𝑣vitalic_v, and where v𝑣vitalic_v is marked as the center.

Definition 1.2 (Local checker ; c,dsubscript𝑐𝑑\mathcal{L}_{c,d}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ; checkability radius).

A local checker at distance d𝑑ditalic_d and with c𝑐citalic_c colors is a local algorithm that is used on a c𝑐citalic_c-colored graph, such that, applied to a vertex v𝑣vitalic_v, it takes the neighborhood at distance d𝑑ditalic_d around v𝑣vitalic_v and chooses an output: accept or reject. We denote by c,dsubscript𝑐𝑑\mathcal{L}_{c,d}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT the set of all local checkers at distance d𝑑ditalic_d with c𝑐citalic_c colors. The distance d𝑑ditalic_d is called the checkability radius.

For short, we sometimes simply use checker instead of local checker. The definition of a degree-myopic local checker is given in Subsection 1.4, along with the discussion of its origin.

Definition 1.3 (Class accepted/recognized by a local checker).

Given a local checker L𝐿Litalic_L, the class of (colored) trees accepted (or equivalentaly recognized) by this checker, denoted by 𝒞(L)𝒞𝐿\mathcal{C}(L)caligraphic_C ( italic_L ), is the set of trees such that on every node the checker L𝐿Litalic_L accepts.

Definition 1.4 (Generalized-LCL).

Let a generalized-LCL be a problem where each node has to choose an output from a finite set, such that the correct output configurations can be recognized by a local checker.

Intuitively, a checker has maximum (resp. minimum) diameter f(n)𝑓𝑛f(n)italic_f ( italic_n ) if all trees recognized by this checker have diameter at most (resp. at least) f(n)𝑓𝑛f(n)italic_f ( italic_n ), when n𝑛nitalic_n is the number of nodes, and this bound is tight. The proper definitions given below, use infimum/supremum instead of maximum/minimum, but we keep the names maximum/minimum, since they are more intuitive.

Definition 1.5 (Exact/minimum/maximum diameter of a checker).

Let L𝐿Litalic_L be a local checker.

  • L𝐿Litalic_L has exact diameter f𝑓fitalic_f if for all n𝑛nitalic_n, G𝒞(L),|V(G)|=n,Diam(G)=f(n)formulae-sequencefor-all𝐺𝒞𝐿formulae-sequence𝑉𝐺𝑛𝐷𝑖𝑎𝑚𝐺𝑓𝑛\forall G\in\mathcal{C}(L),|V(G)|=n,Diam(G)=f(n)∀ italic_G ∈ caligraphic_C ( italic_L ) , | italic_V ( italic_G ) | = italic_n , italic_D italic_i italic_a italic_m ( italic_G ) = italic_f ( italic_n ).

  • L𝐿Litalic_L has maximum diameter f𝑓fitalic_f if, for all n𝑛nitalic_n, supkn{Diam(G)/f(k)\sup_{k\geq n}\{Diam(G)/f(k)roman_sup start_POSTSUBSCRIPT italic_k ≥ italic_n end_POSTSUBSCRIPT { italic_D italic_i italic_a italic_m ( italic_G ) / italic_f ( italic_k ) for all G𝐺Gitalic_G such that |V(G)|=k𝑉𝐺𝑘|V(G)|=k| italic_V ( italic_G ) | = italic_k and GL}=1G\in L\}=1italic_G ∈ italic_L } = 1.

  • L𝐿Litalic_L has minimum diameter f𝑓fitalic_f if, for all n𝑛nitalic_n, infkn{Diam(G)/f(k)\inf_{k\geq n}\{Diam(G)/f(k)roman_inf start_POSTSUBSCRIPT italic_k ≥ italic_n end_POSTSUBSCRIPT { italic_D italic_i italic_a italic_m ( italic_G ) / italic_f ( italic_k ) for all G𝐺Gitalic_G such that |V(G)|=k𝑉𝐺𝑘|V(G)|=k| italic_V ( italic_G ) | = italic_k and GL}=1G\in L\}=1italic_G ∈ italic_L } = 1.

1.3 Discussion, results and techniques for general checkers

Let us first review our results about local checkers without restriction on the computation power of the nodes.

Warm up for maximum and exact diameter

Let us start by introducing some basic intuitions for maximum and exact diameter. First, let us consider a local checker L𝐿Litalic_L at distance 1111, without colors. Such a checker is basically of the following form: if the degree of the node belongs to some specific set of integers S𝑆Sitalic_S, then accept, otherwise reject. Necessarily, 1111 belongs to S𝑆Sitalic_S because we need to allow leaves, if we want to accept finite trees. Let us informally prove that the maximum diameter of L𝐿Litalic_L is Ω(n)Ω𝑛\Omega(n)roman_Ω ( italic_n ). Consider a tree T𝑇Titalic_T accepted by L𝐿Litalic_L, and two of its edges uv𝑢𝑣uvitalic_u italic_v and wz𝑤𝑧wzitalic_w italic_z. The deletion of these edges leaves three connected components: Tmiddlesubscript𝑇𝑚𝑖𝑑𝑑𝑙𝑒T_{middle}italic_T start_POSTSUBSCRIPT italic_m italic_i italic_d italic_d italic_l italic_e end_POSTSUBSCRIPT which is the part of the tree between uv𝑢𝑣uvitalic_u italic_v and wz𝑤𝑧wzitalic_w italic_z, and Tusubscript𝑇𝑢T_{u}italic_T start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT and Tzsubscript𝑇𝑧T_{z}italic_T start_POSTSUBSCRIPT italic_z end_POSTSUBSCRIPT, the connected components of u𝑢uitalic_u and z𝑧zitalic_z, respectively. Then, we can define new trees by replacing Tmiddlesubscript𝑇𝑚𝑖𝑑𝑑𝑙𝑒T_{middle}italic_T start_POSTSUBSCRIPT italic_m italic_i italic_d italic_d italic_l italic_e end_POSTSUBSCRIPT by an arbitrary number of copies of Tmiddlesubscript𝑇𝑚𝑖𝑑𝑑𝑙𝑒T_{middle}italic_T start_POSTSUBSCRIPT italic_m italic_i italic_d italic_d italic_l italic_e end_POSTSUBSCRIPT organized into a chain (identifying copies of wz𝑤𝑧wzitalic_w italic_z in one copy with uv𝑢𝑣uvitalic_u italic_v in the next one). The set of degrees in the new tree is the same as in the original tree. Hence, all these new trees are also accepted, and they have asymptotic linear diameter. The key point is that we can use the fact that the neighborhoods were indistinguishable to make the graph path-like. We refer to this "pumping" technique as grafting and will be formally defined in full generality in Section 2 for any possible distance and number of colors.

Now, for a positive result, consider a checker at distance 2222 (again without colors). It basically manipulates the degree of its neighbors. Then it is possible to have a checker that recognizes exactly the graphs of the following form: take path of length i𝑖iitalic_i, choose one endpoint u𝑢uitalic_u, and attach i𝑖iitalic_i leaves to the node of the path at distance i𝑖iitalic_i from u𝑢uitalic_u. Indeed, the nodes can check that they are either leaves or that their non-leaf neighbors follow the increasing degree sequence. This leads to a local checker that accept trees of maximum diameter Ω(n)Ω𝑛\Omega(\sqrt{n})roman_Ω ( square-root start_ARG italic_n end_ARG ).

An important aspect of the previous argument is that all nodes had different degrees. This actually works with a weaker condition, namely, there is no repeated pair of degrees of adjacent vertices. Indeed, if a pair is repeated, then we can use pumping to prove that the checker accepts trees of linear diameter. By using a longer degree sequence without such repetitions (inspired by de Bruijn sequences), one can actually improve the previous bound to n2/3superscript𝑛23n^{2/3}italic_n start_POSTSUPERSCRIPT 2 / 3 end_POSTSUPERSCRIPT. Moreover, if we want to target a diameter that is much larger than n2/3superscript𝑛23n^{2/3}italic_n start_POSTSUPERSCRIPT 2 / 3 end_POSTSUPERSCRIPT, we would necessarily get some repeated chunks, yielding linear diameter. In some sense, carrying the information about the distance from an extremity uses some quantity of nodes, and at some point we run out of nodes. If we want to go further, then there is some repetition and the maximum diameter moves to the boring linear regime.

But one can also wonder if we can obtain smaller diameters. Suppose that we want to target a diameter that is smaller than n2/3superscript𝑛23n^{2/3}italic_n start_POSTSUPERSCRIPT 2 / 3 end_POSTSUPERSCRIPT. One can show that with the same kind of construction, except that we truncate the main path and attach enough leaves to the last node to get exactly the diameter we want, we can obtain any function of n𝑛nitalic_n which is O(n2/3)𝑂superscript𝑛23O(n^{2/3})italic_O ( italic_n start_POSTSUPERSCRIPT 2 / 3 end_POSTSUPERSCRIPT ) as a diameter. This can be recognized by a local checker, because the last node can check that the number of leaves it has is consistent with the degree of the second-to-last node, which measures the diameter. We refer to this technique as padding.

Our results on maximum and exact diameters, stated in the next paragraph, are generalizations of these constructions.

Formal results and more techniques on maximum and exact diameter

Let us now review our formal results. First, we prove that, for each possible distance d𝑑ditalic_d and every number of colors, there is a threshold function Sc,d(n)subscript𝑆𝑐𝑑𝑛S_{c,d}(n)italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) such that local checkers accept trees of linear diameter or trees of diameter at most O(Sc,d(n))𝑂subscript𝑆𝑐𝑑𝑛O(S_{c,d}(n))italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ). In other words, not all the maximum diameters can be obtained with local checkers. More formally, we prove in Section 2 that the following holds:

Theorem 1.6.

Every local checker in c,dsubscript𝑐𝑑\mathcal{L}_{c,d}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT has maximum diameter at most (4d2+4d+1)Sc,d(n)4superscript𝑑24𝑑1subscript𝑆𝑐𝑑𝑛(4d^{2}+4d+1)\cdot S_{c,d}(n)( 4 italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 4 italic_d + 1 ) ⋅ italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) or Θ(n)Θ𝑛\Theta(n)roman_Θ ( italic_n ), where Sc,1(n)=c2/9subscript𝑆𝑐1𝑛superscript𝑐29S_{c,1}(n)=c^{2}/9italic_S start_POSTSUBSCRIPT italic_c , 1 end_POSTSUBSCRIPT ( italic_n ) = italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / 9, Sc,2(n)=(cnc)2/(2c+1)subscript𝑆𝑐2𝑛superscript𝑐superscript𝑛𝑐22𝑐1S_{c,2}(n)=(cn^{c})^{2/(2c+1)}italic_S start_POSTSUBSCRIPT italic_c , 2 end_POSTSUBSCRIPT ( italic_n ) = ( italic_c italic_n start_POSTSUPERSCRIPT italic_c end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT 2 / ( 2 italic_c + 1 ) end_POSTSUPERSCRIPT, Sc,3(n)=36n/log2nsubscript𝑆𝑐3𝑛36𝑛superscript2𝑛S_{c,3}(n)=36n/\log^{2}nitalic_S start_POSTSUBSCRIPT italic_c , 3 end_POSTSUBSCRIPT ( italic_n ) = 36 italic_n / roman_log start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_n and Sc,d(n)=4n/gd(logn)subscript𝑆𝑐𝑑𝑛4𝑛subscript𝑔𝑑𝑛S_{c,d}(n)=4n/g_{d}(\log n)italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) = 4 italic_n / italic_g start_POSTSUBSCRIPT italic_d end_POSTSUBSCRIPT ( roman_log italic_n ) if d>3𝑑3d>3italic_d > 3.

For large values of d𝑑ditalic_d, the threshold function depends on the inverse gdsubscript𝑔𝑑g_{d}italic_g start_POSTSUBSCRIPT italic_d end_POSTSUBSCRIPT of the function xx/log(d3)xmaps-to𝑥𝑥superscript𝑑3𝑥x\mapsto x/\log^{(d-3)}xitalic_x ↦ italic_x / roman_log start_POSTSUPERSCRIPT ( italic_d - 3 ) end_POSTSUPERSCRIPT italic_x, where the log is iterated d3𝑑3d-3italic_d - 3 times. Note that one can think of the growth of gdsubscript𝑔𝑑g_{d}italic_g start_POSTSUBSCRIPT italic_d end_POSTSUBSCRIPT as slightly super-linear, so the last case of the following theorem is roughly Θ(n/logn)Θ𝑛𝑛\Theta(n/\log n)roman_Θ ( italic_n / roman_log italic_n ).

We moreover provide constructions reaching these upper bounds. To do so, we generalize the idea of paths with a prescribed degree sequence by defining a class of checkers that accept only trees of specific shapes. This allows to get a correspondence between the accepted trees and the strings over a given alphabet. In that correspondence, each checker is associated with a language, where the membership of a string in the language depends only on bounded-size infixes. We then use this machinery on languages to provide tight examples for Theorem 1.6.

We finally provide a generic construction that ensures that it is possible to build a local checker that accept trees whose diameters is precisely any function which is a O(Sc,d(n))𝑂subscript𝑆𝑐𝑑𝑛O(S_{c,d}(n))italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ). In other words, there is no gap in the set of diameters that can be recognized below Sc,d(n)subscript𝑆𝑐𝑑𝑛S_{c,d}(n)italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) by local checkers since all the possible diameters can be recognized. More formally, we prove in Section 3 that the following holds:

Theorem 1.7.

For every function f(n)=O(Sc,d(n))𝑓𝑛𝑂subscript𝑆𝑐𝑑𝑛f(n)=O(S_{c,d}(n))italic_f ( italic_n ) = italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ), there exists a local checker in c,dsubscript𝑐𝑑\mathcal{L}_{c,d}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT of exact diameter f(n)𝑓𝑛f(n)italic_f ( italic_n ).

Note that Theorems 1.6 and 1.7 give fine-grained versions of the intuitions given in the warm-up for distance 1 and 2. For distance 1, because of the colors, pumping works above some constant depending on the colors, while for distance 2, the threshold is polynomial in n𝑛nitalic_n. Then for larger distance we get nearly linear thresholds, which means that we can target almost any diameter.

From this theorem, we can derive the following corollary, which proves that the landscape for generalized-LCLs (as defined earlier) has basically no gaps.

Corollary 1.8.

For every function f(n)=O(Sc,d(n))𝑓𝑛𝑂subscript𝑆𝑐𝑑𝑛f(n)=O(S_{c,d}(n))italic_f ( italic_n ) = italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ), there exists a generalized-LCL at distance d+4𝑑4d+4italic_d + 4 of complexity f(n)𝑓𝑛f(n)italic_f ( italic_n ).

We prove this corollary in Appendix D. The main idea consists in mixing the checkers of Theorem 1.7 with a global problem, namely 2222-coloring, forcing the complexity to be of the same order as the diameter. This is more complicated than it looks at first sight, because the very specific constructions we use for the theorem are such that the nodes can know exactly where they are in the path. In particular, they know the parity of their distance to the first node of the path, hence 2-coloring is not a global problem in these graphs. We modify slightly the construction by subdividing some edges to introduce some uncertainty, which fixes this issue (which is possible only by increasing a bit the checking radius and with a precise understanding on the local checkers of Theorem 1.7).

To finish this part on maximum diameter, let us mention that in Appendix G, we show that if we were to allow cycles, then at distance 1, the behavior would be the same as for trees: the maximum diameter is either constant or linear.

Results on minimum diameter

We now turn our attention to minimum diameter. Note that all the results obtained for exact diameter also hold in the case of minimum diameter. In particular, Theorem 1.7 ensures that for every d2𝑑2d\geq 2italic_d ≥ 2, we can construct a local checker accepting trees whose minimum diameter is almost everything. Therefore, these results leave as open the behavior of the minimum diameter in the range ω(Sc,d(n))𝜔subscript𝑆𝑐𝑑𝑛\omega(S_{c,d}(n))italic_ω ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ) to o(n)𝑜𝑛o(n)italic_o ( italic_n ). We devote Section 4 to study the particular case d=1𝑑1d=1italic_d = 1 where the dichotomy we obtained for maximum diameter leaves a wide range of possibilities for minimum diameter. In this case, we show that the landscape is quite different since the minimum diameter is either constant, logarithmic or Θ(n1/k)Θsuperscript𝑛1𝑘\Theta(n^{1/k})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ) for some values of k𝑘kitalic_k which are at most c2superscript𝑐2c^{2}italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT.

Theorem 1.9.

Let c𝑐citalic_c be an integer. The minimum diameter of any Lc,1𝐿subscript𝑐1L\in\mathcal{L}_{c,1}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , 1 end_POSTSUBSCRIPT is either constant, logarithmic or Θ(n1/k)Θsuperscript𝑛1𝑘\Theta(n^{1/k})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ) for some values of kc2𝑘superscript𝑐2k\leqslant c^{2}italic_k ⩽ italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT.

We note that these are well-known regimes for (bounded-degree) LCLs. In particular, the n1/ksuperscript𝑛1𝑘n^{1/k}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT regime has been identified precisely in [9, 7] and the graphs at the core of both their proof and our proof are the same. For example, for k=2𝑘2k=2italic_k = 2, these are the graphs made of a path of length n𝑛\sqrt{n}square-root start_ARG italic_n end_ARG, where we attach a path of length n𝑛\sqrt{n}square-root start_ARG italic_n end_ARG to every node. For k=3𝑘3k=3italic_k = 3, we take the same construction but with n1/3superscript𝑛13n^{1/3}italic_n start_POSTSUPERSCRIPT 1 / 3 end_POSTSUPERSCRIPT instead of n1/2superscript𝑛12n^{1/2}italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT, and add one more level to the recursion etc. In a nutshell, the graphs of the construction are recursive rake-like graphs, where all the levels are balanced. Now the two proofs are pretty different. In  [9, 7] the arguments are algorithmic: they show that via rake-and-compress, that every tree can be framed as such a rake-like graph, and that the hardest instances are the balanced ones. In our proof, the spirit is that there is some underlying hierarchy of colors, that leads to the hierarchical structure of the graph, and in order to get a minimum diameter we want to balance all the levels, and we show this is always possible, by doing some subtle pumping argument (based on a non-trivial partial order on the pair of colors).

Intriguingly, we do not know whether the results on LCLs and our minimum diameter result are related, in the sense that one would imply the other. Clarifying this relation would be very interesting.

1.4 Discussion, results, and techniques on restricted checkers

From the viewpoint of our original motivations, the results we get for general checkers are not very satisfying: they give a pessimistic answer for LCL generalization (no hope to find gaps in the general unbounded-degree case) and the constructions are too contrived to give insights about natural structures, such as living beings. Therefore, we want to consider a restricted model, that will hopefully reveal some gaps for the maximum diameter (hence avoid statements such as Corollary 1.8) and forbid unnatural constructions.

We start by discussing what conditions such a restricted model should satisfy and propose our model, degree-myopic checkers. Then we discuss the maximum diameter landscape for these checkers, and our proof techniques.

Discussions of the flaws of general checkers

Three elements in our general checker construction feel unnatural. First, in many proofs we use padding: the last node of a path-like structure can observe the neighborhood of the preceding node to deduce the diameter-size ratio of the rest of the graph, and then check that it has been given the right number of leaves to modify this ratio in the right way. One expects that in a more natural construction, the graph is more homogeneous, and no node should compute an explicit complicated function. Second, we map integers to neighborhoods in some arbitrary way, using a generalization of De Bruijn words. To get the full power of this construction, we need that adjacent nodes can have arbitrarily different degrees, and that they can identify these degree perfectly. In some sense, the nodes should be able to manipulate arbitrarily large and different numbers. Third, also needed for the integer to neighborhood mapping: the checking of a node v𝑣vitalic_v depends on the full view of the nodes, and cannot be decomposed as a series of simple checks between adjacent nodes. In some sense, we are abusing the fact that we allowed constant checkability radius, instead of the radius 1.

Degree-myopic checkers

We propose a restricted setting for checkers, called degree-myopic, which boils down to two ideas.

First, we enforce that a node cannot distinguish perfectly between all its possible neighborhoods, by making some kind of equivalence classes. More precisely, since we will use checkers at distance two (without colors), the crux is that a node is not able to distinguish arbitrarily many possible degrees for its neighbors. We make this appear concretely by saying that a node will first put its neighbors’ degree in a few categories, and later will only be allowed to use these categories, not the actual degree. Here there is some freedom in how we choose these categories. We decide to consider that a node can only manage degrees that are close to its degree and leaves, hence the name of degree-myopic. Other meaningful variants could be considered.

Formally, let d𝑑ditalic_d be the degree of the node at hand, and dsuperscript𝑑d^{\prime}italic_d start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT the degree of the neighbor considered. The types of the neighbors are:

  • Leaf: d=1superscript𝑑1d^{\prime}=1italic_d start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = 1

  • Degree-1: d=d1superscript𝑑𝑑1d^{\prime}=d-1italic_d start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = italic_d - 1

  • Equal-degree: d=dsuperscript𝑑𝑑d^{\prime}=ditalic_d start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = italic_d

  • Degree+1: d=d+1superscript𝑑𝑑1d^{\prime}=d+1italic_d start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = italic_d + 1

Hence, at that point, the knowledge that a node has of its neighborhood is a 4-tuple of integers: how many neighbors are of each type. Note that the degree difference between neighbors is very limited: graphs with two non-leaf neighbors of very different degree will be rejected from the start.

Second, we decide to restrict the model further, to avoid complex manipulations of the integers of these 4-tuples. For example, we want to avoid checking that the number of leaves is related to the number of neighbors of equal degree by an arbitrarily complicated function. More precisely, the non-leaf nodes checks that a property C𝐶Citalic_C of the following form is satisfied: for every type i𝑖iitalic_i, we are given two quantities aisubscript𝑎𝑖a_{i}\in\mathbb{N}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ blackboard_N and bi{}subscript𝑏𝑖b_{i}\in\mathbb{N}\cup\{\infty\}italic_b start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ blackboard_N ∪ { ∞ } such that aibisubscript𝑎𝑖subscript𝑏𝑖a_{i}\leq b_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ≤ italic_b start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, and the number of neighbors of type i𝑖iitalic_i is in [ai,bi]subscript𝑎𝑖subscript𝑏𝑖[a_{i},b_{i}][ italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_b start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ]. To avoid issues around the leaves of the tree, the nodes of degree aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT or less are not required to have at least aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT neighbors of type Degree-1. Beyond the technical reasons, this is justified by the fact that we are interested in what happens in the core of the trees, where the degrees will be large.

By construction, this model avoids the three issues mentioned earlier. Indeed, thanks to the type equivalence, we cannot use padding, only similar degrees can be compared, and thanks to the shapes of the property C𝐶Citalic_C, the checking is very constrained. (We will see that it is not useful to have arbitrarily large ai,bisubscript𝑎𝑖subscript𝑏𝑖a_{i},b_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_b start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, hence there is no tricks on this side either.)

Landscape result and technique

Our main result about degree-myopic checkers is the following.

Theorem 1.10.

The possible maximum diameter function for degree-myopic local checkers are O(1)𝑂1O(1)italic_O ( 1 ), Θ(n)Θ𝑛\Theta(\sqrt{n})roman_Θ ( square-root start_ARG italic_n end_ARG ), Θ(logn/loglogn)Θ𝑛𝑛\Theta(\log{n}/\log\log n)roman_Θ ( roman_log italic_n / roman_log roman_log italic_n ), Θ(logn)Θ𝑛\Theta(\log{n})roman_Θ ( roman_log italic_n ) or Ω(n)Ω𝑛\Omega(n)roman_Ω ( italic_n ).

This result is nice from the viewpoint of our LCL motivation: it shows that for restricted checkers, we do have an interesting landscape. In particular, we get Θ(logn/loglogn)Θ𝑛𝑛\Theta(\log n/\log\log n)roman_Θ ( roman_log italic_n / roman_log roman_log italic_n ) which does not appear in the LCL landscape for trees, since there is a gap between O(logn)𝑂superscript𝑛O(\log^{*}n)italic_O ( roman_log start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT italic_n ) and Ω(logn)Ω𝑛\Omega(\log n)roman_Ω ( roman_log italic_n ) [8]. This is also exciting from the viewpoint of our second motivation: we get that simple maximum diameter functions can be obtained by relatively natural checkers.

The proof (deferred to Appendix F) consists in first showing that if a degree-myopic checker does not accept trees of linear diameter, then the accepted trees must be very well-behaved: roughly speaking, we can root the tree, in such a way that all paths from leaves to root are monotone in terms of degrees. Then we do a short case analysis, where it appears that basically the non-trivial extremal behaviors for trees can only be of the following types:

  • A caterpillar, where the i𝑖iitalic_i-th node of the path has degree i𝑖iitalic_i, which leads to Θ(n)Θ𝑛\Theta(\sqrt{n})roman_Θ ( square-root start_ARG italic_n end_ARG ).

  • A complete k𝑘kitalic_k-ary tree (for constant k𝑘kitalic_k), with some pending leaves, which leads to Θ(logn)Θ𝑛\Theta(\log n)roman_Θ ( roman_log italic_n ).

  • A tree, where if the depth is d𝑑ditalic_d, then the nodes at depth i𝑖iitalic_i have degree di+1𝑑𝑖1d-i+1italic_d - italic_i + 1, which leads to Θ(logn/loglogn)Θ𝑛𝑛\Theta(\log n/\log\log n)roman_Θ ( roman_log italic_n / roman_log roman_log italic_n ).

Further related work

Relating local and global structures of graphs is obviously not a new topic. In Appendix A, we review various research areas touching on this topic (network science, graph theory, and distributed computing), and highlight the differences and similarities with our perspective.

2 Gap results for maximum diameter

The goal of this section is to prove that Theorem 1.6 holds.

See 1.6

Intuitively, we show that if a checker accepts a tree containing a sufficiently large path, we can find very similar nodes, and fool them by “pumping” on the path to obtain more trees that are still accepted by the checker, but with various diameters. This pumping relies on an operation called grafting (illustrated on Figure 1).

Refer to caption
Figure 1: The tree T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT is the graft of Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in T𝑇Titalic_T at (uv,uv)𝑢𝑣superscript𝑢superscript𝑣(uv,u^{\prime}v^{\prime})( italic_u italic_v , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ).
Definition 2.1 (Grafting).

Let T𝑇Titalic_T be a (colored) tree and uv𝑢𝑣uvitalic_u italic_v be an edge of T𝑇Titalic_T. We denote by Tuuvsuperscriptsubscript𝑇𝑢𝑢𝑣T_{u}^{uv}italic_T start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT (or Tusubscript𝑇𝑢T_{u}italic_T start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT when u𝑢uitalic_u is clear from context) the connected component of u𝑢uitalic_u in Tuv𝑇𝑢𝑣T\setminus uvitalic_T ∖ italic_u italic_v. Consider two trees T𝑇Titalic_T and Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, with edges uv𝑢𝑣uvitalic_u italic_v and uvsuperscript𝑢superscript𝑣u^{\prime}v^{\prime}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT respectively. The tree T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT which is the graft of Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in T𝑇Titalic_T at (uv,uv)𝑢𝑣superscript𝑢superscript𝑣(uv,u^{\prime}v^{\prime})( italic_u italic_v , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) is the tree obtained from T𝑇Titalic_T by replacing the Tvsubscript𝑇𝑣T_{v}italic_T start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT by Tvsuperscriptsubscript𝑇𝑣T_{v}^{\prime}italic_T start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. In other words, we remove all the vertices of Tvsubscript𝑇𝑣T_{v}italic_T start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT and replace them by the vertices of Tvsuperscriptsubscript𝑇𝑣T_{v}^{\prime}italic_T start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT and the edge uv𝑢superscript𝑣uv^{\prime}italic_u italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT.

Note that, given a tree T𝑇Titalic_T and two edges uv,uv𝑢𝑣superscript𝑢superscript𝑣uv,u^{\prime}v^{\prime}italic_u italic_v , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT such that uvsuperscript𝑢superscript𝑣u^{\prime}v^{\prime}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT belongs to Tvuvsuperscriptsubscript𝑇𝑣𝑢𝑣T_{v}^{uv}italic_T start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT, we can graft T𝑇Titalic_T into itself in two ways: we can graft T𝑇Titalic_T in T𝑇Titalic_T at (uv,uv)𝑢𝑣superscript𝑢superscript𝑣(uv,u^{\prime}v^{\prime})( italic_u italic_v , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) or in (uv,uv)superscript𝑢superscript𝑣𝑢𝑣(u^{\prime}v^{\prime},uv)( italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_u italic_v ). Note that both operations are not the same: one of them will reduce the size and the diameter of the tree while the other will increase them.

Let d2𝑑2d\geq 2italic_d ≥ 2. We first show that the grafting operation preserves acceptance by a local checker provided that the graft happens on similar edges. More precisely, define the view at distance d𝑑ditalic_d from an edge uv𝑢𝑣uvitalic_u italic_v in a graph G𝐺Gitalic_G as the subgraph of G𝐺Gitalic_G, that contains all nodes at distance at most d1𝑑1d-1italic_d - 1 from at least one of the two vertices u𝑢uitalic_u or v𝑣vitalic_v and all the edges with at least one endpoint at distance at most d2𝑑2d-2italic_d - 2 from u𝑢uitalic_u or v𝑣vitalic_v, and where uv𝑢𝑣uvitalic_u italic_v is marked as the center. One can easily check that views are not modified when grafting on edges with the same view. More formally, we prove the following in appendix.

Lemma 2.2.

Let Lc,d𝐿subscript𝑐𝑑L\in\mathcal{L}_{c,d}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT accepting two trees T,T𝑇superscript𝑇T,T^{\prime}italic_T , italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, each containing an edge uvE(T)𝑢𝑣𝐸𝑇uv\in E(T)italic_u italic_v ∈ italic_E ( italic_T ), uvE(T)superscript𝑢superscript𝑣𝐸𝑇u^{\prime}v^{\prime}\in E(T)italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ∈ italic_E ( italic_T ) with the same view at distance d𝑑ditalic_d. Then L𝐿Litalic_L also accepts the graft of Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in T𝑇Titalic_T at (uv,uv)𝑢𝑣superscript𝑢superscript𝑣(uv,u^{\prime}v^{\prime})( italic_u italic_v , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ).

If a local checker accepts a tree T𝑇Titalic_T containing two edges with the same view at distance d𝑑ditalic_d, one can then graft T𝑇Titalic_T into itself at these edges and get a new tree, still accepted by L𝐿Litalic_L, and with a third edge with the same view. Iterating this argument yields the following (the formal proof being postponed to the appendix).

Lemma 2.3.

Let c,d𝑐𝑑c,ditalic_c , italic_d be integers and L𝐿Litalic_L be a local checker in c,dsubscript𝑐𝑑\mathcal{L}_{c,d}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT. If L𝐿Litalic_L accepts a c𝑐citalic_c-colored tree T𝑇Titalic_T that contains a path going through two edges uv,xy𝑢𝑣𝑥𝑦uv,xyitalic_u italic_v , italic_x italic_y (in this order) such that uv𝑢𝑣uvitalic_u italic_v and xy𝑥𝑦xyitalic_x italic_y have the same view at distance d𝑑ditalic_d. Then, L𝐿Litalic_L has linear maximum diameter.

Observe that at distance 1111, the view of an edge is intuitively just the color of its endpoints. In other words, given an edge uv𝑢𝑣uvitalic_u italic_v, the color of the neighbors of v𝑣vitalic_v has no impact on the fact that u𝑢uitalic_u accepts or not. So if we can find a path with two edges colored alike, we will be able to increase the diameter via grafting using Lemma 2.3.

Corollary 2.4.

Let c𝑐citalic_c be an integer. The maximum diameter of any Lc,1𝐿subscript𝑐1L\in\mathcal{L}_{c,1}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , 1 end_POSTSUBSCRIPT is either at most c2superscript𝑐2c^{2}italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT or linear.

Proof 2.5.

Let Lc,1𝐿subscript𝑐1L\in\mathcal{L}_{c,1}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , 1 end_POSTSUBSCRIPT be a local checker accepting a tree T𝑇Titalic_T whose diameter is larger than c2superscript𝑐2c^{2}italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT. Let P𝑃Pitalic_P be a path shortest path of T𝑇Titalic_T of length c2+1superscript𝑐21c^{2}+1italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 1. By pigeonhole principle, P𝑃Pitalic_P has two edges colored similarly and we can apply Lemma 2.3 to conclude.

At distance at least 2222, the view of each edge consists in a pair of c𝑐citalic_c-colored rooted trees of height d𝑑ditalic_d. These may contain arbitrarily many vertices, leading to an unbounded number of possible views. To overcome this issue, we adapt the proof technique by first finding a lot of edges (on a path) whose views contain only few vertices. Denote by t(d,k)𝑡𝑑𝑘t(d,k)italic_t ( italic_d , italic_k ) the number of k𝑘kitalic_k-vertices trees of height d𝑑ditalic_d.

Theorem 2.6 ([16]).

The following holds:

  • logt(3,k)π2k/3similar-to𝑡3𝑘𝜋2𝑘3\log t(3,k)\sim\pi\sqrt{2k/3}roman_log italic_t ( 3 , italic_k ) ∼ italic_π square-root start_ARG 2 italic_k / 3 end_ARG

  • for d>3𝑑3d>3italic_d > 3, logt(d,k)π26klog(d3)(k)similar-to𝑡𝑑𝑘superscript𝜋26𝑘superscript𝑑3𝑘\log t(d,k)\sim\frac{\pi^{2}}{6}\cdot\frac{k}{\log^{(d-3)}(k)}roman_log italic_t ( italic_d , italic_k ) ∼ divide start_ARG italic_π start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG 6 end_ARG ⋅ divide start_ARG italic_k end_ARG start_ARG roman_log start_POSTSUPERSCRIPT ( italic_d - 3 ) end_POSTSUPERSCRIPT ( italic_k ) end_ARG.

We are now ready to conclude the proof of Theorem 1.6.

Proof 2.7 (Proof of Theorem 1.6).

Let Lc,d𝐿subscript𝑐𝑑L\in\mathcal{L}_{c,d}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT and T𝑇Titalic_T be a c𝑐citalic_c-colored n𝑛nitalic_n-vertex tree accepted by L𝐿Litalic_L with diameter more than (4d2+4d+1)Sc,d(n)4superscript𝑑24𝑑1subscript𝑆𝑐𝑑𝑛(4d^{2}+4d+1)\cdot S_{c,d}(n)( 4 italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 4 italic_d + 1 ) ⋅ italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ). Let P𝑃Pitalic_P be a path of length more than (4d2+4d+1)Sc,d(n)4superscript𝑑24𝑑1subscript𝑆𝑐𝑑𝑛(4d^{2}+4d+1)\cdot S_{c,d}(n)( 4 italic_d start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + 4 italic_d + 1 ) ⋅ italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) in T𝑇Titalic_T.

Consider the trees obtained when removing the edges of P𝑃Pitalic_P. Less than 2dSc,d(n)2𝑑subscript𝑆𝑐𝑑𝑛2d\cdot S_{c,d}(n)2 italic_d ⋅ italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) of them contain at least n/2dSc,d(n)𝑛2𝑑subscript𝑆𝑐𝑑𝑛n/2d\cdot S_{c,d}(n)italic_n / 2 italic_d ⋅ italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) vertices. Moreover, each such tree intersects the view of at most 2d+22𝑑22d+22 italic_d + 2 edges of P𝑃Pitalic_P. In particular, P𝑃Pitalic_P contains more than Sc,d(n)subscript𝑆𝑐𝑑𝑛S_{c,d}(n)italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) edges whose view consists of 2d2𝑑2d2 italic_d trees hanging from P𝑃Pitalic_P, all of size less than n/2dSc,d(n)𝑛2𝑑subscript𝑆𝑐𝑑𝑛n/2d\cdot S_{c,d}(n)italic_n / 2 italic_d ⋅ italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ). In particular, their view at distance d𝑑ditalic_d contain at most n/Sc,d(n)𝑛subscript𝑆𝑐𝑑𝑛n/S_{c,d}(n)italic_n / italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) vertices.

When d=2𝑑2d=2italic_d = 2, there are at most c𝑐citalic_c choices for the color of each vertex v𝑣vitalic_v, and at most degc(v)superscriptdegree𝑐𝑣\deg^{c}(v)roman_deg start_POSTSUPERSCRIPT italic_c end_POSTSUPERSCRIPT ( italic_v ) choices for the colors of its neighbors. In particular, we found more than Sc,2(n)subscript𝑆𝑐2𝑛S_{c,2}(n)italic_S start_POSTSUBSCRIPT italic_c , 2 end_POSTSUBSCRIPT ( italic_n ) edges on P𝑃Pitalic_P that can have c2n2c/Sc,2(n)2c=Sc,2(n)superscript𝑐2superscript𝑛2𝑐subscript𝑆𝑐2superscript𝑛2𝑐subscript𝑆𝑐2𝑛c^{2}\cdot n^{2c}/S_{c,2}(n)^{2c}=S_{c,2}(n)italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ⋅ italic_n start_POSTSUPERSCRIPT 2 italic_c end_POSTSUPERSCRIPT / italic_S start_POSTSUBSCRIPT italic_c , 2 end_POSTSUBSCRIPT ( italic_n ) start_POSTSUPERSCRIPT 2 italic_c end_POSTSUPERSCRIPT = italic_S start_POSTSUBSCRIPT italic_c , 2 end_POSTSUBSCRIPT ( italic_n ) different views. We can thus find two edges with the same view and conclude using Lemma 2.3.

When d>2𝑑2d>2italic_d > 2, the view of each endpoint of our edges is a tree of height d𝑑ditalic_d with k:=n/Sc,d(n)assign𝑘𝑛subscript𝑆𝑐𝑑𝑛k:=n/S_{c,d}(n)italic_k := italic_n / italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) nodes, whose k𝑘kitalic_k nodes are colored with c𝑐citalic_c colors, hence there are at most kct(d,k)superscript𝑘𝑐𝑡𝑑𝑘k^{c}\cdot t(d,k)italic_k start_POSTSUPERSCRIPT italic_c end_POSTSUPERSCRIPT ⋅ italic_t ( italic_d , italic_k ) such views. Therefore, the number of views of our edges is at most k2ct(d,k)2superscript𝑘2𝑐𝑡superscript𝑑𝑘2k^{2c}\cdot t(d,k)^{2}italic_k start_POSTSUPERSCRIPT 2 italic_c end_POSTSUPERSCRIPT ⋅ italic_t ( italic_d , italic_k ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT. Using Theorem 2.6, we get (for large enough k𝑘kitalic_k) that k2c+1t(3,k)2e6knsuperscript𝑘2𝑐1𝑡superscript3𝑘2superscript𝑒6𝑘𝑛k^{2c+1}\cdot t(3,k)^{2}\leqslant e^{6\sqrt{k}}\leqslant nitalic_k start_POSTSUPERSCRIPT 2 italic_c + 1 end_POSTSUPERSCRIPT ⋅ italic_t ( 3 , italic_k ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ⩽ italic_e start_POSTSUPERSCRIPT 6 square-root start_ARG italic_k end_ARG end_POSTSUPERSCRIPT ⩽ italic_n since k=log2n/36𝑘superscript2𝑛36k=\log^{2}n/36italic_k = roman_log start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_n / 36 in that case. Similarly, for d>3𝑑3d>3italic_d > 3, we get k2c+1t(d,k)2nsuperscript𝑘2𝑐1𝑡superscript𝑑𝑘2𝑛k^{2c+1}\cdot t(d,k)^{2}\leqslant nitalic_k start_POSTSUPERSCRIPT 2 italic_c + 1 end_POSTSUPERSCRIPT ⋅ italic_t ( italic_d , italic_k ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ⩽ italic_n since k=gd(logn)/4𝑘subscript𝑔𝑑𝑛4k=g_{d}(\log n)/4italic_k = italic_g start_POSTSUBSCRIPT italic_d end_POSTSUBSCRIPT ( roman_log italic_n ) / 4 in that case. Therefore, in both cases, we get k2ct(d,k)2n/k=Sc,d(n)superscript𝑘2𝑐𝑡superscript𝑑𝑘2𝑛𝑘subscript𝑆𝑐𝑑𝑛k^{2c}\cdot t(d,k)^{2}\leqslant n/k=S_{c,d}(n)italic_k start_POSTSUPERSCRIPT 2 italic_c end_POSTSUPERSCRIPT ⋅ italic_t ( italic_d , italic_k ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ⩽ italic_n / italic_k = italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ), and we can again conclude using Lemma 2.3.

3 Construction of local checkers of prescribed exact diameter for d2𝑑2d\geq 2italic_d ≥ 2

The goal of this section is to prove Theorem 1.7.

See 1.7

The case of distance 1111 is very easy: one can easily construct a local checker in 2,1subscript21\mathcal{L}_{2,1}caligraphic_L start_POSTSUBSCRIPT 2 , 1 end_POSTSUBSCRIPT recognizing stars, which have constant exact diameter. So in the rest of the section, we focus on the case d2𝑑2d\geq 2italic_d ≥ 2. We will actually prove that the statement holds even restricted to a class of local checkers that will allow to associate the trees they recognize with strings over some alphabet. Then we will provide local checkers whose maximum diameter is precisely Sc,d(n)subscript𝑆𝑐𝑑𝑛S_{c,d}(n)italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ). We will finally explain how we can adapt our construction using a general tool to accept only trees of diameter f(n)𝑓𝑛f(n)italic_f ( italic_n ) for any function f(n)=O(Sc,d(n))𝑓𝑛𝑂subscript𝑆𝑐𝑑𝑛f(n)=O(S_{c,d}(n))italic_f ( italic_n ) = italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ).

3.1 Encoding sequences and locally testable languages.

A caterpillar is a tree T𝑇Titalic_T such that the removal of the leaves of T𝑇Titalic_T yields a path P𝑃Pitalic_P, called the backbone of T𝑇Titalic_T. A d𝑑ditalic_d-caterpillar is a tree T𝑇Titalic_T such that if we iteratively remove all the leaves d𝑑ditalic_d times then the remaining graph is a path. Equivalently, all the vertices of T𝑇Titalic_T are at distance at most d𝑑ditalic_d from P𝑃Pitalic_P. Note that a caterpillar is a 1111-caterpillar.

Let us now explain how we can encode a word (with an infinite alphabet) into a d𝑑ditalic_d-caterpillar and conversely. Let Σ=(an)nΣsubscriptsubscript𝑎𝑛𝑛\Sigma=(a_{n})_{n\in\mathbb{N}}roman_Σ = ( italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_n ∈ blackboard_N end_POSTSUBSCRIPT be an infinite alphabet together with an ordering on the letters. Let d𝑑ditalic_d be an integer and f𝑓fitalic_f be a bijection associating a colored rooted tree of depth at most d𝑑ditalic_d to each letter. Given a string s=s1sp𝑠subscript𝑠1subscript𝑠𝑝s=s_{1}\cdots s_{p}italic_s = italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT over the alphabet ΣΣ\Sigmaroman_Σ, the tree T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] is obtained by taking the trees f(s1),,f(sp)𝑓subscript𝑠1𝑓subscript𝑠𝑝f(s_{1}),\ldots,f(s_{p})italic_f ( italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) , … , italic_f ( italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ), adding an edge between the root of f(si)𝑓subscript𝑠𝑖f(s_{i})italic_f ( italic_s start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) and the root of f(si+1)𝑓subscript𝑠𝑖1f(s_{i+1})italic_f ( italic_s start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT ) for i[0,p]𝑖0𝑝i\in[0,p]italic_i ∈ [ 0 , italic_p ], where by convention f(s0)𝑓subscript𝑠0f(s_{0})italic_f ( italic_s start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) and f(sp+1)𝑓subscript𝑠𝑝1f(s_{p+1})italic_f ( italic_s start_POSTSUBSCRIPT italic_p + 1 end_POSTSUBSCRIPT ) are paths of length d+1𝑑1d+1italic_d + 1 (rooted at a leaf). Note then that T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] is a d𝑑ditalic_d-caterpillar whose backbone is formed by the roots of f(s0),f(sp+1)𝑓subscript𝑠0𝑓subscript𝑠𝑝1f(s_{0})\ldots,f(s_{p+1})italic_f ( italic_s start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) … , italic_f ( italic_s start_POSTSUBSCRIPT italic_p + 1 end_POSTSUBSCRIPT ). For every vertex of the backbone, we say that aisubscript𝑎𝑖a_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is associated to it if f(ai)𝑓subscript𝑎𝑖f(a_{i})italic_f ( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) is attached on it. Also note that every d𝑑ditalic_d-caterpillar can be seen as T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] for some choice of s𝑠sitalic_s since f𝑓fitalic_f is bijective.

In order to fully control the word, we would like to enforce that we read it in the right direction. And with the caterpillar defined above, both s𝑠sitalic_s and its mirror provide the same caterpillar. Moreover, vertices of the middle of backbone of T𝑇Titalic_T have a priori no reason to know in which direction they are supposed to "read" the word. To enforce one direction of reading, we actually slightly change the definition of T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ]: instead of creating a copy of f(si)𝑓subscript𝑠𝑖f(s_{i})italic_f ( italic_s start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) for each sisubscript𝑠𝑖s_{i}italic_s start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, we create three of them, identify their roots, and add imod3modulo𝑖3i\mod 3italic_i roman_mod 3 pending leaves to the root. (Note that this only changes the number of vertices by a constant multiplicative factor, and the diameter is not affected since d1𝑑1d\geq 1italic_d ≥ 1). Now, the numbers of neighbors outside the backbone of vertices in the backbone mod 3333 yields the sequence 0,1,2,0,1,2,0120120,1,2,0,1,2,\ldots0 , 1 , 2 , 0 , 1 , 2 , …. We say that a caterpillar is special if this property is satisfied and paths of length d+1𝑑1d+1italic_d + 1 are attached to the first and last vertices of the backbone. In particular, since f𝑓fitalic_f is bijective, each special caterpillar can be uniquely written as T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] for some string s𝑠sitalic_s over A𝐴Aitalic_A.

We are interested in local checkers, called special checkers (or d𝑑ditalic_d-special checkers), that only accept special d𝑑ditalic_d-caterpillars. These can be easily enforced as shown by the following lemma, whose proof is deferred to the appendix.

Lemma 3.1.

A local checker at distance d+1𝑑1d+1italic_d + 1 can check:

  • if a tree is a special d𝑑ditalic_d-caterpillar and,

  • every vertex can determine if it is on the backbone or not as well as its neighbors on the backbone and,

  • every vertex can determine if it is an endpoint of the backbone and,

  • every vertex can determine the letter associated to it as well as the letter associated to its neighbors on the backbone.

We denote by c,d+1superscriptsubscript𝑐𝑑1\mathcal{L}_{c,d+1}^{*}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d + 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT the set of local checkers that only accept special d𝑑ditalic_d-caterpillars. We may now associate with each Lc,d+1𝐿superscriptsubscript𝑐𝑑1L\in\mathcal{L}_{c,d+1}^{*}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d + 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT the language of strings s𝑠sitalic_s such that T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] is accepted by L𝐿Litalic_L. Observe that the membership of a string in such languages depends only on its set of substrings of size at most 2d12𝑑12d-12 italic_d - 1. Such languages are said to be locally testable (or d𝑑ditalic_d-testable). In particular, for every possible encoding f𝑓fitalic_f and every locally testable language, there is a local checker in c,dsuperscriptsubscript𝑐𝑑\mathcal{L}_{c,d}^{*}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT accepting exactly the trees T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] for sL𝑠𝐿s\in Litalic_s ∈ italic_L. In the rest of this section we will need two simple locally testable languages. Let Σ=(an)nΣsubscriptsubscript𝑎𝑛𝑛\Sigma=(a_{n})_{n\in\mathbb{N}}roman_Σ = ( italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_n ∈ blackboard_N end_POSTSUBSCRIPT be a (possibly infinite) alphabet where letters are ordered.

Then one can easily check that the following language is locally testable for every d2𝑑2d\geq 2italic_d ≥ 2 (since a substring of 2d12𝑑12d-12 italic_d - 1 characters has to be a consecutive sequence of letters in ΣΣ\Sigmaroman_Σ):

Remark 3.2.

The language L1subscript𝐿1L_{1}italic_L start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT of prefixes of the infinite word a1a2subscript𝑎1subscript𝑎2a_{1}a_{2}\cdotsitalic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⋯ is 2222-testable.

Let us denote by W1subscript𝑊1W_{1}italic_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT the word a1a2subscript𝑎1subscript𝑎2a_{1}a_{2}italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and by Wisubscript𝑊𝑖W_{i}italic_W start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT for every i2𝑖2i\geq 2italic_i ≥ 2 the word a1apap1apsubscript𝑎1subscript𝑎𝑝subscript𝑎𝑝1subscript𝑎𝑝a_{1}a_{p}\cdots a_{p-1}a_{p}italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ⋯ italic_a start_POSTSUBSCRIPT italic_p - 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT. We denote by L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT the language of all words W1Wpsubscript𝑊1subscript𝑊𝑝W_{1}\cdots W_{p}italic_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_W start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT for every p𝑝pitalic_p (that is L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT contains the concatenations of the the p𝑝pitalic_p first words Wisubscript𝑊𝑖W_{i}italic_W start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT for all integer p𝑝pitalic_p). Observe that strings in L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are exactly the ones starting with a1a2subscript𝑎1subscript𝑎2a_{1}a_{2}italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, ending with ap1apsubscript𝑎𝑝1subscript𝑎𝑝a_{p-1}a_{p}italic_a start_POSTSUBSCRIPT italic_p - 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT, and whose subsequences of length 3333 are of the following shape:

  • ak1aaksubscript𝑎𝑘1subscript𝑎subscript𝑎𝑘a_{k-1}a_{\ell}a_{k}italic_a start_POSTSUBSCRIPT italic_k - 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT for some k<𝑘k<\ellitalic_k < roman_ℓ

  • aakasubscript𝑎subscript𝑎𝑘subscript𝑎a_{\ell}a_{k}a_{\ell}italic_a start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT for some 1<k<1𝑘1<k<\ell1 < italic_k < roman_ℓ

  • a1a1asubscript𝑎1subscript𝑎1subscript𝑎a_{\ell-1}a_{1}a_{\ell}italic_a start_POSTSUBSCRIPT roman_ℓ - 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT roman_ℓ end_POSTSUBSCRIPT for some 1<11<\ell1 < roman_ℓ

  • ak1aka1subscript𝑎𝑘1subscript𝑎𝑘subscript𝑎1a_{k-1}a_{k}a_{1}italic_a start_POSTSUBSCRIPT italic_k - 1 end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT for some 1<k1𝑘1<k1 < italic_k

Remark 3.3.

The language L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is 2222-testable.

3.2 Constructions reaching the bound Θ(Sc,d(n))Θsubscript𝑆𝑐𝑑𝑛\Theta(S_{c,d}(n))roman_Θ ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ).

The goal of this part is to provide a local checker whose maximum diameter is exactly the one of Theorem 1.7. We distinguish two cases depending the value of d𝑑ditalic_d.

Case d3𝑑3d\geqslant 3italic_d ⩾ 3. We start with the easier case d3𝑑3d\geqslant 3italic_d ⩾ 3. Since L1subscript𝐿1L_{1}italic_L start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT is locally testable, for every possible encoding f𝑓fitalic_f, there is a special local checker in c,dsuperscriptsubscript𝑐𝑑\mathcal{L}_{c,d}^{*}caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT accepting exactly the trees T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] for sL𝑠𝐿s\in Litalic_s ∈ italic_L.

To obtain the bound of Theorem 1.7, it remains to describe f𝑓fitalic_f. Consider an enumeration of all trees of height d1𝑑1d-1italic_d - 1 by increasing number of vertices, and define f(ai)𝑓subscript𝑎𝑖f(a_{i})italic_f ( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) as the i𝑖iitalic_i-th such tree. By construction, the number of vertices of f(ai)𝑓subscript𝑎𝑖f(a_{i})italic_f ( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) is the smallest k𝑘kitalic_k such that it(d1,k)𝑖𝑡𝑑1𝑘i\leqslant t(d-1,k)italic_i ⩽ italic_t ( italic_d - 1 , italic_k ). By Theorem 2.6, the size of f(ai)𝑓subscript𝑎𝑖f(a_{i})italic_f ( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) is k=Θ(log2i)𝑘Θsuperscript2𝑖k=\Theta(\log^{2}i)italic_k = roman_Θ ( roman_log start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_i ) if d=3𝑑3d=3italic_d = 3 and k=Θ(gd(logi))𝑘Θsubscript𝑔𝑑𝑖k=\Theta(g_{d}(\log i))italic_k = roman_Θ ( italic_g start_POSTSUBSCRIPT italic_d end_POSTSUBSCRIPT ( roman_log italic_i ) ) otherwise. Now let T𝑇Titalic_T be an accepted tree. By Lemma 3.1 it is a d𝑑ditalic_d-caterpillar and by construction of the local checker, the nodes of the backbone are associated to the sequence of letters a1apsubscript𝑎1subscript𝑎𝑝a_{1}\ldots a_{p}italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT … italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT of L1subscript𝐿1L_{1}italic_L start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT for some integer p𝑝pitalic_p. Now observe that T[ai]𝑇delimited-[]subscript𝑎𝑖T[a_{i}]italic_T [ italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ] has diameter at most d𝑑ditalic_d and contains at most 3f(ap)+23𝑓subscript𝑎𝑝23\cdot f(a_{p})+23 ⋅ italic_f ( italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) + 2 vertices (since we attach on each vertex three copies of the same tree plus at most 2222 leaves). Thus T𝑇Titalic_T has diameter Θ(p+d)Θ𝑝𝑑\Theta(p+d)roman_Θ ( italic_p + italic_d ) and its number of vertices is Θ(p|f(ap)|)Θ𝑝𝑓subscript𝑎𝑝\Theta(p\cdot|f(a_{p})|)roman_Θ ( italic_p ⋅ | italic_f ( italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) | ). Plugging in the estimates for |f(ap)|𝑓subscript𝑎𝑝|f(a_{p})|| italic_f ( italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) | concludes.

Case d=2𝑑2d=2italic_d = 2. Since L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is locally testable, and for every choice of f𝑓fitalic_f, there is a local checker in c,2superscriptsubscript𝑐2\mathcal{L}_{c,2}^{*}caligraphic_L start_POSTSUBSCRIPT italic_c , 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT accepting exactly the trees T[s]𝑇delimited-[]𝑠T[s]italic_T [ italic_s ] for sL2𝑠subscript𝐿2s\in L_{2}italic_s ∈ italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

To obtain the bound from Theorem 1.7, it remains to describe the encoding f𝑓fitalic_f of each letter and to prove that it gives the required bound.

Let us start with the colorless case c=1𝑐1c=1italic_c = 1. We define f(ap)𝑓subscript𝑎𝑝f(a_{p})italic_f ( italic_a start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) as the star on p+1𝑝1p+1italic_p + 1 vertices, rooted at its center. Consider the word sp=W1Wpsubscript𝑠𝑝subscript𝑊1subscript𝑊𝑝s_{p}=W_{1}\cdots W_{p}italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT = italic_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_W start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT. Observe that since spsubscript𝑠𝑝s_{p}italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT has length p(p1)𝑝𝑝1p(p-1)italic_p ( italic_p - 1 ), T[sp]𝑇delimited-[]subscript𝑠𝑝T[s_{p}]italic_T [ italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ] is a tree of diameter Θ(p2)Θsuperscript𝑝2\Theta(p^{2})roman_Θ ( italic_p start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ). Moreover, each letter aisubscript𝑎𝑖a_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT appears (p1)𝑝1(p-1)( italic_p - 1 ) times in spsubscript𝑠𝑝s_{p}italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT, hence T[sp]𝑇delimited-[]subscript𝑠𝑝T[s_{p}]italic_T [ italic_s start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ] has Θ((p1)(1++p))=Θ(p3)Θ𝑝11𝑝Θsuperscript𝑝3\Theta((p-1)\cdot(1+\cdots+p))=\Theta(p^{3})roman_Θ ( ( italic_p - 1 ) ⋅ ( 1 + ⋯ + italic_p ) ) = roman_Θ ( italic_p start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT ) vertices. In particular, our local checker has exact diameter n2/3superscript𝑛23n^{2/3}italic_n start_POSTSUPERSCRIPT 2 / 3 end_POSTSUPERSCRIPT, as expected.

To extend this result to the colored case c>1𝑐1c>1italic_c > 1, we just have to adapt the encoding of each letter. We define f(ai)𝑓subscript𝑎𝑖f(a_{i})italic_f ( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) as a star whose center gets color 1111, and with xjsubscript𝑥𝑗x_{j}italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT leaves of color j𝑗jitalic_j for j[1,c]𝑗1𝑐j\in[1,c]italic_j ∈ [ 1 , italic_c ], where (x1,,xc)subscript𝑥1subscript𝑥𝑐(x_{1},\ldots,x_{c})( italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_x start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT ) is the i𝑖iitalic_i-th (in lexicographic order) c𝑐citalic_c-tuple whose entries are non-increasing. Observe that the number of such tuples whose first element is at most p𝑝pitalic_p is (p+cc)=Θ(pc)binomial𝑝𝑐𝑐Θsuperscript𝑝𝑐{p+c\choose c}=\Theta(p^{c})( binomial start_ARG italic_p + italic_c end_ARG start_ARG italic_c end_ARG ) = roman_Θ ( italic_p start_POSTSUPERSCRIPT italic_c end_POSTSUPERSCRIPT ), hence each letter in spcsubscript𝑠superscript𝑝𝑐s_{p^{c}}italic_s start_POSTSUBSCRIPT italic_p start_POSTSUPERSCRIPT italic_c end_POSTSUPERSCRIPT end_POSTSUBSCRIPT is encoded with at most cp𝑐𝑝cpitalic_c italic_p leaves. In particular, the trees accepted by our local checker have diameter Θ(p2c)Θsuperscript𝑝2𝑐\Theta(p^{2c})roman_Θ ( italic_p start_POSTSUPERSCRIPT 2 italic_c end_POSTSUPERSCRIPT ) and Θ(cpp2c)Θ𝑐𝑝superscript𝑝2𝑐\Theta(cp\cdot p^{2c})roman_Θ ( italic_c italic_p ⋅ italic_p start_POSTSUPERSCRIPT 2 italic_c end_POSTSUPERSCRIPT ) nodes, yielding the bound Θ(n2c/(2c+1))Θsuperscript𝑛2𝑐2𝑐1\Theta(n^{2c/(2c+1)})roman_Θ ( italic_n start_POSTSUPERSCRIPT 2 italic_c / ( 2 italic_c + 1 ) end_POSTSUPERSCRIPT ) as required.

3.3 Extension to exact diameter O(Sc,d(n))𝑂subscript𝑆𝑐𝑑𝑛O(S_{c,d}(n))italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) )

The goal of this part is to prove Theorem 1.7 that is to obtain a checker of exact diameter D(n)𝐷𝑛D(n)italic_D ( italic_n ) for every function D(n)=O(Sc,d(n))𝐷𝑛𝑂subscript𝑆𝑐𝑑𝑛D(n)=O(S_{c,d}(n))italic_D ( italic_n ) = italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ). The case d=1𝑑1d=1italic_d = 1 being trivial, we will assume in the rest of this section that d2𝑑2d\geq 2italic_d ≥ 2.

Let D𝐷Ditalic_D be any function such that D(n)=O(Sc,d(n))𝐷𝑛𝑂subscript𝑆𝑐𝑑𝑛D(n)=O(S_{c,d}(n))italic_D ( italic_n ) = italic_O ( italic_S start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT ( italic_n ) ). We consider a slightly modified version of the local checkers Lc,d𝐿subscriptsuperscript𝑐𝑑L\in\mathcal{L}^{*}_{c,d}italic_L ∈ caligraphic_L start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT constructed in Section 3.2. Roughtly speaking, all the nodes have exactly the same behavior but the last node of the backbone, corresponding to the last letter of the word. This node will be allowed to have arbitrarily many leaves (as long as the modulo 3333 condition stays satisfied), and will carry an additional verification. Namely it will check that we added the right amount of leaves to get the correct dependency between diameter and number of nodes. Unfortunately, such a modification does not work directly, and we need to slightly modify our checkers to make it work.

For a node of the backbone corresponding to a letter a𝑎aitalic_a, we create six copies of f(a)𝑓𝑎f(a)italic_f ( italic_a ) instead of three. This at most doubles the total number of vertices. Now, we link the last node u𝑢uitalic_u of the backbone with the center of three stars of the same size. (And we moreover add 0,1010,10 , 1 or 2222 leaves as before depending on the position on the backbone).

Note that all the nodes must have degree equal to 0,1010,10 , 1 or 2222 modulo 6666 except the last node of the backbone which can have degree 3,4343,43 , 4 or 5555 modulo 6666. And all the nodes of the backbone can check the validity of their degree. Moreover, all the nodes can indeed recover their own letter as well as the letter of their neighbors as in the proof of Lemma 3.1. Indeed, since we add to the last node of the backbone only three copies of the same star, this star will be ignored by the penultimate node of the backbone when it reconstructs the subtree. In the case d=2𝑑2d=2italic_d = 2, the argument is a bit more subtle: indeed the neighbor on the backbone does not fully see the subtree attached on the last vertex of the backbone but sees that the number of vertices attached to it is 3333 more than what it should be and does not reject in that case.

To conclude, let us explain when the last vertex of the backbone accepts (the acceptance rule is not modified for the other vertices). The goal is to artificially increase the number of vertices of the trees T[w]𝑇delimited-[]𝑤T[w]italic_T [ italic_w ] for wL2𝑤subscript𝐿2w\in L_{2}italic_w ∈ italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, without changing their diameter, in order to reach the target diameter D𝐷Ditalic_D. Note that, in both languages L1subscript𝐿1L_{1}italic_L start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, the last node of the path is able to determine the length of the path by simply knowing the last two letters. So the last node of the backbone computes the diameter δ𝛿\deltaitalic_δ of T[w]𝑇delimited-[]𝑤T[w]italic_T [ italic_w ] and the number k𝑘kitalic_k of vertices in the tree before it. It then accepts when its number r𝑟ritalic_r of leaves satisfies D(r+k)=δ𝐷𝑟𝑘𝛿D(r+k)=\deltaitalic_D ( italic_r + italic_k ) = italic_δ.

4 Minimum diameter at distance 1111 – Proof of Theorem 1.9

See 1.9

A first idea consists in just applying our pumping argument similarly to the proof of Lemma 2.3, but in reverse, in order to shorten long enough paths until they get constant size. However, this may actually decrease a lot the total number of vertices at the same time, impeding us to construct an infinite family of trees with the claimed diameter. To solve this issue, we have to get more control on which subtrees we remove while de-pumping. More precisely, we will only de-pump subtrees that are almost paths. To ensure that long enough paths exist, we first prove that local checkers accepting trees of arbitrarily large degree have constant minimum diameter. We then consider local checkers L𝐿Litalic_L accepting trees of bounded degree (which already have super-logarithmic diameter), and investigate the edges with a given view to exhibit some structure in the trees accepted by L𝐿Litalic_L. We then use this structure to show that L𝐿Litalic_L must accept trees with a very specific shape, namely that look like complete binary trees or rakes (defined below).

4.1 Constructions

Before diving into the proof, we will prove that Theorem 1.9 is essentially tight, meaning that we can obtain local checkers that accept trees of constant diameter, linear diameter or diameter Θ(n1/k)Θsuperscript𝑛1𝑘\Theta(n^{1/k})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ) for every 2kc/32𝑘𝑐32\leq k\leq c/32 ≤ italic_k ≤ italic_c / 3.

Linear diameter. The local checker in 1,1subscript11\mathcal{L}_{1,1}caligraphic_L start_POSTSUBSCRIPT 1 , 1 end_POSTSUBSCRIPT where every node accepts whenever its degree is at most 2222 accepts exactly the class of paths, hence has linear exact (and then minimum) diameter.

Constant diameter. The local checker in 1,1subscript11\mathcal{L}_{1,1}caligraphic_L start_POSTSUBSCRIPT 1 , 1 end_POSTSUBSCRIPT that where every node accepts regardless of its neighborhood accepts trees of diameter at most 2222 for every possible size of trees.

Logarithmic diameter. The local checker in 1,1subscript11\mathcal{L}_{1,1}caligraphic_L start_POSTSUBSCRIPT 1 , 1 end_POSTSUBSCRIPT where a node accepts if and only if its degree is 1111 or 3333 accepts exactly binary trees. Hence its minimum diameter is logarithmic (even if its maximum diameter is linear) since the minimum diameter of such a tree is reached when the tree is complete.

Refer to caption
Figure 2: A 3333-rake on n𝑛nitalic_n vertices of diameter Θ(n1/3)Θsuperscript𝑛13\Theta(n^{1/3})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / 3 end_POSTSUPERSCRIPT ). The deletion of the top path leaves n1/3superscript𝑛13n^{1/3}italic_n start_POSTSUPERSCRIPT 1 / 3 end_POSTSUPERSCRIPT 2222-rakes.

Polynomial diameter. For each integer k𝑘kitalic_k, let us introduce the class of k𝑘kitalic_k-rakes. The 1111-rakes are paths, and k𝑘kitalic_k-rakes are trees T𝑇Titalic_T containing a path P𝑃Pitalic_P whose removal yields a forest whose connected components are (k1)𝑘1(k-1)( italic_k - 1 )-rakes and such that each vertex of P𝑃Pitalic_P is attached to at most one connected component of TP𝑇𝑃T\setminus Pitalic_T ∖ italic_P (see Figure 2 for an illustration). We prove the following in the appendix.

Lemma 4.1.

The class of k𝑘kitalic_k-rakes has minimum diameter Θ(n1/k)Θsuperscript𝑛1𝑘\Theta(n^{1/k})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ) and is accepted by a local checker in 3k,1subscript3𝑘1\mathcal{L}_{3k,1}caligraphic_L start_POSTSUBSCRIPT 3 italic_k , 1 end_POSTSUBSCRIPT.

4.2 Proof of Theorem 1.9

We now proceed with the proof of Theorem 1.9, and first take care of trees of arbitrary large degree.

Lemma 4.2.

Let c𝑐citalic_c be an integer and Lc,1𝐿subscript𝑐1L\in\mathcal{L}_{c,1}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , 1 end_POSTSUBSCRIPT accepting trees of arbitrary large degree. Then the minimum diameter of L𝐿Litalic_L is constant.

Proof 4.3.

Given two colors a,b𝑎𝑏a,bitalic_a , italic_b, define Ta,bsubscript𝑇𝑎𝑏T_{a,b}italic_T start_POSTSUBSCRIPT italic_a , italic_b end_POSTSUBSCRIPT as a minimum-sized tree accepted by L𝐿Litalic_L containing an edge vavbsubscript𝑣𝑎subscript𝑣𝑏v_{a}v_{b}italic_v start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT such that vasubscript𝑣𝑎v_{a}italic_v start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT has color a𝑎aitalic_a and vbsubscript𝑣𝑏v_{b}italic_v start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT has color b𝑏bitalic_b (if such a tree exists). Denote by α𝛼\alphaitalic_α the largest size of Ta,bsubscript𝑇𝑎𝑏T_{a,b}italic_T start_POSTSUBSCRIPT italic_a , italic_b end_POSTSUBSCRIPT when a,b𝑎𝑏a,bitalic_a , italic_b run across all possible colors.

By hypothesis, L𝐿Litalic_L accepts an infinite family of c𝑐citalic_c-colored trees (Tn)nsubscriptsubscript𝑇𝑛𝑛(T_{n})_{n}( italic_T start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT such that each Tnsubscript𝑇𝑛T_{n}italic_T start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT contains a vertex unsubscript𝑢𝑛u_{n}italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT of degree at least n𝑛nitalic_n. Root each Tnsubscript𝑇𝑛T_{n}italic_T start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT at unsubscript𝑢𝑛u_{n}italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT. Now, for each edge unusubscript𝑢𝑛𝑢u_{n}uitalic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_u of Tnsubscript𝑇𝑛T_{n}italic_T start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT, let a𝑎aitalic_a be the color of unsubscript𝑢𝑛u_{n}italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT and b𝑏bitalic_b the color of u𝑢uitalic_u, and successively graft Ta,bsubscript𝑇𝑎𝑏T_{a,b}italic_T start_POSTSUBSCRIPT italic_a , italic_b end_POSTSUBSCRIPT in Tnsubscript𝑇𝑛T_{n}italic_T start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT at (uun,vavb)𝑢subscript𝑢𝑛subscript𝑣𝑎subscript𝑣𝑏(uu_{n},v_{a}v_{b})( italic_u italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ). By Lemma 2.2, the resulting tree Tnsubscriptsuperscript𝑇𝑛T^{\prime}_{n}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT is accepted by L𝐿Litalic_L. Moreover, every tree Tnsubscriptsuperscript𝑇𝑛T^{\prime}_{n}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT has at least n𝑛nitalic_n nodes and diameter at most 2α2𝛼2\alpha2 italic_α, which concludes.

We may now assume that each local checker accepts only graphs of bounded degree ΔΔ\Deltaroman_Δ. In particular, each accepted tree T𝑇Titalic_T satisfies |T|Δdiam(T)𝑇superscriptΔdiam𝑇|T|\leqslant\Delta^{\operatorname{\mathrm{diam}}(T)}| italic_T | ⩽ roman_Δ start_POSTSUPERSCRIPT roman_diam ( italic_T ) end_POSTSUPERSCRIPT, hence the diameter is at least logarithmic (and at most linear) with respect to the size333Note that even if we restrict to the case of bounded degree, we cannot directly use the LCL machinery since the context is not exactly the same. We are looking at possible diameters of accepted trees and not looking at the checking of some property.. To prove the remaining parts of Theorem 1.9, we study the structure of the edges with the same view, and get a criterion proving that L𝐿Litalic_L accepts trees that look like complete binary trees or k𝑘kitalic_k-rakes for some k𝑘kitalic_k, and thus must have minimum diameter O(logn)𝑂𝑛O(\log n)italic_O ( roman_log italic_n ) or O(n1/k)𝑂superscript𝑛1𝑘O(n^{1/k})italic_O ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ).

Given a local checker L𝐿Litalic_L, we say that a pair of colors (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) is useful if L𝐿Litalic_L accepts some tree containing a path u1,,upsubscript𝑢1subscript𝑢𝑝u_{1},\ldots,u_{p}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_u start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT (p4𝑝4p\geqslant 4italic_p ⩾ 4) where u1,up1subscript𝑢1subscript𝑢𝑝1u_{1},u_{p-1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_p - 1 end_POSTSUBSCRIPT have color c1subscript𝑐1c_{1}italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and u2,upsubscript𝑢2subscript𝑢𝑝u_{2},u_{p}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT have color c2subscript𝑐2c_{2}italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

We define the binary relation <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT on the useful pairs of colors as follows: (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) if L𝐿Litalic_L accepts a c𝑐citalic_c-colored tree T𝑇Titalic_T that can be rooted such that, when orienting the edges towards the leaves, there are three arcs u1u2,v1v2subscript𝑢1subscript𝑢2subscript𝑣1subscript𝑣2u_{1}u_{2},v_{1}v_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and w1w2subscript𝑤1subscript𝑤2w_{1}w_{2}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT such that u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is an ancestor of v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and w1subscript𝑤1w_{1}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, v2subscript𝑣2v_{2}italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is not an ancestor of w2subscript𝑤2w_{2}italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, both ui,visubscript𝑢𝑖subscript𝑣𝑖u_{i},v_{i}italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT have color cisubscript𝑐𝑖c_{i}italic_c start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT for i=1,2𝑖12i=1,2italic_i = 1 , 2, and wisubscript𝑤𝑖w_{i}italic_w start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT has color disubscript𝑑𝑖d_{i}italic_d start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT for i=1,2𝑖12i=1,2italic_i = 1 , 2. When this condition is satisfied, we moreover say that the rooted tree T𝑇Titalic_T witnesses that (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ). (In other words, it means that u1,u2subscript𝑢1subscript𝑢2u_{1},u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are ancestors of the four other vertices while v1v2subscript𝑣1subscript𝑣2v_{1}v_{2}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and w1w2subscript𝑤1subscript𝑤2w_{1}w_{2}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT lie in different subtrees and are incomparable in T𝑇Titalic_T) (see Figure 3 for an illustration).

Refer to caption
Figure 3: A tree T𝑇Titalic_T witnessing (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ). Vertices are labeled with their name and color.

One can easily check that <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT is transitive (a proof of this statement is given in Appendix E.2). To get the remaining cases of Theorem 1.9, we prove in Appendix E.3 that if <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT is not a strict partial order, then L𝐿Litalic_L has minimum diameter Θ(logn)Θ𝑛\Theta(\log n)roman_Θ ( roman_log italic_n ). Otherwise, we claim that L𝐿Litalic_L has minimum diameter Θ(n1/k)Θsuperscript𝑛1𝑘\Theta(n^{1/k})roman_Θ ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ) where k𝑘kitalic_k is the length of the longest chain for <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT (in particular kc2𝑘superscript𝑐2k\leqslant c^{2}italic_k ⩽ italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT). This is a consequence of the two following results, whose proofs are deferred to the appendix.

Lemma 4.4.

If <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT has a chain of size k𝑘kitalic_k, then the minimum diameter of L𝐿Litalic_L is O(n1/k)𝑂superscript𝑛1𝑘O(n^{1/k})italic_O ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ).

Lemma 4.5.

If L𝐿Litalic_L accepts an n𝑛nitalic_n-vertex tree of diameter at most n1/k/Δ(1+1/k)c2superscript𝑛1𝑘superscriptΔ11𝑘superscript𝑐2n^{1/k}/\Delta^{(1+1/k)c^{2}}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT / roman_Δ start_POSTSUPERSCRIPT ( 1 + 1 / italic_k ) italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT, then <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT has a chain of size k+1𝑘1k+1italic_k + 1.

References

  • [1] Karine Altisen, Stéphane Devismes, Swan Dubois, and Franck Petit. Introduction to Distributed Self-Stabilizing Algorithms. Synthesis Lectures on Distributed Computing Theory. Morgan & Claypool Publishers, 2019.
  • [2] Alkida Balliu, Sebastian Brandt, Yi-Jun Chang, Dennis Olivetti, Jan Studený, Jukka Suomela, and Aleksandr Tereshchenko. Locally checkable problems in rooted trees. Distributed Comput., 36(3):277–311, 2023.
  • [3] Alkida Balliu, Sebastian Brandt, Fabian Kuhn, Dennis Olivetti, and Gustav Schmid. On the node-averaged complexity of locally checkable problems on trees. In 37th International Symposium on Distributed Computing, DISC 2023, volume 281 of LIPIcs, pages 7:1–7:21, 2023.
  • [4] Alkida Balliu, Fabian Kuhn, and Dennis Olivetti. Improved distributed fractional coloring algorithms. In 25th International Conference on Principles of Distributed Systems, OPODIS 2021, volume 217, pages 18:1–18:23, 2021.
  • [5] Nicolas Bousquet, Louis Esperet, and François Pirot. Distributed algorithms for fractional coloring. In Structural Information and Communication Complexity - 28th International Colloquium, SIROCCO 2021, volume 12810, pages 15–30. Springer, 2021.
  • [6] Nicolas Bousquet, Laurent Feuilloley, and Sébastien Zeitoun. Local certification of local properties: Tight bounds, trade-offs and new parameters. In 41st International Symposium on Theoretical Aspects of Computer Science, STACS 2024, volume 289 of LIPIcs, pages 21:1–21:18, 2024.
  • [7] Yi-Jun Chang. The complexity landscape of distributed locally checkable problems on trees. In Hagit Attiya, editor, 34th International Symposium on Distributed Computing, DISC 2020, volume 179 of LIPIcs, pages 18:1–18:17, 2020.
  • [8] Yi-Jun Chang, Tsvi Kopelowitz, and Seth Pettie. An exponential separation between randomized and deterministic complexity in the LOCAL model. SIAM J. Comput., 48(1):122–143, 2019.
  • [9] Yi-Jun Chang and Seth Pettie. A time hierarchy theorem for the LOCAL model. SIAM J. Comput., 48(1):33–69, 2019.
  • [10] Laurent Feuilloley. Introduction to local certification. Discret. Math. Theor. Comput. Sci., 23(3), 2021.
  • [11] Henning Hasemann, Juho Hirvonen, Joel Rybicki, and Jukka Suomela. Deterministic local algorithms, unique identifiers, and fractional graph colouring. Theor. Comput. Sci., 610:204–217, 2016.
  • [12] Ted G Lewis. Network science: Theory and applications. John Wiley & Sons, 2011.
  • [13] Henrik Lievonen, Timothé Picavet, and Jukka Suomela. Distributed binary labeling problems in high-degree graphs. In Structural Information and Communication Complexity - 31st International Colloquium, SIROCCO 2024, volume 14662, pages 402–419, 2024.
  • [14] George B. Mertzios, Othon Michail, George Skretas, Paul G. Spirakis, and Michail Theofilatos. The complexity of growing a graph. In Algorithmics of Wireless Networks - 18th International Symposium on Algorithmics of Wireless Networks, ALGOSENSORS 2022, volume 13707, pages 123–137. Springer, 2022.
  • [15] Moni Naor and Larry J. Stockmeyer. What can be computed locally? In Proceedings of the Twenty-Fifth Annual ACM Symposium on Theory of Computing, pages 184–193. ACM, 1993.
  • [16] Péter Pál Pach, Gabriella Pluhár, András Pongrácz, and Csaba Szabó. The number of rooted trees of given depth. the electronic journal of combinatorics, pages P38–P38, 2013.
  • [17] Jukka Suomela. Using round elimination to understand locality. SIGACT News, 51(3):63–81, 2020.

Appendix A Further related work

Network science perspective

Network science has a long history of linking local and global properties of networks. A typical example are scale-free networks where the power-law degree distribution is related to clustering and small world phenomenon, and for which generative models have been introduced (such as preferential attachment). We refer to the book [12] for an introduction to the topic. In general, this perspective differs from ours in two ways: the properties considered are global (e.g. the degree distribution) thus cannot be checked locally, and the generative models are dynamic processes, while we study static processes (in other words, we are interested in maintaining a structure, not in creating it). Papers outside of network science also consider processes to “grow a graph”, see in particular [14].

Graph theory perspective

Graph theory also studies relations between local conditions and global behavior, in a more combinatorial way. For example, there is a wealth of works showing that forbidding small structures in a graph implies the existence of nice decompositions, of bounds on the coloring number etc. Another related direction are theorems à la Dirac: if all nodes have degree at least some function of the number of nodes, then the graph is Hamiltonian or connected. Again, this is quite different from our direction, in particular the diameter is not a topic of interest in this area.

Distributed computing perspective

We have already mentioned several works on LCLs, and how they are related to our paper. For completeness, let us also mention that the complexity landscape has also been studied in rooted trees [2] and in trees for node-averaged complexity [3]. The topic of checking the configuration of a network is central in self-stabilization [1], where it is essential to be able to detect inconsistencies in the computed data-structure, but not in the network topology, which differs from our work. A related field, that does study the network itself is local certification, where one considers labels helping the nodes to check given properties. (We refer to [10] for an introduction to the topic, and to [6] for a recent paper surveying the works related to graph structure.)

Appendix B Proofs of Section 2

B.1 Proof of Lemma 2.2

Using the notations of the definition, suppose that T𝑇Titalic_T and Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT are accepted by L𝐿Litalic_L, and consider the graft T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT of Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in T𝑇Titalic_T at (uv,uv)𝑢𝑣superscript𝑢superscript𝑣(uv,u^{\prime}v^{\prime})( italic_u italic_v , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ). We claim that each node w𝑤witalic_w of T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT has the same view as its copy in T𝑇Titalic_T or Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. Assume by symmetry that w𝑤witalic_w was in T𝑇Titalic_T, and root T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT at w𝑤witalic_w. Then its neighborhood at distance d𝑑ditalic_d in T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT consists in a copy of its neighborhood at distance d𝑑ditalic_d in T𝑇Titalic_T, except if it contains vsuperscript𝑣v^{\prime}italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. In that case, the subtree rooted at vsuperscript𝑣v^{\prime}italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is Tvsubscriptsuperscript𝑇superscript𝑣T^{\prime}_{v^{\prime}}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT. Recall that uv𝑢𝑣uvitalic_u italic_v (in T𝑇Titalic_T) and uvsuperscript𝑢superscript𝑣u^{\prime}v^{\prime}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT (in Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT) have the same view at distance d𝑑ditalic_d, hence the view of vsuperscript𝑣v^{\prime}italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in Tvsubscriptsuperscript𝑇superscript𝑣T^{\prime}_{v^{\prime}}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT and of v𝑣vitalic_v in Tvsubscript𝑇𝑣T_{v}italic_T start_POSTSUBSCRIPT italic_v end_POSTSUBSCRIPT at distance d1𝑑1d-1italic_d - 1 are the same. Thus the the view of w𝑤witalic_w in the subtree rooted at vsuperscript𝑣v^{\prime}italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT (in T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT) is the same as the view of subtree rooted at v𝑣vitalic_v (in T𝑇Titalic_T), hence it accepts. Therefore, T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT is accepted by L𝐿Litalic_L.

B.2 Proof of Lemma 2.3

Let us denote by C1,C2subscript𝐶1subscript𝐶2C_{1},C_{2}italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and C3subscript𝐶3C_{3}italic_C start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT the connected components of T{uv,xy}𝑇𝑢𝑣𝑥𝑦T\setminus\{uv,xy\}italic_T ∖ { italic_u italic_v , italic_x italic_y } containing respectively u𝑢uitalic_u for C1subscript𝐶1C_{1}italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, v𝑣vitalic_v and x𝑥xitalic_x for C2subscript𝐶2C_{2}italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and y𝑦yitalic_y for C3subscript𝐶3C_{3}italic_C start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT.

Let us now define an infinite collection of trees (Ti)isubscriptsubscript𝑇𝑖𝑖(T_{i})_{i\in\mathbb{N}}( italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_i ∈ blackboard_N end_POSTSUBSCRIPT such that, for every i𝑖iitalic_i, the diameter of Ti+1subscript𝑇𝑖1T_{i+1}italic_T start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT is larger than the one of Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and the size of Ti+1subscript𝑇𝑖1T_{i+1}italic_T start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT is the size of Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT plus the size of C2subscript𝐶2C_{2}italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT.

We set T1=Tsubscript𝑇1𝑇T_{1}=Titalic_T start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = italic_T. We define T2subscript𝑇2T_{2}italic_T start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT as the tree obtained by grafting T𝑇Titalic_T in T𝑇Titalic_T at (xy,uv)𝑥𝑦𝑢𝑣(xy,uv)( italic_x italic_y , italic_u italic_v ). Note that, abusing notations, the resulting tree T2subscript𝑇2T_{2}italic_T start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT contains the three following edges: uv𝑢𝑣uvitalic_u italic_v (in one of the trees T𝑇Titalic_T), xv𝑥𝑣xvitalic_x italic_v (corresponding to x𝑥xitalic_x in the first T𝑇Titalic_T and v𝑣vitalic_v in the second) and xy𝑥𝑦xyitalic_x italic_y (in the second tree). We denote by x2y2subscript𝑥2subscript𝑦2x_{2}y_{2}italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_y start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT the edge xy𝑥𝑦xyitalic_x italic_y. Now let i3𝑖3i\geq 3italic_i ≥ 3. and we define Ti+1subscript𝑇𝑖1T_{i+1}italic_T start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT as the tree obtained by grafting T𝑇Titalic_T in Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT at (x2y2,uv)subscript𝑥2subscript𝑦2𝑢𝑣(x_{2}y_{2},uv)( italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_y start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_u italic_v ). Observe that this operation creates a new copy of xy𝑥𝑦xyitalic_x italic_y in Ti+1subscript𝑇𝑖1T_{i+1}italic_T start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT that we denote by xi+1yy+1subscript𝑥𝑖1subscript𝑦𝑦1x_{i+1}y_{y+1}italic_x start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT italic_y start_POSTSUBSCRIPT italic_y + 1 end_POSTSUBSCRIPT (lying in the part of T𝑇Titalic_T that is added to Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT). By Lemma 2.2, each Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is accepted by L𝐿Litalic_L.

The conclusion follows from the fact that Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT has at most |T|+(i1)|C2|𝑇𝑖1subscript𝐶2|T|+(i-1)\cdot|C_{2}|| italic_T | + ( italic_i - 1 ) ⋅ | italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT | nodes and diameter at least idT(x,v)𝑖subscript𝑑𝑇𝑥𝑣i\cdot d_{T}(x,v)italic_i ⋅ italic_d start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT ( italic_x , italic_v ).

Appendix C Proof of Lemma 3.1

Consider a local checker that can see at distance d+1𝑑1d+1italic_d + 1. In particular, a vertex u𝑢uitalic_u can see all the neighbors of all its neighbors at distance at most d𝑑ditalic_d. The vertex u𝑢uitalic_u can then iteratively remove all the leaves d𝑑ditalic_d times. After all these deletions, if the vertex is not eliminated, it should have at most 2222 neighbors (otherwise it rejects) which are its (at most) two neighbors on the backbone. This proves the first and second points.

Let us denote by Tusubscript𝑇𝑢T_{u}italic_T start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT the view of u𝑢uitalic_u rooted at u𝑢uitalic_u where the subtrees rooted on the neighbors of u𝑢uitalic_u in the backbone are removed. The vertex u𝑢uitalic_u first checks its degree in Tusubscript𝑇𝑢T_{u}italic_T start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT and checks that it is coherent with the degree of its neighbors on the backbone (if it has degree 1111 mod 3333, its two neighbors must have degree 00 and 2222).

After removing leaves attached to u𝑢uitalic_u in Tusubscript𝑇𝑢T_{u}italic_T start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT in order to reach a degree 00 mod 3333, the vertex u𝑢uitalic_u can check that its pending subtrees can be partitioned into three copies of the same forest in order to determine its letter. Since it sees at distance d+1𝑑1d+1italic_d + 1 it can run a similar process to determine the letter of its neighbor. Note that this is not completely immediate since, even if it sees the trees of depth d𝑑ditalic_d rooted on its neighbors it cannot check that leaves are indeed leaves. However, after the removal of 0, 1 or 2 attached leaves on its neighbor, the attached trees must consist of three times the same forest plus an additional tree that corresponds to the beginning of the subtree attached on the neighbor at distance 2222 on the backbone. In particular the degree is equal to 1111 modulo 3333. So after grouping the trees three by three, it only remains one tree which corresponding to the rest of the backbone. Removing it allows u𝑢uitalic_u to know the tree associated with its neighbor, and thus its letter, which completes the proof of the fourth point.

For the endpoints of the backbone, there is only one long path attached to them, which can indeed be easily determined. This proves the third point.

Appendix D Consequences on generalized LCL – Proof of Corollary 1.8

See 1.8

Let us first discuss slight modifications of the checkers we have manipulated to get our upper bounds in Section 3.3. We will prove that we can modify checkers to ensure that if our original special checker L𝐿Litalic_L accepts a tree T[w]𝑇delimited-[]𝑤T[w]italic_T [ italic_w ], then the modified checker accepts all the trees T[w]𝑇delimited-[]superscript𝑤T[w^{\prime}]italic_T [ italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ] where wsuperscript𝑤w^{\prime}italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is obtained from w𝑤witalic_w by repeating a constant number of times some letters.

Let k1𝑘1k\geq 1italic_k ≥ 1. A word Wsuperscript𝑊W^{\prime}italic_W start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is a k𝑘kitalic_k-subdivision of W=a1an𝑊subscript𝑎1subscript𝑎𝑛W=a_{1}\cdots a_{n}italic_W = italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT if it is a subword of a1kanksuperscriptsubscript𝑎1𝑘superscriptsubscript𝑎𝑛𝑘a_{1}^{k}\cdots a_{n}^{k}italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT ⋯ italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT and it contains W𝑊Witalic_W as a subword. The k𝑘kitalic_k-subdivision of a language S𝑆Sitalic_S is the language of all the k𝑘kitalic_k-subdivisions of words of S𝑆Sitalic_S. (Note that S𝑆Sitalic_S is the 1111-subdivision of S𝑆Sitalic_S). Corollary 1.8 relies on the fact that k𝑘kitalic_k-subdivision preserves recognition by special local checkers, up to increasing the checkability radius.

Claim 1.

Let rk2𝑟𝑘2r\geq k\geq 2italic_r ≥ italic_k ≥ 2 and Lc,d𝐿subscriptsuperscript𝑐𝑑L\in\mathcal{L}^{*}_{c,d}italic_L ∈ caligraphic_L start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT accepting a r𝑟ritalic_r-testable language S𝑆Sitalic_S such that no word of S𝑆Sitalic_S has identical consecutive letters. Then there is a special local checker Lsuperscript𝐿L^{*}italic_L start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT in c,d+rksubscriptsuperscript𝑐𝑑𝑟𝑘\mathcal{L}^{*}_{c,d+rk}caligraphic_L start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_c , italic_d + italic_r italic_k end_POSTSUBSCRIPT accepting the k𝑘kitalic_k-subdivision of S𝑆Sitalic_S.

Proof D.1.

We consider the same checker L𝐿Litalic_L with slight modifications. Each node u𝑢uitalic_u now can recover all letters at distance kr1𝑘𝑟1kr-1italic_k italic_r - 1, and remove all the repetitions it sees. Since no word of S𝑆Sitalic_S has identical consecutive letters, and each can be repeated at most k𝑘kitalic_k times in the subdivision, u𝑢uitalic_u now has access to the letters at distance r1𝑟1r-1italic_r - 1 from it in the un-subdivided word and run the verification process from L𝐿Litalic_L (since S𝑆Sitalic_S is r𝑟ritalic_r-testable).

We may now proceed with the proof of Corollary 1.8.

Proof D.2 (Proof of Corollary 1.8).

Let us now consider the languages L1subscript𝐿1L_{1}italic_L start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of the previous sections which are 2222-testable. Note that there is no repetition of letters in neither L1subscript𝐿1L_{1}italic_L start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT nor L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. By Claim 1, there is a special checker that can recognize their 2222-subdivisions.

Now, we define a generalized-LCL, which is a generalization of 2222-coloring, in the following way. Each node must choose an output that is either 0, 1, or empty. The verification algorithm checking the correctness of the output is the following. On a node v𝑣vitalic_v,

  • The output of all the vertices that are not in the backbone is empty while all the vertices in the backbone should output 00 or 1111.

  • If v𝑣vitalic_v outputs 00 or 1111, it cannot have a neighbor with the same output (i.e. the non-empty output labels define a 2-coloring.)

We claim that in the trees accepted by the modified local checker, this is a global problem. Consider two nodes at the endpoints of the maximum path, and suppose they have a view asymptotically smaller than the diameter. Now, these nodes cannot recover the middle of the word encoded by the tree. In this middle part of the word, either delete a letter that was repeated or delete a repetition. This leads to a new tree, where the endpoints of the backbone have still the same view, hence should output the same. The 2222-colorings of one of the two trees must be incorrect, which is a contradiction.

Finally note that in the proof above, we have decided to increase a bit the checkability radius of the local checker. If we allow oursleves to have two input colors, then we can keep the same radius. In the instances we consider, all nodes will have input 0, except possibly the first node of the backbone which can have either 0 or 1. Then we enforce that first node should have the same input and output label. Since the nodes on the other side of the tree do not know about this input, 2-coloring is again a global problem.

Appendix E Proofs of Section 4

E.1 Proof of Lemma 4.1

Constructing inductively a k𝑘kitalic_k-rake by choosing each time a path P𝑃Pitalic_P on \ellroman_ℓ vertices, we obtain a k𝑘kitalic_k-rake with ksuperscript𝑘\ell^{k}roman_ℓ start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT vertices and of diameter k𝑘k\ellitalic_k roman_ℓ. Hence the class of k𝑘kitalic_k-rakes has minimum diameter O(n1/k)𝑂superscript𝑛1𝑘O(n^{1/k})italic_O ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ). This bound is actually tight: this is clear for 1111-rakes. For k2𝑘2k\geq 2italic_k ≥ 2, let R𝑅Ritalic_R be a k𝑘kitalic_k-rake and P𝑃Pitalic_P be a path whose deletion leaves a collection of (k1)𝑘1(k-1)( italic_k - 1 )-rakes. If P𝑃Pitalic_P has length at least n1/ksuperscript𝑛1𝑘n^{1/k}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT, the conclusion follows. So we can assume that |P|<n1/k𝑃superscript𝑛1𝑘|P|<n^{1/k}| italic_P | < italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT. Since RP𝑅𝑃R\setminus Pitalic_R ∖ italic_P contains at most |P|𝑃|P|| italic_P | connected components, one of the (k1)𝑘1(k-1)( italic_k - 1 )-rakes has size at least n(k1)/ksuperscript𝑛𝑘1𝑘n^{(k-1)/k}italic_n start_POSTSUPERSCRIPT ( italic_k - 1 ) / italic_k end_POSTSUPERSCRIPT. And by induction hypothesis, such a (k1)𝑘1(k-1)( italic_k - 1 )-rake has diameter at least n1/ksuperscript𝑛1𝑘n^{1/k}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT.

Let us now prove that for every k>0𝑘0k>0italic_k > 0, there exists a local checker L3k,1𝐿subscript3𝑘1L\in\mathcal{L}_{3k,1}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT 3 italic_k , 1 end_POSTSUBSCRIPT accepting exactly the class of k𝑘kitalic_k-rakes as long as c3k𝑐3𝑘c\geq 3kitalic_c ≥ 3 italic_k. The 3k3𝑘3k3 italic_k colors will be represented as pairs of integers (i,j)𝑖𝑗(i,j)( italic_i , italic_j ) with 1ik1𝑖𝑘1\leqslant i\leqslant k1 ⩽ italic_i ⩽ italic_k and j{1,2,3}𝑗123j\in\{1,2,3\}italic_j ∈ { 1 , 2 , 3 }. Each node checks that it has degree at most three. Moreover each node of color (i,j)𝑖𝑗(i,j)( italic_i , italic_j ) checks that it has a neighbor (i+1,1)𝑖11(i+1,1)( italic_i + 1 , 1 ) (if i<k𝑖𝑘i<kitalic_i < italic_k) and that its other neighbors have colors either (i,j1mod3)𝑖modulo𝑗13(i,j-1\mod 3)( italic_i , italic_j - 1 roman_mod 3 ) and (i,j+1mod3)𝑖modulo𝑗13(i,j+1\mod 3)( italic_i , italic_j + 1 roman_mod 3 ), or (i,j+1mod3)𝑖modulo𝑗13(i,j+1\mod 3)( italic_i , italic_j + 1 roman_mod 3 ) and (i1,)𝑖1(i-1,*)( italic_i - 1 , ∗ ) or only (i,j1mod3)𝑖modulo𝑗13(i,j-1\mod 3)( italic_i , italic_j - 1 roman_mod 3 ).

E.2 <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT is transitive

Assume that (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) and (d1,d2)<L(e1,e2)subscript𝐿subscript𝑑1subscript𝑑2subscript𝑒1subscript𝑒2(d_{1},d_{2})<_{L}(e_{1},e_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_e start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_e start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ). Denote by T,T𝑇superscript𝑇T,T^{\prime}italic_T , italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT the (rooted) trees that witness the relation (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) (resp. (d1,d2)<L(e1,e2)subscript𝐿subscript𝑑1subscript𝑑2subscript𝑒1subscript𝑒2(d_{1},d_{2})<_{L}(e_{1},e_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_e start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_e start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT )). In particular, T𝑇Titalic_T contains two arcs u1u2,v1v2subscript𝑢1subscript𝑢2subscript𝑣1subscript𝑣2u_{1}u_{2},v_{1}v_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of colors (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) and an arc w1w2subscript𝑤1subscript𝑤2w_{1}w_{2}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of colors (d1,d2)subscript𝑑1subscript𝑑2(d_{1},d_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ), and Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT contains the arcs x1x2,y1y2subscript𝑥1subscript𝑥2subscript𝑦1subscript𝑦2x_{1}x_{2},y_{1}y_{2}italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_y start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_y start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of colors (d1,d2)subscript𝑑1subscript𝑑2(d_{1},d_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) and z1z2subscript𝑧1subscript𝑧2z_{1}z_{2}italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_z start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of color (e1,e2)subscript𝑒1subscript𝑒2(e_{1},e_{2})( italic_e start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_e start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) with the ancestor relation of the definition of <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT.

Construct the tree T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT by grafting Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in T𝑇Titalic_T at (x1x2,w1w2)subscript𝑥1subscript𝑥2subscript𝑤1subscript𝑤2(x_{1}x_{2},w_{1}w_{2})( italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ). By Lemma 2.2, T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT is accepted by L𝐿Litalic_L. Moreover, by construction of T′′superscript𝑇′′T^{\prime\prime}italic_T start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT, the copy of u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is an ancestor of z1subscript𝑧1z_{1}italic_z start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT but not v2subscript𝑣2v_{2}italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, hence (c1,c2)<L(e1,e2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑒1subscript𝑒2(c_{1},c_{2})<_{L}(e_{1},e_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_e start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_e start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ).

E.3 The logarithmic case

If <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT is not a strict partial order, since it is transitive, there must be a pair of colors (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) such that (c1,c2)<L(c1,c2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑐1subscript𝑐2(c_{1},c_{2})<_{L}(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ). In particular there is a rooted tree T𝑇Titalic_T with three arcs u1u2,v1v2,w1w2subscript𝑢1subscript𝑢2subscript𝑣1subscript𝑣2subscript𝑤1subscript𝑤2u_{1}u_{2},v_{1}v_{2},w_{1}w_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, all of colors (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) such that u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is an ancestor of v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and w1subscript𝑤1w_{1}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT but v2,w2subscript𝑣2subscript𝑤2v_{2},w_{2}italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are not ancestors of each other.

Refer to caption
Figure 4: Illustration of the proof of Appendix E.3. The trees T1subscript𝑇1T_{1}italic_T start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and T2subscript𝑇2T_{2}italic_T start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are depicted.

From T𝑇Titalic_T, we construct a sequence of trees (Ti)isubscriptsubscript𝑇𝑖𝑖(T_{i})_{i}( italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT that look like binary complete trees. Each Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT will contain 2isuperscript2𝑖2^{i}2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT copies of the subtrees of T𝑇Titalic_T rooted at u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. Let T1=Tsubscript𝑇1𝑇T_{1}=Titalic_T start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = italic_T and define Ti+1subscript𝑇𝑖1T_{i+1}italic_T start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT by successively grafting T𝑇Titalic_T in Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT at (xy,u1u2)𝑥𝑦subscript𝑢1subscript𝑢2(xy,u_{1}u_{2})( italic_x italic_y , italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ), where xy𝑥𝑦xyitalic_x italic_y runs across all 2isuperscript2𝑖2^{i}2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT copies of v1v2subscript𝑣1subscript𝑣2v_{1}v_{2}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT or w1w2subscript𝑤1subscript𝑤2w_{1}w_{2}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT in Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. Observe that L𝐿Litalic_L accepts each Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT by Lemma 2.2 (see Figure 4 for an illustration). Moreover, the diameter of Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT increases by a constant (at least one and at most the diameter of T𝑇Titalic_T) compared to Ti1subscript𝑇𝑖1T_{i-1}italic_T start_POSTSUBSCRIPT italic_i - 1 end_POSTSUBSCRIPT and the number of nodes increases by at least 2isuperscript2𝑖2^{i}2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT and at most |T|2i𝑇superscript2𝑖|T|2^{i}| italic_T | 2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT. Thus Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT has diameter Θ(i)Θ𝑖\Theta(i)roman_Θ ( italic_i ) and Θ(2i)Θsuperscript2𝑖\Theta(2^{i})roman_Θ ( 2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ) nodes, which concludes.

E.4 Proof of Lemma 4.4

We basically show that if <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT has a chain of size k𝑘kitalic_k, then L𝐿Litalic_L accepts trees with a k𝑘kitalic_k-rake-like structure, hence its minimum diameter is O(n1/k)𝑂superscript𝑛1𝑘O(n^{1/k})italic_O ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ).

Consider a chain of k𝑘kitalic_k pairs of colors (c1,c1)<L<L(ck,ck)subscript𝐿subscript𝑐1subscriptsuperscript𝑐1subscript𝐿subscript𝑐𝑘subscriptsuperscript𝑐𝑘(c_{1},c^{\prime}_{1})<_{L}\cdots<_{L}(c_{k},c^{\prime}_{k})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ⋯ < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ). Denote by T(i)superscript𝑇𝑖T^{(i)}italic_T start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT a rooted tree and u1(i)u2(i),v1(i)v2(i),w1(i)w2(i)superscriptsubscript𝑢1𝑖superscriptsubscript𝑢2𝑖superscriptsubscript𝑣1𝑖superscriptsubscript𝑣2𝑖superscriptsubscript𝑤1𝑖superscriptsubscript𝑤2𝑖u_{1}^{(i)}u_{2}^{(i)},v_{1}^{(i)}v_{2}^{(i)},w_{1}^{(i)}w_{2}^{(i)}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT , italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT its vertices witnessing that (ci,ci)<L(ci+1,ci+1)subscript𝐿subscript𝑐𝑖subscriptsuperscript𝑐𝑖subscript𝑐𝑖1subscriptsuperscript𝑐𝑖1(c_{i},c^{\prime}_{i})<_{L}(c_{i+1},c^{\prime}_{i+1})( italic_c start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_c start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT ). Finally, let T(k)superscript𝑇𝑘T^{(k)}italic_T start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT be a tree witnessing that (ck,ck)subscript𝑐𝑘subscriptsuperscript𝑐𝑘(c_{k},c^{\prime}_{k})( italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ) is useful, that is T(k)superscript𝑇𝑘T^{(k)}italic_T start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT contains a path between two edges u1(k)u2(k)superscriptsubscript𝑢1𝑘superscriptsubscript𝑢2𝑘u_{1}^{(k)}u_{2}^{(k)}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT and v1(k)v2(k)superscriptsubscript𝑣1𝑘superscriptsubscript𝑣2𝑘v_{1}^{(k)}v_{2}^{(k)}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT of colors (ck,ck)subscript𝑐𝑘subscriptsuperscript𝑐𝑘(c_{k},c^{\prime}_{k})( italic_c start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ).

Refer to caption
Figure 5: The construction of U(i)superscript𝑈𝑖U^{(i)}italic_U start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT from T(i)superscript𝑇𝑖T^{(i)}italic_T start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT (some exponents have been removed for readability).

Let N>0𝑁0N>0italic_N > 0. For every i𝑖iitalic_i, we start by grafting T(i)superscript𝑇𝑖T^{(i)}italic_T start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT in T(i)superscript𝑇𝑖T^{(i)}italic_T start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT at (v1(i)v2(i),u1(i)u2(i))superscriptsubscript𝑣1𝑖superscriptsubscript𝑣2𝑖superscriptsubscript𝑢1𝑖superscriptsubscript𝑢2𝑖(v_{1}^{(i)}v_{2}^{(i)},u_{1}^{(i)}u_{2}^{(i)})( italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT , italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ) N𝑁Nitalic_N times, as in the proof of Lemma 2.3 (see Figure 5). This yields a tree U(i)superscript𝑈𝑖U^{(i)}italic_U start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT containing a copy of the edge u1(i)u2(i)superscriptsubscript𝑢1𝑖superscriptsubscript𝑢2𝑖u_{1}^{(i)}u_{2}^{(i)}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT of T(i)superscript𝑇𝑖T^{(i)}italic_T start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT and N𝑁Nitalic_N copies of w1(i)w2(i)superscriptsubscript𝑤1𝑖superscriptsubscript𝑤2𝑖w_{1}^{(i)}w_{2}^{(i)}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT, that is still accepted by L𝐿Litalic_L by Lemma 2.2.

Refer to caption
Figure 6: The graph S(k1)superscript𝑆𝑘1S^{(k-1)}italic_S start_POSTSUPERSCRIPT ( italic_k - 1 ) end_POSTSUPERSCRIPT built from S(k)superscript𝑆𝑘S^{(k)}italic_S start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT. The graph Uu1(k)(k)subscriptsuperscript𝑈𝑘superscriptsubscript𝑢1𝑘U^{(k)}_{u_{1}^{(k)}}italic_U start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT end_POSTSUBSCRIPT is the one of Figure 5.

Set S(k):=U(k)assignsuperscript𝑆𝑘superscript𝑈𝑘S^{(k)}:=U^{(k)}italic_S start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT := italic_U start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT and for i=k1𝑖𝑘1i=k-1italic_i = italic_k - 1 down to 1111 define S(i)superscript𝑆𝑖S^{(i)}italic_S start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT as the tree obtained by successively grafting S(i+1)superscript𝑆𝑖1S^{(i+1)}italic_S start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT in U(i)superscript𝑈𝑖U^{(i)}italic_U start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT at (u1(i+1)u2(i+1),xy)superscriptsubscript𝑢1𝑖1superscriptsubscript𝑢2𝑖1𝑥𝑦(u_{1}^{(i+1)}u_{2}^{(i+1)},xy)( italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT , italic_x italic_y ) where xy𝑥𝑦xyitalic_x italic_y ranges across the N𝑁Nitalic_N copies of w1(i)w2(i)superscriptsubscript𝑤1𝑖superscriptsubscript𝑤2𝑖w_{1}^{(i)}w_{2}^{(i)}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT in U(i)superscript𝑈𝑖U^{(i)}italic_U start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT (see Figure 6. By Lemma 2.2, all these trees are accepted by L𝐿Litalic_L.

For large enough N𝑁Nitalic_N, each U(i)superscript𝑈𝑖U^{(i)}italic_U start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT has diameter and size Θ(N)Θ𝑁\Theta(N)roman_Θ ( italic_N ). Therefore, when constructing S(i)superscript𝑆𝑖S^{(i)}italic_S start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT from S(i+1)superscript𝑆𝑖1S^{(i+1)}italic_S start_POSTSUPERSCRIPT ( italic_i + 1 ) end_POSTSUPERSCRIPT, the number of nodes is multiplied by Θ(N)Θ𝑁\Theta(N)roman_Θ ( italic_N ) while the diameter increases by an additional Θ(N)Θ𝑁\Theta(N)roman_Θ ( italic_N ). In particular, S(i)superscript𝑆𝑖S^{(i)}italic_S start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT has diameter Θ((ki+1)N)Θ𝑘𝑖1𝑁\Theta((k-i+1)\cdot N)roman_Θ ( ( italic_k - italic_i + 1 ) ⋅ italic_N ) and contains Θ(Nki+1)Θsuperscript𝑁𝑘𝑖1\Theta(N^{k-i+1})roman_Θ ( italic_N start_POSTSUPERSCRIPT italic_k - italic_i + 1 end_POSTSUPERSCRIPT ) vertices. Taking i=1𝑖1i=1italic_i = 1 proves that L𝐿Litalic_L has minimum diameter at most O(n1/k)𝑂superscript𝑛1𝑘O(n^{1/k})italic_O ( italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT ).

E.5 Proof of Lemma 4.5

We prove by induction a slightly stronger and technical statement: if L𝐿Litalic_L accepts an arbitrarily tree with an n𝑛nitalic_n-vertex (possibly non-rooted) subtree T𝑇Titalic_T of diameter less than n1/k/Δ(1+1/k)c2superscript𝑛1𝑘superscriptΔ11𝑘superscript𝑐2n^{1/k}/\Delta^{(1+1/k)c^{2}}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT / roman_Δ start_POSTSUPERSCRIPT ( 1 + 1 / italic_k ) italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT, then T𝑇Titalic_T contains an edge whose pair of colors is smaller than k𝑘kitalic_k other useful pairs (for <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT).

Assume that there is a tree accepted by L𝐿Litalic_L with an n𝑛nitalic_n-vertex subtree T𝑇Titalic_T of diameter less than n1/k/Δ(1+1/k)c2superscript𝑛1𝑘superscriptΔ11𝑘superscript𝑐2n^{1/k}/\Delta^{(1+1/k)c^{2}}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT / roman_Δ start_POSTSUPERSCRIPT ( 1 + 1 / italic_k ) italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT. Root T𝑇Titalic_T arbitrarily. We construct an auxiliary tree Tfsubscript𝑇𝑓T_{f}italic_T start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT, starting with Tf:=Tassignsubscript𝑇𝑓𝑇T_{f}:=Titalic_T start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT := italic_T and successively modifying it as follows. For each pair of colors (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) (by increasing order of <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT), while there exists a branch going through two arcs u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and v1v2subscript𝑣1subscript𝑣2v_{1}v_{2}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT with ui,visubscript𝑢𝑖subscript𝑣𝑖u_{i},v_{i}italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT colored with cisubscript𝑐𝑖c_{i}italic_c start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, we assume that u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and v1v2subscript𝑣1subscript𝑣2v_{1}v_{2}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT are respectively the closest and furthest to the root among all arcs of the branch with these colors, and we graft at u1subscript𝑢1u_{1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT in T𝑇Titalic_T the subtree of T𝑇Titalic_T rooted at v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT. Observe that each time this operation is applied, some vertices, namely the descendants of u1subscript𝑢1u_{1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT but not of v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, are deleted from T𝑇Titalic_T. Denote by Tfsubscript𝑇𝑓T_{f}italic_T start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT the tree obtained after this process is finished, and observe that Tfsubscript𝑇𝑓T_{f}italic_T start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT has height at most c2superscript𝑐2c^{2}italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT since no two pairs of colors can repeat on edges of the same branch. In particular, Tfsubscript𝑇𝑓T_{f}italic_T start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT has at most Δc2superscriptΔsuperscript𝑐2\Delta^{c^{2}}roman_Δ start_POSTSUPERSCRIPT italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT nodes.

Since we considered the pairs of colors by increasing order of <Lsubscript𝐿<_{L}< start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT, due to the choice of u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT as closest to the root, all the vertices chosen as u1subscript𝑢1u_{1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT at some point during this process are chosen only once, and moreover they cannot be deleted afterwards. In other words, each deleted vertex of T𝑇Titalic_T can be associated with an arc u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of Tfsubscript𝑇𝑓T_{f}italic_T start_POSTSUBSCRIPT italic_f end_POSTSUBSCRIPT. By the pigeonhole principle, there is one arc u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT associated with at least n/Δc2𝑛superscriptΔsuperscript𝑐2n/\Delta^{c^{2}}italic_n / roman_Δ start_POSTSUPERSCRIPT italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT deleted nodes.

Consider the branch b𝑏bitalic_b and its arc v1v2subscript𝑣1subscript𝑣2v_{1}v_{2}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT chosen when u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT was selected. Observe that the distance between u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT is less than n1/k/Δ(1+1/k)c2superscript𝑛1𝑘superscriptΔ11𝑘superscript𝑐2n^{1/k}/\Delta^{(1+1/k)c^{2}}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT / roman_Δ start_POSTSUPERSCRIPT ( 1 + 1 / italic_k ) italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT, hence one of the trees Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT pending from b𝑏bitalic_b whose root is between u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT has size more than n=n11/kΔc2/ksuperscript𝑛superscript𝑛11𝑘superscriptΔsuperscript𝑐2𝑘n^{\prime}=n^{1-1/k}\cdot\Delta^{c^{2}/k}italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = italic_n start_POSTSUPERSCRIPT 1 - 1 / italic_k end_POSTSUPERSCRIPT ⋅ roman_Δ start_POSTSUPERSCRIPT italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / italic_k end_POSTSUPERSCRIPT.

First assume that k>1𝑘1k>1italic_k > 1. Note that Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT has diameter less than n1/k/Δ(1+1/k)c2n1/(k1)/Δ(1+1/(k1))c2superscript𝑛1𝑘superscriptΔ11𝑘superscript𝑐2superscriptsuperscript𝑛1𝑘1superscriptΔ11𝑘1superscript𝑐2n^{1/k}/\Delta^{(1+1/k)c^{2}}\leqslant{n^{\prime}}^{1/(k-1)}/\Delta^{(1+1/(k-1% ))c^{2}}italic_n start_POSTSUPERSCRIPT 1 / italic_k end_POSTSUPERSCRIPT / roman_Δ start_POSTSUPERSCRIPT ( 1 + 1 / italic_k ) italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT ⩽ italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUPERSCRIPT 1 / ( italic_k - 1 ) end_POSTSUPERSCRIPT / roman_Δ start_POSTSUPERSCRIPT ( 1 + 1 / ( italic_k - 1 ) ) italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT. By induction, Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT contains an arc w1w2subscript𝑤1subscript𝑤2w_{1}w_{2}italic_w start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT whose pair of colors (d1,d2)subscript𝑑1subscript𝑑2(d_{1},d_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) is smaller than k1𝑘1k-1italic_k - 1 other pairs. Denoting by (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) the colors of u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, we get that (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ), hence (c1,c2)subscript𝑐1subscript𝑐2(c_{1},c_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) is smaller than k𝑘kitalic_k other useful pairs, which concludes the induction.

We may thus assume that k=1𝑘1k=1italic_k = 1. Since nΔc2superscript𝑛superscriptΔsuperscript𝑐2n^{\prime}\geqslant\Delta^{c^{2}}italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ⩾ roman_Δ start_POSTSUPERSCRIPT italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT, Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT must have depth at least c2superscript𝑐2c^{2}italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT. On a longest branch, some pair of colors (d1,d2)subscript𝑑1subscript𝑑2(d_{1},d_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) must be repeated. Hence (d1,d2)subscript𝑑1subscript𝑑2(d_{1},d_{2})( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) is useful and (c1,c2)<L(d1,d2)subscript𝐿subscript𝑐1subscript𝑐2subscript𝑑1subscript𝑑2(c_{1},c_{2})<_{L}(d_{1},d_{2})( italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) < start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT ( italic_d start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_d start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ), which concludes.

Appendix F Restricting the expressivity: degree-myopic local checkers

This section is devoted to the proof of Theorem 1.10.

See 1.10

The proof follows a two-step approach: first, we restrict the possible values for the parameters ai,bisubscript𝑎𝑖subscript𝑏𝑖a_{i},b_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_b start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT’s, by discarding values that either yield degree-myopic checkers with constant or linear maximum diameter or can be modified without changing the maximum diameter. For example, each tree contains leaves, hence we must have bleaves1subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠1b_{leaves}\geq 1italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT ≥ 1. Then, we classify the possible diameter depending on the remaining free parameters.

F.1 Structural properties

First, we note that similarly to what happened earlier in the paper, the regimes O(1)𝑂1O(1)italic_O ( 1 ) and Ω(n)Ω𝑛\Omega(n)roman_Ω ( italic_n ) are uninteresting. It is easy to find degree-myopic local checkers in these regimes: a checker where non-leaf nodes can only see leaves leads to stars; and a checker where every non-leaf node accepts only two neighbors of equal-degree leads to paths. Therefore, we focus on the set of degree-myopic local checkers whose maximum diameter lies between ω(1)𝜔1\omega(1)italic_ω ( 1 ) and o(n)𝑜𝑛o(n)italic_o ( italic_n ), that we denote by \mathcal{M}{}caligraphic_M. And prove a series of claims on that set.

Claim 2.

For any local checker in \mathcal{M}{}caligraphic_M, we must have aDegree+1=0subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒10a_{Degree+1}=0italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT = 0.

Proof F.1.

Consider a tree accepted by a local checker with aDegree+1>0subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒10a_{Degree+1}>0italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT > 0. Since it is finite, then there is a node v𝑣vitalic_v of maximum degree ΔΔ\Deltaroman_Δ. If Δ=1Δ1\Delta=1roman_Δ = 1, then the tree has only leaves, thus it has one or two nodes. Since the local checker is in \mathcal{M}{}caligraphic_M there must be trees with Δ>1Δ1\Delta>1roman_Δ > 1. In that case, v𝑣vitalic_v should have at least aDegree+11subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒11a_{Degree+1}\geq 1italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT ≥ 1 neighbors of degree Δ+1Δ1\Delta+1roman_Δ + 1, a contradiction.

The following results make great use of the grafting operation (Definition 2.1 in Section 2). In our restricted setting, Lemmas 2.2 and 2.3 still hold, where the view of an edge is given by the degrees of its endpoints. Note that in particular, the trees recognized by local checkers in \mathcal{M}caligraphic_M cannot contain any path between edges with the same view. We first use this idea to get rid of the equal-degree type.

Claim 3.

There cannot be a path u1,u2,,v1,v2subscript𝑢1subscript𝑢2subscript𝑣1subscript𝑣2u_{1},u_{2},\ldots,v_{1},v_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , … , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT with deg(u1)=deg(u2)degreesubscript𝑢1degreesubscript𝑢2\deg(u_{1})=\deg(u_{2})roman_deg ( italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) = roman_deg ( italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) and deg(v1)=deg(v2)degreesubscript𝑣1degreesubscript𝑣2\deg(v_{1})=\deg(v_{2})roman_deg ( italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) = roman_deg ( italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) in a tree accepted by some L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M.

Proof F.2.

Assume that a tree T𝑇Titalic_T accepted by L𝐿Litalic_L contains such a path. Now graft T𝑇Titalic_T in T𝑇Titalic_T at (v1v2,v2v1)subscript𝑣1subscript𝑣2subscript𝑣2subscript𝑣1(v_{1}v_{2},v_{2}v_{1})( italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ). By Lemma 2.2, the new tree Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is accepted by L𝐿Litalic_L. Moreover, Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT contains two copies of the edge u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, call the second one u1u2subscriptsuperscript𝑢1subscriptsuperscript𝑢2u^{\prime}_{1}u^{\prime}_{2}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. These two edges have the same view, hence one can apply Lemma 2.3 to construct trees of linear diameter accepted by L𝐿Litalic_L, a contradiction.

Using this result, we can already restrict the study to checkers L𝐿L\in\mathcal{M}italic_L ∈ caligraphic_M with aEqualdegree=bEqualdegree=0subscript𝑎𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒subscript𝑏𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒0a_{Equal-degree}=b_{Equal-degree}=0italic_a start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = italic_b start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = 0. Indeed, by Claim 3, all accepted trees only use the equal-degree case at most once, hence necessarily aEqualdegree=0subscript𝑎𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒0a_{Equal-degree}=0italic_a start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = 0. Then for every such tree T𝑇Titalic_T, we cut the equal-degree edge, keep only half of the tree (the one with largest diameter), and fix it in the following way. We replace the cut edge by an edge to a leaf, and create Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. Observe that Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is accepted by the checker Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT which is the same as L𝐿Litalic_L, except that bleavessubscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT is increased by 1, and bEqualdegree=0subscript𝑏𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒0b_{Equal-degree}=0italic_b start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = 0. It is thus sufficient to prove Theorem 1.10 for Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT.

From now on, we consider only checkers in \mathcal{M}caligraphic_M with aEqualdegree=bEqualdegree=0subscript𝑎𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒subscript𝑏𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒0a_{Equal-degree}=b_{Equal-degree}=0italic_a start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = italic_b start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = 0.

Claim 4.

For any local checker in \mathcal{M}{}caligraphic_M, bDegree11subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree-1}\geq 1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT ≥ 1 and bDegree+11subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree+1}\geq 1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT ≥ 1.

Proof F.3.

Since the checker is in \mathcal{M}{}caligraphic_M, there must be at least two non-leaf nodes in at least one accepted tree. Consider two such non-leaf nodes u𝑢uitalic_u and v𝑣vitalic_v, and w.l.o.g. take them to be adjacent. Since in our restricted setting, we only allow two adjacent non-leaf nodes to have a degree difference of exactly 1, it must be that, up to symmetry, v𝑣vitalic_v is categorizing u𝑢uitalic_u as Degree+1, and u𝑢uitalic_u is categorizing v𝑣vitalic_v as Degree-1. Hence, we must allow at least one neighbor of each type.

Let a zigzag in a tree be six nodes u1,u2,u3subscript𝑢1subscript𝑢2subscript𝑢3u_{1},u_{2},u_{3}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT and v1,v2,v3subscript𝑣1subscript𝑣2subscript𝑣3v_{1},v_{2},v_{3}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT, such that there exists a path in which they appear in this order, and deg(u1)=deg(u3)=deg(u2)1degreesubscript𝑢1degreesubscript𝑢3degreesubscript𝑢21\deg(u_{1})=\deg(u_{3})=\deg(u_{2})-1roman_deg ( italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) = roman_deg ( italic_u start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT ) = roman_deg ( italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) - 1 and deg(v1)=deg(v3)=deg(v2)+1degreesubscript𝑣1degreesubscript𝑣3degreesubscript𝑣21\deg(v_{1})=\deg(v_{3})=\deg(v_{2})+1roman_deg ( italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) = roman_deg ( italic_v start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT ) = roman_deg ( italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) + 1. See Figure 7.

u1subscript𝑢1u_{1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPTu2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPTu3subscript𝑢3u_{3}italic_u start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPTv1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPTv2subscript𝑣2v_{2}italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPTv3subscript𝑣3v_{3}italic_v start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPTIncresing degree
Figure 7: A zigzag in a (not fully depicted) tree, where the nodes are ordered by increasing degree from left to right. The curvy line represents a path in the tree. On this picture the degree of the visubscript𝑣𝑖v_{i}italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is smaller than the degrees of the uisubscript𝑢𝑖u_{i}italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, but this is not necessary. Note that the path in the middle could itself contain zigzags.

Working similarly as Claim 3, we prove that zigzags cannot appear.

Claim 5.

Let L𝐿Litalic_L be a checker in \mathcal{M}{}caligraphic_M. The trees accepted by L𝐿Litalic_L have no zigzag.

Proof F.4.

By contradiction, suppose we have a checker in \mathcal{M}{}caligraphic_M accepting a tree T𝑇Titalic_T with a zigzag u1,u2,u3,v1,v2,v3subscript𝑢1subscript𝑢2subscript𝑢3subscript𝑣1subscript𝑣2subscript𝑣3u_{1},u_{2},u_{3},v_{1},v_{2},v_{3}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT as in the definition. By Lemma 2.2, the tree Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT obtained by grafting Tv1subscript𝑇subscript𝑣1T_{v_{1}}italic_T start_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUBSCRIPT in T𝑇Titalic_T at (v2v3,v2v1)subscript𝑣2subscript𝑣3subscript𝑣2subscript𝑣1(v_{2}v_{3},v_{2}v_{1})( italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) is still accepted by L𝐿Litalic_L.

The new tree Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT contains the original vertices u1,u2,u3subscript𝑢1subscript𝑢2subscript𝑢3u_{1},u_{2},u_{3}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT from T𝑇Titalic_T and also a copy of those from the grafted copy of Tv1subscript𝑇subscript𝑣1T_{v_{1}}italic_T start_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUBSCRIPT, that we call u1,u2,u3superscriptsubscript𝑢1superscriptsubscript𝑢2superscriptsubscript𝑢3u_{1}^{\prime},u_{2}^{\prime},u_{3}^{\prime}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_u start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. In particular, Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT contains a path u1,u2,,u3,u2subscript𝑢1subscript𝑢2subscriptsuperscript𝑢3subscriptsuperscript𝑢2u_{1},u_{2},\ldots,u^{\prime}_{3},u^{\prime}_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , … , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT , italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, where u1u2subscript𝑢1subscript𝑢2u_{1}u_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT has the same view as u3u2subscriptsuperscript𝑢3subscriptsuperscript𝑢2u^{\prime}_{3}u^{\prime}_{2}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. We can thus apply Lemma 2.3 to construct trees of linear diameter accepted by L𝐿Litalic_L and reach a contradiction.

Forbidding zigzags basically proves that paths in accepted trees can be split in two parts, each monotonous in degree (up to vertices of degree at most aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT). This allows us to restrict the values of aleavessubscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠a_{leaves}italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT and bDegree+1subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒1b_{Degree+1}italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT without changing much the maximum diameter.

Claim 6.

Let L𝐿Litalic_L be a myopic local checker with aleaves>0subscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠0a_{leaves}>0italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT > 0 and maximum diameter D(n)𝐷𝑛D(n)italic_D ( italic_n ). Let Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT be the same checker except that aleaves=0subscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠0a_{leaves}=0italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = 0. The maximum diameter function D(n)superscript𝐷𝑛D^{\prime}(n)italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_n ) for Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is at most D(aleavesn)𝐷subscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠𝑛D(a_{leaves}\cdot n)italic_D ( italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT ⋅ italic_n ).

Proof F.5.

Let Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT be an n𝑛nitalic_n-vertex tree of diameter D(n)superscript𝐷𝑛D^{\prime}(n)italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_n ) accepted by Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. By adding aleavessubscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠a_{leaves}italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT pending leaves to each non-leaf vertex, we get a tree T𝑇Titalic_T accepted by L𝐿Litalic_L, with at most aleavesnsubscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠𝑛a_{leaves}\cdot nitalic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT ⋅ italic_n nodes and whose diameter is still Dsuperscript𝐷D^{\prime}italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. In particular, we get D(n)D(aleavesn)superscript𝐷𝑛𝐷subscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠𝑛D^{\prime}(n)\leqslant D(a_{leaves}\cdot n)italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_n ) ⩽ italic_D ( italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT ⋅ italic_n ).

Since every tree accepted by L𝐿Litalic_L is also accepted by Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, we also get DD𝐷superscript𝐷D\leqslant D^{\prime}italic_D ⩽ italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT. Therefore, given the diameter functions D𝐷Ditalic_D we target, we have D(n)=Θ(D(n))superscript𝐷𝑛Θ𝐷𝑛D^{\prime}(n)=\Theta(D(n))italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_n ) = roman_Θ ( italic_D ( italic_n ) ), hence we can assume that aleaves=0subscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠0a_{leaves}=0italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = 0 in the context of the theorem. Using slightly more involved arguments, we get that we may also assume that bDegree+1=1subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree+1}=1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT = 1.

Claim 7.

Let L𝐿Litalic_L be a myopic local checker with bDegree+1>1subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree+1}>1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT > 1 and maximum diameter D𝐷Ditalic_D. Let Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT be the same checker except that bDegree+1=1subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree+1}=1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT = 1. The maximum diameter function Dsuperscript𝐷D^{\prime}italic_D start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT for Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is at least D/2𝐷2D/2italic_D / 2.

Proof F.6.

Consider an n𝑛nitalic_n-vertex tree T𝑇Titalic_T accepted by L𝐿Litalic_L. And take a path P𝑃Pitalic_P that is maximum, that is, its length is D(n)𝐷𝑛D(n)italic_D ( italic_n ). Because of Claim 5, this path either is monotone in terms of the degree of the nodes visited, or the degree sequence changes slope at most once. If it is monotone or is minimum on the endpoints, then for every node having more than one neighbor of larger degree, we prune all such neighbors except the ones used by the path P𝑃Pitalic_P. This is possible because aDegree+1=0subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒10a_{Degree+1}=0italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT = 0 by Claim 2. This tree is accepted by Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT and it has the same diameter as Tsuperscript𝑇T^{\prime}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, and at most the same number of nodes. If the degree sequence is maximum on both endpoints, then we do the same operation, leaving exactly one node with two neighbors of larger degree. Then, we take this node and prune its shortest "forward branch". The diameter has at most halved, while the number of nodes has not increased.

In both cases, we obtained a tree accepted by Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT with nD(n)superscript𝑛𝐷𝑛n^{\prime}\geqslant D(n)italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ⩾ italic_D ( italic_n ) vertices and diameter at least D(n)/2D(n)/2𝐷𝑛2𝐷superscript𝑛2D(n)/2\geqslant D(n^{\prime})/2italic_D ( italic_n ) / 2 ⩾ italic_D ( italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) / 2. In particular, we get an infinite sequence of trees accepted by Lsuperscript𝐿L^{\prime}italic_L start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT with diameter at least D/2𝐷2D/2italic_D / 2, which proves the claim.

F.2 Establishing the classification

The claims above show that we may only prove Theorem 1.10 for degree-myopic local checkers in \mathcal{M}caligraphic_M satisfying:

  • aleaves=0subscript𝑎𝑙𝑒𝑎𝑣𝑒𝑠0a_{leaves}=0italic_a start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = 0 and bleaves1subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠1b_{leaves}\geq 1italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT ≥ 1

  • bDegree11subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree-1}\geq 1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT ≥ 1

  • aEqualdegree=bEqualdegree=0subscript𝑎𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒subscript𝑏𝐸𝑞𝑢𝑎𝑙𝑑𝑒𝑔𝑟𝑒𝑒0a_{Equal-degree}=b_{Equal-degree}=0italic_a start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = italic_b start_POSTSUBSCRIPT italic_E italic_q italic_u italic_a italic_l - italic_d italic_e italic_g italic_r italic_e italic_e end_POSTSUBSCRIPT = 0

  • aDegree+1=0subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒10a_{Degree+1}=0italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT = 0 and bDegree+11subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{Degree+1}\geq 1italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e + 1 end_POSTSUBSCRIPT ≥ 1

We now proceed to the proof of Theorem 1.10, by distinguishing some cases based on the values of bleavessubscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT and aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT. In each case, we provide a lower bound on the maximum diameter by constructing trees with a specific shape that are accepted. Then we provide a complementary upper bound by proving that the same kind of structure necessarily appears in the accepted trees.

Claim 8.

If L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M satisfies bleaves=subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}=\inftyitalic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = ∞ and aDegree11subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒11a_{Degree-1}\leq 1italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT ≤ 1, then its maximum diameter is Θ(n)Θ𝑛\Theta(\sqrt{n})roman_Θ ( square-root start_ARG italic_n end_ARG ).

Proof F.7.

Let L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M such that bleaves=subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}=\inftyitalic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = ∞ and aDegree11subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒11a_{Degree-1}\leq 1italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT ≤ 1. For every integer i𝑖iitalic_i, consider the caterpillar Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT whose backbone has i𝑖iitalic_i nodes, and its degree sequence is 1,2,,i12𝑖1,2,\cdots,i1 , 2 , ⋯ , italic_i. Observe that Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is accepted by L𝐿Litalic_L and moreover, Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT has diameter Θ(i)Θ𝑖\Theta(i)roman_Θ ( italic_i ) and Θ(i2)Θsuperscript𝑖2\Theta(i^{2})roman_Θ ( italic_i start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) vertices. Therefore, L𝐿Litalic_L has maximum diameter at least Ω(n)Ω𝑛\Omega(\sqrt{n})roman_Ω ( square-root start_ARG italic_n end_ARG ).

To conclude, we show that every n𝑛nitalic_n-vertex tree T𝑇Titalic_T accepted by L𝐿Litalic_L has diameter at most O(n)𝑂𝑛O(\sqrt{n})italic_O ( square-root start_ARG italic_n end_ARG ). Take a maximum path P𝑃Pitalic_P in T𝑇Titalic_T, of length D𝐷Ditalic_D. Since there is no zigzag in the tree, the degree sequence of any maximum path changes slope at most once, so up to halving P𝑃Pitalic_P (similarly to Claim 7), one can assume that P𝑃Pitalic_P has a monotone degree sequence, from a vertex of degree aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT to a vertex of degree aDegree1+D/2subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1𝐷2a_{Degree-1}+D/2italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT + italic_D / 2. In particular, there are at least i=0D/2(aDegree1+i)=Θ(D2)superscriptsubscript𝑖0𝐷2subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1𝑖Θsuperscript𝐷2\sum_{i=0}^{D/2}(a_{Degree-1}+i)=\Theta(D^{2})∑ start_POSTSUBSCRIPT italic_i = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_D / 2 end_POSTSUPERSCRIPT ( italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT + italic_i ) = roman_Θ ( italic_D start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) vertices at distance at most one from P𝑃Pitalic_P, so D=O(n)𝐷𝑂𝑛D=O(\sqrt{n})italic_D = italic_O ( square-root start_ARG italic_n end_ARG ).

Claim 9.

If L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M satisfies bleaves=subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}=\inftyitalic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = ∞ and aDegree12subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒12a_{Degree-1}\geq 2italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT ≥ 2, then its maximum diameter is Θ(logn)Θ𝑛\Theta(\log{n})roman_Θ ( roman_log italic_n ).

Proof F.8.

Let L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M such that bleaves=subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}=\inftyitalic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT = ∞ and aDegree12subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒12a_{Degree-1}\geq 2italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT ≥ 2. For every integer i𝑖iitalic_i, denote by Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT the complete aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT-ary tree of height i𝑖iitalic_i (where each internal node has aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT children). Construct Tisubscriptsuperscript𝑇𝑖T^{\prime}_{i}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT from Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT by attaching j𝑗jitalic_j leaves to every vertex at distance j+1𝑗1j+1italic_j + 1 from the leaves. Observe that Tisubscriptsuperscript𝑇𝑖T^{\prime}_{i}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is accepted by L𝐿Litalic_L, because (1) all the leaves and their parents (which have degree aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT) accept, and (2) all the other nodes have aDegree1subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1a_{Degree-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT children (whose degree is precisely one less).

The tree Tisubscriptsuperscript𝑇𝑖T^{\prime}_{i}italic_T start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT has diameter Θ(i)Θ𝑖\Theta(i)roman_Θ ( italic_i ) and a number of nodes Θ(j=0i(j+1)aDegree1ij)=Θ(aDegree1i)Θsuperscriptsubscript𝑗0𝑖𝑗1superscriptsubscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1𝑖𝑗Θsuperscriptsubscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1𝑖\Theta(\sum_{j=0}^{i}(j+1)\cdot a_{Degree-1}^{i-j})=\Theta(a_{Degree-1}^{i})roman_Θ ( ∑ start_POSTSUBSCRIPT italic_j = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ( italic_j + 1 ) ⋅ italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_i - italic_j end_POSTSUPERSCRIPT ) = roman_Θ ( italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ) vertices, hence L𝐿Litalic_L has maximum diameter Ω(logn)Ω𝑛\Omega(\log n)roman_Ω ( roman_log italic_n ).

Let T𝑇Titalic_T be an n𝑛nitalic_n-vertex tree of diameter D𝐷Ditalic_D accepted by L𝐿Litalic_L. Orient its edges from u𝑢uitalic_u to v𝑣vitalic_v if deg(v)>deg(u)degree𝑣degree𝑢\deg(v)>\deg(u)roman_deg ( italic_v ) > roman_deg ( italic_u ). One can easily prove by induction on k𝑘kitalic_k that if T𝑇Titalic_T contains a vertex u𝑢uitalic_u of degree k+aDegree1𝑘subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1k+a_{Degree-1}italic_k + italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT, then the subtree rooted at u𝑢uitalic_u contains at least aDegree1ksuperscriptsubscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1𝑘a_{Degree-1}^{k}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT nodes (it actually contains a copy of Tksubscript𝑇𝑘T_{k}italic_T start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT). Since any maximal path of T𝑇Titalic_T contains a vertex of degree at least D/2𝐷2D/2italic_D / 2, T𝑇Titalic_T has at least aDegree1D/21superscriptsubscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒1𝐷21a_{Degree-1}^{D/2-1}italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_D / 2 - 1 end_POSTSUPERSCRIPT nodes so D=O(logn)𝐷𝑂𝑛D=O(\log n)italic_D = italic_O ( roman_log italic_n ).

Claim 10.

If L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M satisfies bleaves<subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}<\inftyitalic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT < ∞, then its maximum diameter is Θ(logn/loglogn)Θ𝑛𝑛\Theta(\log n/\log\log n)roman_Θ ( roman_log italic_n / roman_log roman_log italic_n ).

Proof F.9.

Let L𝐿L\in\mathcal{M}{}italic_L ∈ caligraphic_M with bleaves<subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠b_{leaves}<\inftyitalic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT < ∞. Let us prove that necessarily bDegree1=subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒1b_{Degree-1}=\inftyitalic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT = ∞. Suppose that this is not the case, then L𝐿Litalic_L accepts only trees of maximum degree ΔΔ\Deltaroman_Δ at most bleaves+bDegree1+1subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒11b_{leaves}+b_{Degree-1}+1italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT + italic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT + 1. If T𝑇Titalic_T is accepted by L𝐿Litalic_L, it contains no zigzag, hence any path in T𝑇Titalic_T has length at most 2Δ2Δ2\Delta2 roman_Δ. Hence, L𝐿Litalic_L has maximum diameter O(1)𝑂1O(1)italic_O ( 1 ), a contradiction with the definition of \mathcal{M}{}caligraphic_M. From now on, assume that bDegree1=subscript𝑏𝐷𝑒𝑔𝑟𝑒𝑒1b_{Degree-1}=\inftyitalic_b start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT = ∞.

For every integer iaDegree11𝑖subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒11i\geq a_{Degree-1}-1italic_i ≥ italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT - 1, we define inductively a rooted tree Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. Let TaDegree11subscript𝑇subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒11T_{a_{Degree-1}-1}italic_T start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT - 1 end_POSTSUBSCRIPT be the subdivided star whose root has degree aDegree11subscript𝑎𝐷𝑒𝑔𝑟𝑒𝑒11a_{Degree-1}-1italic_a start_POSTSUBSCRIPT italic_D italic_e italic_g italic_r italic_e italic_e - 1 end_POSTSUBSCRIPT - 1 and each branch is subdivided once. Then, construct Ti+1subscript𝑇𝑖1T_{i+1}italic_T start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT by attaching i+1𝑖1i+1italic_i + 1 copies of Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT to a new root. Note that Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT has diameter Θ(i)Θ𝑖\Theta(i)roman_Θ ( italic_i ) and Θ(i!)Θ𝑖\Theta(i!)roman_Θ ( italic_i ! ) nodes. We check that L𝐿Litalic_L accepts all the trees Tisubscript𝑇𝑖T_{i}italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, and has maximum diameter Ω(logn/loglogn)Ω𝑛𝑛\Omega(\log n/\log\log n)roman_Ω ( roman_log italic_n / roman_log roman_log italic_n ) (the asymptotic inverse function of factorial).

Let T𝑇Titalic_T be an n𝑛nitalic_n-vertex tree of diameter D𝐷Ditalic_D accepted by L𝐿Litalic_L, so in particular T𝑇Titalic_T contains a vertex of degree at least D/2𝐷2D/2italic_D / 2. Orient each edge of T𝑇Titalic_T towards its endpoint of largest degree. Again, one can easily show by induction on k𝑘kitalic_k that each vertex u𝑢uitalic_u with k+bleaves𝑘subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠k+b_{leaves}italic_k + italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT children has at least k!𝑘k!italic_k ! descendants. In particular, T𝑇Titalic_T contains at least (D/2bleaves)!𝐷2subscript𝑏𝑙𝑒𝑎𝑣𝑒𝑠(D/2-b_{leaves})!( italic_D / 2 - italic_b start_POSTSUBSCRIPT italic_l italic_e italic_a italic_v italic_e italic_s end_POSTSUBSCRIPT ) ! nodes, hence D=O(logn/loglogn)𝐷𝑂𝑛𝑛D=O(\log n/\log\log n)italic_D = italic_O ( roman_log italic_n / roman_log roman_log italic_n ).

Appendix G Towards graphs with cycles

Up to now, we have focused on trees, because they are central for LCLs, and make sense for our second motivation. A natural question at that point is what happens if we go beyond trees. We leave this for further work. We just prove now that if there is a cycle in the graph, but no node can see it (i.e, the girth is large in comparison with the checkability radius) the maximum diameter is linear. Basically, we show that we can do pumping via a crossing argument.

Consider a local checker that accepts some graph with a cycle. We claim that it also accepts arbitrarily large graphs of linear diameter, relying on the so-called duplication operation. Given a colored graph G𝐺Gitalic_G and an edge uvE(G)𝑢𝑣𝐸𝐺uv\in E(G)italic_u italic_v ∈ italic_E ( italic_G ), the duplication of G𝐺Gitalic_G along uv𝑢𝑣uvitalic_u italic_v is the colored graph Guvsuperscript𝐺𝑢𝑣G^{uv}italic_G start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT obtained by taking two copies of G𝐺Gitalic_G, deleting the two copies u1v1subscript𝑢1subscript𝑣1u_{1}v_{1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and u2v2subscript𝑢2subscript𝑣2u_{2}v_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT of uv𝑢𝑣uvitalic_u italic_v and adding u1v2subscript𝑢1subscript𝑣2u_{1}v_{2}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT and u2v1subscript𝑢2subscript𝑣1u_{2}v_{1}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT. It is easy to see that if u𝑢uitalic_u and v𝑣vitalic_v are at distance at least 2d2𝑑2d2 italic_d from each other in Guv𝐺𝑢𝑣G\setminus uvitalic_G ∖ italic_u italic_v, then u1subscript𝑢1u_{1}italic_u start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and u2subscript𝑢2u_{2}italic_u start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT (resp. v1subscript𝑣1v_{1}italic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and v2subscript𝑣2v_{2}italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT) both have the same view at distance d𝑑ditalic_d in Guvsuperscript𝐺𝑢𝑣G^{uv}italic_G start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT as u𝑢uitalic_u (resp. v𝑣vitalic_v) in G𝐺Gitalic_G. In particular, we get the following.

Lemma G.1.

Let c,d𝑐𝑑c,ditalic_c , italic_d be integers, G𝐺Gitalic_G be a c𝑐citalic_c-colored graph containing two adjacent vertices u,v𝑢𝑣u,vitalic_u , italic_v at distance at least 2d2𝑑2d2 italic_d in Guv𝐺𝑢𝑣G\setminus uvitalic_G ∖ italic_u italic_v. Then every Lc,d𝐿subscript𝑐𝑑L\in\mathcal{L}_{c,d}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT accepting G𝐺Gitalic_G also accepts Guvsuperscript𝐺𝑢𝑣G^{uv}italic_G start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT.

The following structural result shows that this operation creates long paths, which is the main ingredient for constructing graphs of linear diameter.

Lemma G.2.

Let uv𝑢𝑣uvitalic_u italic_v be an edge of a graph G𝐺Gitalic_G. Denote by uvsuperscript𝑢superscript𝑣u^{\prime}v^{\prime}italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT the edge between copies of u𝑢uitalic_u and v𝑣vitalic_v in Guvsuperscript𝐺𝑢𝑣G^{uv}italic_G start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT. Then dGuvuv(u,v)=2dGuv(u,v)+1subscript𝑑superscript𝐺𝑢𝑣superscript𝑢superscript𝑣superscript𝑢superscript𝑣2subscript𝑑𝐺𝑢𝑣𝑢𝑣1d_{G^{uv}\setminus u^{\prime}v^{\prime}}(u^{\prime},v^{\prime})=2d_{G\setminus uv% }(u,v)+1italic_d start_POSTSUBSCRIPT italic_G start_POSTSUPERSCRIPT italic_u italic_v end_POSTSUPERSCRIPT ∖ italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_u start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = 2 italic_d start_POSTSUBSCRIPT italic_G ∖ italic_u italic_v end_POSTSUBSCRIPT ( italic_u , italic_v ) + 1.

Using these two results, we can conclude that iterating this duplication operation starting from a nice enough graph G𝐺Gitalic_G yields an infinite sequence of graphs of linear diameter, all accepted by every local checker accepting G𝐺Gitalic_G.

Theorem G.3.

Let c,d𝑐𝑑c,ditalic_c , italic_d be integers and Lc,d𝐿subscript𝑐𝑑L\in\mathcal{L}_{c,d}italic_L ∈ caligraphic_L start_POSTSUBSCRIPT italic_c , italic_d end_POSTSUBSCRIPT accepting a c𝑐citalic_c-colored graph G𝐺Gitalic_G containing two adjacent vertices u,v𝑢𝑣u,vitalic_u , italic_v at distance at least 2d2𝑑2d2 italic_d in Guv𝐺𝑢𝑣G\setminus uvitalic_G ∖ italic_u italic_v. Then L𝐿Litalic_L has maximum diameter Θ(n)Θ𝑛\Theta(n)roman_Θ ( italic_n ).

Proof G.4.

Consider the sequence defined by G0=Gsubscript𝐺0𝐺G_{0}=Gitalic_G start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = italic_G, u0=usubscript𝑢0𝑢u_{0}=uitalic_u start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = italic_u, v0=vsubscript𝑣0𝑣v_{0}=vitalic_v start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = italic_v and for every i𝑖iitalic_i, Gi+1=Giuivisubscript𝐺𝑖1superscriptsubscript𝐺𝑖subscript𝑢𝑖subscript𝑣𝑖G_{i+1}=G_{i}^{u_{i}v_{i}}italic_G start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT = italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT, and ui+1vi+1subscript𝑢𝑖1subscript𝑣𝑖1u_{i+1}v_{i+1}italic_u start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT is an edge in Gi+1subscript𝐺𝑖1G_{i+1}italic_G start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT between the copies of uisubscript𝑢𝑖u_{i}italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and visubscript𝑣𝑖v_{i}italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. By Lemma G.1, all the graphs Gisubscript𝐺𝑖G_{i}italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT are accepted by L𝐿Litalic_L. Moreover, |Gi|=2i|G|subscript𝐺𝑖superscript2𝑖𝐺|G_{i}|=2^{i}\cdot|G|| italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | = 2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ⋅ | italic_G | and by Lemma G.2, the distance between uisubscript𝑢𝑖u_{i}italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and visubscript𝑣𝑖v_{i}italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT in Giuivisubscript𝐺𝑖subscript𝑢𝑖subscript𝑣𝑖G_{i}\setminus u_{i}v_{i}italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∖ italic_u start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is at least 2idsuperscript2𝑖𝑑2^{i}\cdot d2 start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ⋅ italic_d. Therefore, there are two vertices in Gisubscript𝐺𝑖G_{i}italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT at distance at least 2i1dsuperscript2𝑖1𝑑2^{i-1}\cdot d2 start_POSTSUPERSCRIPT italic_i - 1 end_POSTSUPERSCRIPT ⋅ italic_d hence diam(Gi)=Θ(|Gi|)diamsubscript𝐺𝑖Θsubscript𝐺𝑖\operatorname{\mathrm{diam}}(G_{i})=\Theta(|G_{i}|)roman_diam ( italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) = roman_Θ ( | italic_G start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | ), which concludes.