Succinct Population Protocols for Presburger Arithmetic

Angluin et al. proved that population protocols compute exactly the predicates definable in Presburger arithmetic (PA), the first-order theory of addition. As part of this result, they presented a procedure that translates any formula $\varphi$ of quantifier-free PA with remainder predicates (which has the same expressive power as full PA) into a population protocol with $2^{O(\text{poly}(|\varphi|))}$ states that computes $\varphi$. More precisely, the number of states of the protocol is exponential in both the bit length of the largest coefficient in the formula, and the number of nodes of its syntax tree. In this paper, we prove that every formula $\varphi$ of quantifier-free PA with remainder predicates is computable by a leaderless population protocol with $O(\text{poly}(|\varphi|))$ states. Our proof is based on several new constructions, which may be of independent interest. Given a formula $\varphi$ of quantifier-free PA with remainder predicates, a first construction produces a succinct protocol (with $O(|\varphi|^3)$ leaders) that computes $\varphi$; this completes the work initiated in [STACS'18], where we constructed such protocols for a fragment of PA. For large enough inputs, we can get rid of these leaders. If the input is not large enough, then it is small, and we design another construction producing a succinct protocol with one leader that computes $\varphi$. Our last construction gets rid of this leader for small inputs.


Introduction
Population protocols [3,4] are a model of distributed computation by indistinguishable, mobile finite-state agents, intensely investigated in recent years (see e.g.[2,10]).Initially introduced to model networks of passively mobile sensors, they have also been applied to the analysis of chemical reactions under the name of chemical reaction networks (see e.g.[14]).In a population protocol, a collection of agents, called a population, randomly interact in pairs to decide whether their initial configuration satisfies a given property, e.g.whether there are initially more agents in some state A than in some state B. Since agents are indistinguishable and finite-state, their configuration at any time moment is completely characterized by the mapping that assigns to each state the number of agents that currently populate it.A protocol is said to compute a predicate if for every initial configuration where the predicate holds, the agents eventually reach consensus 1, and they eventually reach consensus 0 otherwise.
In a seminal paper, Angluin et al. proved that population protocols compute exactly the predicates definable in Presburger arithmetic (PA) [5].As part of the result, for every Presburger predicate Angluin et al. construct a leaderless protocol that computes it.The construction uses the quantifier elimination procedure for PA: every Presburger formula ϕ can be transformed into an equivalent boolean combination of threshold predicates of the form α • x > β and remainder predicates of the form α • x ≡ β (mod m), where α is an integer vector, and β, m are integers [12].Slightly abusing language, we call the set of these boolean combinations quantifier-free Presburger arithmetic (QFPA) 1 .Using that PA and QFPA have the same expressive power, Angluin et al. first construct protocols for all threshold and remainder predicates, and then show that the predicates computed by protocols are closed under negation and conjunction.
The construction of [5] is simple and elegant, but it produces large protocols.Given a formula ϕ of QFPA, let n be the number of bits of the largest coefficient of ϕ in absolute value, and let m be the number of atomic formulas of ϕ, respectively.The number of states of the protocols of [5] grows exponentially in both n and m.In terms of |ϕ| (defined as the sum of the number of variables, n, and m) they have O(2 poly(|ϕ|) ) states.This raises the question of whether succinct protocols with O(poly(|ϕ|)) states exist for every formula ϕ of QFPA.We give an affirmative answer by proving that every formula of QFPA has a succinct and leaderless protocol.
Succinct protocols are the state-complexity counterpart of fast protocols, defined as protocols running in polylogarithmic parallel time in the size of the population.Angluin et al. showed that every predicate has a fast protocol with a leader [6], but Alistarh et al., based on work by Doty and Soloveichik [9], proved that in the leaderless case some predicates need linear parallel time [1].Our result shows that, unlike for time complexity, succinct protocols can be obtained for every QFPA formula in both the leaderless case and the case with leaders.
The proof of our result overcomes a number of obstacles.Designing succinct leaderless protocols is particularly hard for inputs with very few input agents, because there are less resources to simulate leaders.So we produce two completely different families of protocols, one for small inputs with O(|ϕ| 3 ) agents, and a second for large inputs with Ω(|ϕ| 3 ) agents, and combine them appropriately. 1 Remainder predicates cannot be directly expressed in Presburger arithmetic without quantifiers.
Large inputs.The family for large inputs is based on our previous work [8].However, in order to obtain leaderless protocols we need a new succinct construction for boolean combinations of atomic predicates.This obstacle is overcome by designing new protocols for threshold and remainder predicates that work under reversible dynamic initialization.Intuitively, agents are allowed to dynamically "enter" and "leave" the protocol through the initial states (dynamic initialization).Further, every interaction can be undone (reversibility), until a certain condition is met, after which the protocol converges to the correct output for the current input.We expect protocols with reversible dynamic initialization to prove useful in other contexts, since they allow a protocol designer to cope with "wrong" non-deterministic choices.
Small inputs.The family of protocols for small inputs is designed from scratch.We exploit that there are few inputs of small size.So it becomes possible to design one protocol for each possible size of the population, and combine them appropriately.Once the population size is fixed, it is possible to design agents that check if they have interacted with all other agents.This is used to simulate the concatenation operator of sequential programs, which allows for boolean combinations and succinct evaluation of linear combinations.
Relation to previous work.In [8], we designed succinct protocols with leaders for systems of linear equations.More precisely, we constructed a protocol with O((m + k)(n + log m)) states and O(m(n + log m)) leaders that computes a given predicate Ax ≥ c, where A ∈ Z m×k and n is the number of bits of the largest entry in A and c, in absolute value.Representing Ax ≥ c as a formula ϕ of QFPA, we obtain a protocol with O(|ϕ| 2 ) states and O(|ϕ| 2 ) leaders that computes ϕ.However, in [8] no succinct protocols for formulas with remainder predicates are given, and the paper makes extensive use of leaders.
Organization.Sections 2 and 3 introduce basic notation and definitions.Section 4 presents the main result.Sections 5 and 6 present the constructions of the protocols for large and small inputs, respectively.Section 7 presents conclusions.For space reasons, several proofs are only sketched.Detailed proofs are given in the full version of this paper [7].

Preliminaries
Notation.We write Z to denote the set of integers, N to denote the set of non negative integers {0, 1, . ..}, [n] to denote {1, 2, . . ., n}, and N E to denote the set of all multisets over E, i.e. unordered vectors with components labeled by E. The size of a multiset v ∈ N E is defined as The set of all multisets over E with size s ≥ 0 is Presburger arithmetic.Presburger arithmetic (PA) is the first-order theory of N with addition, i.e.FO(N, +).For example, the PA formula ψ(x, y, z) = ∃x ∃z (x = x + x ) ∧ (y = z +z )∧ ¬(z = 0) states that x is even and that y > z.It is well-known that for every formula S TA C S 2 0 2 0 40:4

Succinct Population Protocols for Presburger Arithmetic
of PA there is an equivalent formula of quantifier-free Presburger arithmetic (QFPA) [13], the theory with syntax given by the grammar where a ∈ Z X , b ∈ Z, c ∈ N ≥2 , and ≡ c denotes equality modulo c.For example, the formula ψ(x, y, z) above is equivalent to (x ≡ 2 0) ∧ (y − z ≥ 1).Throughout the paper, we refer to any formula of QFPA, or the predicate N X → {0, 1} it denotes, as a predicate.Predicates of the form a • v > b and a • v ≡ c b are atomic, and they are called threshold and remainder predicates respectively.The max-norm ϕ of a predicate ϕ is the largest absolute value among all coefficients occurring within ϕ.The length len(ϕ) of a predicate ϕ is the number of boolean operators occurring within ϕ.The bit length of a predicate ϕ, over variables X, is defined as |ϕ| def = len(ϕ) + log ϕ + |X|.We lift these definitions to sets of predicates in the natural way: given a finite set P of predicates, we define its size size(P ) as the number of predicates in P , its length as len(P ) def = ϕ∈P len(ϕ), its norm as P def = max{ ϕ : ϕ ∈ P }, and its bit length as |P | def = size(P ) + len(P ) + log P + |X|.Note that len(P ) = 0 iff P only contains atomic predicates.

Population protocols
A population protocol is a tuple P = (Q, T, L, X, I, O) where Q is a finite set whose elements are called states; X is a finite set whose elements are called input variables; I : X → Q is the input mapping; O : Q → {0, 1, ⊥} is the output mapping.
For readability, we often write t : p → q to denote a transition t = (p, q).Given ∆ ≥ 2, we say that t is ∆-way if |p| ≤ ∆.
In the standard syntax of population protocols T is a subset of N 2 ×N 2 , and O : Q → {0, 1}.These differences are discussed at the end of this section.

Inputs and configurations.
An input is a multiset v ∈ N X such that |v| ≥ 2, and a configuration is a multiset C ∈ N Q such that |C| ≥ 2. Intuitively, a configuration represents a population of agents where C(q) denotes the number of agents in state q.The initial configuration C v for input v is defined as The support and b-support of a configuration C are respectively defined as  Computations.An execution σ is fair if for every configuration D the following holds: In other words, fairness ensures that an execution cannot avoid a configuration forever.We say that a population protocol computes a predicate ϕ : N X → {0, 1} if for every v ∈ N X and every fair execution σ starting from C v , it is the case that O(σ) = ϕ(v).Two protocols are equivalent if they compute the same predicate.It is known that population protocols compute precisely the Presburger-definable predicates [5,11].
Intuitively, each agent stores a number, initially 1.When two agents meet, one of them stores the sum of their values and the other one stores 0, with sums capping at 2 n .Once an agent reaches this cap, all agents eventually get converted to 2 n .Now, consider the protocol and T contains a transition for each 0 ≤ i < n of the form 2 i , 2 i → 0, 2 i+1 , and a transition for each a ∈ Q of the form a, 2 n → 2 n , 2 n .Using similar arguments as above, it follows that P n also computes ϕ, but more succinctly: While P n has 2 n + 1 states, P n has only n + 1 states.

Types of protocols. A protocol P = (Q, T, L, X, I, O) is
leaderless if |L| = 0, and has |L| leaders otherwise; ∆-way if all its transitions are ∆-way; , the output is determined by the number of agents in f and t.) Protocols with leaders and leaderless protocols compute the same predicates [5].Every ∆-way protocol can be transformed into an equivalent 2-way protocol with a polynomial increase in the number of transitions [8].Finally, every protocol can be transformed into an equivalent simple protocol with a polynomial increase in the number of states [7].

Main result
The main result of this paper is the following theorem: Theorem 2. Every predicate ϕ of QFPA can be computed by a leaderless population protocol P with O(poly(|ϕ|)) states.Moreover, P can be constructed in polynomial time.
To prove Theorem 2, we first provide a construction that uses ∈ O(|ϕ| 3 ) leaders.If there are at least |v| ≥ input agents v (large inputs), we will show how the protocol can be made leaderless by having agents encode both their state and the state of some leader.Otherwise, |v| < (small inputs), and we will resort to a special construction, with a single S TA C S 2 0 2 0 40:6 Succinct Population Protocols for Presburger Arithmetic leader, that only works for populations of bounded size.We will show how the leader can be simulated collectively by the agents.Hence, we will construct succinct protocols computing ϕ for large and small inputs, respectively.Formally, we prove: Lemma 3. Let ϕ be a predicate over variables X.There exist ∈ O(|ϕ| 3 ) and leaderless protocols P ≥ and P < with O(poly(|ϕ|)) states such that: Theorem 2 follows immediately from the lemma: it suffices to take the conjunction of both protocols, which only yields a quadratic blow-up on the number of states, using the classical product construction [3].The rest of the paper is dedicated to proving Lemma 3. Parts (a) and (b) are shown in Sections 5 and 6, respectively.
In the remainder of the paper, whenever we claim the existence of some protocol P, we also claim polynomial-time constructibility of P without mentioning it explicitly.

Succinct protocols for large populations
We show that, for every predicate ϕ, there exists a constant ∈ O(|ϕ| 3 ) and a succinct protocol P ≥ computing (|v| ≥ ) → ϕ(v).Throughout this section, we say that n ∈ N is large if n ≥ , and that a protocol computes ϕ for large inputs if it computes (|v| ≥ ) → ϕ(v).
We present the proof in a top-down manner, by means of a chain of statements of the form "A ← B, B ← C, C ← D, and D".Roughly speaking, and using notions that will be defined in the forthcoming subsections: Section 5.1 introduces protocols with helpers, a special class of protocols with leaders.
The section shows: ϕ is computable for large inputs by a succinct leaderless protocol (A), if it is computable for large inputs by a succinct protocol with helpers (B).Section 5.2 defines protocols that simultaneously compute a set of predicates.The section proves: (B) holds if the set P of atomic predicates occurring within ϕ is simultaneously computable for large inputs by a succinct protocol with helpers (C).Section 5.3 introduces protocols with reversible dynamic initialization.The section shows: (C) holds if each atomic predicate of P is computable for large inputs by a succinct protocol with helpers and reversible dynamic initialization (D).Section 5.4 shows that (D) holds by exhibiting succinct protocols with helpers and reversible dynamic initialization that compute atomic predicates for large inputs.

From protocols with helpers to leaderless protocols
Intuitively, a protocol with helpers is a protocol with leaders satisfying an additional property: adding more leaders does not change the predicate computed by the protocol.Formally, let P = (Q, T, L, X, I, O) be a population protocol computing a predicate ϕ.We say that P is a protocol with helpers if for every L L the protocol P = (Q, T, L , X, I, O) also computes ϕ, where L L def = ∀q ∈ Q : (L (q) = L(q) = 0 ∨ L (q) ≥ L(q) > 0).If |L| = , then we say that P is a protocol with helpers.Theorem 4. Let P = (Q, T, L, X, I, O) be a ∆-way population protocol with -helpers computing some predicate ϕ.There exists a 2-way leaderless population protocol with Proof sketch.By [8, Lemma 3], P can be transformed into a 2-way population protocol (with helpers 2 ) computing the same predicate ϕ, and with at most |Q| + 3∆ • |T | states.Thus, we assume P to be 2-way in the rest of the sketch.
For simplicity, assume X = {x} and L = 3 • q, 5 • q ; that is, P has 8 helpers, and initially 3 of them are in state q, and 5 are in q .We describe a leaderless protocol P that simulates P for every input v such that |v| ≥ |L| = .Intuitively, P runs in two phases: In the first phase each agent gets assigned a number between 1 and 8, ensuring that each number is assigned to at least one agent (this is the point at which the condition |v| ≥ is needed).At the end of the phase, each agent is in a state of the form (x, i), meaning that the agent initially represented one unit of input for variable x, and that it has been assigned number i.To achieve this, initially every agent is placed in state (x, 1).
Transitions are of the form (x, i), (x, i) → (x, i + 1), (x, i) for every 1 ≤ i ≤ 7. The transitions guarantee that all but one agent is promoted to (x, 2), all but one to (x, 3), etc.In other words, one agent is "left behind" at each step.
In the second phase, an agent's state is a multiset: agents in state (x, i) move to state I(x), q if 1 ≤ i ≤ 3, and to state I(x), q if 4 ≤ i ≤ 8. Intuitively, after this move each agent has been assigned two jobs: simultaneously simulate a regular agent of P starting at state x, and a helper of L starting at state q or q .Since in the first phase each number is assigned to at least one agent, P has at least 3 agents simulating helpers in state q, and at least 5 agents simulating helpers in state q .There may be many more helpers, but this is harmless, because, by definition, additional helpers do not change the computed predicate.
The transitions of P are designed according to this double role of the agents of P .More precisely, for all multisets p, q, p , q of size two, p, q → p , q is a transition of P iff (p + q) − → (p + q ) in P.

From multi-output protocols to protocols with helpers
where O i denotes the mapping such that O i (q) def = O(i, q) for every q ∈ Q. Intuitively, since each Q i only differs by its output mapping, Q can be seen as a single population protocol whose executions have k outputs.More formally, Q computes a set of predicates Whenever the number k is irrelevant, we use the term multi-output population protocol instead of k-output population protocol.Proof sketch.Consider a binary tree decomposing the boolean operations of ϕ.We design a protocol for ϕ by induction on the height of the tree.
The case where the height is 0, and ϕ is atomic, is trivial.We sketch the induction step for the case where the root is labeled with ∧, that is ϕ = ϕ 1 ∧ ϕ 2 , the other cases are similar.By induction hypothesis, we have simple protocols P 1 , P 2 computing ϕ 1 , ϕ 2 , 2 Lemma 3 of [8] deals with leaders and not the more specific case of helpers.Nonetheless, computation under helpers is preserved as the input mapping of P remains unchanged in the proof of the lemma.

Succinct Population Protocols for Presburger Arithmetic
respectively.Let t j , f j be the output states of P j for j ∈ {1, 2} such that O j (t j ) = 1 and O j (f j ) = 0. We add two new states t, f (the output states of the new protocol) and an additional helper starting in state f.To compute ϕ 1 ∧ ϕ 2 we add the following transitions for every b The additional helper computes the conjunction as desired.

From reversible dynamic initialization to multi-output protocols
Let P = {ϕ 1 , . . ., ϕ k } be a set of k ≥ 2 atomic predicates of arity n ≥ 1 over a set X = {x 1 , . . ., x n } of variables.We construct a multi-output protocol P for P of size poly(|ϕ Let P 1 , . . ., P k be protocols for ϕ 1 , . . ., ϕ k .Observe that P cannot be a "product protocol" that executes P 1 , . . ., P k synchronously.Indeed, the states of such a P are (q 1 , . . ., q k ) of states of P 1 , . . ., P k , and so P would have exponential size in k.Further, P cannot execute P 1 , . . ., P k asynchronously in parallel, because, given an input x ∈ N n , it must dispatch k • x agents (x to the input states of each P j ), but it only has x.Such a P would need (k − 1)|x| helpers, which is not possible, because a protocol of size poly(|ϕ The solution is to use a more sophisticated parallel asynchronous computation.Consider two copies of inputs, denoted X = {x 1 , . . ., x n } and X = {x 1 , . . ., x n }.For each predicate ϕ over X, consider predicate φ over X ∪ X satisfying φ(x, x) = ϕ(kx + x) for every (x, x) ∈ N X∪X .We obtain φ(x, x) = ϕ(x) whenever kx + x = x, e.g. for x := x k and x := x mod k.With this choice, P needs to dispatch a total of k (|x + x|) ≤ |x| + n • (k − 1) 2 agents to compute φ1 (x, x), . . ., φk (x, x).That is, n • (k − 1) 2 helpers are sufficient to compute P. Formally, we define φ in the following way: and similarly for modulo predicates.For instance, if ϕ( Let us now describe how the protocol P computes φ1 (x, x), . . ., φk (x, x).Let P1 , . . ., Pk be protocols computing φ1 , . . ., φk .Let X = {x 1 , . . ., x n } be the input states of P, and let x j 1 , . . ., x j n and x j 1 , . . ., x j n be the input states of Pj for every 1 ≤ j ≤ k.Protocol P repeatedly chooses an index 1 ≤ i ≤ n, and executes one of these two actions: (a) take k agents from x i , and dispatch them to x 1 i , . . ., x k i (one agent to each state); or (b) take one agent from x i and (k − 1) helpers, and dispatch them to x 1 i , . . ., x k i .The index and the action are chosen nondeterministically. Notice that if for some input x i , all agents of x i are dispatched, then kx j i + x j i = for all j.If all agents of x i are dispatched for every 1 ≤ i ≤ n, then we say that the dispatch is correct.

40:9
To solve this problem we ensure that P can always recall agents already dispatched to P1 , . . ., Pk as long as the dispatch is not yet correct.This allows P to "try out" dispatches until it dispatches correctly, which eventually happens by fairness.For this we design P so that (i) the atomic protocols P1 , . . ., Pk can work with inputs agents that arrive over time (dynamic initialization), and (ii) P1 , . . ., Pk can always return to their initial configuration and send agents back to P, unless the dispatch is correct (reversibility).To ensure that P stops redistributing after dispatching a correct distribution, it suffices to replace each reversing transition p → q by transitions p + x i → q + x i , one for each 1 ≤ i ≤ n: All these transitions become disabled when x 1 , . . ., x n are not populated.

Reversible dynamic initialization.
Let us now formally introduce the class of protocols with reversible dynamic initialization that enjoys all properties needed for our construction.A simple protocol with reversible dynamic initialization (RDI-protocol for short) is a tuple L, X, I, O) is a simple population protocol, and T † is the set of transitions making the system reversible, called the RDI-transitions.
Intuitively, all configurations C ∈ [C] are equivalent to C in all but the output states.
An RDI-protocol is required to be reversible, that is for every initialization sequence π with effective input w, and such that L Intuitively, an RDI-protocol can never have more agents in an input state than the effective number of agents it received via the input and output transitions.Further, an RDI-protocol can always reverse all sequences that do not contain input or output transitions.This reversal does not involve the states f and t, which have a special role as output states.Since RDI-protocols have a default output, we need to ensure that the default output state is populated when dynamic initialization ends, and reversal for f and t would prevent that.
An RDI-protocol P computes ϕ if for every initialization sequence π with effective input w such that L π − → C for some L L, the standard population protocol P ∞ computes ϕ(w) from C (that is with T † disabled).Intuitively, if the dynamic initialization terminates, the RDI-transitions T † become disabled, and then the resulting standard protocol P ∞ converges to the output corresponding to the dynamically initialized input.

Atomic predicates under reversible dynamic initialization
Lastly, we show that atomic predicates are succinctly computable by RDI-protocols: The protocols for arbitrary threshold and remainder predicates satisfying the conditions of Theorem 7, and their correctness proofs, are given in [7].Note that the threshold protocol is very similar to the protocol for linear inequalities given in Section 6 of [8].Thus, as an example, we will instead describe how to handle the remainder predicate 5x − y ≡ 7 4. Note, that the predicate can be rewritten as (5x + 6y ≥ 4 (mod 7)) ∧ (5x + 6y ≥ 5 (mod 7)).As we can handle negations and conjunctions separately in Section 5.2, we will now explain the protocol for ϕ def = 5x + 6y ≥ 4 (mod 7).The protocol is partially depicted in Figure 1 using Petri net conventions for the graphical representation.
The protocol has an input state x for each variable x ∈ X, output states f and t, a neutral state 0, and numerical states of the form +2 i for every 0 ≤ i ≤ n, where n is the smallest number such that 2 n > ϕ .Initially, (at least) one helper is set to f and (at least) 2n helpers set to 0. In order to compute 5x + 6y ≥ 4 (mod 7) for x := r and y := s, we initially place r and s agents in the states x and y, i.e., the agents in state x encode the number r in unary, and similarly for y.The blue transitions on the left of Figure 1 "convert" each agents in input states to a binary representation of their corresponding coefficient.In our example, agents in state x are converted to a(x) = 5 = 0101 2 by putting one agent in 4 and another one in 1.Since two agents are needed to encode 5, the transition "recruits" one helper from state 0. Observe that, since the inputs can be arbitrarily large, but a protocol can only use a constant number of helpers, the protocol must reuse helpers in order to convert all agents in input states.This happens as follows.If two agents are in the same power of two, say +2 i , then one of them can be "promoted" to +2 i+1 , while the other one moves to state 0, "liberating" one helper.This allows the agents to represent the overall value of all converted agents in the most efficient representation.That is, from any configuration, one can always reach a configuration where there is at most one agent in each place 2 0 , . . ., 2 n−1 , there are at most the number of agents converted from input places in place 2 n , and hence there are at least n agents in place 0, thus ready to convert some agent from the input place.Similar to promotions, "demotions" to smaller powers of two can also happen.Thus, the agents effectively shift through all possible binary representations of the overall value of all converted agents.The ≡ 7 transition in Figure 1 allows 3 agents in states 4, 2 and 1 to "cancel out" by moving to state 0, and it moves the output helper to f.Furthermore, there are RDI-transitions that allow to revert the effects of conversion and cancel transitions.These are not shown in Figure 1.
We have to show that this protocol computes ϕ under reversible dynamic initialization.First note, that while dynamic initialization has not terminated, all transitions have a corresponding reverse transition.Thus, it is always possible to return to wrong initial configurations.However, reversing the conversion transitions can create more agents in input states than the protocol effectively received.To forbid this, each input agent is "tagged" with its variable (see tokens in Figure 1).Therefore, in order to reverse a conversion transitions, the original input agent is needed.This implies, that the protocol is reversible.
Next, we need to argue that the protocol without the RDI-transitions computes ϕ once the dynamic initialization has terminated.The agents will shift through the binary representations of the overall value.Because of fairness, the ≡ 7 transition will eventually reduce the overall value to at most 6.There is a ≥ 4-transition which detects the case where the final value is at least 4 and moves the output helper from f to state t.Notice that whenever transition ≡ 7 occurs, we reset the output by moving the output helper to state f.

Succinct protocols for small populations
We show that for every predicate ϕ and constant = O(|ϕ| 3 ), there exists a succinct protocol P < that computes the predicate (|v| < ) → ϕ(v).In this case, we say that P < computes ϕ for small inputs.Further, we say that a number n ∈ N (resp.an input v) is small with respect to ϕ if n ≤ (resp.|v| ≤ ).We present the proof strategy in a top-down manner.Section 6.1 proves: There is a succinct leaderless protocol P that computes ϕ for small inputs (A), if for every small n some succinct protocol P n computes ϕ for all inputs of size n (B).Intuitively, constructing a succinct protocol for all small inputs reduces to the simpler problem of constructing a succinct protocol for all small inputs of a fixed size.Section 6.2 introduces halting protocols.It shows: There is a succinct protocol that computes ϕ for inputs of size n, if for every atomic predicate ψ of ϕ some halting succinct protocol computes ψ for inputs of size n (C).Thus, constructing protocols for arbitrary predicates reduces to constructing halting protocols for atomic predicates.Section 6.3 proves (C).Given a threshold or remainder predicate ϕ and a small n, it shows how to construct a succinct halting protocol that computes ϕ for inputs of size n.

From fixed-sized protocols with one leader to leaderless protocols
We now define when a population protocol computes a predicate for inputs of a fixed size.
Intuitively, it should compute the correct value for every initial configurations of this size; for inputs of other sizes, the protocol may converge to the wrong result, or may not converge.
S TA C S 2 0 2 0 40:12 Succinct Population Protocols for Presburger Arithmetic Definition 8. Let ϕ be a predicate and let i ≥ 2. A protocol P computes ϕ for inputs of size i, denoted "P computes (ϕ | i)", if for every input v of size i, every fair execution of P starting at C v stabilizes to ϕ(v).
We show that if, for each small number i, some succinct protocol computes (ϕ | i), then there is a single succinct protocol that computes ϕ for all small inputs.Theorem 9. Let ϕ be a predicate over a set of variables X, and let ∈ N. Assume that for every i ∈ {2, 3, . . ., − 1}, there exists a protocol with at most one leader and at most m states that computes (ϕ | i).Then, there is a leaderless population protocol with O( 4 • m 2 • |X| 3 ) states that computes (x < ) → ϕ(x).
Proof sketch.Fix a predicate ϕ and ∈ N.For every 2 ≤ i < , let P i be a protocol computing (ϕ | i).We describe the protocol P = (Q, T, X, I, O) that computes (x ≥ ) ∨ ϕ(x) ≡ (x < ) → ϕ(x).The input mapping I is the identity.During the computation, agents never forget their initial state -that is, all successor states of an agent are annotated with their initial state.The protocol initially performs a leader election.Each provisional leader stores how many agents it has "knocked out" during the leader election in a counter from 0 to − 1.After increasing the counter to a given value i < , it resets the state of i agents and itself to the corresponding initial state of P i+1 , annotated with X, and initiates a simulation of P i+1 .When the counter of an agent reaches − 1, the agent knows that the population size must be ≥ , and turns the population into a permanent 1-consensus.Now, if the population size i is smaller than , then eventually a leader gets elected who resets the population to the initial population of P i .Since P i computes (ϕ | i), the simulation of P i eventually yields the correct output.

Computing boolean combinations of predicates for fixed-size inputs
We want to produce a population protocol P for a boolean combination ϕ of atomic predicates (ϕ i ) i∈[k] for which we have population protocols (P i ) i∈ [k] .As in Section 5.3, we cannot use a standard "product protocol" that executes P 1 , . . ., P k synchronously because the number of states would be exponential in k.Instead, we want to simulate the concatenation of (P i ) i∈ [k] .However, this is only possible if for all i ∈ [k], the executions of P i eventually "halt", i.e. some agents are eventually certain that the output of the protocol will not change anymore, which is not the case in general population protocols.For this reason we restrict our attention to "halting" protocols.
Definition 10.Let P be a simple protocol with output states f and t.We say that P is a halting protocol if every configuration C reachable from an initial configuration satisfies: > 0 for every q ∈ {f, t} and every configuration C .
Intuitively, a halting protocol is a simple protocol in which states f and t behave like "final states": If an agent reaches q ∈ {f, t}, then the agent stays in q forever.In other words, the protocol reaches consensus 0 (resp.1) iff an agent ever reaches f (resp.t).
Theorem 11.Let k, i ∈ N. Let ϕ be a boolean combination of atomic predicates (ϕ j ) j∈ [k] .Assume that for every j ∈ [k], there is a simple halting protocol P j = (Q j , L j , X, T j , I j , O j ) with one leader computing (ϕ j | i).Then there exists a simple halting protocol P that computes (ϕ | i), with one leader and O (|X| Proof sketch.We only sketch the construction for ϕ = ϕ 1 ∧ ϕ 2 .The main intuition is that, since P 1 and P 2 are halting, we can construct a protocol that, given an input v, first simulates P 1 on v, and, after P 1 halts, either halts if P 1 converges to 0, or simulates P 2 on v if P 1 converges to 1.Each agent remembers in its state the input variable it corresponds to, in order to simulate P 2 on v.

Computing atomic predicates for fixed-size inputs
We describe a halting protocol that computes a given threshold predicate for fixed-size inputs.
For every i ∈ N, there exists a halting protocol with one leader and O(i 2 (|ϕ| + log i) 3 ) states that computes (ϕ | i).
We first describe a sequential algorithm Greater-Sum(x, y), that for every input x, y satisfying |x| + |y| = i decides whether α • x − β • y > 0 holds.Then we simulate Greater-Sum by means of a halting protocol with i agents.
Since each agent can only have O(log i + log |ϕ|) bits of memory (the logarithm of the number of states), Greater-Sum must use at most O(i • (log i + log |ϕ|)) bits of memory, otherwise it cannot be simulated by the agents.Because of this requirement, Greater-Sum cannot just compute, store, and then compare α • x and β • y; this uses too much memory.
Greater-Sum calls procedures Probe 1 (j) and Probe 2 (j) that return the j-th bits of αx and βy, respectively, where j = 1 is the most significant bit.Since |x| ≤ i, and the largest constant in α is at most ||ϕ||, we have α • x ≤ i • ||ϕ||, and so α • x has at most m def = |ϕ| + log(i) + 1 bits, and the same holds for βy.So we have 1 ≤ j ≤ m.Let us first describe Greater-Sum, and then Probe 1 (j); the procedure Probe 2 (j) is similar.
Greater-Sum(x, y) loops through j = 1, . . ., m.For each j, it calls Probe 1 (j) and Probe 2 (j).If Probe 1 (j) > Probe 2 (j), then it answers ϕ(x, y) = 1, otherwise it moves to j + 1.If Greater-Sum reaches the end of the loop, then it answers ϕ(x, y) = 0. Observe that Greater-Sum only needs to store the current value of j and the bits returned by Probe 1 (j) and Probe 2 (j).Since j ≤ m, Greater-Sum only needs O(log(|ϕ| + log i)) bits of memory.
Probe 1 (j) uses a decreasing counter k = m, . . ., j to successively compute the bits b 1 (k) of α • x, starting at the least significant bit.To compute b 1 (k), the procedure stores the carry c k ≤ i of the computation of b 1 (k + 1); it then computes the sum s k := c k + α(k) • x (where α(k) is the k-th vector of bits of α), and sets b k := s k mod 2 and c k−1 := s k ÷ 2. The procedure needs O(log(|ϕ| + log i)) bits of memory for counter k, log(i) + 1 bits for encoding s k , and O(log(i)) bits for encoding c k .So it only uses O(log(|ϕ| + log i)) bits of memory.
Let us now simulate Greater-Sum(x, y) by a halting protocol with one leader agent.Intuitively, the protocol proceeds in rounds corresponding to the counter k.The leader stores in its state the value j and the current values of the program counter, of counter k, and of variables b k , s k , and c k .The crucial part is the implementation of the instruction s k := c k + α(k) • x of Probe 1 (j).In each round, the leader adds input agents one by one.As the protocol only needs to work for populations with i agents, it is possible for each agent to know if it already interacted with the leader in this round, and for the leader to count the number of agents it has interacted with this round, until it reaches i to start the next round.

Conclusion and further work
We have proved that every predicate ϕ of quantifier-free Presburger arithmetic (QFPA) is computed by a leaderless protocol with poly(|ϕ|) states.Further, the protocol can be computed in polynomial time.The number of states of previous constructions was exponential S TA C S 2 0 2 0 40:14 Succinct Population Protocols for Presburger Arithmetic both in the bit-length of the coefficients of ϕ, and in the number of occurrences of boolean connectives.Since QFPA and PA have the same expressive power, every computable predicate has a succinct leaderless protocol.This result completes the work initiated in [8], which also constructed succinct protocols, but only for some predicates, and with the help of leaders.
It is known that protocols with leaders can be exponentially faster than leaderless protocols.Indeed, every QFPA predicate is computed by a protocol with leaders whose expected time to consensus is polylogarithmic in the number of agents [6], while every leaderless protocol for the majority predicate needs at least linear time in the number of agents [1].Our result shows that, if there is also an exponential gap in state-complexity, then it must be because some family of predicates have protocols with leaders of logarithmic size, while all leaderless families need polynomially many states.The existence of such a family is an open problem.
The question of whether protocols with poly(|ϕ|) states exist for every PA formula ϕ, possibly with quantifiers, also remains open.However, it is easy to prove that no algorithm for the construction of protocols from PA formulas runs in time 2 p(n) for any polynomial p. Theorem 13.For every polynomial p, every algorithm that accepts a formula ϕ of PA as input, and returns a population protocol computing ϕ, runs in time 2 ω(p(|ϕ|)) .
Therefore, if PA also has succinct protocols, then they are very hard to find.
Our succinct protocols for QFPA have slow convergence (in the usual parallel time model, see e.g.[2]), since they often rely on exhaustive exploration of a number of alternatives, until the right one is eventually hit.The question of whether every QFPA predicate has a succinct and fast protocol is very challenging, and we leave it open for future research.
We sometimes write multisets using set-like notation, e.g.a, 2•b denotes the multiset v such that v(a) = 1, v(b) = 2 and v(e) = 0 for every e ∈ E \ {a, b}.The empty multiset is instead denoted 0 for readability.For every u, v ∈ N E , we write u ≥ v if u(e) ≥ v(e) for every e ∈ E.Moreover, we write u + v to denote the multiset w ∈ N E such that w(e) def = u(e) + v(e) for every e ∈ E. The multiset u v is defined analogously with − instead of +, provided that u ≥ v.

40: 5
We denote the reflexive and transitive closure of S − → by S * − − →.If S is the set of all transitions of the protocol under consideration, then we simply write − → and * − →.An execution is a sequence of configurations σ = C 0 C 1 • • • such that C i − → C i+1 for every i ∈ N. We write σ i to denote configuration C i .The output of an execution σ is defined as follows.If there exist i ∈ N and b ∈ {0, 1} such that O(σ i ) = O(σ i+1 ) = • • • = b, then O(σ) def = b, and otherwise O(σ) def = ⊥.

Proposition 5 .
Assume that every finite set A of atomic predicates is computed by some |A|-way multi-output protocol with O(|A| 3 ) helpers and states, and O(|A| 5 ) transitions.Every QFPA predicate ϕ is computed by some simple |ϕ|-way protocol with O(|ϕ| 3 ) helpers and states, and O(|ϕ| 5 ) transitions.
and let In def = {in x : x ∈ X} and Out def = {out x : x ∈ X} be the sets of input and output transitions, respectively, where in x def = (0, I(x) ) and out x def = ( I(x) , 0).An initialization sequence is a finite execution π ∈ (T ∪ In ∪ Out) * from the initial configuration L with L L. The effective input of π is the vector w such that w(x) def = |π| inx − |π| outx for every x ∈ X. Intuitively, a RDI-protocol starts with helpers only, and is dynamically initialized via the input and output transitions.Let f, t ∈ Q be the unique states of P with O(f) = 0 and O

π−→
C for some L L, the following holds: if C T * − − → D and D ∈ [D], then D T * − − → C for some C ∈ [C], and C(I(x)) ≤ w(x) for all x ∈ X.

Theorem 7 .Figure 1
Figure 1Partial representation of the protocol computing 5x + 6y ≥ 4 (mod 7) as a Petri net, where places (circles), transitions (squares) and tokens (smaller filled circles) represent respectively states, transitions and agents.Non-helper agents remember their input variable (labeled here within tokens).The depicted configuration is obtained from input x = 2, y = 1 by firing the bottom leftmost transition (dark blue).