Hardness of computing and approximating predicates and functions with leaderless population protocols
HHardness of computing and approximating predicates and functionswith leaderless population protocols ∗ Amanda Belleville , David Doty , and David Soloveichik Department of Computer Science, University of California, Davis Department of Electrical and Computer Engineering, University of Texas, Austin
Abstract
Population protocols are a distributed computing model appropriate for describing massivenumbers of agents with very limited computational power (finite automata in this paper), such assensor networks or programmable chemical reaction networks in synthetic biology. A populationprotocol is said to require a leader if every valid initial configuration contains a single agent in aspecial “leader” state that helps to coordinate the computation. Although the class of predicatesand functions computable with probability 1 (stable computation) is the same whether a leaderis required or not (semilinear functions and predicates), it is not known whether a leader isnecessary for fast computation. Due to the large number of agents n (synthetic molecularsystems routinely have trillions of molecules), efficient population protocols are generally definedas those computing in polylogarithmic in n (parallel) time. We consider population protocolsthat start in leaderless initial configurations, and the computation is regarded finished when thepopulation protocol reaches a configuration from which a different output is no longer reachable.In this setting we show that a wide class of functions and predicates computable by popula-tion protocols are not efficiently computable (they require at least linear time to stabilize on acorrect answer), nor are some linear functions even efficiently approximable . For example, ourresults for predicates immediately imply that the widely studied parity, majority, and equalitypredicates cannot be computed in sublinear time. (Existing arguments specific to majority werealready known). Moreover, it requires at least linear time for a population protocol even to ap-proximate division by a constant or subtraction (or any linear function with a coefficient outsideof N ), in the sense that for sufficiently small γ >
0, the output of a sublinear time protocol canstabilize outside the interval f ( m )(1 ± γ ) on infinitely many inputs m . We also show that itrequires linear time to exactly compute a wide range of semilinear functions (e.g., f ( m ) = m if m is even and 2 m if m is odd).In a complementary positive result, we show that with a sufficiently large value of γ , apopulation protocol can approximate any linear f with nonnegative rational coefficients, withinapproximation factor γ , in O (log n ) time. Population protocols were introduced by Angluin, Aspnes, Diamadi, Fischer, and Peralta [4] asa model of distributed computing in which the agents have very little computational power andno control over their schedule of interaction with other agents. They can be thought of as aspecial case of a model of concurrent processing introduced in the 1960s, known alternately as ∗ The first and second authors were supported by NSF grant 1619343, and the third author by NSF grant 1618895. a r X i v : . [ c s . D C ] N ov ector addition systems [26], Petri nets [30], or commutative semi-Thue systems (or, when alltransitions are reversible, “commutative semigroups”) [12, 28]. As well as being an appropriatemodel for electronic computing scenarios such as sensor networks, they are a useful abstraction of“fast-mixing” physical systems such as animal populations [33], gene regulatory networks [9], andchemical reactions.The latter application is especially germane: several recent wet-lab experiments demonstratethe systematic engineering of custom-designed chemical reactions [8, 16, 31, 34], unfortunately inall cases having a cost that scales linearly with the number of unique chemical species (states).(The cost can even be quadratic if certain error-tolerance mechanisms are employed [32].) Thus,it is imperative in implementing a molecular computational system to keep the number of distinctchemical species at a minimum. On the other hand, it is common (and relatively cheap) for thetotal number of such molecules (agents) to number in the trillions in a single test tube. It is thusimportant to understand the computational power enabled by a large number of agents n , whereeach agent has only a constant number of states (each agent is a finite state machine).A population protocol is said to require a leader if every valid initial configuration containsa single agent in a special “leader” state that helps to coordinate the computation. Studyingcomputation without a leader is important for understanding essentially distributed systems wheresymmetry breaking is difficult. Further, in the chemical setting obtaining single-molecule precisionin the initial configuration is difficult. Thus, it would be highly desirable if the population protocoldid not require an exquisitely tuned initial configuration. A population protocol is defined by a finite set Λ of states that each agent may have, togetherwith a transition function δ : Λ → Λ . A configuration is a nonzero vector c ∈ N Λ describing,for each s ∈ Λ, the count c ( s ) of how many agents are in state s . By convention we denote thenumber of agents by n = (cid:107) c (cid:107) = (cid:80) s ∈ Λ c ( s ) . Given states r , r , p , p ∈ Λ, if δ ( r , r ) = ( p , p )(denoted r , r → p , p ), and if a pair of agents in respective states r and r interact, then theirstates become p and p . The next pair of agents to interact is chosen uniformly at random. Theexpected (parallel) time for any event to occur is the expected number of interactions, dividedby the number of agents n . This measure of time is based on the natural parallel model whereeach agent participates in a constant number of interactions in one unit of time; hence Θ( n ) totalinteractions are expected per unit time [6].The most well-studied population protocol task is computing Boolean-valued predicates . It isknown that a protocol stably decides a predicate φ : N k → { , } (meaning computes the correctanswer with probability 1; see Section 4 for a formal definition) if [4] and only if [5] φ is semilinear.Population protocols can also compute integer-valued functions f : N k → N . Suppose we startwith m ≤ n/ x and the remaining agents in a “quiescent” state q . Considerthe protocol with a single transition rule x, q → y, y . Eventually exactly 2 m agents are in the“output” state y , so this protocol computes the function f ( m ) = 2 m . Furthermore (letting s =count of state s ), if q − m = Ω( n ) initially (e.g., q = 3 m ), then it takes Θ(log n ) expected timeuntil y = 2 m . Similarly, the transition rule x, x → y, q computes the function f ( m ) = (cid:98) m/ (cid:99) , butexponentially slower, in expected time Θ( n ). The transitions x , q → y, q and x , y → q, q compute Some work allows nondeterministic transitions, in which the transition function maps to subsets of Λ × Λ.Our results are independent of whether transitions are nondeterministic, and we choose a deterministic, symmetrictransition function, rather than a more general relation δ ⊆ Λ , merely for notational convenience. In the most generic model, there is no restriction on which agents are permitted to interact. If one prefers tothink of the agents as existing on nodes of a graph, then it is the complete graph K n for a population of n agents. ( m , m ) = m − m (assuming m ≥ m ), also in time Θ( n ) if m = m + O (1).Formally, we say a population protocol stably computes a function f : N k → N if, for every“valid” initial configuration i ∈ N Λ representing input m ∈ N k (via counts i ( x ) , . . . , i ( x k ) of“input” states Σ = { x , . . . , x k } ⊆ Λ) with probability 1 the system reaches from i to o such that o ( y ) = f ( m ) ( y ∈ Λ is the “output” state) and o (cid:48) ( y ) = o ( y ) for every o (cid:48) reachable from o (i.e., o is stable ). Defining what constitutes a “valid” initial configuration (i.e., what non-input states canbe present initially, and how many) is nontrivial. In this paper we focus on population protocolswithout a leader —a state present in count 1, or small count—in the initial configuration. Here, weequate “leaderless” with initial configurations in which no positive state count is sublinear in thepopulation size n .It is known that a function f : N k → N is stably computable by a population protocol if andonly if its graph { ( m , f ( m )) | m ∈ N k } ⊂ N k +1 is a semilinear set [5, 15]. This means intuitivelythat it is piecewise affine, with each affine piece having rational slopes.Despite the exact characterization of predicates and functions stably computable by populationprotocols, we still lack a full understanding of which of the stably computable (i.e., semilinear)predicates and functions are computable quickly (say, in time polylogarithmic in n ) and whichare only computable slowly (linear in n ). For positive results, much is known about time to convergence (time to get the correct answer). It has been known for over a decade that with aninitial leader, any semilinear predicate can be stably computed with polylogarithmic convergencetime [6]. Furthermore, it has recently been shown that all semilinear predicates can be computed without a leader with sublinear convergence time [27]. (See Section 1.4 for details.)In this paper, however, we exclusively study time to stabilization without a leader (time afterwhich the answer is guaranteed to remain correct ). Except where explicitly marked otherwise witha variant of the word “converge”, all references to time in this paper refer to time until stabilization.Section 9 explains in more detail the distinction between the two. Undecidability of many predicates in sublinear time.
Every semilinear predicate φ : N k →{ , } is stably decidable in O ( n ) time [6]. Some, such as φ ( m , m ) = 1 iff m ≥
1, are stablydecidable in O (log n ) time by a leaderless protocol, in this case by the transition x , x → x , x ,where x “votes” for output 1 and x votes 0. A predicate is eventually constant if φ ( m ) = φ ( m (cid:48) )for all sufficiently large m (cid:54) = m (cid:48) . We show in Theorem 4.4 that unless φ is eventually constant, anyleaderless population protocol stably deciding a predicate φ requires at least linear time. Examplesof non-eventually constant predicates include parity ( φ ( m ) = 1 iff m is odd), majority ( φ ( m , m ) =1 iff m ≥ m ), and equality ( φ ( m , m ) = 1 iff m = m ). It does not include certain semilinearpredicates, such as φ ( m , m ) = 1 iff m ≥ O (log n ) time) or φ ( m , m ) = 1 iff m ≥ O ( n ) time, and no faster protocol is known). Definition of function computation and approximation.
We formally define computationand approximation of functions f : N k → N for population protocols. This mode of computationwas discussed briefly in the first population protocols paper [4, Section 3.4], which focused more onBoolean predicate computation, and it was defined formally in the more general model of chemicalreaction networks [15, 19]. Some subtle issues arise that are unique to population protocols. Wealso formally define a notion of function approximation with population protocols. Inapproximability of most linear functions with sublinear time and sublinear error.
Recall that the transition rule x, x → y, q computes f ( m ) = (cid:98) m/ (cid:99) in linear time. Consider the3ransitions a, x → b, y and b, x → a, q , starting with x = m , a = γm for some 0 < γ < y = q = 0 (so n = m + γm total agents). Then eventually y ∈ { m/ , . . . , m/ γm } and x = 0 (stabilizing y ), after O ( γ log n ) expected time. (This is analyzed in more detail inSection 7.) Thus, if we tolerate an error linear in n , then f can be approximated in logarithmictime. However, Theorem 6.1 shows this error bound to be tight: any leaderless population protocolthat approximates f ( m ) = (cid:98) m/ (cid:99) , or any other linear function with a coefficient outside of N (suchas (cid:98) m/ (cid:99) or m − m ), requires at least linear time to achieve sublinear error.As a corollary, such functions cannot be stably computed in sublinear time (since computingexactly is the same as approximating with zero error). Conversely, it is simple to show that anylinear function with all coefficients in N is stably computable in logarithmic time (Observation 7.1).Thus we have a dichotomy theorem for the efficiency (with regard to stabilization) of computinglinear functions f by leaderless population protocols: if all of f ’s coefficients are in N , then it iscomputable in logarithmic time, and otherwise it requires linear time. Approximability of nonnegative rational-coefficient linear functions with logarithmictime and linear error.
Theorem 6.1 says that no linear function with a coefficient outside of N can be stably computed with sublinear time and sublinear error. In a complementary positiveresult, Theorem 7.2, by relaxing the error to linear, and restricting the coefficients to be nonnegative rationals (but not necessarily integers), we show how to approximate any such linear function inlogarithmic time. (It is open if m − m can be approximated with linear error in logarithmic time.) Uncomputability of many nonlinear functions in sublinear time.
What about non-linearfunctions? Theorem 8.5 states that sublinear time computation cannot go much beyond linearfunctions with coefficients in N : unless f is eventually N -linear , meaning linear with nonnegativeinteger coefficients on all sufficiently large inputs, any protocol stably computing f requires at leastlinear time. Examples of non-eventually- N -linear functions, that provably cannot be computedin sublinear time, include f ( m , m ) = min( m , m ) (computable slowly via x , x → y, q ), and f ( m ) = m − x, x → x, y ).The only remaining semilinear functions whose asymptotic time complexity remains unknownare those “piecewise linear” functions that switch between pieces only near the boundary of N k ; forexample, f ( m ) = 0 if m ≤ f ( m ) = m otherwise.Note that there is a fundamental difficulty in extending the negative results to functions andpredicates that “do something different only near the boundary of N k ”. This is because for inputswhere one state is present in small count, the population protocol could in principle use that inputas a “leader state”—and no longer be leaderless. However, this does not directly lead to a positiveresult for such inputs, because it is not obvious how to use (for instance) state x as a leader whenits count is 1 while still maintaining correctness for larger counts of x .Our results leave open the possibility that non-eventually constant predicates and non-eventually- N -linear functions, which cannot be computed in sublinear time in our setting, could be efficientlycomputed in the following ways:1. With an initial leader stabilizing to the correct answer in sublinear time,2. Stabilizing to an output in expected sublinear time but allowing a small probability of incorrectoutput (with or without a leader), or3. Without an initial leader but converging to the correct output in sublinear time. RecentlyKosowski and Uzna´nski [27] showed that this task is indeed possible. (See Section 1.4.)4 .3 Essential proof techniques
Techniques developed in previous work for proving time lower bounds [1,20] can certainly generalizebeyond leader election and majority, although it was not clear what precise category of computationthey cover. However, to extend the impossibility results to all non-eventually- N -linear functions,we needed to develop new tools.Compared to our previous work showing the impossibility of sublinear time leader election [20],we achieve three main advances in proof technique. First, the previous machinery did not giveus a way to affect large -count states predictably to change the answer, but rather focused onusing surgery to remove a single leader state. Second, we need much additional reasoning toargue if a predicate is not eventually constant, then we can find infinitely many α -dense inputsthat differ on their output but are close together. This leads to a contradiction when we usetransition manipulation arguments to show how to absorb the small extra difference between theinputs without changing the output. Third, we need entirely different reasoning to argue that if asemilinear function is not eventually N -linear, then we can find infinitely many α -dense inputs m that do not appear “locally affine”: pushing a small distance v from m changes the function f ( m )to f ( m + v ) = f ( m ) + (cid:15) , but pushing by the same distance again changes it a different amount,i.e., f ( m + 2 v ) = f ( m ) + (cid:15) + δ , where (cid:15) (cid:54) = δ . This leads to a contradiction when we use transitionmanipulation arguments to show how, from input m + 2 v , to stabilize the count of the output tothe incorrect value f ( m ) + 2 (cid:15) . Both in prior and current work, the high level intuition of the proof technique is as follows. Theoverall argument is a proof by contradiction: if sublinear time computation is possible, then wefind a nefarious execution sequence that stabilizes to an incorrect output. In more detail, sublineartime computation requires avoiding “bottlenecks”—having to go through a transition in which bothstates are present in small count (constant independent of the number of agents n ). Traversing evena single such transition requires linear time. Technical lemmas show that bottleneck-free executionsequences from α -dense initial configurations (i.e., where every state that is present is present in atleast αn count) are amenable to predictable “surgery” [1,20]. At the high level, the surgery lemmasshow how states that are present in “low” count when the population protocol stabilizes, can bemanipulated (added or removed) such that only “high” count other states are affected. Since it canalso be shown that changing high count states in a stable configuration does not affect its stability,this means that the population protocol cannot “notice” the surgery, and remains stabilized to theprevious output. For leader election, the surgery allows one to remove an additional leader state(leaving us with no leaders). For majority computation [1], the minority input must be present inlow count (or absent) at the end. This allows one to add enough of the minority input to turn itinto the majority, while the protocol continues to output the wrong answer.However, applying the previously developed surgery lemmas to fool a function computing pop-ulation protocol is more difficult. The surgery to consume additional input states affects the countof the output state, which could be present in “large count” at the end. How do we know that theeffect of the surgery on the output is not consistent with the desired output of the function? Inorder to arrive at a contradiction we develop two new techniques, both of which are necessary tocover all cases. The first involves showing that the slope of the change in the count of the outputstate as a function of the input states is inconsistent. The second involves exposing the semilinearstructure of the graph of the function being computed, and forcing it to enter the “wrong piece”(i.e., periodic coset). These arguments are easier to understand for the special case when we can assume f is linear. Thus Section 6concentrates on this special case, obtaining an exact characterization of the efficiently computable linear functions.Section 8 reasons about the more difficult case of arbitrary semilinear functions. .4 Related work Positive results.
Angluin, Aspnes, Diamadi, Fischer, and Peralta [4] showed that any semilinearpredicate can be decided in expected parallel time O ( n log n ), later improved to O ( n ) by Angluin,Aspnes, and Eisenstat [6]. More strikingly, the latter paper showed that if an initial leader ispresent (a state assigned to only a single agent in every valid initial configuration), then there isa protocol for φ that converges to the correct answer in expected time O (log n ). However, thisprotocol’s expected time to stabilize is still provably Ω( n ). Section 9 explains this distinction inmore detail. Chen, Doty, and Soloveichik [15] showed in the related model of chemical reactionnetworks (borrowing techniques from the related predicate results [4,5]) that any semilinear function (integer-output f : N k → N ) can similarly be computed with expected convergence time O (log n )if an initial leader is present, but again with much slower stabilization time O ( n log n ). Dotyand Hajiaghayi [19] showed that any semilinear function can be computed by a chemical reactionnetwork without a leader with expected convergence and stabilization time O ( n ). Although thechemical reaction network model is more general, these results hold for population protocols.Kosowski and Uzna´nski [27] show that all semilinear predicates can be computed without aninitial leader, converging in O (polylog n ) time if a small probability of error is allowed, and con-verging in O ( n (cid:15) ) time with probability 1, where (cid:15) can be made arbitrarily close to 0 by changingthe protocol. They also showed leader election protocols (which can be thought of as computingthe constant function f ( m ) = 1) with the same properties.Since efficient computation seems to be helped by a leader, the computational task of leaderelection has received significant recent attention. In particular, Alistarh and Gelashvili [3] showedthat in a variant of the model allowing the number of states λ n to grow with the population size n ,a protocol with λ n = O (log n ) states can elect a leader with high probability in O (log n ) expectedtime. Alistarh, Aspnes, Eisenstat, Gelashvili, and Rivest [1] later showed how to reduce the numberof states to λ n = O (log n ), at the cost of increasing the expected time to O (log . n log log n ). Gasie-niec and Stachowiak [21] showed that there is a protocol with O (log log n ) states electing a leaderin O (log n ) time in expectation and with high probability, recently improved to O (log n log log n )time by Gasieniec, Stachowiak, and Uzna´nski [22]. This asymptotically matches the Ω(log log n )states provably required for sublinear time leader election (see negative results below). Negative results.
The first attempt to show the limitations of sublinear time population proto-cols, using the more general model of chemical reaction networks, was made by Chen, Cummings,Doty, and Soloveichik [14]. They studied a variant of the problem in which negative results areeasier to prove, an “adversarial worst-case” notion of sublinear time: the protocol is required tobe sublinear time not only from the initial configuration, but also from any reachable configu-ration. They showed that the predicates computable in this manner are precisely those whoseoutput depends only on the presence or absence of states (and not on their exact positive counts).Doty and Soloveichik [20] showed the first Ω( n ) lower bound on expected time from valid initialconfigurations, proving that any protocol electing a leader with probability 1 takes Ω( n ) time.These techniques were improved by Alistarh, Aspnes, Eisenstat, Gelashvili, and Rivest [1],who showed that even with up to λ n = O (log log n ) states, any protocol electing a leader withprobability 1 requires nearly linear time: Ω( n/ polylog n ). They used these tools to prove timelower bounds for another important computational task: majority (detecting whether state x or x is more numerous in the initial population, by stabilizing on a configuration in which the statewith the larger initial count occupies the whole population). Alistarh, Aspnes, and Gelashvili [2]strengthened the state lower bound, showing that Ω(log n ) states are required to compute majorityin O ( n − c ) time for some c >
0, when a certain “natural” condition is imposed on the protocol that6olds for all known protocols.In contrast to these previous results on the specific tasks of leader election and majority, weobtain time lower bounds for a broad class of functions and predicates, showing “most” of thosecomputable at all by population protocols, cannot be computed in sublinear time. Since they all can be computed in linear time, this settles their asymptotic population protocol time complexity.Informally, one explanation for our result could be that some computation requires electing“leaders” as part of the computation, and other computation does not. Since leader election itselfrequires linear time as shown in [20], the computation that requires it is necessarily inefficient. Itis not clear, however, how to define the notion of a predicate or function computation requiringelecting a leader somewhere in the computation, but recent work by Michail and Spirakis helps toclarify the picture [29].
Section 2 defines population protocol model and notation. Section 3 proves the technical lemmasthat are used in all the time lower bound proofs. Section 4 shows that a wide class of predicatesrequires Ω( n ) time to compute. Section 5 explains our definitions of function computation andapproximation. Section 6 shows that linear functions with either a negative (e.g., m − m ) ornon-integer (e.g., (cid:98) m/ (cid:99) ) coefficient cannot be stably approximated with o ( n ) error in o ( n ) time.Section 7 shows our positive result, Theorem 7.2, that linear functions with all nonnegative rationalcoefficients (e.g., (cid:98) m / (cid:99) + 3 m ) can be stably approximated with O ( n ) error in O (log n ) time.Section 8 studies non-linear functions, showing that a large class of those computable by populationprotocols require Ω( n ) time to compute. Section 9 states conclusions and open questions. If Λ is a finite set (in this paper, of states , which will be denoted as lowercase Roman letters withan overbar such as s ), we write N Λ to denote the set of functions c : Λ → N . Equivalently, weview an element c ∈ N Λ as a vector of | Λ | nonnegative integers, with each coordinate “labeled” byan element of Λ. (By assuming some canonical ordering s , . . . , s k of Λ, we also interpret c ∈ N Λ as a vector c ∈ N k .) Given s ∈ Λ and c ∈ N Λ , we refer to c ( s ) as the count of s in c . Let (cid:107) c (cid:107) = (cid:107) c (cid:107) = (cid:80) s ∈ Λ c ( s ). We write c ≤ c (cid:48) to denote that c ( s ) ≤ c (cid:48) ( s ) for all s ∈ Λ. Since we viewvectors c ∈ N Λ equivalently as multisets of elements from Λ, if c ≤ c (cid:48) we say c is a subset of c (cid:48) .For α >
0, we say that c ∈ N k is α -dense if, for all i ∈ { , . . . , k } , if c ( i ) >
0, then c ( i ) ≥ α (cid:107) c (cid:107) .It is sometimes convenient to use multiset notation to denote vectors, e.g., { x, x, y } and { x, y } both denote the vector c defined by c ( x ) = 2, c ( y ) = 1, and c ( s ) = 0 for all s (cid:54)∈ { x, y } . Given c , c (cid:48) ∈ N Λ , we define the vector component-wise operations of addition c + c (cid:48) , subtraction c − c (cid:48) ,and scalar multiplication m c for m ∈ N . For a set ∆ ⊂ Λ, we view a vector c ∈ N ∆ equivalently asa vector c ∈ N Λ by assuming c ( s ) = 0 for all s ∈ Λ \ ∆ . Write c (cid:22) ∆ to denote the vector d ∈ N ∆ such that c ( s ) = d ( s ) for all s ∈ ∆. For any vector or matrix c , let amax( c ) denote the largestabsolute value of any component of c . Also, given b ∈ N and m ∈ N k , max( b, m ) is a shorthandfor max (cid:16) { b } ∪ (cid:83) ki =1 { m ( i ) } (cid:17) , and similar for amax( b, m ).In this paper, the floor function (cid:98)·(cid:99) : R → Z is defined to be the integer closest to 0 that isdistance < (cid:98)− . (cid:99) = − (cid:98) . (cid:99) = 3. For an (infinite) set/sequenceof configurations C , let bdd ( C ) = { s ∈ Λ | ( ∃ b ∈ N )( ∀ c ∈ C ) c ( s ) < b } be the set of stateswhose counts are bounded by a constant in C . Let unbdd ( C ) = Λ \ bdd ( C ). For m ∈ N , let7 k ≥ m = { m ∈ N k | ( ∀ i ∈ { , . . . , k } m ( i ) ≥ m } , denote the set of vectors in which each coordinateis at least m . A population protocol is a pair P = (Λ , δ ), where Λ is a finite set of states and δ : Λ → Λ is the(symmetric) transition function . A configuration of a population protocol is a vector c ∈ N Λ , withthe interpretation that c ( s ) agents are in state s ∈ Λ. If there is some “current” configuration c understood from context, we write s to denote c ( s ). By convention, the value n ∈ Z ≥ representsthe total number of agents (cid:107) c (cid:107) . A transition is a 4-tuple τ = ( r , r , p , p ) ∈ Λ , written τ : r , r → p , p , such that δ ( r , r ) = ( p , p ). If an agent in state r interacts with an agent instate r , then they change states to p and p . This paper typically defines a protocol by a list oftransitions, with δ implicit. There is a null transition δ ( r , r ) = ( r , r ) if a different output for δ ( r , r ) is not specified.Given c ∈ N Λ and transition τ : r , r → p , p , we say that τ is applicable to c if c ≥ { r , r } ,i.e., c contains 2 agents, one in state r and one in state r . If τ is applicable to c , then write τ ( c )to denote the configuration c − { r , r } + { p , p } (i.e., that results from applying τ to c ); otherwise τ ( c ) is undefined. A finite or infinite sequence of transitions ( τ i ) is a transition sequence . Given a c ∈ N Λ and a transition sequence ( τ i ), the induced execution sequence (or path ) is a finite or infinitesequence of configurations ( c , c , . . . ) such that, for all i ≥ c i = τ i − ( c i − ). If a finite executionsequence, with associated transition sequence q , starts with c and ends with c (cid:48) , we write c = ⇒ q c (cid:48) .We write c = ⇒ P c (cid:48) (or c = ⇒ c (cid:48) when P is clear from context) if such a path exists (i.e., it is possibleto reach from c to c (cid:48) ) and we say that c (cid:48) is reachable from c . Let post P ( c ) = { c (cid:48) | c = ⇒ P c (cid:48) } todenote the set of all configurations reachable from c , writing post ( c ) when P is clear from context.If it is understood from context what is the initial configuration i , then say c is simply reachable if i = ⇒ c . If a transition τ : r , r → p , p has the property that for i ∈ { , } , r i (cid:54)∈ { p , p } , or if( r = r and ( r i (cid:54) = p or r i (cid:54) = p )), then we say that τ consumes r i ; i.e., applying τ reduces thecount of r i . We say τ produces p i if it increases the count of p i . The model used to analyze time complexity is a discrete-time Markov process, whose states cor-respond to configurations of the population protocol. In any configuration the next interaction ischosen by selecting a pair of agents uniformly at random and applying transition function δ todetermine the next configuration. Since a transition may be null, self-loops are allowed. To mea-sure time we count the expected total number of interactions (including null), and divide by thenumber of agents n . (In the population protocols literature, this is often called “parallel time”; i.e. n interactions among a population of n agents corresponds to one unit of time). Let c ∈ N Λ and C ⊆ N Λ . Denote the probability that the protocol reaches from c to some configuration c (cid:48) ∈ C by Pr [ c = ⇒ C ]. If Pr [ c = ⇒ C ] = 1, define the expected time to reach from c to C , denoted T [ c = ⇒ C ],to be the expected number of interactions to reach from c to some c (cid:48) ∈ C , divided by the numberof agents n = (cid:107) c (cid:107) . If Pr [ c = ⇒ C ] < T [ c = ⇒ C ] = ∞ . When the initial configuration to which a transition sequence is applied is clear from context, we may overloadterminology and refer to a transition sequence and an execution sequence interchangeably. Since population protocols have a finite reachable configuration space, this is equivalent to requiring that for all x ∈ post ( c ), there is a c (cid:48) ∈ C ∩ post ( x ). Technical tools
In this section we explain some technical results that are used in proving the time lower boundsof Theorems 4.4, 6.3, 6.4, 8.4, and 8.5. In some cases the main ideas are present in previouspapers, but several must be adapted significantly to the current problem. Throughout Section 3,let P = (Λ , δ ) be a population protocol.Although other results from this section are used in this paper, the key technical result of thissection is Corollary 3.11. It gives a generic method to start with an initial configuration i reachingin sublinear time to a configuration o (in all our uses o is a stable configuration, but this is notrequired by the corollary), and starting from two copies of i , to manipulate the transitions leadingfrom 2 i to 2 o while having a predictable effect on the counts of certain states, possibly also startingwith a “small” number of extra states, denoted d ∆ in Corollary 3.11. This leads to a contradictionwhen the effect on the counts of the states representing the output can be shown to be incorrectfor the given input 2 i + d ∆ .We often deal with infinite sequences of configurations. The following lemma, used frequently inreasoning about population protocols, shows that we can always take a nondecreasing subsequence.
Lemma 3.1 (Dickson’s Lemma [17]) . Any infinite sequence c , c , . . . ∈ N k has an infinite nonde-creasing subsequence c i ≤ c i ≤ . . . , where i < i < . . . ∈ N . Let b ∈ N . A transition r , r → p , p is a b -bottleneck for configuration c if c ( r ) ≤ b and c ( r ) ≤ b .The next observation, proved in [20], states that, if to get from a configuration x ∈ N Λ to someconfiguration in a set S ⊆ N Λ , it is necessary to execute a transition r , r → p , p in which thecounts of r and r are both at most some number b , then the expected time to reach from x tosome configuration in S is Ω( n/b ). Observation 3.2 ( [20]) . Let b ∈ N , x ∈ N Λ , and S ⊆ N Λ such that Pr [ x = ⇒ S ] = 1 . If every pathtaking x to a configuration o ∈ S has a b -bottleneck, then T [ x = ⇒ S ] ≥ n − b | Λ | ) > n b (cid:107) Λ (cid:107) . The next corollary is useful.
Observation 3.3 ( [20]) . Let γ > , b ∈ N , c ∈ N Λ , and X, S ⊆ N Λ such that Pr [ c = ⇒ X ] ≥ γ , Pr [ c = ⇒ S ] = 1 , and every path from every x ∈ X to some o ∈ S has a b -bottleneck. Then T [ c = ⇒ S ] > γ n b | Λ | . The following lemma was originally proved in [14] and was restated in the language of populationprotocols as Lemma 4.5 in [20]. Intuitively, the lemma states that a “fast” transition sequence(meaning one without a bottleneck transition) that decreases certain states from large counts tosmall counts must contain transitions of a certain restricted form. In particular the form is asfollows: if ∆ is the set of states whose counts decrease from large to small, then we can write thestates in ∆ in some order d , d , . . . , d d , such that for each 1 ≤ i ≤ d , there is a transition τ i thatconsumes d i , and every other state involved in τ i is either not in ∆, or comes later in the ordering.These transitions will later be used to do controlled “surgery” on fast transition sequences, because In general these will not be execution sequences. Typically none of the configurations are reachable from anyothers because they are configurations with increasing numbers of agents. d i , by inserting or removing the transitions τ i , knowing thatthis will not affect the counts of d , . . . , d i − .Let ∆ ⊆ Λ, with d = | ∆ | . We say that P is ∆ -ordered (via τ , . . . , τ d ) if there is an order on∆, so that we may write ∆ = { d , . . . , d d } , such that, for all i ∈ { , . . . , d } , there is a transition τ i : d i , s i → o i , o (cid:48) i , such that s i , o i , o (cid:48) i (cid:54)∈ { d , . . . , d i } . In other words, for each i there is a transitionconsuming exactly one d i without affecting d , . . . , d i − . Lemma 3.4 (adapted from [14]) . Let b , b ∈ N such that b > | Λ | · b . Let x , o ∈ N Λ such that x = ⇒ p o via a path p without a b -bottleneck. Define ∆ = { d ∈ Λ | x ( d ) ≥ b and o ( d ) ≤ b } . Then P is ∆ -ordered via τ , . . . , τ d , and each τ i occurs at least ( b − | Λ | · b ) / | Λ | times in p . Say that c ∈ N Λ is full if ( ∀ s ∈ Λ) c ( s ) >
0, i.e., every state is present. The following theoremstates that with high probability, a population protocol will reach from an α -dense configuration toa configuration in which all states are present (full) in “large” count ( β -dense, for some 0 < β < α ). It was proven in [18] in the more general model of chemical reaction networks, for a subclass ofsuch networks that includes all population protocols.
Theorem 3.1 (adapted from [18]) . Let α > . Then there are constants (cid:15), β > such that, letting X β = { x ∈ N Λ | x is full and β -dense } , for all sufficiently large α -dense i ∈ N Λ , Pr [ i = ⇒ X β ] ≥ − − (cid:15) (cid:107) i (cid:107) . The following was originally proved as Lemma 4.4 in [20]. The result was stated with S beingthe set of what was called “ Q -stable configs,” but we have adapted it to make the statement moregeneral and quantitatively relate the bound b ( n ) to the expected time t ( n ). It states that if aprotocol goes from an α -dense configuration to a set of states S in expected time ≤ t ( n ), then thereis a full β -dense (for 0 < β < α ) reachable configuration x and a path from x to a state in S withno b ( n )-bottleneck transition, where b ( n ) = O (cid:18)(cid:113) nt ( n ) (cid:19) . If t ( n ) = o ( n ), then b ( n ) = ω (1), whichsuffices for our subsequent results. Lemma 3.5 (adapted from [20]) . For all α > , there is a β > such that the following holds.Suppose that for some t : N → N , some set S ⊆ N Λ and some set of α -dense initial configurations I , for all i ∈ I , T [ i = ⇒ S ] ≤ t ( n ) . Define b ( n ) = | Λ | (cid:113) n t ( n ) . There is an n ∈ N such that for all i ∈ I with (cid:107) i (cid:107) = n ≥ n , there is x ∈ post ( i ) and path p such that:1. x ( s ) ≥ βn for all s ∈ Λ ,2. x = ⇒ p o , where o ∈ S , and3. p has no b ( n ) -bottleneck transition.Proof. Intuitively, the lemma follows from the fact that state x is reached with high probabilityby Theorem 3.1, and if no paths such as p existed, then all paths from x to a stable configurationwould have a bottleneck and require more than the stated time by Observation 3.3. Since x isreached with high probability, this would imply the entire expected time is linear. With the same probability, this happens in time O (1), although this fact is not needed in this paper. x reachable from some configuration i ∈ I , there is a transition sequence p satisfying condition (2) by the fact that Pr [ i = ⇒ S ] = 1. It remains to show we can find x and p satisfying conditions (1) and (3).By Theorem 3.1 there exist (cid:15), β (which depend only on A and α ) such that, starting in anysufficiently large initial configuration i , with probability at least 1 − − (cid:15)n , A reaches a configuration x where all states s ∈ Λ have count at least βn , where n = (cid:107) i (cid:107) . For all i , let X i = post ( i ) ∩ X β = { x | i = ⇒ x and ( ∀ s ∈ Λ) x ( s ) ≥ β (cid:107) i (cid:107)} . Let n be a lower bound on n such that Theorem 3.1 appliesfor all n ≥ n and 1 − − (cid:15)n ≥ . Then for all i ∈ I such that (cid:107) i (cid:107) = n ≥ n , Pr [ i = ⇒ X i ] ≥ .Choose any n ≥ n for which there is i ∈ I with (cid:107) i (cid:107) = n . Then any x ∈ X i satisfies condition (1): x ( s ) ≥ βn for all s ∈ Λ. We now show that by choosing x from X i for a large enough n , we canfind a corresponding p satisfying condition (3) as well.Suppose for the sake of contradiction that, we cannot satisfy condition (3) when choosing x as above, no matter how large we make n . This means that for infinitely many i ∈ I , (andtherefore infinitely many population sizes n = (cid:107) i (cid:107) ), all transition sequences from X i to S have a b ( n )-bottleneck. Applying Observation 3.3, letting c = i , γ = , X = X i , tells us that t ( n ) = T [ i = ⇒ S ] > n b ( n ) | Λ | , so b ( n ) > | Λ | (cid:113) n t ( n ) , a contradiction.In the following lemma, note that the indexing is over a subset N ⊆ N ; for example, the sequencemight be indexed i , i , i , i , . . . if N = { , , , , . . . } , allowing us to retain the convention thatthe population size (cid:107) i n (cid:107) is represented by n . Lemma 3.6 essentially states that, if infinitely manyconfigurations i satisfy the hypothesis of Lemma 3.5, then we can find three infinite sequencessatisfying the conclusion of Lemma 3.5: initial configurations i n , intermediate full configurations x n , and “final” configurations o n (in our applications all o n will be stable), which by Dickson’slemma can all be assumed nondecreasing. Lemma 3.6.
For all α > , there is a β > such that the following holds. Suppose that for someset S ⊆ N Λ and infinite set of α -dense initial configurations I , for all i ∈ I , T [ i = ⇒ S ] ≤ t ( n ) .Define b ( n ) = | Λ | (cid:113) nt ( n ) . There is an infinite set N ⊆ N and infinite sequences of configurations ( i n ∈ I ) n ∈ N , ( x n ∈ N Λ ) n ∈ N , ( o n ∈ N Λ ) n ∈ N , where ( x n ) n ∈ N and ( o n ) n ∈ N are nondecreasing, andan infinite sequence of paths ( p n ) n ∈ N such that, for all n ∈ N ,1. (cid:107) i n (cid:107) = (cid:107) x n (cid:107) = (cid:107) o n (cid:107) = n ,2. i n = ⇒ x n ,3. x n ( s ) ≥ βn for all s ∈ Λ ,4. x n = ⇒ p n o n , where o n ∈ S , and5. p n has no b ( n ) -bottleneck transition.Proof. Since I is infinite, the set I n = { i ∈ I | (cid:107) i n (cid:107) ≥ n } is infinite. Pick an infinite sequence ( i n )from I n , where (cid:107) i n (cid:107) = n ( n may range over a subset of N here, but for each n ∈ N , at most oneconfiguration in the sequence has size n ). For each i n in the sequence, pick x n , p n and o n for i n as in Lemma 3.5. By Dickson’s Lemma (Lemma 3.1) there is an infinite subset N ⊆ N such that( x n ) n ∈ N and ( o n ) n ∈ N are nondecreasing on the respective subsequences of ( x n ) n ∈ N and ( o n ) n ∈ N corresponding to N . Lemma 3.5 ensures that properties (1)-(5) are satisfied.The conclusion of Lemma 3.6, with its various infinite sequences, is quite complex. The hy-pothesis of Lemma 3.9 is equally complex; they are used in tandem to prove Lemma 3.10 and11orollary 3.11, the latter being our main technical tool for proving the time lower bounds of The-orems 4.4, 6.3, 6.4, 8.4, and 8.5.The idea of Lemma 3.10 is to start with a protocol satisfying the hypothesis of Lemma 3.6,which reaches in sublinear time from some set I of α -dense initial configurations to some set S (in allapplications, S is the set of stable configurations reachable from I ). Then, invoke Lemma 3.9 to showthat it is possible from certain initial configurations to drive some states in the set ∆ = bdd (( o n ))to 0.The reason that the statement of Lemma 3.10 is also fairly complex, and references some ofthese infinite sequences, is that the set ∆ appearing in the conclusion of Lemma 3.9 depends on theparticular infinite sequence ( o n ) defined in the conclusion of Lemma 3.6. Several infinite sequences,each with their own ∆, could satisfy the hypothesis of Lemma 3.9, and it matters which one we pick.Thus, in applying these results, before reaching the conclusion of Lemma 3.9, we must explicitlydefine these infinite sequences to know the particular ∆ to which the conclusion of Lemma 3.9applies. This is the most technically dense subsection, with many intermediate technical lemmas that cul-minate in our primary technical tool for proving time lower bounds, Corollary 3.11. Each lemmastatement is complex and involves many interacting variables. The first three lemmas are accom-panied by an example and figures to help trace through the intuition.The next two lemmas, Lemmas 3.7 and 3.8, apply to population protocols that have transitionsas described in Lemma 3.4. Both use these transitions in order to manipulate a configuration (bymanipulating a “fast” path leading to it from another configuration) until it has prescribed countsof states in ∆ from Lemma 3.4.Lemmas 3.7 and 3.8 are based on statements first proven as “Claim 1” and “Claim 2” in [20].Since their statements in that paper were not self-contained (being claims as part of a larger proof),we have rephrased them as self-contained Lemmas 3.7 and 3.8, and we give self-contained proofs.Furthermore, we have significantly adapted both the statements and proofs to make them moregenerally useful for proving negative results, in particular stating the minimum conditions requiredto apply the lemmas, in addition to quantitatively accounting for the precise effect that the pathmanipulation has on the underlying configurations.We use linear algebra to describe changes in counts of states. It is beneficial to fix somenotational conventions first. Recall Λ is the set of all states, ∆ ⊂ Λ where ∆ = { d , . . . , d d } ,and Γ = Λ \ ∆ where Γ = { g , . . . , g g } . A matrix ˜ C ∈ Z Γ × ∆ is an integer-valued matrix with g rows and d columns, with row j corresponding to state g j and column i corresponding to state d i .Given a vector c ∆ ∈ N ∆ representing counts of states in ∆, then ˜ C . c ∆ = d Γ is a vector d Γ ∈ Z Γ representing changes in counts of states in Γ.Our notation for indexing these matrices will generally follow our usual vector convention ofusing the name of the state itself, rather than an integer index, so for example, ˜ C ( g i , d j ) refersto the entry in the column corresponding to d j and the row corresponding to g i . If necessary toidentify the position, this will correspond to the i ’th row and j ’th column. Where convenient, wealso use the traditional notation ˜ C ( i, j ) as well: for instance, a protocol being ∆-ordered implies a1-1 correspondence between transitions τ , . . . , τ d and ∆ = { d , . . . , d d } , which can both be indexedby i ∈ { , . . . , d } .Similarly, when convenient we will abuse notation and consider a vector v ∈ N k , for a predicateor function with k inputs, to equivalently represent a configuration or subconfiguration in N Σ ,where Σ ⊆ Λ is the set of k input states of the population protocol.12he next lemma says that for any amount c ∆ ∈ N ∆ of states in ∆, there exists an amount e ∈ N Λ of states that, if present in addition to c ∆ , can be used to remove c ∆ and e (cid:22) ∆ (the statesof e that are in ∆), resulting in a configuration z Γ ∈ N Γ with no states in ∆. Furthermore, both e and z Γ are linear functions of c ∆ .So when we employ Lemma 3.7 later, where will these extra agents e come from? Althoughwe talk about them as if they are somehow physically added, in actuality, we’ll start with a largerinitial configuration and “guide” some of the agents to the desired states that make up e ; this isthe work of Lemma 3.8. Lemma 3.7 (adapted from [20]) . Let ∆ ⊆ Λ such that P is ∆ -ordered, d = | ∆ | , and let Γ = Λ \ ∆ .Then there are matrices C ∈ N Γ × ∆ and C ∈ N Λ × ∆ , with max( C ) < d +1 , max( C ) < d , suchthat, for all c ∆ ∈ N ∆ , setting e = C . c ∆ ∈ N Λ and z Γ = C . c ∆ ∈ N Γ , then c ∆ + e = ⇒ z Γ .Proof. Intuitively, the proof works as follows. Since P is ∆-ordered, for each i ∈ { , . . . , d } , there isa transition τ i : d i , s i → o i , o (cid:48) i , such that for all i , d i ∈ ∆ and o i , o (cid:48) i (cid:54)∈ { d , . . . , d i } . We will constructthe path p such that c ∆ + e = ⇒ p z as follows. A na¨ıve approach would simply consume states in c ∆ , by adding c ∆ ( i ) copies of τ i to the path p , and c ∆ ( i ) copies of the other input s i to e . Since P is ∆-ordered this would indeed result in count 0 of d . However, although for i ∈ { , . . . , d } , thisconsumes c ∆ ( d i ) copies of d i , it might produce additional copies of d i if it appears as an output stateof some transitions τ , . . . , τ i − that were added. Let c ∆1 denote these counts. Since c ∆1 ( d ) = 0, wewon’t need to add any more τ . Repeat the na¨ıve approach a second time to consume c ∆1 , whichwill result in c ∆2 , where c ∆2 ( d ) = c ∆2 ( d ) = 0. Repeating this d times consumes all of ∆.We now formally define matrices that will help to account for the exact changes in state countsthat result from executing this path. First, we define a matrix T ∈ N d × d . Intuitively, if c ∆ ∈ N ∆ represents counts of states in ∆, then the vector t ∈ N d defined by t = T . c ∆ represents countsof transitions τ , . . . , τ d in the path p such that c ∆ + e = ⇒ p z Γ . In particular, t ( d i ) will representthe total number of transitions τ i that we add to path p , in order to consume all copies of d i , notonly the c ∆ ( d i ) present initially, but also any added because of transitions τ j for j < i appearingpreviously in p , if one of the outputs of τ j is d i .Define the d × d matrix T as follows. Intuitively, T is a matrix such that, if t ∈ N d represents“counts of transition executions”, i.e., t ( j ) means “execute transition τ j t ( j ) times”, then T . t ∈ N d (equivalently, N ∆ ) represents the total count of output states in ∆ that would be produced as outputs of these transitions. It does not account for the number of input states consumed, nor the numberof output states in Γ produced.Formally, T is a strictly lower diagonal matrix (0’s on and above the diagonal). Column j is0’s, other than potentially up to two positive entries, described below. • If τ j has output states d k , d k (cid:48) where j < k (cid:54) = k (cid:48) , then T ( k, j ) = T ( k (cid:48) , j ) = 1. • If τ j has output states d k , d k where j < k , then T ( k, j ) = 2. • If τ j has output states d k , g , where j < k and g ∈ Γ, then T ( k, j ) = 1.By the fact that P is ∆-ordered via τ , . . . , τ d , there are no other forms the transitions can take.For example, if we have transitions τ : d , d → d , d τ : d , g → d , d τ : d , d → d , g τ : d , d → g , g τ : d , g → d , d τ : d , g → g , g g , g ∈ Γ, then T = We define T based on T . Na¨ıvely, to consume states in c ∆ , for each i ∈ { , . . . , d } one wouldadd c ∆ ( i ) copies of τ i . Since P is ∆-ordered this would indeed result in count 0 of d . However,although for i ∈ { , . . . , d } , this consumes c ∆ ( d i ) copies of d i , it also produces ( T . c ∆ )( i ) copies of d i , which is positive if d i is an output of some transition in τ , . . . , τ i − .Applying the na¨ıve idea a second time, to consume the states that were produced on the firststep, for each i ∈ { , . . . , d } we add ( T . c ∆ )( d i ) copies of τ i . (Note that ( T . c ∆ )( d ) = 0 so thissecond step adds no additional copies of τ .) Thus, this results in count 0 of d , and although itconsumes the copies of d , . . . , d d that remained after the first step, it also produces T . ( T c ∆ )( d i )additional copies of d i . The number of transitions after two steps is then described by summingsteps 1 and 2: c ∆ + T . c ∆ . We iterate this procedure a total of d steps, where the transitions addedin step i are described by the vector T i − . c ∆ .Since the i ’th step results in getting to count 0 of d , . . . , d i , all d , . . . , d d will have count0 after d steps. The total number of transitions applied over all steps is then described by thevector obtained by summing the d vectors indicating transition counts for each step 1 through d : c ∆ + T . c ∆ + T . c ∆ + T . c ∆ + . . . + T d − . c ∆ . Thus, taking T to be the d × d identity matrix,we can define the matrix T = (cid:80) d − i =0 T i . Since each column of T is either all 0, has one or two1’s, or has a single 2, a simple induction shows that for all i ∈ { , . . . , d − } , max( T i ) ≤ i .Thus max( T ) ≤ (cid:80) d − i =0 max( T i ) ≤ (cid:80) d − i =0 i < d . (This bound is nearly tight; e.g., transitions τ i : d i , s → d i +1 , d i +1 result in T ( d,
1) = 2 d − .)Now that we have defined T , which tells us that we will have ( T . c ∆ )( i ) copies of τ i in path p ,it is easy to define C and C based on T . For each copy of τ i : d i , s → o, o (cid:48) , we add a copy of s to e . Thus, define the matrix S ∈ N Λ × ∆ so that, for all i ∈ { , . . . , d } , S ( s, d i ) = 1 if transition τ i ,which by definition has one input state d i , has s as its other input state. All other entries of S are0. Then C = S . T , and max( C ) = max( T ) < d .It remains to define C , so that C . c ∆ describes the vector z Γ of states in Γ produced by path p First, define the matrix G ∈ N Γ × ∆ as follows, which intuitively maps a count vector of transitionsin τ , . . . , τ d to a total count of states in Γ produced as output by the transitions. Let j ∈ { , . . . , d } and let τ j : d j , s → o, o (cid:48) . If o, o (cid:48) ∈ ∆, then the j ’th column of G is all 0. If exactly one (w.l.o.g.) o ∈ Γ, then G ( o, d j ) = 1 and the remainder of the j ’th column of G is all 0. If both o, o (cid:48) ∈ Γ, and o = o (cid:48) , then G ( o, d j ) = 2 and the remainder of the j ’th column of G is all 0. If both o, o (cid:48) ∈ Γ, and o (cid:54) = o (cid:48) , then G ( o, d j ) = G ( o (cid:48) , d j ) = 1 and the remainder of the j ’th column of G is all 0. Then C = G . T , and max( C ) ≤ · max( T ) < d +1 .We demonstrate Lemma 3.7 with a concrete example. Consider a Population Protocol P definedby transitions τ : d , d → g , d τ : g , d → g , d τ : g , d → g , g τ : g , g → g , g τ : g , g → g , g { d , d , d } . Then P is ∆-ordered via τ , τ , τ , because τ does not reference d , and τ does not reference d or d , and for all i ∈ { , , } , τ i contains exactly one reference to d i as aninput. By the terminology of Lemma 3.7, Γ = { g , g } .For a given c ∆ , we can design a configuration e ∈ N ∆ such that c ∆ + e = ⇒ z Γ . We will removeagents in ∆ using the transitions given to us by P being ∆-ordered. For example, to remove n agents of d we will need transition τ to occur n times. Similarly, to remove m agents of d , wewill need τ to occur at least m times, and we may need more if τ generated additional copies of d . Let T be defined as in the proof of Lemma 3.7 and let c ∆ = In order to remove 5 copies of d , we need enough copies of d for τ to occur 5 times. Assuch, we add T . c ∆ ( d ) = 5 d agents to e allowing τ to occur 5 times, as shown in Figure 1.This effectively removes all copies of d and produces 5 extra copies of both g and d . Since P is∆-ordered, we know that the only states created will either be in Γ or they will be in ∆ but furtherin the ordering - allowing us to remove the extra agents at a later time. add 5· d c 𝚫 T.c ( ) 𝚫 dd ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : (cid:15482) → (a) (b) (c) Figure 1: First step of the surgery detailed in Lemma 3.7. (a)
Our initial configuration c ∆ . (b) Add 5 d agents which will react with 5 d agents. (c) All 5 copies of d have been removed.Now, we must remove 1 original copy of d plus 5 newly created copies created via τ in theprevious step. To do so, we can use τ , which requires we add T . c ∆ ( d ) = 6 additional copies of g to e . Via τ , an additional 6 copies of both d and g are created. This process is illustratedin Figure 2 Again, since d comes after d in the ordering, we can still remove all copies of d at alater step.There are now 8 copies of d to remove due to additional agents being produced in the previoussteps. We will add T . c ∆ ( d ) = 8 copies of g to e to allow 8 instances of τ to take place. Thiswill transition all instances of d into instances of g and leave us with a configuration z Γ of statesonly in Γ as shown in Figure 3While the process can be presented as several separate steps as above, e will be the sum of allthe agents added in the prior steps. In Figure 4, we add e to c ∆ , which will then transition to z Γ .We have removed all agents in ∆ and arrived at a configuration z Γ as desired.The next lemma works toward generating the vector of states e needed to apply Lemma 3.7.The “cost” for Lemma 3.8 is that the path must be taken “in the context” of additional agents instates captured by p . The intuitive reason p is needed is this: In Lemma 3.7, we add new transitionsand add enough new states ( e ) to supply the inputs for all these transitions. Thus the resultingcounts of states in Γ can only be larger than the the original path. However, the manipulation of15 add 6· g T.c ( ) 𝚫 d (cid:15482) (b) (c) d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : (a) Figure 2: Second step of the surgery detailed in Lemma 3.7. (a)
The same configuration as inpanel (c) of Figure 1. (b)
Add 6 g agents which will react with 6 d agents. (c) All 6 copies of d have been removed. add 8· g z 𝚪 T.c ( ) 𝚫 d (cid:15482) → (a) (b) (c) d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : Figure 3: Third step of the surgery detailed in Lemma 3.7. (a)
The same configuration as in panel(c) of Figure 2. (b)
Add 8 g agents which will react with 8 d agents. (c) All 8 copies of d havebeen removed. The resulting configuration contains only states in Γ.Lemma 3.8 does not add new states, so inputs of added transitions may have lower count. Also,unlike Lemma 3.8, the manipulation also involves removing transitions; thus the outputs of thosetransitions may have their counts lowered. The states in p are used as a “buffer” to keep anystate count from becoming negative, which could happen if the manipulation were applied to thepath starting from just the original configuration x . Because of this, we do not specify whereprecisely in the transition sequence certain transitions are added, nor which specific occurrencesare removed. These could be chosen anywhere along the sequence, and the buffer p ensures thatthe entire sequence remains applicable.Importantly, the net effect of the path preserves p , which will give a way to “interleave” Lem-mas 3.7 and 3.8, in order to start from a configuration with large counts of all states and reach aconfiguration with count 0 of all states in ∆. Note that unlike matrices ˜ C and ˜ C of Lemma 3.7,the matrix ˜ C may have negative entries, since the resulting configuration is described as a differ-ence from the configuration o , and some states in Γ may have lower count in the new configurationthan in o . Lemma 3.8 (adapted from [20]) . Let b , b ∈ N . Let x , o ∈ N Λ such that x = ⇒ q o via path q thatdoes not contain a b -bottleneck. Define ∆ = { d ∈ Λ | o ( d ) ≤ b } , d = | ∆ | , and Γ = Λ \ ∆ . Let o ∆ = o (cid:22) ∆ and o Γ = o (cid:22) Γ . Then there is a matrix ˜ C ∈ Z Γ × ∆ with amax( ˜ C ) < d +1 , suchthat for all e ∆ ∈ N ∆ , if b ≥ | Λ | · b + d d · max( b , e ∆ ) · | Λ | , and if x ( s ) ≥ b for all s ∈ Λ and o ( s ) ≥ b for all s ∈ Γ , letting p ∈ N Λ be defined p ( s ) = d d +1 · max( b , e ∆ ) for all s ∈ Λ , then p + x = ⇒ p + o Γ + ˜ C . o ∆ − ˜ C . e ∆ + e ∆ . Note that we consider configurations in which all counts in o Γ are arbitrarily large (see Lemma 3.9),whereas counts in o ∆ and e ∆ , as well as the entries of ˜ C , are bounded. Thus, for sufficiently large16 ec 𝚫 add e g },
5· 6· ⊕ ⊕ z 𝚪 = {5· d (cid:15482) e (a) (b) (c) d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : Figure 4: Illustration of the whole path surgery technique detailed in Lemma 3.7. We combine thesteps shown in Figures 1, 2, and 3 to form a single transition sequence leading from c ∆ to z Γ . (a) The same initial configuration c ∆ as in panel (a) of Figure 1. (b) Add e = { d } + { g } + { g } = { d , g } to c ∆ . (c) All states in ∆ are removed and we reach a configuration z Γ .starting configurations, o Γ ≥ ˜ C . o ∆ − ˜ C . e ∆ + e ∆ , justifying our earlier claim that in this lemma,we “get p back at the end.” Proof.
By Lemma 3.4, P is ∆-ordered via τ , . . . , τ d , and each τ i occurs at least ( b − | Λ | · b ) / | Λ | times in q .Intuitively, this proof is similar to that of Lemma 3.7, except that instead of targeting count0 of all states in ∆, we target counts given by e ∆ . Also, rather than constructing a new pathconsisting solely of transitions of type τ , . . . , τ d , we alter the path q , which may contain othertypes of transitions (although we will only modify transitions of type τ , . . . , τ d ). Since x = ⇒ p o ,we can think of our “starting value” for counts in ∆ as being o ∆ , and thus the total change incounts that we want to make is described by the vector o ∆ − e ∆ . In particular, since we may have o ∆ ( d i ) < e ∆ ( d i ) for some d ∈ ∆, this may require removing transitions from q as well as addingthem. Furthermore, since we have no e at the start as in Lemma 3.7, when adding or removingtransition d i , s → o, o (cid:48) to alter the count of d i , we must account not only for the effect this has onthe output states o, o (cid:48) , but also the effect on the other input state s . This may result in a paththat is not valid, in the sense that some counts may be negative after the modification. The extrastates in p have the purpose of keeping the entire path valid. The bound on p will then be derivedfrom the bound on the size of the changes to q that we make.First, we define a matrix ˜ T ∈ Z d × d . Intuitively, if ˜ c ∆ ∈ Z ∆ represents changes in counts ofstates in ∆ that we wish to achieve through addition and removal of transitions τ , . . . , τ d from thepath q , then the vector ˜ t ∈ Z d defined by ˜ t = ˜ T . ˜ c ∆ represents changes in counts of transitions τ , . . . , τ d in the path q to achieve this. More precisely, the counts in o are given by o ∆ , but wewish them to be e ∆ instead. Letting ˜ c ∆ = o ∆ − e ∆ , then ˜ t = ˜ T . ˜ c ∆ describes how many transitionsof each type to add or remove from q .Define the d × d matrix ˜ T as follows. Intuitively, ˜ T is a matrix such that, if ˜ t ∈ Z d represents(possibly negative) “counts of transition executions”, i.e., ˜ t ( j ) means “execute transition τ j anadditional ˜ t ( j ) times” (where executing a transition an additional negative number of times meansremoving it from q ), then ˜ T . ˜ t ∈ Z d (equivalently, Z ∆ ) represents the total count of states in ∆ that would be produced as outputs of these transitions or consumed as the second input . Here, the“second” input means, for transition τ i : d i , s → o, o (cid:48) , the input s that is not d i . It does not accountfor the number of input states in Γ consumed, nor the number of output states in Γ produced.Formally, ˜ T is a strictly lower diagonal matrix (0’s on and above the diagonal). Column j is0’s, other than potentially up to two nonzero entries, described below. • If τ j has output states d k , d k (cid:48) where j < k (cid:54) = k (cid:48) , then ˜ T ( k, j ) = ˜ T ( k (cid:48) , j ) = 1.17 If τ j has output states d k , d k where j < k , then ˜ T ( k, j ) = 2. • If τ j has output states d k , g , where j < k and g ∈ Γ, then ˜ T ( k, j ) = 1. • If τ j has second input state d k where j < k , then ˜ T ( k, j ) = − P is ∆-ordered via τ , . . . , τ d , there are no other forms the transitions can take.For example, if we have transitions τ : d , d → d , d τ : d , g → d , d τ : d , d → d , g τ : d , d → g , g τ : d , g → d , d τ : d , g → g , g where g , g ∈ Γ, then ˜ T = − − − We define ˜ T based on ˜ T . Na¨ıvely, to consume (respectively, produce) counts of states asdescribed in ˜ c ∆ , for each i ∈ { , . . . , d } one would add ˜ c ∆ ( i ) copies of τ i (where adding a negativeamount means removing from path q ). Since P is ∆-ordered this would indeed result in alteringthe count of d by ˜ c ∆ ( d ). However, although for i ∈ { , . . . , d } , this consumes (resp. produces) c ∆ ( d i ) copies of d i , it also produces ( ˜ T . ˜ c ∆ )( i ) copies of d i (where “producing” a negative numbercorresponds to consuming copies of d i ). Note that ( ˜ T . ˜ c ∆ )(1) = 0 since d does not appear in anytransition other than τ .We take the same approach as in the proof of Lemma 3.7, in which we take the vector ˜ T . ˜ c ∆ ,which represents the difference between the count of states in ∆, compared to our target after doingstep 1 above. Step 2 consists of adding transitions as described by the vector ˜ T . ˜ c ∆ , resulting in˜ T . ˜ c ∆ , in which ˜ T . ˜ c ∆ (1) = ˜ T . ˜ c ∆ (2) = 0. The i ’th step involves adding transitions according tothe vector ˜ T i . ˜ c ∆ . We define ˜ T = (cid:80) d − i =0 ˜ T i .Thus, if transition τ i appears a i times in q , then in the altered path q (cid:48) , it appears a i + ( ˜ T . ˜ c ∆ )( i )times. Thus, so long as for each i , a i ≥ − ( ˜ T . ˜ c ∆ )( i ), there are sufficiently many transitions ofeach type in q to potentially remove. Since each column of ˜ T has either a single 2, or two 1’s,and at most one −
1, a simple induction shows that for each i , amax( ˜ T i ) ≤ i . Thus amax( ˜ T ) ≤ (cid:80) d − i =0 ˜ T i ≤ (cid:80) d − i =0 i < d , which implies that max( − ( ˜ T . ˜ c ∆ )) < d d · amax(˜ c ∆ ). Thus, it sufficesif a i ≥ d d · amax(˜ c ∆ ). By Lemma 3.4, a i ≥ ( b − | Λ | · b ) / | Λ | . Thus it suffices to show that d d · amax(˜ c ∆ ) ≤ ( b − | Λ | · b ) / | Λ | . Note that b ≥ max( o ∆ ) by the defintion of ∆ in thestatement of the lemma. Then we have d d · amax(˜ c ∆ ) = d d · amax( o ∆ − e ∆ ) ≤ d d · max( o ∆ , e ∆ ) ≤ d d · max( b , e ∆ ) ≤ ( b − | Λ | · b ) / | Λ | where the last inequality follows from the assumption that b ≥ | Λ | · b + d d · max( b , e ∆ ) · | Λ | .It remains to define ˜ C , so that the vector ˜ C . ˜ c ∆ = ˜ C . o ∆ − ˜ C . e ∆ describes relative counts ofstates in Γ compared to o Γ . First, define the matrix G ∈ N Γ × ∆ as follows, which intuitively mapsa count vector of transitions in τ , . . . , τ d to a total count of states in Γ either produced as outputor consumed as a second input by the transitions. Let j ∈ { , . . . , d } and let τ j : d j , s → o, o (cid:48) . Let18 ∈ { , . . . , g } (recall g = | Γ | ). Let G ( i, j ) ∈ {− , , , } denote the net number of g i producedby τ j ; e.g., − s = g i (cid:54) = o, o (cid:48) , 0 if g i (cid:54) = s, o, o (cid:48) or if g i = s = o (cid:54) = o (cid:48) , etc. Then ˜ C = G . T , andamax( ˜ C ) ≤ · amax( ˜ T ) < d +1 .Finally, recall that the new path may not be valid since, although the final configuration o Γ +˜ C . o ∆ − ˜ C . e ∆ + e ∆ ∈ N Λ is nonnegative, some intermediate configurations between x and thefinal configuration could be negative. Define G (cid:48) ∈ N Λ × ∆ similarly to G above, but reflectingthe effect of a transition τ , . . . , τ d on every state s ∈ Λ (not just those in Γ). Then letting˜ C (cid:48) = G (cid:48) . T , amax( ˜ C (cid:48) . ˜ c ∆ ) < d d +1 amax(˜ c ∆ ) is an upper bound on how much any individual statecount can change. Thus, for all s ∈ Λ, letting p ( s ) = d d +1 · amax(˜ c ∆ ) = d d +1 · amax( o ∆ − e ∆ ) ≤ d d +1 · max( o ∆ , e ∆ ) ≤ d d +1 · max( b , e ∆ ) suffices to ensure that the whole path p + x = ⇒ p + o Γ +˜ C . o ∆ − ˜ C . e ∆ + e ∆ is valid.The following example provides intuition for Lemma 3.8. Let ∆, Γ, x , o , p be defined as inLemma 3.8. For all e ∆ , we can alter a transition sequence p — either by adding or removingtransitions — to ensure we finish with only states in Γ plus exactly e ∆ from ∆. In other words,given that we have additional agents in p to use, we can manipulate a population protocol to havethe exact amount of agents in ∆ that we desire. Depending on the desired e ∆ , doing so will effectthe counts of states in Γ in a predictable way.Let us continue with the above example using P . In order to transition c ∆ to z Γ , we needed toadd e , which contained 14 copies of g and 5 copies of d . So, for this example, we will show howto produce e ∆ such that e ∆ = Let x = ⇒ p o by transition sequence p and let o ∆ = So, ˜ c ∆ = o ∆ − e ∆ = − representing the number of agents of each state in ∆ that must be removed. The proof of Lemma 3.8provides further detail on how to create matrices to determine exactly how many instances of eachtransition are added or removed based on ˜ c ∆ . We will need to remove two instances of τ and add3 instances of τ and 4 instances of τ .Additional transition executions can be added to the end of the transition sequence withoutotherwise affecting the original transition sequence; however, you can only remove transition exe-cutions where they take place. Thus, to remove two instance of τ , we need to alter p in the middleof the sequence.Removing transitions has an affect on the overall counts of other states. We have extra statesin p to account for this. If removing a transition in the middle of the sequence causes the count ofa state to become zero later in the sequence, and if a transition requiring that state was meant totake place after that point, the extra agents in p can be used instead.Our example population protocol P includes τ and τ to demonstrate how p may be used.While these transition rules may not seem particularly useful in practice, they allow us to show asimple situation in which the count of one state dips to zero.19n P , removing two instances of τ will increase the count of d by 2, at the same time reducingthe count of g by 2. At some point in p , the count of g dips to 2. With 2 fewer g agents in ourmodified transition sequence, we instead arrive at a configuration where there are zero copies of g .In order for the next τ transition to take place, we must use the extra agents provided by p . Thus,the presence of additional agents allows the rest of the transition sequence to remain unchangedafter removing transitions from the transition sequence. This is demonstrated in Figure 5.We can then add the transitions necessary to remove d and d from the resulting configuration,since our final configuration e ∆ contains no agents from these states. This process is similar to theone detailed above to describe Lemma 3.7. In Figure 6 we add 3 instances of τ and in Figure 7 weadd 4 instances of τ , which completes the adjusted transition sequence.In the final configuration of Figure 7, counts of states in Γ are altered and counts of states in∆ are exactly equal to those in e ∆ as desired. This demonstrates how we can create e as requiredby Lemma 3.7. This concludes the description of the example showing Lemma 3.8.The following is a general lemma that uses Lemmas 3.7 and 3.8 to “steer” certain configurations(each of which is expressed as “twice a configuration x n where all counts are large ( ≥ b ), plus afew more states described by d ∆ ”) to a configuration with a “target” t ∆ amount of states in ∆.Intuitively, the proof goes like this: Letting c ∆ in Lemma 3.7 equal o n (cid:22) ∆ + d ∆ , the statesin ∆ in the final configuration o n , plus the states d ∆ that we have added at the start, which wewant to eliminate, use Lemma 3.7 to determine what states e need to be added to apply the extratransitions of Lemma 3.7 and eliminate all of d ∆ + o n (cid:22) ∆. Then, apply Lemma 3.8 to producethese states e from x n . However, Lemma 3.8 requires the presence of an extra “buffer” p of statesto enable e to be produced. A second copy of x n serves as this extra buffer (for large enough n x n ≥ p , since x n ( s ) ≥ βn for all state counts in x n , due to x n , when we employ Lemma 3.9, beingthe sequence of configurations from Lemma 3.6 in which all state counts are at least βn for a fixed β > d ∆ + o n (cid:22) ∆ (i.e., set final counts ofstates in ∆ all to 0), but to target other positive counts of states in ∆, represented by the vector t ∆ . The states in t ∆ can simply be generated by Lemma 3.8 alongside the states in e . In thispaper we use only Corollary 3.11, which sets t ∆ = , but it may be useful in other applications tobe able to choose a nonzero t ∆ . Lemma 3.9.
Let b ∈ N . Let N ⊆ N be infinite. Let ( x n ) n ∈ N and ( o n ) n ∈ N be nondecreasingsequences of configurations. Let ( p n ) n ∈ N be a sequence of paths such that, for all n ∈ N ,1. (cid:107) x n (cid:107) = (cid:107) o n (cid:107) = n ,2. x n ( s ) ≥ b for all s ∈ Λ ,3. x n = ⇒ p n o n , and4. p n has no b -bottleneck transition.Let ∆ = bdd (( o n ) n ∈ N ) , d = | ∆ | , and Γ = Λ \ ∆ . Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ with amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and the following holds. For each n ∈ N , let o ∆ n = o n (cid:22) ∆ and o Γ n = o n (cid:22) Γ . Let b = max n ∈ N,d ∈ ∆ o ∆ n ( d ) . For all b ∈ N , there is n b ∈ N such that forall n ∈ N with n ≥ n b and all d ∆ , t ∆ ∈ N ∆ with d ∆ ≤ b , t ∆ ≤ d d ( b + b ) , and b ≥ max( | Λ | · b + d d · max( b , d d +1 ( b + b )) · | Λ | , d d +2 ( b + b )) , we have x n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ + t ∆ .Proof. Choose n ∈ N sufficiently large to satisfy the conditions below as needed. The bound on b in the hypothesis is a max of two different bounds, each needed for its own purpose:20 d = d = d = d = g = g = g = g = g = g = x o p · d = g = g = d = d = d = d = d = g = g = d = d = g = g = d = d = d = d = d = d = · d = g = g = g = g = g = g = x c op i e s o f r e m ov e d d = TT g = g = d = d = d = d = g = g = d = d = d = d = d = d = p — · d = d = d = p · ( a )( )( c )( )( e ) ( a )( f) ( )( c )( )( e )( f) (cid:15482)(cid:15482)(cid:15482)(cid:15482) (cid:15482)(cid:15482) (cid:15482)(cid:15482) (cid:15482) (cid:15482) (cid:15482)(cid:15482) m a ny t r a n s iti on s m a ny t r a n s iti on s m a ny t r a n s iti on s m a ny t r a n s iti on s m a ny t r a n s iti on s d , d g , d → : g , d g , d → : g , d g , g → :
111 111 g , g g , g → : g , g g , g → : d , d g , d → : g , d g , d → : g , d g , g → :
111 111 g , g g , g → : g , g g , g → : pppp − · g F i g u r e : Su r g e r y a s d e s c r i b e d i n L e mm a3 . t o p r o du ce t w o e x t r a c o p i e s o f d . T h i s fi g u r e s h o w s t h e d i ff e r e n ce b e t w ee n t h e o r i g i n a l t r a n s i t i o n s e q u e n ce a nd t h e s e q u e n ce a f t e r s u r g e r y . T h e t o pd i ag r a m s h o w s x = ⇒ p o w i t h o u t a n y i n t e r f e r e n ce . ( a ) T h e i n i t i a l c o nfi g u r a t i o n x . ( b ) a n i n t e r m e d i a t ec o nfi g u r a t i o n . ( c ) i n s t a n ce s o f τ t a k e p l a ce . ( d ) A c o nfi g u r a t i o n a f t e r m a n y i n s t a n ce s o f τ h a v ec a u s e d t h ec o un t s o f g t o d r o p t o2 . ( e ) i n s t a n ce s o f τ t a k e p l a ce b r i n g i n g t h ec o un t o f g t o4 . ( f ) F i n a ll y , t h e t r a n s i t i o n s e q u e n cee nd s i n o . C o n s i s t e n t w i t h t h e d e fin i t i o n o f ∆ a nd Γ , t h ec o un t s o f s t a t e s i n ∆ a r e l o w , a nd c o un t s o f b o t h g a nd g a r e “ l a r g e ” . ( a ) T h e s a m e i n i t i a l c o nfi g u r a t i o n x f r o m ( ) . ( b ) t h e s a m e i n t e r m e d i a t ec o nfi g u r a t i o n f r o m ( b ) . ( c ) R e m o v e i n s t a n ce s o f τ . ( d ) D u e t o t h e r e m o v a l o f i n s t a n ce s o f τ , t h e r e a r e l e ss c o p i e s o f g a nd e x t r a c o p i e s o f d c o m p a r e d t o ( d ) . T h e t r a n s i t i o n s e q u e n ce r e a c h e s a p o i n t w h e r e t h e r e a r e n o t e n o u g h ag e n t s o u t s i d e o f p f o r τ t o e x ec u t e . ( e ) W e m u s t u s e t h e a dd i t i o n a l ag e n t s i n p t o c o n t i nu e w i t h t h e r e m a i nd e r o f t h e t r a n s i t i o n s e q u e n ce p − τ . ( f ) W e a r e l e f t w i t h dd i t i o n a l c o p i e s o f d a nd l e ss c o p i e s o f g du e t o r e m o v i n g2 i n s t a n ce s o f τ . W e h a v ec r e a t e d s o m e o f t h ec o p i e s o f d r e q u i r e d f o r o u r d e s i r e d e ∆ . N o t e t h a t p c a nb e “ r e s t o r e d ” b y t a k i n g c o p i e s o f g f r o m o Γ s i n ce i t h a s “ l a r g e ” c o un t s . g = 20 g = 22 d = 3 d = 1 d = 4 g = 23 g = 22 d = 0 d = 4 d = 1 p p d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : (a) (b) Figure 6: Removing all instances of d using techniques detailed in Lemma 3.8. Since we are addingtransitions (not removing them as in Figure 5), this is similar to the surgery shown in Figures 1, 2,and 3. (a) The same configuration as seen in panel (2f) of Figure 5. (b)
Add 3 instances of τ toremove all copies of d as e ∆ contains no copies of d (cid:15482) g = 23 g = 22 d = 0 d = 4 d = 1 d = 0 d = 5 d = 0 o + C .o - C .e + e 𝚫 𝚫 𝚪 ^ ~ ~ g = 23 g = 22 p p d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : (a) (b) Figure 7: Removing all instances of d using techniques detailed in Lemma 3.8. This is similarto the surgery shown in Figures 1, 2, and 3. (a) The same configuration as seen in panel (b) ofFigure 6. (b)
Add 4 instances of τ to remove all copies of d as e ∆ contains no copies of d (c) The only agents from ∆ that remain are exactly those needed in e ∆ = { d } .1. b ≥ | Λ | · b + d d · max( b , d d +1 ( b + b )) · | Λ | is necessary to apply Lemma 3.8.2. b ≥ d d +2 ( b + b ) is necessary to ensure that x n , which has x n ( s ) ≥ b for all s ∈ Λ byhypothesis, obeys x n ≥ p as defined below, where p is used as in Lemma 3.8.Choose ˜ C for ∆, Γ, x n , o n , and p n as in Lemma 3.8. By Lemma 3.7, letting c ∆ = d ∆ + o ∆ n ,there are C ∈ N Γ × ∆ and C ∈ N Λ × ∆ , so that, setting e = C . c ∆ , there is a transition sequence q such that d ∆ + o ∆ n + e = ⇒ q C . ( d ∆ + o ∆ n )= C . d ∆ + C . o ∆ n . Since max( C ) < d +1 , max( C ) < d , max( o ∆ n ) ≤ b , and max( d ∆ ) ≤ b , we have max( C . ( d ∆ + o ∆ n ) < d d +1 ( b + b ) and max( e ) = max( C . ( d ∆ + o ∆ n )) < d d ( b + b ) . Let e ∆ = e (cid:22) ∆ and e Γ = e (cid:22) Γ. Let e ∆2 = e ∆ + t ∆ . Since max( e ) < d d ( b + b ) andmax t ∆ ≤ d d ( b + b ), we have that max( e ∆2 ) ≤ d d +1 ( b + b ).22pply Lemma 3.8 on e ∆2 , which says that, letting p ∈ N Λ be defined p ( s ) = d d +1 · max( b , e ∆2 ) ≤ d d +1 · max( b , d d +1 ( b + b ))= d d +1 · d d +1 ( b + b )= d d +2 ( b + b )for all s ∈ Λ, there is a transition sequence q such that p + x n = ⇒ q p + o Γ n + ˜ C . ( o ∆ n ) − ˜ C . e ∆2 + e ∆2 = p + o Γ n + ˜ C . ( o ∆ n ) − ˜ C . e ∆2 + e ∆ + t ∆ . Since b ≥ max( | Λ | · b + d d · max( b , e ∆2 ) · | Λ | , ( d + 1)2 d +1 ( b + b )), we have b ≥ ( d +1)2 d +1 ( b + b ). Since x n ( s ) ≥ b for all s ∈ Λ, x n ≥ p , so by additivity2 x n = ⇒ q x n + o Γ n + ˜ C . ( o ∆ n ) − ˜ C . e ∆ + e ∆ + t ∆ . For large enough n , for all s ∈ Γ, o Γ n ( s ) ≥ e Γ ( s ) . Define ˆ o Γ n = o Γ n − e Γ . Then o Γ n + e ∆ = ˆ o Γ n + e .Therefore 2 x n = ⇒ q x n + ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + e ∆ + t ∆ . Recall that the transition sequence p n takes x n = ⇒ p n o n . By additivity we have (the relevant parts of the configuration needed for thesubsequence transitions are underlined)2 x n + d ∆ = ⇒ q x n + ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + e + t ∆ + d ∆ = ⇒ p n o n + ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + d ∆ + e + t ∆ = o Γ n + ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + o ∆ n + d ∆ + e + t ∆ = ⇒ q o Γ n + ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + C . d ∆ + C . o ∆ n + t ∆ = 2 o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + C . d ∆ + C . o ∆ n − e Γ + t ∆ Recall that e = C . ( d ∆ + o ∆ n ), so e Γ = C . ( d ∆ + o ∆ n ) (cid:22) Γ. Thus, the last configuration above is2 o Γ n + ˜ C . o ∆ n − ˜ C . ( C . ( d ∆ + o ∆ n ) (cid:22) ∆) + C . d ∆ + C . o ∆ n − C . ( d ∆ + o ∆ n ) (cid:22) Γ + t ∆ Let C Γ2 be C with the rows corresponding to ∆ removed (so that for any v ∈ N ∆ , C Γ2 . v ∈ Z Γ ;this has the same effect as restricting the output vector to Γ, as above with C . ( d ∆ + o ∆ n ) (cid:22) Γ).Similarly, let C ∆2 be C with the rows corresponding to Γ removed, and let ˜ C ∈ Z Γ × ∆ be ˜ C . C ∆2 ,Then the above configuration is2 o Γ n + ˜ C . o ∆ n − ˜ C . ( d ∆ + o ∆ n ) + C . d ∆ + C . o ∆ n − C Γ2 . ( d ∆ + o ∆ n ) + t ∆ = 2 o Γ n + ˜ C . o ∆ n − ˜ C . o ∆ n + C . o ∆ n − C Γ2 . o ∆ n − ˜ C . d ∆ + C . d ∆ − C Γ2 . d ∆ + t ∆ . Letting ˜ D = ˜ C − ˜ C + C − C Γ2 and ˜ D = − ˜ C + C − C Γ2 , the above is 2 o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ + t ∆ . Since max( C ) < d , and amax( ˜ C ) < d +1 , we can conclude that amax( ˜ C ) < d d +1 . Sincemax( C ) < d +1 and C and C are both nonnegative, we know that amax( C − C Γ2 ) < d +1 .Thus, amax( ˜ D ) < d +1 + d d +1 + 2 d +1 < d d +2 , and similarly for amax( ˜ D ).We will use the same population protocol used in the previous two examples, P , to demonstratehow Lemma 3.7 and Lemma 3.8 can be used in conjunction with each other. We choose the specialcase of target t ∆ = . We will show that if a transition sequence arrives at a configuration withoutany b -bottleneck transitions, then we can also bring all counts of states in ∆ to zero. In the23tatement of Lemma 3.9, we define Γ and ∆ over an infinite sequence. Here, will we be looking ata single population protocol with configuration x n that satisfies the constraints of Lemma 3.9. Let C be defined as in the proof of Lemma 3.9We will begin with two copies of x n plus d ∆ which contains additional agents from ∆ that needto be removed. x n = d ∆ = The second copy of x n will serve the same purpose as p in Lemma 3.8.Using Lemma 3.8, one copy of x n will transition via transition sequence q to ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + e . We use the same techniques here to build the desired e ∆ as in Lemma 3.8. Then, thesecond copy of x n will transition “normally” via p n to o n . The process is shown in Figure 8. o ∆ n = o + C .o - C .e + e n n 𝚫 𝚫 𝚪 ^ ~ ~ x n d 𝚫 d 𝚫 d 𝚫 g = 10 g = 10 d = 10 d = 10 d = 10 x n g = 10 g = 10 d = 10 d = 10 d = 10 d = 0 d = 5 d = 0 g = 23 g = 22 x n g = 10 g = 10 d = 10 d = 10 d = 10 d = 0 d = 5 d = 0 g = 23 g = 22 d = 3 d = 2 d = 1 g = 22 g = 22 o n q p n (cid:15482) (cid:15482) d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : o + C .o - C .e + e n n 𝚫 𝚫 𝚪 ^ ~ ~ (a) (b) (c) Figure 8: The first steps of Lemma 3.9 use techniques from Lemma 3.8 to push one copy of x n to the desired configuration and produce e . (a) We start with two copies of x n plus d ∆ . (b) Via transition sequence q based on the techniques of Lemma 3.8, we produce the e = { d , g } needed for Lemma 3.7. (c) Via transition sequence p n , the second copy of x n transitions withoutinterference to o n . We end in the configuration d ∆ + o n + ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + e . Figure 9 showshow to use Lemma 3.7 to use the e produced in (b) to remove states in ∆ in o n in (c).At this point, our goal is to remove all agents from d ∆ and o ∆ n . Using the techniques fromLemma 3.7 along with e created previously using the techniques of Lemma 3.8, e has exactly thecounts of agents from ∆ needed to remove all of d ∆ + o ∆ n . And so, d ∆ + o ∆ n + e = ⇒ q C . ( d ∆ + o ∆ n ) = C . d ∆ + C . o ∆ n The resulting final configuration contains only agents in Γ. As shown in Figure 9,all agents in ∆ have been removed, as desired.Finally, we combine Lemmas 3.6 and 3.9 into a single lemma, which is the main technical resultof this subsection, used (via Corollary 3.11, which sets t ∆ = ) for proving time lower bounds inTheorems 4.4, 6.3, 6.4, 8.4, and 8.5. 24 .d + 𝚫 C .o n 𝚫 d 𝚫 o + C .o - C .e n 3 3n 𝚫 𝚫𝚪 ^ ~ ~ q equivalent o n 𝚫 e o n 𝚪 e o n 𝚫 o + C .o - C .e n n 𝚫 𝚫𝚪 ^ ~ ~ o n 𝚪 d 𝚫 o + C .o - C .e n n 𝚫 𝚫𝚪 ^ ~ ~ o n 𝚪 = (cid:15482) d ,d g ,d → : g ,d g ,d → : g ,d g ,g → : g ,g g ,g → : g ,g g ,g → : (a) (b) (c) Figure 9: The second steps of Lemma 3.9 use techniques from Lemma 3.7 to remove all remainingstates from ∆. (a)
This is the same configuration as in panel (c) in Figure 8. (b)
We visuallyseparate e from ˆ o Γ n + ˜ C . o ∆ n − ˜ C . e ∆ + e and o ∆ n from o Γ n . (c) Via transition sequence q based onthe techniques of Lemma 3.7, d ∆ + o ∆ n + e = ⇒ q C . d ∆ + C . o ∆ n . The agents in e react with agentsfrom o n and d ∆ to remove all remaining states in ∆. The final configuration has only states fromΓ, as desired. Lemma 3.10.
Let α > . Suppose that for some set S ⊆ N Λ and infinite set I of α -denseconfigurations, for all i ∈ I , letting n = (cid:107) i (cid:107) , T [ i = ⇒ S ] = o ( n ) .Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinitenondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that the following holds. Let ∆ = bdd (( o n ) n ∈ N ) , d = | ∆ | , and Γ = Λ \ ∆ . For each n ∈ N , let o ∆ n = o n (cid:22) ∆ and o Γ n = o n (cid:22) Γ .Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and1. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. Let b = max n ∈ N,d ∈ ∆ o ∆ n ( d ) . For all b ∈ N , there is n b ∈ N such that, for all n ∈ N suchthat n ≥ n b and all d ∆ , t ∆ ∈ N ∆ such that d ∆ ≤ b and t ∆ ≤ d d ( b + b ) , we have that i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ + t ∆ .Proof. Let t : N → N be such that T [ i n = ⇒ S ] ≤ t ( n ). Define b ( n ) = | Λ | (cid:113) nt ( n ) ; note that b ( n ) = ω (1) since t ( n ) = o ( n ) by hypothesis. By Lemma 3.6 there is β > N ⊆ N and infinite sequences of configurations ( i n ∈ I ) n ∈ N ,( x n ∈ N Λ ) n ∈ N , ( o n ∈ N Λ ) n ∈ N , where ( x n ) n ∈ N and ( o n ) n ∈ N are nondecreasing, and an infinitesequence of paths ( p n ) n ∈ N such that, for all n ∈ N ,1. (cid:107) i n (cid:107) = (cid:107) x n (cid:107) = (cid:107) o n (cid:107) = n ,2. i n = ⇒ x n ,3. x n ( s ) ≥ βn for all s ∈ Λ,4. x n = ⇒ p n o n , where o n ∈ S , and5. p n has no b ( n )-bottleneck transition.Conditions (1) and (3) of Lemma 3.9 are two of the above. Let b = max n ∈ N,d ∈ ∆ o n ( d ). Let b =max( | Λ | · b + d d · max( b , d d +1 ( b + b )) · | Λ | , d d +2 ( b + b )). For sufficiently large n , βn > b ,satisfying condition (2) of Lemma 3.9, and b ( n ) ≥ b , satisfying condition (4) of Lemma 3.9.25hus Lemma 3.9 tells us that there are ˜ D , ˜ D ∈ Z Γ × ∆ such that for all b ∈ N , there exists n b ∈ N such that for all n ≥ n b such that n ∈ N and all d ∆ , t ∆ ∈ N ∆ such that d ∆ ≤ b and t ∆ ≤ d d ( b + b ), letting o ∆ n = o n (cid:22) ∆ and o Γ n = o n (cid:22) Γ, 2 x n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ + t ∆ .Since i n = ⇒ x n , by additivity 2 i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ + t ∆ . Lemma 3.9 also givesthat amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 .The following corollary, which sets t ∆ = , is the only result of this subsection employed forour time lower bounds. Corollary 3.11.
Let α > . Suppose that for some set S ⊆ N Λ and infinite set I of α -denseconfigurations, for all i ∈ I , letting n = (cid:107) i (cid:107) , T [ i = ⇒ S ] = o ( n ) .Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinitenondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that the following holds. Let ∆ = bdd (( o n ) n ∈ N ) , d = | ∆ | , and Γ = Λ \ ∆ . For each n ∈ N , let o ∆ n = o n (cid:22) ∆ and o Γ n = o n (cid:22) Γ .Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and1. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. For all b ∈ N , there is n b ∈ N such that, for all n ∈ N such that n ≥ n b and all d ∆ ∈ N ∆ such that max( d ∆ ) ≤ b , we have i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ . For all n ∈ N , define v Γ n = 2 o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ to be the configuration reached in part (2) ofthe conclusion. We note two important properties of v Γ n :1. v Γ n ∈ N Γ (i.e., it has no states in ∆). This is crucial for the final statement of Observation 3.12below arguing that v Γ n is stable.2. There is a constant c ∈ N such that for all s ∈ Γ and n ∈ N , | v Γ n ( s ) − o n ( s ) | ≤ c , i.e., thecounts of Γ states in v Γ n are within a constant c of those in 2 o n . The constant c depends onthe sequence ( o n ), which defines max( o ∆ n ), and c also depends on the bound b on max( d ∆ ),as well as the values of entries of ˜ D and ˜ D , but crucially c does not depend on n . In this subsection, let C be a function-computing or function-approximating population protocolwith input states Σ and output state y , taking “stable” in the next two observations to mean stablewith respect to y . The set ∆ (and its complement Γ) referenced frequently in previous sections willplay a key role the main proof as the set of states with bounded counts in some infinite sequenceof reachable stable configurations.The next observation states that if we have a stable configuration o , and we modify it byreducing the counts of states that are already “small” (contained in ∆) and changing in eitherdirection the counts of states that are “large” (contained in Γ), then the resulting configuration v is also stable. Observation 3.12.
If there is an infinite nondecreasing sequence ( o n ) of stable configurations suchthat Γ = unbdd (( o n )) and ∆ = bdd (( o n )) , for every v ∈ N Λ such that v (cid:22) ∆ ≤ o n (cid:22) ∆ for some n ∈ N , v is stable. In particular, any v ∈ N Γ is stable. Compare this to Lemma 3.10, which allows one to “target” a particular nonzero count t ∆ of ∆ states to bepresent in the final configuration. n , v ≤ o n , and stability is closed downward. Thefollowing corollary is useful, which states that adding any amount u of states in Γ to a stableconfiguration, as well as removing any amount w of states (whether in Γ or not), keeps it stable. Corollary 3.13.
If there is an infinite nondecreasing sequence ( o n ) of stable configurations suchthat Γ = unbdd (( o n )) , for every o n and every u ∈ N Γ and w ∈ N Λ , o n + u − w is stable. In this section we show that a wide class of Boolean predicates cannot be stably computed insublinear time by population protocols (without a leader). This is the class of predicates φ : N k →{ , } that are not eventually constant (see definition below): for all m ∈ N , there are two inputs m , m ∈ N k ≥ m such that φ ( m ) (cid:54) = φ ( m ). Computation of Boolean predicates φ : N k → { , } was the first type of computational problemstudied in population protocols [4–7]. Compared to function computation (defined formally inSection 5), it is a bit more complex to define output, since we require a convention for convertingseveral integer counts to a single Boolean value. However, the definition is also simpler becausethere is no need for initial configurations to contain quiescent states (see Section 5): whateverpredicates are computable by population protocols, are computable from initial configurationscontaining only the input states [7]. Thus we have a 1-1 correspondence between inputs to φ andvalid initial configurations.It is worth mentioning that, using the output convention from the foundational work on predi-cate computation with population protocols [4–7], we cannot merely consider predicates a specialcase of functions with integer outputs in { , } . If this were the case, then the results of this sectionwould follow trivially from Theorem 8.5. The reason this does not work is that the output conven-tion requires not merely to produce a single y if and only if the answer is yes; instead it requires all agents to vote unanimously on a “yes” or “no” output. Formally, a predicate-deciding leaderless population protocol is a tuple D = (Λ , δ, Σ , Υ ), where(Λ , δ ) is a population protocol, Σ ⊆ Λ is the set of input states , and Υ ⊆ Λ is the set of .By convention, we define Υ = Λ \ Υ to be the set of . The output Φ( c ) of a configuration c ∈ N Λ is b ∈ { , } if c ( s ) = 0 for all s ∈ Υ − b (i.e., if the vote is unanimously b ); the outputis undefined if voters of both types are present. We say o ∈ N Λ is stable if Φ( o ) is defined andfor all o (cid:48) ∈ post ( o ), Φ( o (cid:48) ) = Φ( o ). For all m ∈ N k , define initial configuration i m ∈ N Λ by i m (cid:22) Σ = m and i m (cid:22) (Λ \ Σ) = . Call such an initial configuration valid . For any valid initialconfiguration i m ∈ N Λ and predicate φ : N k → { , } , let S i m ,φ = { o ∈ N Λ | i m = ⇒ o , o is stable,and Φ( o ) = φ ( m ) } . A population protocol stably decides a predicate φ : N k → { , } if, for any The reason this issue is not trivially resolved by converting the “0 / y is absent, there is no straightforward way to detect this in orderto ensure that 0-voters are produced. It turns out that this output convention is equivalent if time complexity isnot an issue, although this is not straightforward to prove [11]. But this leads to the second issue: 2) Even with asymmetric convention where a single n state is present to represent output 0, and a single y state to represent output1, it takes at least linear time to convert all other voters by a standard scheme where the single agent representingoutput directly interacts with all other agents. The original definition [4] used the term stably compute , which we reserve for integer-valued function computa-tion. i m ∈ N Λ , Pr [ i m = ⇒ S i m ,φ ] = 1. This is equivalent to requiring that for all c ∈ post ( i m ), there is o ∈ post ( c ) such that o is stable and Φ( o ) = φ ( m ).For example, the protocol defined by transitions x , x → q , q x , q → x , q x , q → x , q q , q → q , q if Υ = { x , q } and Υ = { x , q } , decides whether m = i ( x ) ≥ m = i ( x ). The first transitionstops once the less numerous input state is gone. If x (resp. x ) is left over, then the second (resp.third) transition converts q i states to its vote. If neither is left over (i.e., if m = m , requiringoutput 1), the fourth transition converts all q states to q . Relation to prior work.
Alistarh, Aspnes, Eisenstat, Gelashvili, and Rivest [1] showed a linear-time lower bound on any leaderless population protocol deciding the majority predicate. Theirtechnique is based on showing that after adding enough of the input in the minority to change itto the majority, the effect of this addition can be effectively nullified by surgery of the transitionsequence, yielding a stable configuration with the original (now incorrect) answer. The techniquecan be extended easily to show various other specific predicates, such as equality and parity, alsorequire linear time. We use the same technique of finding pairs of inputs with opposite correctanswers and apply a similar transition sequence surgery. The main difficulty in showing Theo-rem 4.4, which covers the class of all predicates that are semilinear but not eventually constant(see below), is to identify a common characteristic, derived from the semilinear structure of thepredicate computed, that can be exploited to find an infinite sequence of pairs of inputs that areall α -dense for some fixed α >
0. Subsection 4.2 shows how this structure can be used.
Let φ : N k → { , } , and for b ∈ { , } , define φ − ( b ) = { m ∈ N k | φ ( m ) = b } to be the set ofinputs on which φ outputs b . We say φ is eventually constant if there is m ∈ N such that φ isconstant on N k ≥ m = { m ∈ N k | ( ∀ i ∈ { , . . . , k } ) m ( i ) ≥ m } , i.e., either φ − (0) ∩ N k ≥ m = ∅ or φ − (1) ∩ N k ≥ m = ∅ . In other words, although φ may have an infinite number of each output,“sufficiently far from the boundary” (where all coordinates exceed m ), only one output appears.The main result of this section, Theorem 4.4, concerns eventually constant predicates as definedabove. However, our proof technique requires reasoning about infinitely many inputs m ∈ N k thatare α -dense for some α >
0. A predicate φ : N k → { , } can be not eventually constant, yet forany fixed α >
0, have all but finitely many α -dense inputs map to a single output. For example,the predicate φ ( m ) = 1 ⇐⇒ m (1) = m (2) is not eventually constant, yet for any fixed α > α -dense inputs m have φ ( m ) = 0. The rest of this section shows that for semilinear predicates φ , if φ is not eventually constant, then we can find infinitely many α -denseinputs mapping to each output. The actual requirements we need to prove Theorem 4.4 are a bitmore technical and are captured in Corollary 4.3.Given D ⊆ N k , we say φ is almost constant on D if either | φ − (0) ∩ D | < ∞ or | φ − (1) ∩ D | < ∞ .In other words, φ is constant on D except for a finite number of counterexamples in D . For α > Note that almost constant is a stricter requirement than eventually constant, since the latter allows infinitelymany counterexamples so long as at least one component is “small”. k ∈ N , let D kα = { m ∈ N k | m is α -dense } . Say that a predicate φ : N k → { , } is α -denselyalmost constant if φ is almost constant on D kα . Say that φ is densely almost constant if for all α > φ is α -densely almost constant.The following proof uses the definition of semilinear given in Section 8 in terms of finite unionsof periodic cosets. Lemma 4.1. If φ : N k → { , } is semilinear and densely almost constant, then φ is eventuallyconstant.Proof. We prove this by contrapositive. Assume φ is semilinear and not eventually constant. Wewill show φ is not densely almost constant.For b ∈ { , } , let I b = φ − ( b ) be the set of inputs mapping to output b . Since φ is not eventuallyconstant, for all m ∈ N , for both b ∈ { , } , | I b ∩ N k ≥ m | (cid:54) = ∅ . If for some m , | I b ∩ N k ≥ m | < ∞ ,then for sufficiently large m (cid:48) , we would have | I b ∩ N k ≥ m (cid:48) | = ∅ , a contradiction. So in fact, for all m ∈ N , for both b ∈ { , } , | I b ∩ N k ≥ m | = ∞ .Since φ is semilinear, so is I b , so expressible as a finite union I b = (cid:83) pi =1 P i , of p periodic cosets P , . . . , P p . Since | I b ∩ N k ≥ m | = ∞ for all m ∈ N , without loss of generality, | P ∩ N k ≥ m | = ∞ for all m ∈ N as well. Let b , p , . . . , p l ∈ N k be such that P = { b + n p + . . . + n l p l | n , . . . , n l ∈ N } .Let p = p + . . . + p l . Then p ( i ) > i ∈ { , . . . , k } . (Otherwise, we would have( ∃ i )( ∀ j ) p j ( i ) = 0 and P could not be arbitrarily large on component i , so it could not intersect N k ≥ m for all m .) Letting α (cid:48) = min( p ) / (cid:107) p (cid:107) , we have that for all r ∈ N , r p is α (cid:48) -dense. Let α = α (cid:48) /
2. Then for sufficiently large r , b + r p is α -dense. Since ( b + r p ) ∈ P ⊆ I b , this showsthat I b has infinitely many α -dense points. Since b ∈ { , } was arbitrary, φ is not α -densely almostconstant, hence not densely almost constant.For i ∈ { , . . . , k } , let u i ∈ N k be the unit vector such that u i ( i ) = 1 and u i ( j ) = 0 for all j (cid:54) = i . Lemma 4.2.
Let φ : N k → { , } . If φ is not densely almost constant, then there is α > and aninfinite subset D ⊆ D kα so that one of the following two conditions holds.1. For all m ∈ D , φ ( m ) (cid:54) = φ (2 m ) .2. There is i ∈ { , . . . , k } such that for all m ∈ D , φ ( m ) (cid:54) = φ ( m + u i ) and φ ( m ) (cid:54) = φ (2( m + u i )) .Proof. Since φ is not densely almost constant, for some α > | φ − (0) ∩ D kα | = | φ − (1) ∩ D kα | = ∞ .So for infinitely many m ∈ D kα , there is i m ∈ { , . . . , k } such that φ ( m ) (cid:54) = φ ( m + u i m ). In otherwords, since each output b ∈ { , } is supported on infinitely many points in D kα , there must beinfinitely many pairs of adjacent points with opposite output (“adjacent” meaning that the pointsdiffer on exactly one coordinate, and that difference is 1). By the pigeonhole principle there is i ∈ { , . . . , k } so that some infinite subset of these m use the same coordinate i m = i , so consideronly this infinite subset D (cid:48) ⊆ D kα .If φ ( m ) (cid:54) = φ (2 m ) for infinitely many m ∈ D (cid:48) , take D to be this infinite subset, and we are done.Otherwise, φ ( m ) = φ (2 m ) for all but finitely many m ∈ D (cid:48) . If φ (2 m ) (cid:54) = φ (2( m + u i )) forinfinitely many of these m , then φ ( m ) (cid:54) = φ (2( m + u i )) and we are done. In the remaining case, wehave that φ (2( m + u i )) = φ (2 m ) (cid:54) = φ ( m + u i ) for infinitely many m ∈ D (cid:48) . In this case, replace eachsuch m in D (cid:48) with m (cid:48) = m + u i , calling the resulting set D , noting that m (cid:48) satisfies condition (1)of the lemma since φ ( m (cid:48) ) (cid:54) = φ (2 m (cid:48) ).Combining Lemma 4.2 and the contrapositive of Lemma 4.1 gives the following corollary.29 orollary 4.3. Let φ : N k → { , } be semilinear and not eventually constant. Then there is α > and an infinite subset D ⊆ D kα so that one of the following two conditions holds.1. For all m ∈ D , φ ( m ) (cid:54) = φ (2 m ) .2. There is i ∈ { , . . . , k } such that for all m ∈ D , φ ( m ) (cid:54) = φ ( m + u i ) and φ ( m ) (cid:54) = φ (2( m + u i )) . The following theorem shows that unless a predicate is eventually constant, it cannot be stablydecided in sublinear time by a leaderless population protocol.
Theorem 4.4.
Let φ : N k → { , } and D be a predicate-deciding leaderless population protocolthat stably decides φ . If φ is not eventually constant, then D takes expected time Ω( n ) . The high level intuition behind our proof technique is as follows. Sublinear time computationrequires avoiding “bottlenecks”—having to go through a transition in which both states are presentin small count (constant independent of the number of agents n ). Traversing even a single suchtransition requires linear time. Corollary 3.11 shows that bottleneck-free execution sequences from α -dense initial configurations (i.e., initial configurations where every state that is present is presentin at least αn count) are amenable to predictable “surgery”. Using Corollary 3.11, we show howto consume additional input states but still drive the system to the same output stable answer,and thus fool the population protocol into giving the wrong answer. Using Corollary 3.11 is rathertechnical and requires finding infinitely many candidate execution sequences and respective α -dense initial configurations that are “close” to other initial configurations on which the computedpredicate is supposed to evaluate to the opposite answer. The reason that Theorem 4.4 holds onlyfor not eventually constant predicates is that the initial configurations susceptible to surgery needto be α -dense, and thus we can only fool the population protocol if the predicate evaluates to both0 and 1 “far away” from the boundaries of N k .A bit of care is needed in picking the pairs of inputs that give a different answer. In particular,we need to ensure that any input states x i that we add in d ∆ when applying Corollary 3.11 areactually contained in ∆, the set of states with bounded counts in all the output stable configurationsin the sequence. Not all input states are contained in ∆ in some cases. For instance, consider themajority-computing protocol x , x → y, yx , n → x , yx , y → x , ny, n → y, y, which decides whether x ≥ x initially, if φ ( x ) = φ ( y ) = 1 and φ ( x ) = φ ( n ) = 0. If thesequence of inputs picked were such that x = 2 x , then x would grow unboundedly in stableconfigurations, hence x ∈ Γ. Note, however, that x ∈ ∆ since it would have count 0 in all suchstable configurations. This helps to see how ∆ depends on the choice of infinite sequences of inputs;if instead x = x / x ∈ ∆ but x ∈ Γ. If x = x , then x , x ∈ ∆.We choose such inputs m as in Lemma 4.2 to be such that either φ ( m ) (cid:54) = φ (2 m ), or φ ( m ) (cid:54) = φ ( m + u i ) and φ ( m ) (cid:54) = φ (2( m + u i )), where u i ∈ { , } k . In the first case, we don’t need any inputsto be in ∆; we get a contradiction since Corollary 3.11 with d ∆ = gives us a way to drive from2 m to a stable configuration very close to (therefore having the same output as) twice the stable30onfiguration reached from m , which gives a contradiction. In the second case, the contradictionarises between inputs m and 2( m + u i ), but unlike the first case, we need to apply Corollary 3.11with d ∆ (cid:54) = . The d ∆ we choose corresponds to the positive entries of u i . The assumption that φ ( m ) (cid:54) = φ ( m + u i ) is used to justify that those input states that are positive in u i are in factcontained in ∆, so that we are able to send their counts to 0 via Corollary 3.11 and conclude viaCorollary 3.13 that the resulting configuration is stable. Proof.
Suppose for the sake of contradiction that D takes expected time o ( n ). Since D stablydecides φ , φ is semilinear [5], so by Corollary 4.3 there is α > D ⊆ D kα sothat one of the following two conditions holds.1. For all m ∈ D , φ ( m ) (cid:54) = φ (2 m ).2. There is i ∈ { , . . . , k } such that for all m ∈ D , φ ( m ) (cid:54) = φ ( m + u i ) and φ ( m ) (cid:54) = φ (2( m + u i )).Let I = { i m ∈ N Λ | m ∈ D } denote the set of initial configurations corresponding to D . Let S = { o | ( ∃ i ∈ I ) i = ⇒ o and o is stable } be the set of stable configurations reachable from someinitial configuration in I . By assumption we have that for each i ∈ I , T [ i = ⇒ S ] = o ( n ).Apply Corollary 3.11. Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinite nondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that thefollowing holds. Let ∆ = bdd (( o n ) n ∈ N ), d = | ∆ | , and Γ = Λ \ ∆. For each n ∈ N , let o ∆ n = o n (cid:22) ∆and o Γ n = o n (cid:22) Γ. Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and1. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. For all b ∈ N , there is n b ∈ N such that, for all n ∈ N such that n ≥ n b and all d ∆ ∈ N ∆ such that max( d ∆ ) ≤ b , we have 2 i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ .Let b = 2; below we ensure that max( d ∆ ) ≤ b . Let m = i n b (cid:22) Σ and o = o n b .Suppose we are in case (1) of Lemma 4.2; then φ ( m ) (cid:54) = φ (2 m ). Let v Γ = 2 o Γ n b + ˜ D . o ∆ n b . Thenapplying the above reachability argument with d ∆ = gives that 2 i n b = ⇒ v Γ , which is stable andhas the same output as is correct for m , a contradiction since it is reachable from 2 i n b representinginput 2 m , which should have the opposite output.Suppose we are in case (2) of Lemma 4.2; then there is i ∈ { , . . . , k } such that for all m ∈ D , φ ( m ) (cid:54) = φ ( m + u i ) and φ ( m ) (cid:54) = φ (2( m + u i )). Let x i be the input corresponding to unit vector u i .We claim that x i ∈ ∆. To see why, recall that φ ( m ) (cid:54) = φ ( m + u i ). If x i (cid:54)∈ ∆, then Corollary 3.13tells us that o + { x i } is stable (hence the same output φ ( m ) as o ). However, i n b + { x i } = ⇒ o + { x i } ,a contradiction since φ ( m ) (cid:54) = φ ( m + u i ). This shows that x i ∈ ∆.Let d ∆ = { x i } ∈ N ∆ . By the above, letting v Γ = 2 o Γ n b + ˜ D . o ∆ n b + ˜ D . d ∆ , we have that2 i n b + d ∆ = ⇒ v Γ . By Corollary 3.13, v Γ is stable and reachable from the initial configuration2 i n b + d ∆ corresponding to input 2 m + u i , which should have the opposite output as m . Thiscontradicts the correctness of D . In this section we formally define error-free (a.k.a. stable ) function computation by populationprotocols. This mode of computation was discussed briefly in the first population protocols paper [4,Section 3.4], which focused more on Boolean predicate computation, and more extensively in themore general model of chemical reaction networks [15, 19].31 .1 Issues with definition of approximation and computation
There are subtle issues in formalizing these definitions for population protocols, as well as extendingfrom exact to approximate computation, which we discuss before stating our definitions.We focus on single-output functions f : N k → N . It is simple to apply all of our results tomulti-output functions f : N k → N l , simply by considering f as the result of combining l differentsingle-output functions all computed in parallel by independent protocols.The model of chemical reaction networks allows the creation and destruction of molecules viareactions such as X → Y and 2 X → Y . However, all population protocol transitions occurbetween two agents, so to compute a function such as f ( m ) = 2 m via the transition x, q → y, y requires starting with m agents in an input state x and at least m additional agents in a “quiescent”state q , to ensure that there are enough agents to represent the output of the function.Next, the time complexity models are slightly different between chemical reaction networks andpopulation protocols. In addition to the distinction between continuous time in chemical reactionnetworks and discrete time in population protocols, the former model has an extra parameter calledthe volume , which dictates the rate of bimolecular reactions. To make the models have the sameexpected time, the “volume” of a population protocol is implicitly the total number of agents n .However, as we noted above, the total number of agents n in some cases necessarily differs fromthe number of agents representing input . This leads to a definitional quandary: is it more “fair” tomeasure the time as a function of the input size m (number of agents representing input), or as afunction of the total system size n ≥ m (number of total agents, including non-input agents)? Wewill handle this by requiring the protocol to work no matter how large n is compared to m , butwill measure expected time as a function of n , and our main theorem applies to show an expectedtime lower bound only when n = O ( m ). This will lead to the same asymptotic time measurementwithin a multiplicative constant, whether time is measured as a function of m or n .Finally, given the specific nature of the problem we study, that of approximating functionswith population protocols, we must take care in what are defined as valid initial configurations.We observed that the protocol a, x → b, y and b, x → a, q can approximate the function f ( m ) = (cid:98) m/ (cid:99) within multiplicative factor γ from the initial configuration i m,γ defined by i m,γ ( x ) = m and i m,γ ( a ) = (cid:98) γm (cid:99) . The initial count of state a serves to control the approximation factor;setting it lower makes the approximation better but the stabilization time longer. What is theappropriate way to generalize this to a complete definition of function approximation? Note thatthe following does not work: declaring the set the valid initial configurations to be { i m,γ | m ∈ N } ,where γ is a fixed constant. For then, we could simply set γ = and let y = a , and have notransitions whatsoever: the initial configuration would already contain the correct amount of y ,with the computation having been done not by the protocol itself, but merely by the specificationof the initial configuration. To avoid this sort of cheating by “sneaking computation into the initialconfiguration,” we allow the designer of the protocol to set a constant lower bound (not dependenton the input value), but not an upper bound, on how many agents have initial state a .Informally, a population protocol exactly computes a function f : N k → N if, starting in aconfiguration with counts of agents in “input” states x , . . . , x k described by a vector m ∈ N k ,and sufficiently large counts of other agents in a “quiescent” state q , the protocol is guaranteedto stabilize to exactly f ( m ) agents in “output” state y . Unlike predicate computation with aBoolean output (as studied in the foundational population protocol papers [4–7]), it is necessaryto allow initial agents in the quiescent state q , beyond those representing the input, if f ( m ) > m (1) + . . . + m ( k ), to ensure there are enough agents to represent the output. For example, thefunction f ( m ) = 2 m is computable via the transition x, q → y, y if q ≥ x initially. However, theprotocol must work in any sufficiently large population, i.e., for any sufficiently large initial count32f q .Informally, a protocol approximates a function if it is guaranteed to get y “close” to thecorrect output value, where the closeness is controlled by the initial count of an “approximation”state a . (Actually, there is no requirement that the approximation error must depend on a , butthe definition is motivated by the protocols of Theorem 7.2, which do use the approximation statein this way.) In particular, the protocol may stabilize to different values of y on different runsstarting from the same initial configuration (so the protocol may not stably compute any function).However, the protocol is required to stabilize its output count to some value on each run. Analternative formulation would relax this requirement, and merely require that y eventually enters,and never again leaves, an interval surrounding the correct value, while continuing to change thevalue of y indefinitely. However, our proof technique is based on the idea that certain (carefullychosen) input states must be absent, or very low count, in stable configurations. Under this morerelaxed definition, this would not be the case. For example, for any γ >
0, there is a t ∈ R ≥ such that, for any m , starting with x = m , the transition x, x → y, q in expected time t gets y to the interval [ m/ − γm/ , m/ constant time the protocol “stabilizes to that interval”,even though the value of y may still change within that interval, so it is not stable by the stricterdefinition. However, at the time that y enters the interval, x = γm , whereas our proof techniquerequires x = O (1) in any stable configuration. In this example, once y stabilizes (i.e., stopschanging), then x is either 0 or 1.Sections 5.2 and 5.3 give formal definitions of these concepts. A function-computing leaderless population protocol is a tuple C = (Λ , δ, Σ , y, q ), where (Λ , δ ) is apopulation protocol, Σ = { x , . . . , x k } ⊂ Λ is the set of input states , y ∈ Λ is the output state , and q ∈ Λ \ Σ is the quiescent state . We say that a configuration o ∈ N Λ is stable if, for all o (cid:48) ∈ post ( o ), o ( y ) = o (cid:48) ( y ), i.e., the count of y cannot change once o is reached.Let f : N k → N , i ∈ N Λ , and let m = i (cid:22) Σ. We say that C stably computes f from i if, for all c ∈ post ( i ), there exists a stable o ∈ post ( c ) such that o ( y ) = f ( m ), i.e., C stabilizes to the correctoutput from the initial configuration i . However, for any input m ∈ N k , there are many initialconfigurations i ∈ N Λ representing it (i.e., such that i (cid:22) Σ = m ). We now formalize what sort ofinitial configurations C is required to handle.We say a function q : N k → N is linearly bounded if there is a constant c ∈ N such that, for all m ∈ N k , q ( m ) ≤ c (cid:107) m (cid:107) . We say that C stably computes f if there is a linearly bounded function q : N k → N such that, for any i ∈ N Λ , defining m = i (cid:22) Σ, if i ( q ) ≥ q ( m ) and i ( s ) = 0 forall s ∈ Λ \ (Σ ∪ { q } ), then C stably computes f from i . We say that an initial configuration i so defined is valid . Since all semilinear functions are linearly bounded [15], a linearly bounded q suffices to ensure there are enough agents to represent the output of a semilinear function, evenif we choose i ( q ) = q ( i (cid:22) Σ). If q were not linearly bounded, and thus a super-linear count ofstate q is required, we would essentially need to do non-semilinear computation just to initializethe population protocol.It is well-known [7] that this is equivalent to requiring, under the randomized model in whichthe next interaction is between a pair of agents picked uniformly at random, that the protocolstabilizes on the correct output with probability 1. More formally, given f : N k → N and m ∈ N k ,defining S C f, m = { o ∈ N Λ | o is stable and o ( y ) = f ( m ) } , C stably computes f if and only if, forall m , defining i with i (cid:22) Σ = m as above with i ( q ) sufficiently large, Pr (cid:104) i = ⇒ S C f, m (cid:105) = 1. It isalso equivalent to requiring that every fair infinite execution leads to a correct stable configuration,33here an execution is fair if every configuration infinitely often reachable appears infinitely oftenin the execution.Let f : N k → N and t : N → N . Given a function-computing leaderless population protocol C that stably computes f , we say C stably computes f in expected time t if, for all valid initialconfigurations i of C , letting m = i (cid:22) Σ, T (cid:104) i = ⇒ S C f, m (cid:105) ≤ t ( n ).Note that unstability is closed upwards in N Λ . In other words, for any c ∈ N Λ , if c is not stable,then no c (cid:48) ≥ c is stable either. This is because c is unstable if and only if there is a path p suchthat c = ⇒ p d and c ( y ) (cid:54) = d ( y ). Thus p is applicable to any c (cid:48) ≥ c , also changing y by the amount d ( y ) − c ( y ), so c (cid:48) is also unstable. By contrapositive, the set of stable configurations is then closed downward : for any stable o , if o (cid:48) ≤ o , then o (cid:48) is also stable. A function-approximating leaderless population protocol is a tuple A = (Λ , δ, Σ , y, q, a ), where(Λ , δ, Σ , y, q ) is a function-computing population protocol and a ∈ Λ \ (Σ ∪ { y, q } ) is the approxi-mation state . Let (cid:15), τ ∈ N ; intuitively τ represents the “target” (or “true”) function output, and (cid:15) represents the allowed approximation error. We say that a configuration o ∈ N Λ is (cid:15) - τ -correct if | o ( y ) − τ | ≤ (cid:15) .Let f : N k → N , (cid:15) ∈ N , i ∈ N Λ , and let m = i (cid:22) Σ. We say that A stably (cid:15) -approximates f from i if, for all c ∈ post ( i ), there exists a o ∈ post ( c ) that is stable and (cid:15) - f ( m )-correct, i.e., from theinitial configuration i , A gets the output to stabilize to a value at most (cid:15) from the correct output.Let S A f, m ,(cid:15) = { o ∈ N Λ | o is stable and (cid:15) - f ( m )-correct } . Note that A stably (cid:15) -approximates f from i if and only if Pr (cid:104) i = ⇒ S A f, m ,(cid:15) (cid:105) = 1.Let E : N → N ; the choice of E as a function instead of a constant reflects the idea that theapproximation error is allowed to depend on the initial count i ( a ) of the approximation state a ,i.e., E ( i ( a )) is the desired approximation error. We say that A stably E -approximates f if thereare a ∈ N and linearly bounded q : N k +1 → N such that, for any i ∈ N Λ , defining m = i (cid:22) Σ,if i ( a ) ≥ a , i ( q ) ≥ q ( m , i ( a )), and i ( s ) = 0 for all s ∈ Λ \ (Σ ∪ { q, a } ), then A stably E ( i ( a ))-approximates f from i . An initial configuration i so defined is valid .Note that we allow the protocol to require at least a certain initial amount of a in order tofunction correctly. For example, the protocol with transitions a, x → b, y and b, x → a, q stably E -approximates f ( m ) = (cid:98) m/ (cid:99) , where E : N → N is the identity function, if at least one a ispresent initially. However, setting a does not imply the protocol is able to use a as a leader: since a is just a lower bound. The protocol must work correctly for any initial value of i ( a ) ≥ a , where E ( i ( a )) defines how close the output must be to f ( m ) to be “correct”.Note also that in this example, the approximation error increases with i ( a ) (i.e., E is mono-tonically increasing), while the expected time to stabilization decreases with i ( a ). It is conceivablefor the approximation error to decrease with i ( a ), or even not to depend on i ( a ), although we donot know of any examples of such protocols. Our main theorem lower bounds the approximationerror as a linear function of the count of the lowest-count state present in the initial configuration,whether that is a or not, so our proof works regardless of the precise form of E . I.e., the initial count i ( a ) can influence the initial required count i ( q ), since adding more initial a may imply thatmore quiescent agents are required as “fuel”. However, a is constant, not a function of m . Sublinear-time, sublinear-error approximation of linear func-tions with negative or non-integer coefficients is impossible
We say a function f : N k → N is N -linear if there are c , . . . , c k ∈ N such that for all m ∈ N k , f ( m ) = (cid:80) ki =1 c i m ( i ).As we consider leaderless population protocols, we need to make sure that a does not act as asmall count “leader”. Consistent with the rest of this paper, we reason about initial configurationswith i ( a ) ≥ αn for some α > α -density.Let f : N k → N . In defining running time for function-approximating population protocols, weexpress the expected time as a function of both the total number of agents n = (cid:107) i (cid:107) and the initialcount i ( a ) of approximation states. Let E : N → N and t : N → N . Given a function-approximatingpopulation protocol A that E -approximates f , we say A E -approximates f in expected time t if, forall valid initial configurations i of A , letting m = i (cid:22) Σ, T (cid:104) i = ⇒ S A f, m , E ( i ( a )) (cid:105) ≤ t ( n, i ( a )).The following theorem states that given any linear function f and any population protocol P ,if f has a non-integer or negative coefficient, then P requires at least linear time to approximate f with sublinear error. It states this by contrapositive: if the protocol takes sublinear time, thenthe error E : N → N must grow at least linearly with the initial count of approximation state a . Inparticular, the initial configurations i (letting n = (cid:107) i (cid:107) ) on which our argument maximizes the errorhave i ( a ) = Ω( n ). Thus, the fact that E ( a ) ≥ γa implies that on these i , the error is Ω( n ). Theorem 6.1.
Let f : N k → N be a linear function that is not N -linear. Let E : N → N . Let A be afunction-approximating leaderless population protocol that stably E -approximates f in expected time t , where for some α > , t ( n, αn ) = o ( n ) . Then there is a constant γ > such that, for infinitelymany a ∈ N , E ( a ) ≥ γa . A protocol stably computing f also stably E -approximates f for E ( a ) = 0, so we have: Corollary 6.2.
Let f : N k → N be a linear function f ( m ) = (cid:80) ki =1 (cid:98) c i m ( i ) (cid:99) , where c i (cid:54)∈ N for some i ∈ { , . . . , k } . Let C be a function-computing leaderless population protocol that stably computes f .Then C takes expected time Ω( n ) . This gives a complete classification of the asymptotic efficiency of computing linear functions f ( m ) = (cid:80) ki =1 (cid:98) c i m ( i ) (cid:99) with population protocols. If c i ∈ N for all i ∈ { , . . . , k } , then f is stablycomputable in logarithmic time by Observation 7.1. Otherwise, f requires linear time to stablycompute by Corollary 6.2, or even to approximate within sublinear error by Theorem 6.1. Theremainder of Section 6 is devoted to proving Theorem 6.1.Theorem 6.1 follows directly from the two theorems in this section.First, we show that subtraction takes linear time to approximate with sublinear error. Theorem 6.3.
Let f : N k → N be a linear function f ( m ) = (cid:80) ki =1 (cid:98) c i m ( i ) (cid:99) , where c i < forsome i ∈ { , . . . , k } . Let E : N → N and t : N → N . Let A be a function-approximating leaderlesspopulation protocol that stably E -approximates f in expected time t . Suppose there is α > such that t ( n, αn ) = o ( n ) . Then there is a constant γ > such that, for infinitely many a ∈ N , E ( a ) ≥ γa .Proof. Assume without loss of generality that f ( m ) = c m (1) − c m (2) for c , c >
0; a functionwith more inputs can have those inputs set to 0, and the remaining two re-ordered to be thefirst two, to result in this f . Assume for notational ease that c = c = 1. The extension to othercoefficients in Q > is routine, requiring us only to modify the set I = α below to contain configurations i with c i ( x ) = c i ( x ) instead of merely i ( x ) = i ( x ).35et E : N → N and t : N → N . Let C be a function-approximating population protocol thatstably E -approximates f in expected time t . Let α > t ( n, αn ) = o ( n ) and, for all m ∈ N , there is a valid α -dense initial configuration i ∈ N Λ such that i ( x ) = i ( x ) = m . Such an α exists since the quiescent threshold q : N k → N is linearly bounded.Let I = α be the set of all such α -dense valid i , where i ( x ) = i ( x ) (i.e., the set of α -dense initialconfigurations representing an input m to f such that f ( m ) = 0). Let S = { o | ( ∃ i ∈ I = α ) i = ⇒ o and o is stable } be the set of stable configurations reachable from some initial configuration in I = α .By assumption we have that for each i ∈ I = α , T [ i = ⇒ S ] = o ( n ).Apply Corollary 3.11. Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinite nondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that thefollowing holds. Let ∆ = bdd (( o n ) n ∈ N ), d = | ∆ | , and Γ = Λ \ ∆. For each n ∈ N , let o ∆ n = o n (cid:22) ∆and o Γ n = o n (cid:22) Γ. Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and1. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. For all b ∈ N , there is n b ∈ N such that, for all n ∈ N such that n ≥ n b and all d ∆ ∈ N ∆ such that max( d ∆ ) ≤ b , we have 2 i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ .Let b = 1; below we ensure that max( d ∆ ) ≤ b .There are two cases: y ∈ ∆ : We claim that x ∈ ∆. To see why, observe that increasing the initial amount of x by1 should increase the output by 1. If we had x ∈ Γ, then by Corollary 3.13, for any stableconfiguration o , the configuration o + { x } would also be stable, but would have the sameoutput. Let i be any initial configuration representing an input with x = x , such that i = ⇒ o . Then we should have o ( y ) = 0. Then i + { x } = ⇒ o + { x } , a contradiction since thecorrect output to compute from i + { x } is 1, but the output is also 0 in stable configuration o + { x } . This shows the claim that x ∈ ∆.Let d ∆ = { x } . Let w = 2 o Γ n b + ˜ D . o ∆ n b and let c = ˜ D . d ∆ . The above implies that2 i n b + { x } = ⇒ w + c . For all l ∈ N , let v l = l ( w + c ) and i (cid:48) l = l (2 i n (cid:48) + { x } ). Thus i (cid:48) l = ⇒ v l .Let m = (2 lm + l, lm ) = i (cid:48) l (cid:22) Σ, with correct output f (2 lm + l, lm ) = l , but v l ( y ) = 0. y ∈ Γ : Then for all sufficiently large n ≥ n b , 2 o n ( y ) + (cid:18) min n (cid:48) ∈ N (cid:16) ˜ D . o ∆ n (cid:48) (cid:17) ( y ) (cid:19) >
0. Fix such an n .Let w = 2 o Γ n + ˜ D . o ∆ n ; note that w ( y ) >
0. Letting d ∆ = , the above implies that 2 i n = ⇒ w .For all l ∈ N , let v l = l w and i (cid:48) l = 2 l i n . Thus i (cid:48) l = ⇒ v l .Let m = (2 lm, lm ) = i (cid:48) l (cid:22) Σ, with correct output f (2 lm, lm ) = 0, but v l ( y ) ≥ l .In each case v l is stable by Observation 3.12 and reachable from an initial configuration i (cid:48) l repre-senting input m , with | v l ( y ) − f ( m ) | ≥ l , so E (2 l i n b ( a )) ≥ l . Since 2 i n b ( a ) is constant with respectto l , choosing γ = i nb ( a ) proves the theorem.Now we show that division by a constant takes linear time to approximate with sublinear error. Theorem 6.4.
Let f : N k → N be a linear function f ( m ) = (cid:80) ki =1 (cid:98) c i m ( i ) (cid:99) , where c i (cid:54)∈ Z forsome i ∈ { , . . . , k } . Let E : N → N and t : N → N . Let A be a function-approximating leaderlesspopulation protocol that stably E -approximates f in expected time t . Suppose there is α > such that t ( n, αn ) = o ( n ) . Then there is a constant γ > such that, for infinitely many a ∈ N , E ( a ) ≥ γa . roof. If c i < i , then Theorem 6.3 applies and we are done, so assume all c i ≥
0. Assumewithout loss of generality that f ( m ) = (cid:98) cm (cid:99) , where c ∈ Q > \ N ; a function with more inputs canhave those inputs set to 0 to result in this f . Write c in lowest terms as pr for p, r ∈ Z ≥ , and notethat r ≥ c (cid:54)∈ Z . Let the input state x be denoted simply x .Let E : N → N . Let δ > A be a function-approximating population protocol thatstably E -approximates f in expected time o ( n ). Let α > t ( n, αn ) = o ( n ) and, for all m ∈ N , there is a valid α -dense initial configuration i ∈ N Λ with i ( x ) = m . Such an α exists sincethe quiescent threshold q : N k → N is linearly bounded.Let I α be the set of all such α -dense valid i . Let S = { o | ( ∃ i ∈ I α ) i = ⇒ o and o is stableand E ( i ( a ))- f ( i ( x ))-correct } be the set of stable “ (cid:15) - t ”-correct configurations reachable from someconfiguration i ∈ I α , and where the choice of (cid:15) and t to define (cid:15) - t -correct depends on i . Byhypothesis we have that for each i ∈ I α , T [ i = ⇒ S ] = o ( n ).Apply Corollary 3.11. Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinite nondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that thefollowing holds. Let ∆ = bdd (( o n ) n ∈ N ), d = | ∆ | , and Γ = Λ \ ∆. For each n ∈ N , let o ∆ n = o n (cid:22) ∆and o Γ n = o n (cid:22) Γ. Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and1. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. For all b ∈ N , there is n b ∈ N such that, for all n ∈ N such that n ≥ n b and all d ∆ ∈ N ∆ such that max( d ∆ ) ≤ b , we have 2 i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ .Note that y ∈ Γ since f ( m ) grows unboundedly with m and m = i n ( x ) grows unboundedly with n . We claim that x ∈ ∆. To see why, observe that increasing the initial amount of x by r shouldincrease the output by p . If we had x ∈ Γ, then by Corollary 3.13, for any stable configuration o ,the configuration o + { rx } would also be stable, but would have the same output. Let i be anyinitial configuration such that i = ⇒ o . Then i + { rx } = ⇒ o + { rx } , a contradiction since the correctoutput to compute from i + { rx } is p larger than the correct output for i . This shows the claimthat x ∈ ∆.Let b = 1; below we ensure that max( d ∆ ) ≤ b . Let w = r (cid:16) o Γ n b + ˜ D . o ∆ n b (cid:17) and c = ˜ D . d ∆ .The above argument shows that 2 r i n b = ⇒ w (letting d ∆ = ) and 2 r i n b + r { x } = ⇒ w + r c (letting d ∆ = { x } ). Since w ∈ N Γ and c ∈ N Γ , both w and w + r c are stable by Observation 3.12. Recall f (2 rm ) = (cid:98) rmp/r (cid:99) = 2 mp . We have two cases: w ( y ) (cid:54) = 2 mp : Thus | w ( y ) − mp | ≥
1. For all l ∈ N , let v l = l w and m l = 2 lrm . Then 2 lr i n b = ⇒ v l ,and | v l ( y ) − f ( m l ) | = | l w ( y ) − lmp | = l | w ( y ) − mp | ≥ l. w ( y ) = 2 mp : For all l ∈ N , let v l = l ( w + r c ) and m l = l (2 rm + r ). Thus, l (2 r i n b + r { x } ) = ⇒ v l .Also, f ( m l ) = (cid:98) lp (2 rm + r ) /r (cid:99) = 2 lmp + lu . Note that c ( y ) ∈ Z . There are two subcases: c ( y ) ≥ : Then v l ( y ) = l ( w ( y ) + r c ( y )) ≥ l (2 mp + r ) = 2 lmp + lr , so v l ( y ) − f ( m l ) ≥ lmp + lr − (2 lmp + l ) = lr − l ≥ l. c ( y ) ≤ : Then v l ( y ) = l ( w ( y ) + r c ( y )) ≤ lmp , so f ( m l ) − v l ( y ) ≥ lmp + l − lmp = l. In each case v l is stable by Observation 3.12 and reachable from an initial configuration representinginput m l , with count 2 lr i n b ( a ) of a , but | v l ( y ) − f ( m l ) | ≥ l , so E (2 lr i n b ( a )) ≥ l . Since 2 r i n b ( a ) isconstant with respect to l , choosing γ = r i nb ( a ) proves the theorem.37 Logarithmic-time, linear-error approximation of linear functionswith nonnegative rational coefficients is possible
Recall the definition of N -linear function from Section 6. It is easy to see that any N -linear function f can be stably computed in logarithmic time. Recall that x, q → y, y stably computes f ( m ) = 2 m in expected time O (log n ). The extension to larger coefficients, e.g., f ( m ) = 4 m , uses a series oftransitions: x, q → y, x (cid:48) x (cid:48) , q → y, x (cid:48)(cid:48) x (cid:48)(cid:48) , q → y, y The extension to multiple inputs, e.g., f ( m , m , m ) = 4 m + m + 2 m , uses similar transitionsfor each input: x , q → y, x (cid:48) x (cid:48) , q → y, x (cid:48)(cid:48) x (cid:48)(cid:48) , q → y, yx , q → y, qx , q → y, y We summarize this in the following observation.
Observation 7.1.
Let f : N k → N be an N -linear function. There is a function-computing leader-less population protocol that stably computes f in expected time O (log n ) . A function is Q ≥ -linear if there are c , . . . , c k ∈ Q ≥ such that for all m ∈ N k , f ( m ) = (cid:80) ki =1 (cid:98) c i m ( i ) (cid:99) . We now describe how to stably approximate Q ≥ -linear functions with a linearapproximation error, in logarithmic time. (It is open to do this for negative coefficients, e.g., f ( m , m ) = m − m ). Recall the following simple example of a population protocol that ap-proximately divides by 2 (that is, with probability 1 it outputs a value guaranteed to be a certaindistance to the correct output), with a linear approximation error, and is fast ( O (log n ) time) withinitial counts x = m , a = γm , and q = y = 0: a, x → b, yb, x → a, q which stabilizes y to somewhere in the interval { m/ , m/ , . . . , m/ γm } .To see that the protocol is correct, note that the transition sequence can make y closer to oneendpoint of the interval or the other depending on which transitions are chosen to consume the last γm of x , but no matter what, the first transition executes at least as many times as the second,but not more than γm times more.If a = 1 initially, the above protocol stably computes (cid:98) m/ (cid:99) (taking linear time just for thelast transition; and in total takes Θ( n log n ) time, by a coupon collector argument).To see that the protocol takes O (log n ) time if a = γm initially, note n = m + γm ≤ m. Observe that a + b = γm in any reachable configuration. Thus the probability any giveninteraction is one of the above two transitions is ≈ γm xn , so the expected number of interactions38ntil such a transition occurs is n γm x . After m such transitions occur, all the input x is gone andthe protocol stabilizes, which by linearity of expectation takes expected number of interactions m (cid:88) x =1 n γm x = n γm m (cid:88) x =1 x ≈ n γm ln m ≤ n γn/ n = 2 nγ ln n, i.e., expected parallel time γ ln n . Thus this shows a tradeoff between accuracy and speed in asingle protocol, adjustable by the initial count of a . In this case, the approximation error increases,and the expected time to stabilization decreases, with increasing initial a .More generally, we can prove the following. In particular, if a = Ω( n ), then t ( n, a ) = O (log n ).Also, if a = o ( n ), then the approximation error is o ( n ), and if a = ω (log n ), then the expectedtime is o ( n ) also. This does not contradict Theorem 6.1 since setting a = o ( n ) implies the initialconfigurations are not all α -dense for a fixed α > Theorem 7.2.
Let f : N k → N be a Q ≥ -linear function. Let E : N → N be the identity function.Define t : N → N by t ( n, a ) = na log n. Then there is a function-approximating leaderless populationprotocol A that E -approximates f in expected time O ( t ) .Proof. Write each rational coefficient c i = p i r i , where p i , r i ∈ Z ≥ . (Since f is linear, the case p i = 0 is easy to handle by simply ignoring x i as an input, so we assume all coefficients arestrictly positive.) The initial configuration i has i ( x i ) = m ( i ) for each i ∈ { , . . . , k } , i ( a ) > i ( q ) ≥ k i ( a ) + (cid:80) ki =1 p i i ( x i ).First, for each i ∈ { , . . . , k } , we have transitions that multiply x i = m ( i ) by p i . If p i = 1, wehave the transition x i , q → y i , q. If p i = 2, we have the transition x i , q → y i , y i . If p i ≥
3, we havea sequence of transitions that multiply x i by p i : x i , q → y i , x ( p i − i x ( p i − i , q → y i , x ( p i − i x ( p i − i , q → y i , x ( p i − i . . .x (2) i , q → y i , y i This ensures that for each i ∈ { , . . . , k } , eventually y i = p i i ( x i ). Note that each agent in state x i eventually causes p i agents in state q to be consumed as inputs to the above transitions, henceat least (cid:80) ki =1 p i m ( i ) agents in state q are required initially for the above to complete.Next, we split up the approximation states to have a specific one for each input x i . In otherwords, the initial configuration has i ( a ) agents in state a , and we want to reach a configurationwith i ( a ) agents in state a , i ( a ) other agents in state a , . . . , i ( a ) other agents in state a k . If k = 1then we simply use a directly in place of the state a (1)1 below. Otherwise, let l ∈ N be such that2 l − < k ≤ l (i.e., 2 l is the next power of 2 at least k ).39e have the transitions that make copies of a for each input: a, q → a , a a , q → a , a a , q → a , a a , q → a , a a , q → a , a a , q → a , a a , q → a , a a , q → a , a . . . and so on, up to transitions whose output (right-hand side) states are binary strings of length l .Also, for each i ∈ { , . . . , k } , we have the transition a b ( i ) , q → a (1) i , q , where b ( i ) is the i ’th stringin the lexicographical ordering of { , } l . If k is not a power of 2, then we will simply let a b ( i ) gounused for i ∈ { k + 1 , . . . , l } .Note that each agent in state a eventually causes (cid:80) lj =1 j = 2 l +1 − < k agents in state q tobe consumed as inputs to the above transitions, hence at least i ( a )(2 l +1 −
1) agents in state q arerequired initially for the above to complete. Combined with the lower bound on i ( q ) associated tothe first set of transitions, at least i ( a )(2 l +1 −
1) + (cid:80) ki =1 p i i ( x i ) ≤ k i ( a ) + (cid:80) ki =1 p i i ( x i ) agents instate q are required initially. Note that this is O ( (cid:107) i (cid:22) (Σ ∪ { a } ) (cid:107) ) . Next, we approximately divide y i by r i , using the state a (1) i produced by the second sequenceof transitions. If r i = 1, this is easily handled (exactly) by the transition y i , q → y, q . Otherwise,for each i such that r i ≥
2, we have the transitions that divide y i by r i : a (1) i , y i → a (2) i , ya (2) i , y i → a (3) i , qa (3) i , y i → a (4) i , q. . .a ( r i ) i , y i → a (1) i , q which consumes r i copies of y i (of which there are p i m ( i )) for each y produced. Since for all i , thefirst transition above outputs the same state y , the final count of y will be the sum (cid:80) ki =1 (cid:106) p i r i m ( i ) (cid:107) ,i.e., the value f ( m ).It remains to prove the stated bound on expected time. Above we stated a lower bound on i ( q ) required for the protocol to be correct. To obtain the stated expected time, we double thisbound and add (cid:107) i (cid:22) (Σ ∪ { a } ) (cid:107) , which ensures that q is always at least n/ n ≥ (cid:80) ki =1 p i m ( i ). Let ˆ p = max i p i .We analyze a simpler process that stochastically dominates the actual Markov process. Weassume that the first set of transitions (multiplying x i by p i ) completes before the start of thesecond (making copies of a for each input), and that these then complete before the start of thethird group (dividing y i by r i ). Also, transitions that can go in parallel within these groups(such as the first set of transitions for different values of i ) can have their expected times analyzedindependently and summed to obtain a loose bound on the time for them all to terminate.40et i ∈ { , . . . , k } . For the first group, we assume that for each x ( p i − j ) i , q → y i , x ( p i − j − i completes (consuming all available x ( p i − i states) before the next x ( p i − j − i , q → y i , x ( p i − j − i starts,since this process stochastically dominates the actual process that allows the transitions to go inparallel. For notational brevity we just analyze the first transition x i , q → y i , x ( p i − i . By ourchoice of i ( q ), each interaction has probability at least to have a q state, and conditioned on this,probability at least x i n for the other state to be x i , so probability at least x i n to be of the form x i , q → y i , x ( p i − i . Thus the expected number of interactions until this transition happens is atmost n x i . By linearity of expectation, the expected number of interactions until all x i are consumedis at most (cid:80) m ( i ) x i =1 2 n x i ≈ n ln m ( i )). Thus the expected parallel time to complete these transitionsis 2 ln m ( i ). Thus for each i , the expected time for all p i of these transitions to complete is at most2 p i ln m ( i ), so the expected time for all to complete is at most 2 (cid:80) ki =1 p i ln m ( i ) ≤ k ˆ p ln n .The second group of transitions can be analyzed similarly, by assuming they each complete(consume all non- q input states) before the next starts. Each then takes ln i ( a ) expected time tocomplete. There are 2 l +1 − < k total transitions so 2 k ln i ( a ) ≤ k ln n expected time is required.The third group of transitions is a bit different. Since we do not begin analysis until the secondgroup of transitions completes, we start with a (1) i = i ( a ) and y i = p i m ( i ). Also note that i ( a ) = (cid:80) r i j =1 a ( j ) i in any subsequently reachable configuration. Thus, in any such configurationthe probability that the next transition involves an a ( j ) i state is i ( a ) n , and conditioned on this, theprobability that the other input state is y i is y i n , so probability i ( a ) y i n that the next transitionis one of the r i transitions. Thus the expected number of transitions until such a transitionhappens is n i ( a ) y i . By linearity of expectation, the expected number of interactions until all y i are consumed is at most (cid:80) p i m ( i ) y i =1 n i ( a ) y i ≈ n i ( a ) ln( p i m ( i )), so expected parallel time n i ( a ) ln( p i m ( i )).Thus the expected time for all k groups of transitions to complete is at most n i ( a ) (cid:80) ki =1 ln( p i m ( i )) = n i ( a ) k ln(ˆ pn ).Thus, summing the above three bounds, the total expected time to stabilization is at most2 k ˆ p ln n + 2 k ln n + n i ( a ) k ln(ˆ pn ). Since k and ˆ p are constant with respect to n and i ( a ), the boundis dominated by the last term, which is O (cid:16) n i ( a ) ln n (cid:17) . In Section 6, we obtained a precise characterization of the linear functions stably computable insublinear time by population protocols and furthermore show that those not exactly computablein sublinear time are not even approximable with sublinear error in sublinear time. However, theclass of functions stably computable (in any amount of time) by population protocols is knownto contain non-linear functions such as f ( m , m ) = max( m , m ), or f ( m ) = m if m is even and f ( m ) = 2 m if m is odd. In fact a function is stably computable by a population protocol if andonly if its graph { ( m , f ( m )) | m ∈ N k } is a semilinear set [5, 15]. A set A ⊆ N k is semilinear if and only if [23] it is expressible as a finite number of unions, intersections, and complementsof sets of one of the following two forms: threshold sets of the form { x | (cid:80) ki =1 a i · x ( i ) < b } forsome constants a , . . . , a k , b ∈ Z or mod sets of the form { x | (cid:80) ki =1 a i · x ( i ) ≡ b mod c } for someconstants a , . . . , a k , b, c ∈ N .Say that a set P ⊆ N k is a periodic coset if there exist b , p , . . . , p l ∈ N k such that P = { b + n p + . . . + n l p l | n , . . . , n l ∈ N } . (These are typically called “linear” sets, but we wish toavoid confusion with linear functions.) Equivalently, a set is semilinear if and only if it is a finite41nion of periodic cosets.Although our technique fails to completely characterize the efficient computability of all semi-linear functions, we show that a wide class of semilinear functions cannot be stably computedin sublinear time: functions that are not eventually N -linear. The only exceptions, for which wecannot prove linear time is required, yet neither is there known a counterexample protocol stablycomputing the function in sublinear time, are functions whose “non-integral-linearities are near theboundary of N k ”. For example, the function f ( m ) = 0 if m ≤ f ( m ) = m otherwise is non-linear (although it is semilinear, so stably computable), but restricted to the domain of inputs > N -linear. Theorem 8.5 generalizes the forwarddirection (restricted to nonlinear functions) to eventually N -linear functions. Say that a function f : N k → N is eventually N -affine if there exist n , c , . . . , c k ∈ N and b ∈ Z such that, for all m ∈ N k ≥ n , f ( m ) = b + (cid:80) ki =1 c i m ( i ).The function f : N k → Q is affine if and only if all points on the graph of f lie on a k -dimensionalhyperplane. This holds if and only if, for all m , v ∈ N k , f ( m + v ) − f ( m ) = f ( m +2 v ) − f ( m + v ).In other words, the change in output resulting by moving by a vector v , starting from m , is thesame if we move by v a second time. The next lemma, due to Sungjin Im [25], shows that a function f : N k → N is eventually N -affine if the above holds for any sufficiently large input m and any vector v ∈ { , } k . In other words, if f “looks N -affine” when moving by small amounts(each component at most 1), then it is N -affine. This appears obvious, but some care is needed: forexample, it is false if we assume that v are only unit vectors. For example, the non-affine function f ( m , m ) = m · m obeys f ( m + u ) − f ( m ) = f ( m + 2 u ) − f ( m + u ) for each m ∈ N and each u ∈ { (0 , , (1 , } , but fails if u = (1 , Lemma 8.1.
Let f : N k → N . Suppose there exists n ∈ N such that for all m ∈ N k ≥ n and v ∈ { , } k , f ( m + v ) − f ( m ) = f ( m + 2 v ) − f ( m + v ) . Then f is eventually N -affine: there are n , b, c , . . . , c k ∈ N such that, for all m ∈ N k ≥ n , f ( m ) = b + (cid:80) ki =1 c i m ( i ) .Proof. Assume the hypothesis and let v ∈ { , } k and m ∈ N k ≥ n . A straightforward inductionshows that, for all n ≥ f ( m + n v ) − f ( m + ( n − v ) = f ( m + v ) − f ( m ), and thus f ( m + n v ) = f ( m ) + n · ( f ( m + v ) − f ( m )) . (8.1)Let i ∈ { , . . . , k } , fix values of m (cid:48) i +1 , . . . , m (cid:48) k ≥ n , and define f i : N i → N by f i ( m , . . . , m i ) = f ( m , . . . , m i − , m i , m (cid:48) i +1 , . . . , m (cid:48) k ). We show by induction on i that f i is N -affine on inputs m , . . . , m i ≥ n , i.e., f ( m , . . . , m i ) = b + c m + . . . + c i m i for some b, c , . . . , c i ∈ N . Base case:
For any fixed m (cid:48) , . . . , m (cid:48) k ≥ n , let f ( m ) = f ( m , m (cid:48) , . . . , m (cid:48) k ). We must show f isan N -affine function of m (assuming m ≥ n ). Let v = (1 , , . . . ,
0) and let m = ( n , m (cid:48) . . . , m (cid:48) k ).Then using eq. (8.1), we obtain that for any m ≥ n , f ( m ) = f ( n , m (cid:48) , . . . , m (cid:48) k ) +( m − n ) · (cid:2) f ( n + 1 , m (cid:48) , . . . , m (cid:48) k ) − f ( n , m (cid:48) , . . . , m (cid:48) k ) (cid:3) , We let the range be Q instead of N here to get a bidirectional implication, but the direction we are interested inrequires only range N : if f : N k → N is affine, then all points lie on a k -dimensional hyperplane. b + cm of m , with offset b = f ( n , m (cid:48) , . . . , m (cid:48) k ) − n · [ f ( n + 1 , m (cid:48) , . . . , m (cid:48) k ) − f ( n , m (cid:48) , . . . , m (cid:48) k )] and coefficient c = f ( n +1 , m (cid:48) , . . . , m (cid:48) k ) − f ( n , m (cid:48) , . . . , m (cid:48) k ). Inductive case:
Fix values m (cid:48) i +1 , . . . , m (cid:48) k ≥ n . By the inductive hypothesis, f i ( m , . . . , m i ) = f ( m , . . . , m i , m (cid:48) i +1 , . . . , m (cid:48) k ) is an N -affine function of m , . . . , m i (if all m j ≥ n ). We want to showthat f i +1 ( m , . . . , m i +1 ) = f ( m , . . . , m i +1 , m (cid:48) i +2 . . . , m (cid:48) k ) is an N -affine function of m , . . . , m i +1 (ifall m j ≥ n ).Let m , . . . , m i +1 ≥ n . By eq. (8.1), letting m = ( m , . . . , m i , n , m (cid:48) i +2 , . . . , m (cid:48) k ) and v =(0 , . . . , (cid:124) (cid:123)(cid:122) (cid:125) i , , , . . . , f i +1 ( m , . . . , m i +1 )= f ( m , . . . , m i , m i +1 , m (cid:48) i +2 , . . . , m (cid:48) k )= f ( m , . . . , m i , n , m (cid:48) i +2 , . . . , m (cid:48) k ) + (8.2)( m i +1 − n ) · (cid:2) f ( m , . . . m i , n + 1 , m (cid:48) i +2 . . . , m (cid:48) k ) − f ( m , . . . m i , n , m (cid:48) i +2 , . . . , m (cid:48) k ) (cid:3) By the inductive hypothesis, defining f i, , f i, : N i → N by f i, ( m , . . . , m i ) = f ( m , . . . m i , n , m (cid:48) i +2 , . . . , m (cid:48) k )and f i, ( m , . . . , m i ) = f ( m , . . . m i , n + 1 , m (cid:48) i +2 , . . . , m (cid:48) k ), f i, and f i, are both N -affine. Thus forsome a , . . . a i , b ∈ N and c , . . . c i , d ∈ N , f i, ( m , . . . , m i ) = b + a m + . . . + a i m i (8.3) f i, ( m , . . . , m i ) = d + c m + . . . + c i m i (8.4)Substituting (8.3) and (8.4) into (8.2), defining f i +1 : N i +1 → N for all m , . . . , m i +1 by f i +1 ( m , . . . , m i +1 ) = f ( m , . . . , m i , m i +1 , m (cid:48) i +2 , . . . , m (cid:48) k )= ( b + a m + . . . + a i m i ) +( m i +1 − n ) · [( d + c m + . . . + c i m i ) − ( b + a m + . . . + a i m i )] . Let a (cid:48) i +1 = d − b and b (cid:48) = b − a (cid:48) i +1 n . For j ∈ { , . . . , i } , let e j = c j − a j and a (cid:48) j = a j − e j n . Then f i +1 ( m , . . . , m i +1 )= b + a m + . . . + a i m i + ( m i +1 − n ) · [ a i +1 + e m + . . . + e i m i ]= b + a m + . . . + a i m i + a i +1 m i +1 + e m m i +1 + e m m i +1 + . . . + e i m i m i +1 − a i +1 n − e m n − e m n − . . . − e i m i n = b − a i +1 n + i +1 (cid:88) j =1 a j m j + i (cid:88) j =1 e j m j m i +1 − i (cid:88) j =1 e j m j n = b (cid:48) + i +1 (cid:88) j =1 a (cid:48) j m j + i (cid:88) j =1 e j m j m i +1 (8.5)To prove f i +1 is N -affine, we must show that e = e = . . . = e i = 0 and that a (cid:48) i +1 ≥ b, a , . . . , a i ≥
0, so if each e j = 0, then a (cid:48) j = a j − e j n = a j ≥ e , . . . , e i ≥
0. To see why, suppose for the sake of contradiction that some e l <
0, and consider fixing m j for each j (cid:54)∈ { l, i + 1 } and taking the limit of m l = m i +1 = n as n → ∞ . Equation (8.5) will be dominated by the quadratic term in n , i.e., e l m l m i +1 = e l n , andthus f i +1 would be negative for large enough n , a contradiction.43e will eventually show that e , . . . , e i = 0. Once this is shown, a similar argument shows that a (cid:48) i +1 ≥
0, or else with increasing m i +1 , f i +1 would become negative. (The assumption a (cid:48) i +1 ≥ e = e = . . . = e i = 0, define v = (1 , . . . , (cid:124) (cid:123)(cid:122) (cid:125) i +1 , , . . . , (cid:124) (cid:123)(cid:122) (cid:125) k − i − ) ∈ N k . Let m =( n , . . . , n (cid:124) (cid:123)(cid:122) (cid:125) i +1 , m (cid:48) i +2 , . . . , m (cid:48) k ). Let m i +1 = ( n , . . . , n (cid:124) (cid:123)(cid:122) (cid:125) i +1 ) ∈ N i +1 be the first i + 1 coordinates of m .Similarly, let v i +1 = (1 , . . . , (cid:124) (cid:123)(cid:122) (cid:125) i +1 ) ∈ N i +1 be the first i + 1 coordinates of v . Then f ( m ) = f i +1 ( m i +1 ), f ( m + v ) = f i +1 ( m i +1 + v i +1 ), and f ( m + 2 v ) = f i +1 ( m i +1 + 2 v i +1 ), Applying the hypothesis ofthe lemma and these identities, f i +1 ( m i +1 + v i +1 ) − f i +1 ( m i +1 ) = f i +1 ( m i +1 + 2 v i +1 ) − f i +1 ( m i +1 + v i +1 )Substituting eq. (8.5), f i +1 ( m i +1 + v i +1 ) − f i +1 ( m i +1 ) = b (cid:48) + i +1 (cid:88) j =1 a (cid:48) j ( n + 1) + i (cid:88) j =1 e j ( n + 1) − b (cid:48) + i +1 (cid:88) j =1 a (cid:48) j n + i (cid:88) j =1 e j n = i +1 (cid:88) j =1 a (cid:48) j + i (cid:88) j =1 e j (2 n + 1)Similarly, the difference f ( m + 2 v ) − f ( m + v ) can be expressed as f i +1 ( m i +1 + 2 v i +1 ) − f i +1 ( m i +1 + v i +1 ) = b (cid:48) + i +1 (cid:88) j =1 a (cid:48) j ( n + 2) + i (cid:88) j =1 e j ( n + 2) − b (cid:48) + i +1 (cid:88) j =1 a (cid:48) j ( n + 1) + i (cid:88) j =1 e j ( n + 1) = i +1 (cid:88) j =1 a (cid:48) j + i (cid:88) j =1 e j (2 n + 3)Since the first difference equals the second, (cid:80) i +1 j =1 e j (2 n + 1) = (cid:80) i +1 j =1 e j (2 n + 3) . Since each e j ≥
0, this implies each e j = 0, so a (cid:48) j = a j . Thus f i +1 ( m , . . . , m i +1 ) = b (cid:48) + (cid:80) i +1 j =1 a j m j , an N -affine function, proving the inductive case.The contrapositive of Lemma 8.1 states that if f is not eventually N -affine, then for all m ∈ N ,there is v ∈ { , } k and m ∈ N k ≥ m such that f ( m + v ) − f ( m ) (cid:54) = f ( m + 2 v ) − f ( m + v ). Since { , } k is finite, by the pigeonhole principle, some infinite subset of such m ’s can be found thatagree on the same v . Thus we have the following corollary. Corollary 8.2.
Let f : N k → N . If f is not eventually N -affine, then there is v ∈ { , } k such thatfor all m ∈ N , there is m ∈ N k ≥ m such that f ( m + v ) − f ( m ) (cid:54) = f ( m + 2 v ) − f ( m + v ) . furthermore that this set is α -dense for some α >
0. This isnot true for arbitrary functions. For example, consider the function f ( m , m ) = m + m unless m = 2 m , in which case f ( m , m ) = 0 instead. However, if f is a semilinear function, then wecan find an infinite set of “counter-examples to affine” that is α -dense for some α > Lemma 8.3.
Let f : N k → N be semilinear but not eventually N -affine. Then there are v ∈ { , } k , α > , and infinitely many α -dense m ∈ N k such that f ( m + v ) − f ( m ) (cid:54) = f ( m + 2 v ) − f ( m + v ) .Proof. For all v ∈ { , } k , let C v = { m ∈ N k | f ( m + v ) − f ( m ) (cid:54) = f ( m + 2 v ) − f ( m + v ) } .Corollary 8.2 tells us that there is v ∈ { , } k such that, for all m ∈ N , we have N k ≥ m ∩ C v (cid:54) = ∅ .This implies that for all m ∈ N , | C v ∩ N k ≥ m | = ∞ . Otherwise, since N k ≥ m ⊂ N k ≥ m +1 for all m ,if | C v ∩ N k ≥ m | < ∞ , then for sufficiently large m (cid:48) , C v ∩ N k ≥ m (cid:48) = ∅ , contradicting the fact that C intersects all N k ≥ m (cid:48) .We denote the graph of f by G ( f ) = { ( m , f ( m )) | m ∈ N k } ⊂ N k +1 . Since f is semilinear, G ( f ) is a semilinear set. Thus it is a finite union G ( f ) = (cid:83) p − j =0 P j of p periodic cosets P , . . . , P p − .Intuitively, the lemma will be proven as follows. C v , the “counterexamples to N -affineness”, occurin these periodic cosets. Adding period vectors to a point keeps it in the same periodic coset.However, if we add the same multiple of period vectors each time, and if their sum is positive onall coordinates, then this sets a minimum α -denseness that we cannot fall below. This is how wewill show that C v has infinitely many α -dense points.For all m ∈ N k , let m f = ( m , f ( m )) ∈ N k +1 denote the point in G ( f ) corresponding to input m . By the pigeonhole principle, there are x, y, z ∈ { , . . . , p − } and an infinite subset C P ⊆ C v such that, for all m , there is m ∈ C P ∩ N k ≥ m such that m f ∈ P x , ( m + v ) f ∈ P y , ( m + 2 v ) f ∈ P z .For notational convenience we assume that x = 0 , y = 1 , z = 2. In other words, we can find aninfinite subset C P of C v in which, in the finite union of periodic cosets defining G ( f ), m f is alwayspart of the same periodic coset P , ( m + v ) f is always part of the same periodic coset P , and( m + 2 v ) f is always part of the same periodic coset P .Let m f S , m f L ∈ C P such that min( m L − m S ) ≥
1; i.e., m L is strictly larger than m S on allcoordinates. By the fact that C P contains arbitrarily large points (i.e., points in N k ≥ m for all m ),such m S and m L must exist.Let b , p (1)0 , . . . , p ( l )0 ∈ N k +1 be such that P = (cid:110) b + n (1) p (1)0 + . . . + n ( l ) p ( l )0 (cid:12)(cid:12)(cid:12) n (1) , . . . , n ( l ) ∈ N (cid:111) , and similarly for b , p (1)1 , . . . , p ( l )1 , b , p (1)2 , . . . , p ( l )2 ∈ N k +1 and P , P , respectively.For i ∈ { , , } , let d fi = ( m L + i v ) f − ( m S + i v ) f , and let d i denote d fi restricted to the first k coordinates, so that d i = ( m L + i v ) − ( m S + i v ) = m L − m S . In other words, d f , d f , d f differonly on their last coordinate, representing f ( m L + i v ) − f ( m S + i v ). Then d f = (cid:80) l j =1 n ( j )0 p ( j )0 for some n (1)0 , . . . , n ( l )0 ∈ N since m f S , m f L ∈ P . Similarly, there must exist n (1)1 , . . . , n ( l )1 ∈ N and n (1)2 , . . . , n ( l )2 ∈ N such that d f = (cid:80) l j =1 n ( j )1 p ( j )1 and d f = (cid:80) l j =1 n ( j )2 p ( j )2 .For all n ∈ N , define m fn = m f S + n d f (note that m f L = m f and m f S = m f ), letting m n be m fn restricted to the first k coordinates. By the definition of P , for all n ∈ N , m fn ∈ P , since m f S ∈ P and d f is a nonnegative multiple of period vectors in P . Our goal next is to show that This can be assumed without loss of generality even if some of x, y, z are equal, since we can have “duplicate”periodic cosets that are equal despite having different subscripts. m fn are in C P ⊆ C v . After showing that, we argue that m n are all α -dense forsome α >
0, proving the lemma.For i ∈ { , , } , let ∆ y i = d fi ( k + 1) = f ( m L + i v ) − f ( m S + i v ). Note that for all n ∈ N , f ( m S + i v + n d i ) = f ( m S + i v ) + n ∆ y i .We claim that for all n ∈ N , m n ∈ C v . Let c = f ( m S + v ) − f ( m S ) and c = f ( m S + 2 v ) − f ( m S + v ). Note that c (cid:54) = c since m S ∈ C v . For all n ∈ N , f ( m n + v ) − f ( m n ) = f ( m S + v + n d ) − f ( m S + n d )= f ( m S + v ) + n ∆ y − ( f ( m S ) + n ∆ y )= c + n (∆ y − ∆ y ) , and f ( m n + 2 v ) − f ( m n + v ) = f ( m S + 2 v + n d ) − f ( m S + v + n d )= f ( m S + 2 v ) + n ∆ y − ( f ( m S + v ) + n ∆ y )= c + n (∆ y − ∆ y ) . Thus[ f ( m n + v ) − f ( m n )] − [ f ( m n + 2 v ) − f ( m n + v )] = [ c + n (∆ y − ∆ y )] − [ c + n (∆ y − ∆ y )]= ( c − c ) + n (2∆ y − ∆ y − ∆ y ) . There are two cases to complete the claim that m n ∈ C v :2∆ y − ∆ y − ∆ y = 0 : Then for all n , the above difference is c − c (cid:54) = 0, so f ( m n + v ) − f ( m n ) (cid:54) = f ( m n + 2 v ) − f ( m n + v ), implying m n ∈ C v .2∆ y − ∆ y − ∆ y (cid:54) = 0 : Then for all sufficiently large n , ( c − c ) + n (2∆ y − ∆ y − ∆ y ) (cid:54) = 0, so f ( m n + v ) − f ( m n ) (cid:54) = f ( m n + 2 v ) − f ( m n + v ), implying m n ∈ C v .Letting α (cid:48) = min( d ) / (cid:107) d (cid:107) , we have that for all n ∈ N , n d is α (cid:48) -dense. Note that α (cid:48) > d = m L − m S to be positive on all coordinates. Let α = α (cid:48) /
2. Then for all sufficientlylarge n , m n = m S + n d is α -dense. Since m n ∈ C P ⊆ C v , this proves the lemma. Recall that definition of N -linear functions from Section 6. We say a function f : N k → N is eventually N -linear if it is eventually N -affine with offset b = 0, i.e., if there are c , . . . , c k ∈ N and m ∈ N such that for all m ∈ N k ≥ m , f ( m ) = (cid:80) ki =1 c i m ( i ).The following lemma is a special case of the main result of this Section, Theorem 8.5, showingthat the non-linear functions in a sense “closest” to being eventually N -linear, the eventually N -affine functions, are not stably computable in sublinear time. This includes functions as simple as f ( m ) = m − x, x → x, y ). Theorem 8.4.
Let f : N k → N be eventually N -affine but not eventually N -linear. Then nofunction-computing leaderless population protocol stably computes f in sublinear time.Proof. Since f is eventually N -affine, there m ∈ N and b, c , . . . , c k ∈ N such that, for all m ∈ N k ≥ m , f ( m ) = b + (cid:80) ki =1 c i m ( i ). Since f is not eventually N -linear, b (cid:54) = 0. Thus, for all m ∈ N k ≥ m , f (2 m ) (cid:54) = 2 f ( m ). 46et I be the set of all α -dense valid initial configurations i representing input in N k ≥ m suchthat f (2 m ) >
0. Let S = { o | ( ∃ i ∈ I α ) i = ⇒ o and o is stable } . By hypothesis we have that foreach i ∈ I , T [ i = ⇒ S ] = o ( n ).Apply Corollary 3.11. Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinite nondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that thefollowing holds. Let ∆ = bdd (( o n ) n ∈ N ), d = | ∆ | , and Γ = Λ \ ∆. For each n ∈ N , let o ∆ n = o n (cid:22) ∆and o Γ n = o n (cid:22) Γ. Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and1. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. For all b ∈ N , there is n b ∈ N such that, for all n ∈ N such that n ≥ n b and all d ∆ ∈ N ∆ such that max( d ∆ ) ≤ b , we have 2 i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ .Let b = 0; below we ensure that max( d ∆ ) ≤ b . Let m = i n b (cid:22) Σ. Let s = 2 o Γ n b + ˜ D . o ∆ n b .Letting d ∆ = , the above argument shows that 2 i n b = ⇒ s . Since s ∈ N Γ , it is stable byObservation 3.12. Since the protocol is correct, s ( y ) = f (2 m ) >
0. Then 4 i n b = ⇒ s , also stable,with 2 s ( y ) = 2 f (2 m ) (cid:54) = f (4 m ), a contradiction.Finally, we can prove the main result of this section, that any protocol requires linear expectedtime to stably compute a non-eventually- N -linear function.Intuitively, the proof has a similar shape to that of Theorem 4.4. However, applying the surgerylemmas to fool the population protocol is more difficult, since with the predicate output convention,it is immediate that if two configurations have a well-defined output and share at least one statein common, they must have the same output (equal to the vote of that state). With the integer-count output convention, things are trickier. The surgery of Corollary 3.11 to consume additionalinput states affects the count of the output state—how do we know that the effect of the surgeryon the output is not consistent with the desired output of the function? In order to arrive at acontradiction we develop two techniques. The first involves showing that the slope of the change inthe count of the output state as a function of the input states is inconsistent. The second involvesexposing the semilinear structure of the graph of the function being computed, and forcing it toenter the “wrong piece” (i.e., periodic coset). Theorem 8.5.
Let f : N k → N , and let C be a function-computing leaderless population protocolthat stably computes f . If f is not eventually N -linear then C takes expected time Ω( n ) .Proof. If f is eventually N -affine but not eventually N -linear, then Theorem 8.4 implies that f requires expected time Ω( n ) to stably compute. So assume that f is not eventually N -affine.Since f is semilinear, Lemma 8.3 tells us that there is v ∈ { , } k and α > α -dense m ∈ N k such that f ( m + v ) − f ( m ) (cid:54) = f ( m + 2 v ) − f ( m + v ). Let C be the set of all such m .Note that for every point m (cid:48) ∈ N k , there exists m ∈ N k and u ∈ { , } k such that m (cid:48) = 2 m + u ;i.e., every point m (cid:48) is equal some point 2 m with all even coordinates, plus some binary vector u (to reach the odd coordinates in m (cid:48) ).Let I be a set of α -dense valid initial configurations i representing an input m such that thereis some m (cid:48) ∈ C and u ∈ { , } k such that m (cid:48) = 2 m + u . Let S = { o | ( ∃ i ∈ I ) i = ⇒ o and o isstable } be the set of stable configurations reachable from some initial configuration in I . Assumefor the sake of contradiction that for each i ∈ I , T [ i = ⇒ S ] = o ( n ).Apply Corollary 3.11. Then there are matrices ˜ D ∈ Z Γ × ∆ and ˜ D ∈ Z Γ × ∆ , an infinite set N ⊆ N , and infinite nondecreasing sequences of configurations ( i n ) n ∈ N and ( o n ) n ∈ N such that thefollowing holds. Let ∆ = bdd (( o n ) n ∈ N ), d = | ∆ | , and Γ = Λ \ ∆. For each n ∈ N , let o ∆ n = o n (cid:22) ∆and o Γ n = o n (cid:22) Γ. Then amax( ˜ D ) , amax( ˜ D ) ≤ d d +2 and47. For all n ∈ N , i n ∈ I , o n ∈ S , (cid:107) i n (cid:107) = (cid:107) o n (cid:107) = n , and i n = ⇒ o n .2. For all b ∈ N , there is n b ∈ N such that, for all n ∈ N such that n ≥ n b and all d ∆ ∈ N ∆ such that max( d ∆ ) ≤ b , we have 2 i n + d ∆ = ⇒ o Γ n + ˜ D . o ∆ n + ˜ D . d ∆ .Some of the inputs x , . . . , x k are in ∆, and others are in Γ. Let u ∆ = u (cid:22) ∆, u Γ = u (cid:22) Γ, v ∆ = v (cid:22) ∆, and v Γ = v (cid:22) Γ. Let b = 3; below we ensure that max( d ∆ ) ≤ b . Let m ∈ N k be the input represented by i n b . Let m (cid:48) ∈ C and u ∈ { , } k such that m (cid:48) = 2 m + u . Let s = 2 o Γ n + ˜ D . o ∆ n + ˜ D . u ∆ . Letting d ∆ = u ∆ in Lemma 3.10, we have 2 i n b + u ∆ = ⇒ s . Bycorrectness, since initial configuration 2 i n b + u represents input m (cid:48) , we have s ( y ) = f ( m (cid:48) ).Let s = s + ˜ D . d ∆ . Then letting d ∆ = u ∆ + v ∆ in Lemma 3.10, we have that 2 i n b + u ∆ + d ∆ = ⇒ s . By additivity this implies that 2 i n b + u ∆ + u Γ + v Γ = ⇒ s + u Γ + v Γ . By correctness, s ( y ) = f ( m (cid:48) + v ). By Corollary 3.13, s + u Γ + v Γ is stable.Let s = s + 2 ˜ D . d ∆ . Then letting d ∆ = u ∆ + 2 v ∆ in Lemma 3.9, we have that 2 i n b + u ∆ +2 v ∆ = ⇒ s . By additivity this implies that 2 i n b + u ∆ + 2 v ∆ + u Γ + 2 v Γ = ⇒ s + u Γ + 2 v Γ . ByCorollary 3.13, s + u Γ + 2 v Γ is stable.By linearity, s ( y ) = s ( y ) + 2 q ( y ). However, since f ( m (cid:48) + v ) − f ( m (cid:48) ) (cid:54) = f ( m (cid:48) + 2 v ) − f ( m (cid:48) + v ),this implies s ( y ) (cid:54) = f ( m (cid:48) + 2 v ). However, since s is stable and reachable from 2 i m + u + 2 v ,representing input m (cid:48) + 2 v , this implies that the protocol stabilizes on the wrong output. Some interesting questions remain open.
Time complexity of non-eventually- N -linear functions and non-eventually-constant pred-icates. The most obvious open question is to determine the optimal stabilization time complexityof computing semilinear functions and predicates not satisfying the hypotheses of Theorems 4.4and 8.5; namely the eventually N -linear functions, (e.g., f ( m ) = 0 if m < f ( m ) = m oth-erwise) and eventually constant predicates (e.g., φ ( m ) = 1 iff m ≥ N -linear functions computable insublinear time are the N -linear functions (e.g., f ( m ) = 2 m ), computable in logarithmic time byObservation 7.1. The only known examples of eventually constant predicates that are computablein sublinear time are the detection predicates studied in [14] (and observed to be decidable in log-arithmic time): predicates whose value depends only on the presence or absence of certain inputs,but not on their exact positive values (e.g., φ ( m ) = 1 iff m ≥ Allowing more than O (1) states. Alistarh, Aspnes, Eisenstat, Gelashvili, and Rivest [1] showedtime lower bounds for leader election and majority with superconstant states (i.e., the number ofstates is allowed to grow with the population size). In this paper we have shown time lowerbounds for more general function and predicate computation with a constant set of states. It isnatural to ask whether more general function and predicate computation time lower bounds canbe proven for superconstant states using similar techniques. Notably, Chatzigiannakis, Michail,Nikolaou, Pavlogiannis, and Spirakis [13] have shown that if the number of states λ n = o (log n ),then the protocol’s computational power remains limited to computing semilinear predicates, thesame limitation that applies when λ n = O (1). However, with λ n = Ω(log n ), the computationalability of population protocols moves beyond semilinear predicates [13]. Thus, there is a wider The bound on states is described in [13] in terms of space available to a Turing machine that computes thetransition function, permitting o (log log n ) space. Since a Turing machine with space s has 2 O ( s ) configurations, this Convergence time without a leader.
Although we measure computation time with respectto stabilization—the ultimate goal of stable computation—some work uses a different goalpostfor completion. Consider a protocol stably computing a function, and consider one particulartransition sequence that describes its history. We can say the transition sequence converged at thepoint when the output count is the same in every subsequently reached configuration. In contrast,recall that the point of stabilization is when the output count is the same in every subsequently reachable configuration (whether actually reached in the transition sequence or not). In otherwords, after stabilization, even an adversarial scheduler cannot change the output. Measuring timeto stabilization in the randomized model, as we do here, measures the expected time until theprobability of changing the output becomes 0.Our proof shows only that stabilization must take expected Ω( n ) time for “most” predicates andfunctions if there is no initial leader. However, convergence could occur much earlier in a transitionsequence than stabilization. Indeed, Kosowski and Uzna´nski [27] show that all semilinear predicatescan be computed without an initial leader, converging in O (polylog n ) time if a small probability oferror is allowed, and converging in O ( n (cid:15) ) time with probability 1, where (cid:15) can be made arbitrarilyclose to 0 by changing the protocol. Stabilization time with a leader.
It remains open to determine the optimal stabilizationtime for stably computing semilinear predicates and functions with an initial leader. The stablycomputing protocols converging in O (log n ) time [6, 15] provably require expected time Ω( n ) tostabilize, and it is unknown whether faster stabilization is possible. High-probability computation of non-semilinear functions/predicates without a leader.
Going beyond stable computation, the open question of Angluin, Aspnes, and Eisenstat [6] askswhether their efficient high-probability simulation of a space-bounded Turing machine by a popu-lation protocol could remove the assumption of an initial leader. That simulation has some smallprobability (cid:15) > (cid:15) (cid:48) > (cid:15) + (cid:15) (cid:48) (i.e., still close to 0). Recent work by Kosowski and Uzna´nski [27] may berelevant, which shows a protocol for leader election converging in O (polylog n ) time with a smallprobability of error. Non-dense initial configurations without a leader.
Our general negative result applies to α -dense initial configurations. However, is sublinear time stable computation possible from other kindsof initial configurations that satisfy our intuition of not having preexisting leaders? In particular,our technique for proving time lower bounds fails when the input states themselves have countssufficiently skewed to prevent α -denseness, even without any other state initially present. Forexample, given any function f : N → N computable quickly with a leader, imagine a function f : N → N such that f ( m,
1) = f ( m ) for all m ∈ N . It is difficult to rule out the possibility ofa protocol using the unique agent in state x as a leader to simulate the fast protocol computing f . However, it is not clear is how to ensure that f is computed correctly on other inputs where m (cid:54) = 1, since it is unknown how to compute whether m = 1 in sublinear time. is equivalent to requiring that the number of states be at most o (log n ) (and furthermore that the transition functionbe uniformly computed by a single Turing machine.) unctions approximable in unbounded time. We showed in Theorem 7.2 that linear func-tions all coefficients in Q ≥ can be approximated in logarithmic time with linear error, but wealso showed in Theorem 6.1 that linear functions with some coefficient not in N cannot even beapproximated in sublinear time with sublinear error. However, this is the first study of approxi-mate function computation with population protocols, so it is not even clear what functions can beapproximated at all with unbounded time. Clearly it is not limited to semilinear functions, or evenTuring-computable functions. For example, the identity function is a close approximation of theuncomputable function f ( m ) = m if the m ’th Turing machine halts and f ( m ) = m + 1 otherwise.A sensible way to formulate the question might be this: require (as we do) for a protocol oninput m ∈ N k to stabilize, but nondeterministically to one of a set of possible outputs Y m ⊆ N .Define the nondeterministic function it computes to be f : N k → P ( N ) defined by f ( m ) = Y m .What range of such functions can be computed? This is applicable to approximation when theoutput set is a small interval.It might also be interesting to consider multi-valued nondeterministic functions, where theprotocol has (cid:96) different output states y , . . . , y (cid:96) and computes a function f : N k → P ( N (cid:96) ). Infact, this question is interesting even when there is no input, in the generalized model of chemicalreaction networks that permit some reactions (transitions) such as x → y, y or x , x → x toalter the population size. The system starts with a single x , and it nondeterministically stabilizesto some counts of y , . . . , y (cid:96) . It might appear as though the set of counts that can be reached issemilinear, but in fact non-semilinear sets are possible [24]. Alternate Boolean output conventions.
The standard model by which a population protocolreports a Boolean output is by consensus: each state “votes” 0 or 1, and output is defined only ifall states present in a configuration vote unanimously. Brijder, Doty, and Soloveichik [10] showedthat under some reasonable alternative output conventions, the class of Boolean predicates stablycomputable remains the semilinear predicates. However, it may not be the case that the efficiency of predicates remains unchanged. For example, one alternative is the democratic output convention:the output is b ∈ { , } if the b voters outnumber the 1 − b voters. In this case, the majority predicatebecomes trivially computable in constant time, merely by having each input state x and x votefor itself, and no transitions are even required: the initial configuration already reports the correctanswer. Acknowledgements.
The authors are grateful to Sungjin Im for the proof of Lemma 8.1. Wealso thank anonymous reviewers for their helpful comments.
References [1] Dan Alistarh, James Aspnes, David Eisenstat, Rati Gelashvili, and Ronald L. Rivest. Time-space trade-offs in molecular computation. In
SODA 2017: Proceedings of the 28th AnnualACM-SIAM Symposium on Discrete Algorithms , 2017. to appear.[2] Dan Alistarh, James Aspnes, and Rati Gelashvili. Space-optimal majority in population pro-tocols. In
SODA 2018: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium onDiscrete Algorithms , pages 2221–2239. SIAM, 2018.[3] Dan Alistarh and Rati Gelashvili. Polylogarithmic-time leader election in population protocols.In
ICALP 2015: Proceedings of the 42nd International Colloquium on Automata, Languages,and Programming, Kyoto, Japan , 2015. 504] Dana Angluin, James Aspnes, Zo¨e Diamadi, Michael Fischer, and Ren´e Peralta. Computationin networks of passively mobile finite-state sensors.
Distributed Computing , 18:235–253, 2006.Preliminary version appeared in PODC 2004.[5] Dana Angluin, James Aspnes, and David Eisenstat. Stably computable predicates are semi-linear. In
PODC 2006: Proceedings of the twenty-fifth annual ACM symposium on Principlesof distributed computing , pages 292–299, New York, NY, USA, 2006. ACM Press.[6] Dana Angluin, James Aspnes, and David Eisenstat. Fast computation by population protocolswith a leader.
Distributed Computing , 21(3):183–199, September 2008. Preliminary versionappeared in DISC 2006.[7] Dana Angluin, James Aspnes, David Eisenstat, and Eric Ruppert. The computational powerof population protocols.
Distributed Computing , 20(4):279–304, 2007.[8] Alexandre Baccouche, Kevin Montagne, Adrien Padirac, Teruo Fujii, and Yannick Rondelez.Dynamic dna-toolbox reaction circuits: a walkthrough.
Methods , 67(2):234–249, 2014.[9] James M Bower and Hamid Bolouri.
Computational modeling of genetic and biochemicalnetworks . MIT press, 2004.[10] Robert Brijder, David Doty, and David Soloveichik. Robustness of expressivity in chemicalreaction networks. In
DNA 2016: Proceedings of the 22th International Meeting on DNAComputing and Molecular Programming , pages 52–66, 2016.[11] Robert Brijder, David Doty, and David Soloveichik. Democratic, existential, and consensus-based output conventions in stable computation by chemical reaction networks.
Natural Com-puting , 17(1):97–108, 2018. Special issue of invited papers from DNA 2016.[12] E. Cardoza, Richard J. Lipton, and Albert R. Meyer. Exponential space complete problemsfor Petri nets and commutative semigroups (preliminary report). In
STOC 1976: Proceedingsof the 8th annual ACM Symposium on Theory of Computing , pages 50–54. ACM, 1976.[13] Ioannis Chatzigiannakis, Othon Michail, Stavros Nikolaou, Andreas Pavlogiannis, and Paul G.Spirakis. Passively mobile communicating machines that use restricted space.
TheoreticalComputer Science , 412(46):6469–6483, October 2011.[14] Ho-Lin Chen, Rachel Cummings, David Doty, and David Soloveichik. Speed faults in compu-tation by chemical reaction networks.
Distributed Computing , 2015. to appear. Special issueof invited papers from DISC 2014.[15] Ho-Lin Chen, David Doty, and David Soloveichik. Deterministic function computation withchemical reaction networks.
Natural Computing , 13(4):517–534, 2014. Preliminary versionappeared in DNA 2012.[16] Yuan-Jyue Chen, Neil Dalchau, Niranjan Srinivas, Andrew Phillips, Luca Cardelli, DavidSoloveichik, and Georg Seelig. Programmable chemical controllers made from DNA.
NatureNanotechnology , 8(10):755–762, 2013.[17] Leonard E. Dickson. Finiteness of the odd perfect and primitive abundant numbers with n distinct prime factors. American Journal of Mathematics , 35(4):413–422, October 1913.5118] David Doty. Timing in chemical reaction networks. In
SODA 2014: Proceedings of the 25thAnnual ACM-SIAM Symposium on Discrete Algorithms , pages 772–784, January 2014.[19] David Doty and Monir Hajiaghayi. Leaderless deterministic chemical reaction networks.
Nat-ural Computing , 14(2):213–223, 2015. Preliminary version appeared in DNA 2013.[20] David Doty and David Soloveichik. Stable leader election in population protocols requireslinear time.
Distributed Computing , 31(4):257–271, 2018. Special issue of invited papers fromDISC 2015.[21] Leszek Gasieniec and Grzegorz Stachowiak. Fast space optimal leader election in populationprotocols. In
SODA 2018: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposiumon Discrete Algorithms, SODA 2018, New Orleans, LA, USA, January 7-10, 2018 , pages2653–2667, 2018.[22] Leszek Gasieniec, Grzegorz Stachowiak, and Przemyslaw Uznanski. Almost logarithmic-timespace optimal leader election in population protocols.
CoRR , abs/1802.06867, 2018.[23] Seymour Ginsburg and Edwin H. Spanier. Semigroups, Presburger formulas, and languages.
Pacific Journal of Mathematics , 16(2):285–296, 1966.[24] John E. Hopcroft and Jean-Jacques Pansiot. On the reachability problem for 5-dimensionalvector addition systems.
Theoretical Computer Science , 8:135–159, 1979.[25] Sungjin Im. Personal communication.[26] Richard M Karp and Raymond E Miller. Parallel program schemata.
Journal of Computerand System Sciences , 3(2):147–195, 1969.[27] Adrian Kosowski and Przemyslaw Uznanski. Brief announcement: Population protocols arefast. In
PODC 2018: Proceedings of the 2018 ACM Symposium on Principles of DistributedComputing , pages 475–477. ACM, 2018.[28] Ernst W Mayr and Albert R Meyer. The complexity of the word problems for commutativesemigroups and polynomial ideals.
Advances in mathematics , 46(3):305–329, 1982.[29] Othon Michail and Paul G Spirakis. How many cooks spoil the soup? In
InternationalColloquium on Structural Information and Communication Complexity , pages 3–18. Springer,2016.[30] Carl A Petri. Communication with automata. Technical report, DTIC Document, 1966.[31] Niranjan Srinivas.
Programming chemical kinetics: Engineering dynamic reaction networkswith DNA strand displacement . PhD thesis, California Institute of Technology, 2015.[32] Chris Thachuk, Erik Winfree, and David Soloveichik. Leakless DNA strand displacementsystems. In
DNA 2015: Proceedings of the 21st International Conference on DNA Computingand Molecular Programming , pages 133–153. Springer, 2015.[33] Vito Volterra. Variazioni e fluttuazioni del numero dindividui in specie animali conviventi.
Mem. Acad. Lincei Roma , 2:31–113, 1926.[34] David Yu Zhang and Georg Seelig. Dynamic DNA nanotechnology using strand-displacementreactions.