The expressibility of functions on the Boolean domain, with applications to Counting CSPs

An important tool in the study of the complexity of Constraint Satisfaction Problems (CSPs) is the notion of a relational clone, which is the set of all relations expressible using primitive positive formulas over a particular set of base relations. …

Authors: Andrei A. Bulatov, Martin Dyer, Leslie Ann Goldberg

The expressibility of functions on the Boolean domain, with applications   to Counting CSPs
The expressibility of functions on the Boolean domain, with applica tions to Counting CSPs ∗ Andrei A. Bulato v 1 Martin Dy er 2 Leslie Ann Goldb erg 3 Mark Jerrum 4 Colin McQuillan 3 Octob er 15, 2018 Abstract An imp ortan t to ol in the study of the complexit y of Constrain t Satisfaction Prob- lems (CSPs) is the notion of a relational clone, which is the set of all relations express- ible using primitive positive form ulas o ver a particular set of base relations. P ost’s lattice gives a complete classification of all Bo olean relational clones, and this has b een used to classify the computational difficult y of CSPs. Motiv ated b y a desire to un- derstand the computational complexity of (w eigh ted) coun ting CSPs, w e develop an analogous notion of functional clones and study the landscape of these clones. One of these clones is the collection of log-sup ermodular (lsm) functions, whic h turns out to pla y a significant role in classifying counting CSPs. In the conserv ativ e case (where all nonnegativ e unary functions are av ailable), we sho w that there are no functional clones lying strictly b etw een the clone of lsm functions and the total clone (con taining all functions). Thus, any coun ting CSP that contains a single nontrivial non-lsm func- tion is computationally as hard to appro ximate as an y problem in #P . F urthermore, w e show that any non-trivial functional clone (in a sense that will b e made precise) con tains the binary function “implies”. As a consequence, in the conserv ative case, all non-trivial counting CSPs are as hard as # BIS , the problem of coun ting indep enden t sets in a bipartite graph. Giv en the complexit y-theoretic results, it is natural to ask whether the “implies” clone is equiv alen t to the clone of lsm functions. W e use the M¨ obius transform and the F ourier transform to show that these clones coincide pre- cisely up to arit y 3. It is an intriguing op en question whether the lsm clone is finitely generated. Finally , we in vestigate functional clones in which only restricted classes of unary functions are av ailable. ∗ The w ork rep orted in this pap er w as supp orted b y an EPSR C Research Gran t “Computational Coun ting” (refs. EP/I011528/1, EP/I011935/1, EP/I012087/1), and b y an NSERC Discov ery Grant, and b y an EPSRC do ctoral training gran t. P art of the wor k w as supported b y a visit to the Isaac Newton Institute for Mathematical Sciences, under the programme “Discrete Analysis”. Some of the results w ere announced in the preliminary pap ers [8] and [29]. 1 Sc ho ol of Computing Science, Simon F raser Universit y , 8888 Universit y Drive, Burnaby BC, V5A 1S6, Canada. 2 Sc ho ol of Computing, Univ ersity of Leeds, Leeds LS2 9JT, United Kingdom. 3 Departmen t of Computer Science, Ashton Building, Univ ersity of Liverpo ol, Liverpo ol L69 3BX, United Kingdom. 4 Sc ho ol of Mathematical Sciences, Queen Mary , Universit y of London, Mile End Road, London E1 NS, United Kingdom. The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 2 1 In tro duction In the classical setting, a (non-uniform) constrain t satisfaction problem CSP ( Γ ) is sp ecified b y a finite domain D and a constraint language Γ , whic h is a set of relations of v arying arities o v er D . F or example, D migh t b e the Bo olean domain { 0 , 1 } and Γ migh t b e the set con taining the single relation NAND = { (0 , 0) , (0 , 1) , (1 , 0) } . An instance of CSP ( Γ ) is a set of n v ariables taking v alues in D , together with a set of constrain ts on those v ariables. Eac h constrain t is a relation R from Γ applied to a tuple of v ariables, which is called the “scop e” of the constrain t. The problem is to find an assignmen t of domain elements to the v ariables whic h satisfies all of the constrain ts. F or example, the problem of finding an indep enden t set in a graph can b e represented as a CSP with Γ = { NAND } . The v ertices of the graphs are the v ariables of the CSP instance. The instance has one NAND constraint for each edge of the graph. V ertices whose v ariables are mapp ed to domain elemen t 1 are deemed to b e in the indep enden t set. Constrain t satisfaction problems (CSPs) may be view ed as generalised satisfiabilit y problems, among which usual satisfiability is a very sp ecial case. The notion of expressibility is key to understanding the complexity of CSPs. A primitive p ositive formula (pp-form ula) in v ariables V = { v 1 , . . . , v n } is a form ula of the form ∃ v n +1 . . . v n + m ^ i ϕ i , where each atomic form ula ϕ i is either a relation R from Γ applied to some of the v ariables in V 0 = { v 1 , . . . , v n + m } or an equalit y relation of the form v i = v j , which w e write as EQ( v i , v j ). F or example, the formula ∃ v 3 NAND( v 1 , v 2 )EQ( v 1 , v 3 )EQ( v 2 , v 3 ) is a pp-form ula in v ariables v 1 and v 2 . This form ula corresp onds to the relation { (0 , 0) } since the only wa y to satisfy the constraints is to map b oth v 1 and v 2 to the domain elemen t 0. The r elational clone h Γ i R is the set of all relations expressible as pp-form ulas ov er Γ . Relational clones hav e play ed a k ey role in the developmen t of the complexity of CSPs b ecause of the following imp ortant fact, which is describ ed, for example, in the exp ository c hapter of Cohen and Jeav ons [14]: If tw o sets of relations Γ and Γ 0 generate the same relational clone, then the computational complexities of the corresp onding CSPs, CSP ( Γ ) and CSP ( Γ 0 ), are exactly the same. Th us, in order to understand the complexity of CSPs, one does not to consider all sets of relations Γ . It suffices to consider those that are relational clones. Recen tly , there has b een considerable interest in the computational complexit y of count- ing CSPs (see, for example [7, 10, 13, 19, 20, 35]). Here, the goal is to coun t the num b er of solutions of a CSP rather than merely to decide if a solution exists. In fact, in order to encompass the computation of partition functions of models from statistical physics and other generating functions, it is common (see, for example, [9]) to consider weigh ted sums, whic h can b e expressed b y replacing the relations in the constrain t language b y real-v alued or complex-v alued functions. In this case, the w eight of an assignmen t (of domain v alues to the v ariables) is the product of the function v alues corresp onding to that assignmen t, while the v alue of the CSP instance itself is the sum of the weigh ts of all assignmen ts. If Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 3 I is an instance of such a coun ting CSP then this w eighted sum is called the “partition function of I ” (by analogy with the concept in statistical physics) and is denoted Z ( I ). F or a finite set of functions Γ we are interested in the problem # CSP ( Γ ), which is the problem of computing Z ( I ), giv en an instance I whic h uses only functions from Γ . Our first goal (see § 2) is to determine the most useful analogues of pp-definabilit y and relational clones in the context of (weigh ted) counting CSPs (#CSPs), and to see what insigh t this provides in to the computational complexit y of these problems. It is clear that, in order to adapt the concept of pp-definabilit y to the coun ting setting, one should replace a conjunction of relations b y a pro duct of functions and replace existen tial quantification b y summation. Ho w ever, there are sensible alternatives for the detailed definitions, and these ha ve ramifications for the complexit y-theoretic consequences. There is at least one prop osal in the literature for extending pp-definability to the algebraic/functiona l setting — that of Y amak ami [35]. Ho wev er, we find it useful to adopt a more lib eral notion of pp-definabilit y , including a limit op eration. Without this, a functional clone could con tain arbitrarily close approximations to a function F of interest, without including F itself. W e call this analogue of pp-definabilit y “pps ω -definabilit y”. The notion of pps ω -definabilit y leads to a more inclusiv e functional clone than the one considered in [35]. Aside from a desire for tidiness, there is a go o d empirical motiv ation for in tro ducing limits. Just as pp-definability is closely related to p olynomial-time reductions b etw een clas- sical CSPs, so is pps ω -definabilit y related to approximation-preserving reductions b et w een (w eigh ted) counting CSPs. Lemma 17 is a precise statemen t of this connection. Many appro ximation-preserving reductions in the literature (for example, those in [21]) are based not on a fixed “gadget” but on sequences of increasingly-large gadgets that come arbitrar- ily close to some prop ert y without actually attaining it. Our notion of pps ω -definabilit y is in tended to capture this phenomenon. The second, more concrete goal of this pap er (see § 3– § 9) is to explore the space of functional clones and to use what we learn ab out this space to classify the complexity of appro ximating #CSPs. W e restrict atten tion to the Bo olean situation so the domain is { 0 , 1 } and the allow ed functions are of the form { 0 , 1 } k → R ≥ 0 for some integer k . W e examine the landscap e of functional clones for the case in whic h all nonnegativ e unary functions (w eights) are av ailable. This case is kno wn as the c onservative case. It is also studied in the con text of decision and optimisation CSPs [6, 28] and in work related to counting CSPs suc h as Cai, Lu and Xia’s w ork on classifying “Holant ∗ ” problems [11]. The conserv ativ e case is easier to to classify than the general case, so w e are able to construct a useful map of the landscap e of functional clones (see Theorem 16). Note that Y amak ami [35] has considered an ev en more sp ecial case in which all unary weigh ts (including negativ e w eights) are av ailable. In that case the landscap e turns out to b e less ric h and more p essimistic — negativ e w eigh ts in tro duce cancellation, whic h tends to driv e approximate counting CSPs in the direction of in tractabilit y . An issue that turns out to b e imp ortan t in the classification of conserv ative functional clones is lo g-sup ermo dularity . Roughly , a function with Bo olean domain is said to b e log- sup ermodular if its logarithm is sup ermo dular. (A formal definition app ears later.) It is a non-trivial fact (Lemma 7) that the set LSM of log-sup ermo dular functions is a functional clone (using our notion of pps ω -definabilit y). Conserv ativ e functional clones are classified as follo ws. A particularly simple functional The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 4 clone is the clone generated b y the disequality relation. A coun ting CSP derived from this clone is trivial to solve exactly , as the partition function factorises. W e sa y that functions from this clone are of “pro duct form”. Our main result (Theorem 16) is that any clone that con tains a function F that is not of pro duct form necessarily contains the binary relation IMP = { (0 , 0) , (0 , 1) , (1 , 1) } . This has imp ortant complexity-theoretic consequences, whic h will b e discussed presen tly . F urthermore, (also Theorem 16), an y non-trivial clone that con tains a function F that is not log-supermo dular actually con tains all functions. Therefore a large part of the functional clone landscap e is very simple. In particular, w e ha ve a complete understanding of the clones b elo w the clone generated by IMP and of the clones ab o ve LSM . The complexity of the landscap e of functional clones is th us sandwiched b et w een the clone generated by IMP and the clone LSM . In order to deriv e complexity-theoretic consequences (see Theorem 18), w e also present an efficien t v ersion of pps ω -definabilit y , and a corresp onding notion of functional clone. The complexit y-theoretic consequences are the third con tribution of the pap er. In order to de- scrib e these, we need a quick digression into the complexit y of approximate coun ting. The complexit y class #RHΠ 1 of counting problems was in tro duced by Dy er, Goldb erg, Greenhill and Jerrum [20] as a means to classify a wide class of approximate coun ting problems that w ere previously of indeterminate computational complexit y . The problems in #RHΠ 1 are those that can b e expressed in terms of counting the n umber of mo dels of a logical form ula from a certain syntactically restricted class. The complexit y class #RHΠ 1 has a complete- ness class (with resp ect to appro ximation-preserving “AP-reductions”) whic h includes a wide and ev er-increasing range of natural counting problems, including: indep enden t sets in a bi- partite graph, do wnsets in a partial order, configurations in the Widom-Rowlinson mo del (all [20]) and stable matchings [12]. Either all of these problems admit a F ully Polynomial Randomised Appro ximation Sc heme (FPRAS), or none do. The latter is conjectured. A t ypical complete problem in this class is # BIS , the problem of coun ting indep endent sets in a bipartite graph. Our complexity-theoretic results are presented in § 10. As noted ab ov e, # CSP ( F ) is computationally easy if ev ery function in F is of pro duct form. W e show that, in ev ery other (conserv ativ e) case, it is as difficult to approximate as # BIS . If, in addition, F contains a function F which is not log-sup ermodular, then the counting problem # CSP ( F ) turns out to b e universal for Bo olean coun ting CSPs and hence is prov ably NP -hard to appro ximate. As immediate corollaries, we reco ver existing results concerning the complexit y of computing the partition function of the Ising mo del [21]. Giv en the ab ov e discussion, one might sp eculate that the IMP-clone and LSM are the same. In fact, they are not. In § 11, w e examine the classes h LSM k i generated by lsm functions of arit y at most k . W e show that h LSM 3 i is equal to the IMP-clone, but w e give a pro of that h LSM 3 i is strictly contained in h LSM 4 i . This mirrors the situation for V CSPs, where binary submo dular functions can express all ternary submo dular functions but not all arit y 4 submo dular functions [36]. Ho wev er, w e do not know whether there is a fixed k suc h that LSM = h LSM k i . W e conjecture that this is not the case. If LSM = h LSM k i for some k , there w ould still remain the question of whether LSM is finitely generated, i.e., whether it is the functional clone generated b y some finite set of functions F . W e conjecture the opp osite, that there is no such F . Finally , in § 12 and § 13, we step outside the conserv ative case, and study functional Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 5 clones in whic h only restricted classes of unary functions are av ailable. As migh t b e ex- p ected, this yields a ric her structure of functional clones, including one that corresp onds to the ferromagnetic Ising model with a consistent field, a problem that is tractable in the FPRAS sense [25]. W e also exhibit in this setting t wo clones that are pro v ably incompa- rable with resp ect to inclusion, ev en though their corresp onding coun ting CSPs are related b y approximation-preserving reducibilit y . These coun ting CSPs hav e natural interpretations as (a) ev aluating the w eigh t enum erator of a binary co de, and (b) coun ting indep enden t sets in a bipartite graph. This example sho ws that, in demonstrating in tractability , it ma y sometimes b e necessary to use reductions that go b ey ond pps ω -definabilit y . Although we fo cus on appro ximation of the partition functions of (weigh ted) #CSPs in this pap er, there is, of course, an extensiv e literature on exact ev aluation. See, for example, the recent survey of Chen [13]. 2 F unctional clones As usual, w e denote the natural n um b ers b y N , the real num b ers b y R and the complex n um b ers b y C . F or n ∈ N , w e denote the set { 1 , 2 , . . . , n } by [ n ]. Let ( C , + , × ) b e any subsemiring of ( C , + , × ), and let D be a finite domain. F or n ∈ N , denote by U n the set of all functions D n → C ; also denote by U = U 0 ∪ U 1 ∪ U 2 ∪ · · · the set of functions of all arities. Note that we do not sp ecify the domain, whic h w e take to b e understoo d from the context, in this notation. Supp ose F ⊆ U is some collection of functions, V = { v 1 , . . . , v n } is a set of v ariables and x : { v 1 , . . . , v n } → D is an assignmen t to those v ariables. An atomic formula has the form ϕ = G ( v i 1 , . . . , v i a ) where G ∈ F , a = a ( G ) is the arit y of G , and ( v i 1 , v i 2 , . . . , v i a ) ∈ V a is a scope. Note that repeated v ariables are allo w ed. The function F ϕ : D n → C represented b y the atomic form ula ϕ = G ( v i 1 , . . . , v i a ) is just F ϕ ( x ) = G ( x ( v i 1 ) , . . . , x ( v i a )) = G ( x i 1 , . . . , x i a ) , where from now on we write x j = x ( v j ). A pps-form ula (“primitiv e pro duct summation form ula”) is a summation 1 of a pro duct of atomic form ulas. A pps-formula ψ in v ariables V ⊆ V 0 = { v 1 , . . . , v n + m } ov er F has the form (1) ψ = X v n +1 ,...,v n + m s Y j =1 ϕ j , where ϕ j are all atomic formulas o v er F in the v ariables V 0 . (The v ariables V are free, and the others, V 0 \ V , are b ound.) The formula ψ sp ecifies a function F ψ : D n → C in the follo wing w a y: (2) F ψ ( x ) = X y ∈ D m s Y j =1 F ϕ j ( x , y ) , 1 T o av oid am biguit y , w e will try to use “summation” of functions only with the meaning giv en here. Sums of different functions will b e referred to as “addition”. The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 6 where x and y are assignmen ts V → D , V 0 \ V → D . The functional clone hF i generated b y F is the set of all functions in U that can b e represented b y a pps-form ula ov er F ∪ { EQ } where EQ is the binary equality function defined b y EQ( x, x ) = 1 and EQ( x, y ) = 0 for x 6 = y . W e refer to the pps-formula as an implementation of the function. Since pps-form ulas are defined using sums of products (with just one lev el of each), w e need to c hec k that functions that are pps-definable in terms of functions that are themselv es pps-definable ov er F are actually directly pps-definable o ver F . The follo wing lemma ensures that this is the case. Lemma 1. If G ∈ hF i then hF , G i = hF i . Note that, to simplify notation, w e write hF , G i in place of the more correct hF ∪ { G }i . More generally , w e shall often drop set-brac k ets, replace the union symbol ∪ by a comma, and confuse a singleton set with the elemen t it contains. Pr o of of L emma 1. Let F 0 = F ∪ { EQ } . Supp ose that ψ is a pps-form ula ov er F 0 ∪ { G } giv en b y (3) ψ = X v n +1 ,...,v n + m r Y i =1 ϕ i ! s Y j =1 ψ j ! , where { ϕ i } are atomic F 0 -form ulas and { ψ j } are atomic G -formulas in the v ariables V 0 . Then (4) F ψ ( x ) = X y ∈ D m r Y i =1 F ϕ i ( x , y ) ! s Y j =1 F ψ j ( x , y ) ! , where x and y are assignments x : { v 1 , . . . , v n } → D and y : { v n +1 , . . . , v n + m } → D . No w, since G is pps-definable o v er F 0 , and eac h ψ j is an atomic G -form ula in the v ariables V 0 , w e can write each ψ j as ψ j = X v ν j +1 ,...,v ν j + ` t Y k =1 ϕ j,k , where ` is the n um b er of b ound v ariables used in the definition of ψ j ( ` is indep enden t of j ), ν j = n + m + ( j − 1) ` is the n um b er of free v ariables plus the num b er of b ound v ariables that are “used up” by ψ 1 , . . . , ψ j − 1 , and eac h ϕ j,k is an atomic F 0 -form ula o v er the v ariables V 0 ∪ { v ν j +1 , . . . , v ν j + ` } . W e get F ψ ( x ) = X y ∈ D m r Y i =1 F ϕ i ( x , y ) ! s Y j =1 X z j ∈ D ` t Y k =1 F ϕ j,k ( x , y , z j ) ! = X y ∈ D m X z 1 ∈ D ` · · · X z s ∈ D ` r Y i =1 F ϕ i ( x , y ) ! s Y j =1 t Y k =1 F ϕ j,k ( x , y , z j ) ! , Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 7 where each z j is an assignment z j : { v ν j +1 , . . . , v ν j + ` } → D . So ϕ = X v n +1 ,...,v ν s + ` r Y i =1 ϕ i ! s Y j =1 t Y k =1 ϕ j,k ! is a pps-formula o v er F 0 for the function F ψ . T o extend the notion of definabilit y , w e allo w limits as follows. W e sa y that an a -ary function F ∈ U is pps ω -definable o ver F if there exists a finite subset S F of F , suc h that, for every ε > 0, there exists an a -ary function b F , pps-definable o ver S F , such that k b F − F k ∞ = max x ∈ D a | b F ( x ) − F ( x ) | < ε. Denote the set of functions that are pps ω -definable ov er F ∪ { EQ } by hF i ω ; we call this the pps ω -definable functional clone generated b y F . Observ e that functions in hF i ω are determined only b y finite subsets of F . Also, some functions taking v alues outside C ma y b e the limit of functions pps-definable ov er F . But they are not pps ω -definable, since the function v alues of the limit m ust b e in C . The domain C of the univ ersal class of functions U in op eration at an y time will b e clear from the context. The following lemma is an analogue of Lemma 1. Lemma 2. If G ∈ hF i ω then hF , G i ω = hF i ω . Pr o of. Let F 0 = F ∪ { EQ } . Suppose that H is an a -ary function in hF , G i ω . Let S H b e a finite subset of F 0 ∪ { G } such that the following is true: Given ε > 0, there exists an a -ary function b H , pps-definable ov er S H , suc h that k b H − H k ∞ < ε/ 2. Let ψ be a pps-formula o v er S H represen ting b H . F or any function b G with the same arity as G , denote by ψ [ G := b G ] the form ula obtained from ψ b y replacing all o ccurrences of G by b G . By con tinuit y of the op erators of pps-form ulas, w e know there exists δ > 0 such that, for ev ery function b G of the same arity as G , k b G − G k ∞ < δ implies k F ψ [ G := b G ] − F ψ k ∞ < ε/ 2 . This claim will be explicitly quantified in the pro of of Lemma 4, but w e don’t need so m uc h detail here. Of course, b H = F ψ so for eac h suc h b G w e ha ve k F ψ [ G := b G ] − b H k ∞ < ε/ 2. No w let S G b e the finite subset of F 0 used to sho w that G is pps ω -definable o v er F 0 . Let S = S G ∪ S H \ { G } ⊆ F 0 . Cho ose a function b G , pps-definable o v er S G , satisfying k b G − G k ∞ < δ . Notice that b G ∈ h S i and F ψ ∈ h S , G i so F ψ [ G := b G ] ∈ h S i (by Lemma 1), and k F ψ [ G := b G ] − H k ∞ ≤ k F ψ [ G := b G ] − b H k ∞ + k b H − H k ∞ < ε. Since ε > 0 is arbitrary , and S ⊆ F 0 is finite, we conclude that H ∈ hF i ω . That completes the setup for expressibility . In order to deduce complexity results, w e need an efficient version of hF i ω . W e sa y that a function F is efficiently pps ω -definable o v er F if there is a finite subset S F of F , and a TM M F,S F with the follo wing prop erty: on input The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 8 ε > 0, M F,S F computes a pps-formula ψ o v er S F suc h that F ψ has the same arit y as F and k F ψ − F k ∞ < ε . The running time of M F,S F is at most a p olynomial in log ε − 1 . Denote the set of functions in U that are efficiently pps ω -definable ov er F ∪ { EQ } b y hF i ω ,p ; w e call this the efficient pps ω -definable functional clone generated b y F , The following useful observ ation is immediate from the definition of hF i ω ,p . Observation 3 . Supp ose F ∈ hF i ω ,p (or F ∈ hF i ω ). Then there is a finite subset S F of F suc h that F ∈ h S F i ω ,p (resp. F ∈ h S F i ω ). The following lemma is an analogue of Lemma 2 . Lemma 4. If G ∈ hF i ω ,p then hF , G i ω ,p = hF i ω ,p . Pr o of. Let F 0 = F ∪ { EQ } . Supp ose H is an a -ary function in hF 0 , G i ω ,p . Our goal is to sp ecify a finite subset S of F 0 and to construct a TM M H,S with the follo wing prop erty: on input ε > 0, M H,S should compute an a -ary pps-form ula ϕ o v er S suc h that k F ϕ − H k ∞ < ε . The running time of M H,S should b e at most a p olynomial in log ε − 1 . Let S H b e the finite subset of F 0 ∪ { G } from the efficien t pps ω -definition of H o ver F 0 ∪ { G } . Given an input ε/ 2, the TM M H,S H computes an a -ary pps-formula ψ ov er S H suc h that k F ψ − H k ∞ < ε/ 2. W rite ψ as in Equation (3) so F ψ is written as in Equation (4). Supp ose that, for j ∈ [ s ] and y ∈ { 0 , 1 } m , δ j, y ( x ) is a function of x . Consider the expression Υ( x ) = X y ∈ D m r Y i =1 F ϕ i ( x , y ) ! s Y j =1 ( F ψ j ( x , y ) + δ j, y ( x )) ! − X y ∈ D m r Y i =1 F ϕ i ( x , y ) ! s Y j =1 F ψ j ( x , y ) ! , whic h can b e expanded as Υ( x ) = X y ∈ D m X ∅⊂ T ⊆ [ s ] C y ,T ( x ) Y j ∈ T δ j, y ( x ) , where C y ,T ( x ) = r Y i =1 F ϕ i ( x , y ) Y j ∈ [ s ] \ T F ψ j ( x , y ) . Let C = max x , y ,T | C y ,T ( x ) | and let δ = ε 2 − ( s +1) | D | − m C − 1 < 1. No w let S G b e the finite subset of F 0 used to show that G is efficien tly pps ω -definable o v er F 0 . Giv en the input δ , the TM M G,S G computes a pps-formula b ψ o ver S G represen ting a function F b ψ with the same arity as G such that k F b ψ − G k ∞ < δ . Since eac h ψ j is an atomic G -form ula in the v ariables V 0 , w e ma y appropriately name the v ariables of b ψ to obtain a pps-form ula b ψ j o v er S G suc h that k F b ψ j − F ψ j k ∞ < δ . F or y ∈ D m , let δ j, y ( x ) = F b ψ j ( x , y ) − F ψ j ( x , y ) and note that | δ j, y ( x ) | ≤ δ . Let S = S G ∪ S H \ { G } ⊆ F 0 . Let ψ 0 b e the formula o v er S formed from ψ b y substituting each Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 9 o ccurrence of ψ j with b ψ j . Let ϕ b e the pps-form ula o ver S for the function F ψ 0 whic h is constructed as in the pro of of Lemma 1. F rom the calculation ab o v e, k F ϕ − F ψ k ∞ = k F ψ 0 − F ψ k ∞ = max x | F ψ 0 ( x ) − F ψ ( x ) | = max x | Υ( x ) | ≤ 2 s | D | m C δ = ε/ 2 . Note that k F ϕ − H k ∞ ≤ k F ϕ − F ψ k ∞ + k F ψ − H k ∞ < ε. Th us, the formula ϕ is an appropriate output for our TM M H,S . Finally , let us c heck ho w long the computation takes. The running time of M H,S H is at most poly (log ε − 1 ). Since this mac hine outputs the formula ψ , we conclude that m and r and s are b ounded from ab ov e by p olynomials in log ε − 1 . Let ∆ b e the ceiling of the maxim um absolute v alue of any function in S H . Note that C ≤ ∆ r + s . The running time of M G,S G is at most p oly(log( δ − 1 )), whic h is at most a p olynomial in m + s + log ( C ) + log( ε − 1 ) whic h is at most a p olynomial in log ( ε − 1 ). Finally , the direct manipulation of the form ulas that we did (renaming v ariables from b ψ to obtain b ψ j and pro ducing the pps-formula ϕ from ψ and the b ψ j form ulas) tak es time at most p olynomial in the size of ψ and b ψ , whic h is at most a p olynomial in log( ε − 1 ). Lemma 4 ma y ha v e wider applications in the study of approximate counting problems. Often, appro ximation-preserving reductions b et ween coun ting problems are complicated to describ e and difficult to analyse, owing to the need to track error estimates. Lemma 4 suggests breaking the reduction in to smaller steps, and analysing each of them indep enden tly . This assumes, of course, that the reductions are pps ω -definable, but that often seems to b e the case in practice. 3 Relational clones and nonnegativ e functions A function F ∈ U is Bo ole an 2 if its range is a subset of { 0 , 1 } . Then F enco des a relation R as follows: x is in the relation R iff F ( x ) = 1. W e will not distinguish b et ween relations and the Bo olean functions that define them. Supp ose that R ⊆ U is a set of relations/Bo olean functions. A pp-formula ov er R is an existentially quantified pro duct of atomic form ulas (this is called an ∃ CNF( R )-form ula in [16]). More precisely , a pp-form ula ψ ov er R in v ariables V 0 = { v 1 , . . . , v n + m } has the form ψ = ∃ v n +1 , . . . , v n + m s ^ j =1 ϕ j , 2 Note that “Bo olean” applies to the co domain here, not the domain. As noted earlier, all of the functions that we consider ha ve Bo olean domains. This usage of “Bo olean function” is unfortunate, but is w ell established in the literature. When the range is not a subset of { 0 , 1 } we emphasise this fact by referring to the function as a “pseudo-Bo olean” function. The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 10 where ϕ j are all atomic formulas ov er R in the v ariables V 0 . As before, the v ariables V = { v 1 , . . . , v n } are called “free”, and the others, V 0 \ V , are called “b ound”. The formula ψ sp ecifies a Bo olean function R ψ : D n → { 0 , 1 } in the following wa y . R ψ ( x ) = 1 if there is a v ector y ∈ D m suc h that V s j =1 R ϕ j ( x , y ) ev aluates to “1”, where x and y are assignments x : { v 1 , . . . , v n } → D and y : { v n +1 , . . . , v n + m } → D ; R ψ ( x ) = 0 otherwise. W e call the pp-form ula an implementation of R ψ . A r elational clone (often called a “co-clone”) is a set of relations con taining the equality relation and closed under finite Cartesian pro ducts, pro jections, and identification of v ari- ables. A b asis [16] for the relational clone I is a set R of Bo olean relations such that the relations in I are exactly the relations that can b e implemented with a pp-form ula o ver R . Ev ery relational clone has suc h a basis. F or ev ery set R of Bo olean relations, let hRi R denote the set of relations that can be represen ted by a pp-formula ov er R ∪ { EQ } . It is w ell-kno wn that if R ∈ hRi R then hR ∪ { R }i R = hRi R (This can b e prov ed similarly to the pro of of Lemma 1.) Thus, hRi R is in fact a relational clone with basis R . A basis R for a relational clone hRi R is called a “plain basis” [16, Definition 1] if ev ery mem b er of hRi R is definable by a CNF( R )-formula (a pp-form ula o v er R with no ∃ ). Pseudo-Bo olean functions [5] are defined on the Bo olean domain D = { 0 , 1 } , and ha ve co domain C = R , the real num b ers. F or n ∈ N , denote by B n the set of all functions { 0 , 1 } n → R , and denote the set of functions of all arities by B = B 0 ∪ B 1 ∪ B 2 ∪ · · · . Note that any tuple x ∈ { 0 , 1 } n is the indicator function of a subset of [ n ]. W e write | x | for the cardinalit y of this set, i.e. | x | = P n j =1 x j . F or most of this pap er, we restrict atten tion to the co domain C = R ≥ 0 of nonnegativ e real num b ers. Then B n is the set giv en by replacing R b y R ≥ 0 in the definition of B n , and then B is defined analogously to B . W e will also need to consider the p ermissive functions in B . These are functions whic h are p ositive everywhere, so the co domain C = R > 0 , the p ositiv e real num b ers. Th us B > 0 n and B > 0 are giv en by replacing R b y R > 0 in the definitions of B n and B . The adv antage of working with the Bo olean domain is (i) it has a w ell-developed theory of relational clones, and (ii) the concept of a log-sup ermodular function exists (see § 4). As explained in the introduction, the adv antage of working with nonnegativ e real num b ers is that w e disallow cancellation, and p oten tially obtain a more nuanced expressibility/complexit y landscap e. Giv en a function F ∈ B , let R F b e the function corresp onding to the relation under- lying F . That is, R F ( x ) = 0 if F ( x ) = 0 and R F ( x ) = 1 if F ( x ) > 0. The follo wing straigh tforw ard lemma will b e useful. Lemma 5. Supp ose F ⊆ B . Then h{ R F | F ∈ F }i R = { R F | F ∈ hF i} . Pr o of. Let F b e a subset of B . First, we must sho w that, for any R ∈ h{ R F | F ∈ F }i R , R is in { R F | F ∈ hF i} . Let ψ b e the pp-form ula o ver { R F | F ∈ F } ∪ { EQ } that is used to represen t R . W rite Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 11 ψ as ψ = ∃ v n +1 , . . . , v n + m s ^ j =1 R F j ( v i ( j, 1) , . . . , v i ( j,a j ) ) , where F j is an arit y- a j function in F ∪ { EQ } , and the index function i ( · , · ) pic ks out an index in the range [1 , n + m ], and hence a v ariable from V 0 = { v 1 , . . . , v n + m } . Let ψ 0 b e the pps-form ula o v er F ∪ { EQ } given by ψ 0 = X v n +1 ,...,v n + m s Y j =1 F j ( v i ( j, 1) , . . . , v i ( j,a j ) ) . Let F 0 = F ψ 0 . Note that F 0 ∈ hF i and that R F 0 = R . By reversing this construction, we can sho w that, for any R ∈ { R F | F ∈ hF i} , R is in h{ R F | F ∈ F }i R . 4 Log-sup ermo dular functions A function F ∈ B n is lo g-sup ermo dular (lsm) if F ( x ∨ y ) F ( x ∧ y ) ≥ F ( x ) F ( y ) for all x , y ∈ { 0 , 1 } n . The terminology is justified by the observ ation that F ∈ B > 0 n is lsm if and only if f = log F is sup ermo dular . W e denote b y LSM ⊂ B the class of all lsm functions. The second part of our main result (Theorem 16) says that, in terms of expressivity , ev erything of interest tak es place within the class LSM . Consequen tly , in § 11, w e will inv estigate the in ternal structure of LSM . Note that B 0 , B 1 ⊂ LSM , since log-sup ermo dularit y is trivial for n ullary or unary func- tions, and hence the class LSM is conserv ative. And it fits naturally into our study of expressibilit y because of the follo wing closure prop erty: functions that are pps ω -definable from lsm functions are lsm. The non-trivial step in showing this is encapsulated in the follo wing lemma. It is a sp ecial case of the Ahlsw ede-Daykin “four functions” theorem [1]. Ho w ever [1] is a m uc h stronger result than is required, so w e give an easier pro of, using an argumen t similar to the base case of the induction in [1]. Lemma 6. If G ∈ B n + m , let G 0 ∈ B n b e define d by G 0 ( x ) = P z ∈{ 0 , 1 } m G ( x , z ) . Then G ∈ LSM implies G 0 ∈ LSM . Pr o of. By symmetry and induction, it suffices to consider summation on the last v ariable. Th us, let ( x , x n +1 ) , ( y , y n +1 ) ∈ { 0 , 1 } n +1 , and let α z = G ( x , z ) , β z = G ( y , z ) , γ z = G ( x ∨ y , z ) , δ z = G ( x ∧ y , z ) ( z ∈ { 0 , 1 } ) . Then we must sho w that G ∈ LSM implies ( α 0 + α 1 )( β 0 + β 1 ) ≤ ( γ 0 + γ 1 )( δ 0 + δ 1 ) , whic h expands to (5) α 0 β 0 + α 1 β 0 + α 0 β 1 + α 1 β 1 ≤ γ 0 δ 0 + γ 0 δ 1 + γ 1 δ 0 + γ 1 δ 1 . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 12 Since G ∈ LSM , we ha v e the following four inequalities, (6) α 0 β 0 ≤ γ 0 δ 0 , (7) α 0 β 1 ≤ γ 1 δ 0 , (8) α 1 β 0 ≤ γ 1 δ 0 , (9) α 1 β 1 ≤ γ 1 δ 1 . W e will complete the proof by showing that (6) to (9) imply (5) for arbitrary nonnegative real num b ers α z , β z , γ z , δ z ( z ∈ { 0 , 1 } ). Using (6) and (9), it follo ws that (5) is implied by (10) α 1 β 0 + α 0 β 1 ≤ γ 0 δ 1 + γ 1 δ 0 . Observ e that γ 1 δ 0 = 0 implies (10), since the left side is zero b y (7) and (8). Thus w e may assume γ 1 δ 0 > 0. No w, using (6) and (9) again, (10) is implied b y (11) α 1 β 0 + α 0 β 1 ≤ ( α 0 β 0 )( α 1 β 1 ) δ 0 γ 1 + γ 1 δ 0 = ( α 1 β 0 )( α 0 β 1 ) γ 1 δ 0 + γ 1 δ 0 . No w (11) can b e rewritten as 0 ≤ ( γ 1 δ 0 − α 1 β 0 )( γ 1 δ 0 − α 0 β 1 ) , whic h is implied by (7) and (8). Lemma 7. If F ⊆ LSM then hF i ω ⊆ LSM . Pr o of. W e just need to show that eac h level in the definition of pps ω -definable function preserv es lsm: first that every atomic form ula o ver F ∪ { EQ } defines an lsm function, then that a pro duct of lsm functions is lsm, then that a summation of an lsm function is lsm, and finally that a limit of lsm functions is lsm. As we shall see b elow, only the third step is non-trivial, and it is cov ered by Lemma 6. First, note that the EQ is lsm, so ev ery function in F ∪ { EQ } is lsm, An atomic formula ϕ = G ( v i 1 , . . . , v i a ) defines a function F ϕ ( x ) = G ( x i 1 , . . . , x i a ) which is lsm: F ϕ ( x ∨ y ) F ϕ ( x ∧ y ) = G ( x i 1 ∨ y i 1 , . . . , x i a ∨ y i a ) G ( x i 1 ∧ y i 1 , . . . , x i a ∧ y i a ) ≥ G ( x i 1 , . . . , x i a ) G ( y i 1 , . . . , y i a ) = F ϕ ( x ) F ϕ ( y ) . Note that we do not need to assume that i 1 , . . . , i a are all distinct. It is immediate that the pro duct of tw o lsm functions (and hence the pro duct of an y n um b er) is lsm. Th us the pro duct Q s j =1 F ϕ j app earing in (2) is lsm. Then, b y Lemma 6, the pps-definable function F ψ in (2) is lsm. Finally , we will sho w that any function that is appro ximated b y lsm functions is lsm. Supp ose that a function F ∈ B n has the prop ert y that, for ev ery ε > 0, there is an arity- n lsm function b F satisfying k b F − F k ∞ = max x ∈{ 0 , 1 } a | b F ( x ) − F ( x ) | < ε. W e wish to show that F is lsm. Let F max = max x F ( x ). Suppose for con tradiction that F is not lsm, so there is a δ > 0 and x , y ∈ { 0 , 1 } n suc h that F ( x ∨ y ) F ( x ∧ y ) ≤ F ( x ) F ( y ) − δ. Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 13 Let ε > 0 b e sufficiently small that ε max( F max , 1) is tin y compared to δ . Then b F ( x ∨ y ) b F ( x ∧ y ) ≤ ( F ( x ∨ y ) + ε )( F ( x ∧ y ) + ε ) ≤ F ( x ∨ y ) F ( x ∧ y ) + 2 εF max + ε 2 ≤ F ( x ) F ( y ) − δ + 2 εF max + ε 2 ≤ ( b F ( x ) + ε )( b F ( y ) + ε ) − δ + 2 εF max + ε 2 ≤ b F ( x ) b F ( y ) + 2 ε ( F max + ε ) − δ + 2 εF max + 2 ε 2 < b F ( x ) b F ( y ) , so b F is not lsm, giving a con tradiction. An imp ortant example of an lsm function is the 0,1-function “implies”, IMP( x, y ) = ( 0 , if ( x, y ) = (1 , 0); 1 , otherwise . W e also think of this as a binary relation IMP = { (0 , 0) , (0 , 1) , (1 , 1) } . Complexit y-theoretic issues will b e treated in detail in § 10. How ev er, it ma y be helpful to giv e a p oin ter here to the imp ortance of IMP in the study of approximate coun ting problems. The problem # BIS is that of counting indep enden t sets in a bipartite graph. Dy er et al. [18] exhibited a class of counting problems, including # BIS , whic h are interreducible via appro ximation-preserving reductions. F urther natural problems ha ve b een sho wn to lie in this class, pro viding comp elling evidence that is of intermediate complexity b et w een counting problems that are tractable (admit a p olynomial-time approximation algorithm) and those that are NP -hard to appro ximate. W e will see in due course (Theorem 18 and Proposition 36) that # BIS and # CSP (IMP) are interreducible via approximation-preserving reductions, and hence are of equiv alen t difficult y . W e kno w from Lemma 7 that h IMP , B 1 i ω ⊆ LSM , and one might ask whether this inclu- sion is strict. W e will address this question in § 11. 5 Pinnings and mo dular functions Let δ 0 b e the unary function with δ 0 (0) = 1 and δ 0 (1) = 0 and let δ 1 b e the unary function with δ 1 (0) = 0 and δ 1 (1) = 1. Let S ⊆ [ n ], let x 0 = ( x j ) j / ∈ S , and x 00 = ( x j ) j ∈ S , and partition x ∈ { 0 , 1 } n as ( x 0 ; x 00 ). Then, if F ∈ B n , the function F ( x 0 ; c ) given b y setting x 00 j = c j for constants c j ∈ { 0 , 1 } ( j ∈ S ) is a pinning of F . Note that we allow the empt y pinning S = ∅ , which is F itself, and the pinning of all v ariables S = [ n ], which is a nullary function. Clearly , ev ery pinning of F is in h F, δ 0 , δ 1 i , since a constant c ∈ { 0 , 1 } can be implemen ted using either δ 0 or δ 1 , i.e. w e add δ c ( x i ) to the constraint set. W e will use the notation i ← c to indicate that the i th v ariable has b een pinned to c . If n ≥ 2 then a 2-pinning of a function F ∈ B n is a function F ( x i , x j ; c ) whic h pins al l but 2 of the v ariables. Thus [ n ] \ S = { i, j } , where i and j are distinct indices in [ n ], and c ∈ { 0 , 1 } n − 2 . Clearly , every 2-pinning of F is in h F , B p 1 i , since it is a pinning of F . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 14 W e sa y that a function F ∈ B n is log-mo dular if F ( x ∨ y ) F ( x ∧ y ) = F ( x ) F ( y ) for all x , y ∈ { 0 , 1 } n . It is a fact that LSM and the class of log-modular functions are closed under pinning. This is a consequence of the following lemma ab out 2-pinnings of lsm and log-mo dular functions. It is due, in essence, to T opkis [31], but w e provide a short pro of for completeness. Lemma 8 (T opkis) . A function F ∈ B > 0 is lsm iff every 2 -pinning is lsm, and is lo g-mo dular iff every 2 -pinning is lo g-mo dular. Pr o of. The necessit y of the 2-pinning condition is obvious, but we must pro v e sufficiency . W e need only sho w F ( x ) F ( y ) ≤ F ( x ∨ y ) F ( x ∧ y ) for x , y such that x i 6 = y i ( i ∈ [ n ]). All other cases follow from this. Note that log-supermo dularity is preserved under arbitrary p erm utation of v ariables. Thus, if 0 r , 1 r denote r -tuples of 0’s and 1’s resp ective ly , w e m ust sho w that, for all r , s > 0 with r + s = n , (12) F (0 r , 1 s ) F (1 r , 0 s ) ≤ F (1 r , 1 s ) F (0 r , 0 s ) . W e will prov e this b y induction, assuming it is true for all r 0 , s 0 > 0 suc h that r 0 + s 0 < n . The base case, r 0 = s 0 = 1, is the 2-pinning assumption. If r > 1, then w e hav e F (0 r , 1 s ) F (1 r − 1 , 0 s +1 ) ≤ F (1 r − 1 , 0 , 1 s ) F (0 r , 0 s ) , (13) b y induction, after pinning the r th p osition to 0, F (1 r − 1 , 0 , 1 s ) F (1 r , 0 s ) ≤ F (1 r , 1 s ) F (1 r − 1 , 0 s +1 ) (14) b y induction, after pinning the first r − 1 > 0 p ositions to 1. No w, m ultiplying (13) and (14) gives (12) after cancellation, whic h is v alid since F is p ermissiv e. If r = 1, we do not hav e the induction giving (14), so w e use instead F (1 , 0 s ) F (0 , 1 , 0 s − 1 ) ≤ F (0 , 1 s ) F (1 , 1 , 0 s − 1 ) , (15) b y induction, using the base case after pinning the last s − 1 p ositions to 0, F (1 , 1 , 0 s − 1 ) F (0 , 1 s ) ≤ F (1 , 1 s ) F (0 , 1 , 0 s − 1 ) . (16) b y induction, after pinning the second p osition to 1. No w, m ultiplying (15) and (16) gives (12) after cancellation, completing the pro of for log-sup ermodularity . The pro of for log-mo dularit y is identical, except that every “ ≤ ” must b e replaced b y “=”. R emark 9 . W e ha v e pro ved Lemma 8 only for p ermissiv e functions b ecause, in fact, it is false more generally . Consider, for example, the function F ∈ B 4 suc h that F (1 , 1 , 0 , 0) = F (0 , 0 , 1 , 1) = 1, F ( x ) = 0 otherwise. It is easy to see that all the 2-pinnings F 0 of F ha v e F 0 ( x, y ) > 0 for at most one ( x, y ) ∈ { 0 , 1 } 2 . It follows that ev ery 2-pinning of F is log-mo dular. But F is not even lsm, since F (1 , 1 , 0 , 0) F (0 , 0 , 1 , 1) > F (1 , 1 , 1 , 1) F (0 , 0 , 0 , 0). Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 15 6 Computable real n um b ers Since we wan t to b e able to derive computational results, w e will now fo cus atten tion on functions whose co-domain is restricted to efficiently-computable real num b ers. W e will sa y that a real n umber is p olynomial-time computable if the n most significant bits of its binary expansion can b e computed in time polynomial in n . This is essentially the definition giv en in [27]. Let R p denote the set of nonne gative real num b ers that are p olynomial-time computable. F or n ∈ N , denote by B p n the set of all functions { 0 , 1 } n → R p ; also denote b y B p = B p 0 ∪ B p 1 ∪ B p 2 ∪ · · · the set of functions of all arities. R emark 10 . As w e hav e defined them, it is kno wn that the p olynomial-time computable n um b ers form a field [27], and hence a subsemiring C of C , as w e require. Th us, in our definitions, there is no difficult y with pps-definability . Ho wev er, there could b e a problem with pps ω -definabilit y , since the limit of a sequence of p olynomial-time computable reals ma y not b e p olynomial-time computable. P olynomial-time computability is ensured only by placing restrictions on sp eed of con vergence. See [27, 32] for details. How ever, observe that our definition of efficien t pps ω -definabilit y a voids this difficult y entirely , b y insisting that the limit of a sequence of reals will b e p ermitted only if the limit is itself p olynomial-time computable. R emark 11 . The p olynomial-time computable real n umbers are a prop er sub class of the efficiently appr oximable real n um b ers, defined in [22]. (This fact can b e deduced from [27].) W e ha ve made this restriction since it results in a more uniform treatment of limits when w e discuss efficient pps ω -definabilit y for functions in B p . 7 Binary functions W e b egin the study of the conserv ative case in the simplest non trivial situation. W e consider the functional clones h F , B p 1 i ω ,p , where F is a single binary function. Recall that EQ is the binary relation EQ = { (0 , 0) , (1 , 1) } . (W e used the name “EQ” to denote the equiv alen t binary function, but it will do no harm to use the same symbol for the relation and the function.) Denote b y OR, NEQ, and NAND the binary relations OR = { (0 , 1) , (1 , 0) , (1 , 1) } , NEQ = { (0 , 1) , (1 , 0) } , and NAND = { (0 , 0) , (0 , 1) , (1 , 0) } . When we write a function F ∈ B 2 , w e will identify the arguments b y writing F ( x 1 , x 2 ). W e may represen t F b y a 2 × 2 matrix M ( F ) =  F (0 , 0) F (0 , 1) F (1 , 0) F (1 , 1)  =  f 00 f 01 f 10 f 11  , sa y , with ro ws indexed b y x 1 ∈ { 0 , 1 } and columns by x 2 ∈ { 0 , 1 } . W e will assume f 01 ≥ f 10 , since otherwise w e ma y consider the function F T , suc h that F T ( x 1 , x 2 ) = F ( x 2 , x 1 ), represen ted b y the matrix M ( F ) T . Clearly h F T i = h F i . If U is a unary function, we will write U = ( U (0) , U (1)) = ( u 0 , u 1 ), say . Then w e ha v e M  U ( x 1 ) F ( x 1 , x 2 )  =  u 0 f 00 u 0 f 01 u 1 f 10 u 1 f 11  , M  U ( x 2 ) F ( x 1 , x 2 )  =  u 0 f 00 u 1 f 01 u 0 f 10 u 1 f 11  , The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 16 where b oth U ( x 1 ) F ( x 1 , x 2 ) and U ( x 2 ) F ( x 1 , x 2 ) are clearly in h F , U i . If F 1 , F 2 ∈ B 2 , then M ( F 1 ) M ( F 2 ) = M ( F ), where F ∈ h F 1 , F 2 i is such that F ( x 1 , x 2 ) = 1 X y =0 F 1 ( x 1 , y ) F 2 ( y , x 2 ) . Lemma 12. L et F ∈ B p 2 . Assuming f 01 ≥ f 10 , (i) if f 00 f 11 = f 01 f 10 , then h F , B p 1 i ω ,p = hB p 1 i ω ,p ; (ii) if f 01 , f 10 = 0 and f 00 , f 11 > 0 , then h F , B p 1 i ω ,p = hB p 1 i ω ,p ; (iii) if f 00 , f 11 = 0 and f 01 , f 10 > 0 , then h F , B p 1 i ω ,p = h NEQ , B p 1 i ω ,p ; (iv) if f 00 , f 01 , f 11 > 0 and f 00 f 11 > f 01 f 10 , then h F , B p 1 i ω ,p = h IMP , B p 1 i ω ,p ; (v) otherwise, h F , B p 1 i ω ,p = h OR , B p 1 i ω ,p . The non-efficient version — with B 1 , B 2 r eplacing B p 1 , B p 2 , and h·i ω r eplacing h·i ω ,p — also holds. Pr o of. T o pro v e h F 1 , B p 1 i ω ,p = h F 2 , B p 1 i ω ,p , it suffices to sho w that F 2 ∈ h F 1 , B p 1 i ω ,p and F 1 ∈ h F 2 , B p 1 i ω ,p . W e will v erify this in each of the five cases. (i) Supp ose f 00 f 11 = f 01 f 10 . If f 00 , f 01 = 0, then F ( x 1 , x 2 ) = U 1 ( x 1 ) U 2 ( x 2 ) with U 1 = (0 , 1) and U 2 = ( f 10 , f 11 ). Similarly if f 00 , f 10 = 0, f 01 , f 11 = 0, or f 10 , f 11 = 0. In the remaining case f 00 , f 01 , f 10 , f 11 > 0. Then c ho ose U 1 = (1 , f 10 /f 00 ), U 2 = ( f 00 , f 01 ). In all cases F ∈ h U 1 , U 2 i , so h F , B p 1 i ω ,p = hB p 1 i ω ,p . (ii) if f 01 , f 10 = 0 and f 00 , f 11 > 0, then F ( x 1 , x 2 ) = U ( x 1 )EQ( x 1 , x 2 ), where U = ( f 00 , f 11 ), so F ∈ h U i . Hence h F , B p 1 i ω ,p = hB p 1 i ω ,p . (iii) If f 00 , f 11 = 0 and f 01 , f 10 > 0, then F ( x 1 , x 2 ) = U ( x 1 )NEQ( x 1 , x 2 ), where U = ( f 01 , f 10 ), so F ∈ h NEQ , U i . Similarly NEQ( x 1 , x 2 ) = U 0 ( x 1 ) F ( x 1 , x 2 ), where U 0 = (1 /f 01 , 1 /f 10 ), so NEQ ∈ h F , U 0 i . So h F , B p 1 i ω ,p = h NEQ , B p 1 i ω ,p . (iv) If f 00 , f 01 , f 11 > 0, f 00 f 11 > f 01 f 10 , w e can apply unary w eights U 1 , U 2 , where U 1 = (1 /f 00 , f 01 /f 00 f 11 ), U 2 = (1 , f 00 /f 01 ), to implemen t IMP α ( x 1 , x 2 ) = U 1 ( x 1 ) U 2 ( x 2 ) F ( x 1 , x 2 ), where M (IMP α ) =  1 1 α 1  , where α = f 01 f 10 /f 00 f 11 < 1. Then w e hav e IMP α ∈ h F, U 1 , U 2 i . Note that IMP 0 = IMP. If α > 0, consider the function IMP k α , with matrix M (IMP k α ) =  1 1 α k 1  . No w IMP k α can b e implemen ted as IMP k α ( x 1 , x 2 ) = U k 1 ( x 1 ) U k 2 ( x 2 ) F k ( x 1 , x 2 ), by taking k copies of U 1 , U 2 and F . Since α < 1, we see that lim k →∞ IMP k α = IMP 0 = IMP. Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 17 Moreo v er, the limit is efficient, since k IMP − IMP k α k < ε if k = O (log ε − 1 ), and so an ε -appro ximation to IMP can b e computed in O (log ε − 1 ) time. Hence IMP ∈ h F , B p 1 i ω ,p . Note that “pow ering” limits lik e that used here will be employ ed b elo w without further discussion of their efficiency . Con v ersely , from IMP, we first implement IMP α . If α = 0, we do nothing. Otherwise, w e use unary weigh ts U 1 , U 2 suc h that U 1 = (1 /α − 1 , 1), U 2 = ( α, 1), to implement F 1 ( x 1 , x 2 ) = U 1 ( x 1 ) U 2 ( x 2 )IMP( x 2 , x 1 ), where M ( F 1 ) =  1 − α 0 α 1  . Then M (IMP α ) = M (IMP) M ( F 1 ), so IMP α ∈ h IMP , U 1 , U 2 i . Now w e can reco v er F ( x 1 , x 2 ) = U 3 ( x 1 ) U 4 ( x 2 )IMP α ( x 1 , x 2 ), where U 3 = ( f 00 , f 00 f 11 /f 01 ), U 4 = (1 , f 01 /f 00 ), so we hav e F ∈ h IMP , U 1 , U 2 , U 3 , U 4 i . Hence h F , B p 1 i ω ,p = h IMP , B p 1 i ω ,p . (v) The remaining cases are (a) f 01 , f 10 , f 11 > 0, f 00 f 11 < f 01 f 10 and (b) f 00 , f 01 , f 10 > 0, f 11 = 0. First, we deal with part (a): If f 01 , f 10 , f 11 > 0 and f 00 f 11 < f 01 f 10 , we apply unary w eigh ts U 1 , U 2 , where U 1 = ( f 11 /f 01 , 1), U 2 = (1 /f 10 , 1 /f 11 ), to implement OR α ( x 1 , x 2 ) = U 1 ( x 1 ) U 2 ( x 2 ) F ( x 1 , x 2 ), where α = f 00 f 11 /f 01 f 10 < 1, and M (OR α ) =  α 1 1 1  If α = 0, OR 0 = OR, so we hav e OR ∈ h F , B p 1 i . Otherwise lim k →∞ OR k α = OR 0 = OR, so we hav e OR ∈ h F , B p 1 i ω ,p . Con v ersely , from OR, w e first express NEQ. Use the unary function U = (2 , 1 / 2 ) to implemen t F 1 = U ( x 1 ) U ( x 2 )OR( x 1 , x 2 ), where M ( F 1 ) =  0 1 1 1 / 4  . Then lim k →∞ F k 1 = NEQ, so NEQ ∈ h OR , B p 1 i ω ,p . No w w e observe that M (IMP) = M (NEQ) M (OR), so IMP ∈ h OR , B p 1 i ω ,p . Now w e ha v e IMP α ∈ h OR , B p 1 i ω ,p , as in (iv) ab o v e. Then M (OR α ) = M (NEQ) M (IMP α ), so OR α ∈ h OR , B p 1 i ω ,p . No w w e can rev erse the transformation from F to OR α to recov er F . No w, w e consider part (b): If f 00 , f 01 , f 10 > 0 and f 11 = 0, w e apply unary w eights U 1 , U 2 , where U 1 = (1 /f 00 , 1 /f 10 ), U 2 = (1 , f 00 /f 01 ), to implemen t NAND( x 1 , x 2 ) = U 1 ( x 1 ) U 2 ( x 2 ) F ( x 1 , x 2 ), where M (NAND) =  1 1 1 0  , so w e ha v e NAND ∈ h F , B p 1 i . W e now use unary w eigh t U = ( 1 / 2 , 2) to implemen t F 1 ( x 1 ) = U ( x 1 ) U ( x 1 )NAND( x 1 , x 2 ) with M ( F 1 ) =  1 / 4 1 1 0  . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 18 Then w e hav e lim k →∞ F k 1 = NEQ, so again NEQ ∈ h F , B p 1 i ω ,p . Then we observ e that M (OR) = M (NEQ) M (NAND) M (NEQ), so OR ∈ h F , B p 1 i ω ,p . Con v ersely , from OR, w e hav e NEQ ∈ h OR , B p 1 i ω ,p from the ab o v e. Then w e ha v e M (NAND) = M (NEQ) M (OR) M (NEQ), so NAND ∈ h OR , B p 1 i ω ,p . No w w e rev erse the transformation ab o ve from F to NAND to reco ver F . Th us F ∈ h OR , B p 1 i ω ,p . R emark 13 . F rom Lemma 12, w e see that IMP do es not really o ccupy a sp ecial p osition in h IMP , B p 1 i ω ,p , in the sense that there are other functions F with h F , B p 1 i ω ,p = h IMP , B p 1 i ω ,p . Similarly , OR do es not o ccup y a sp ecial p osition in h OR , B p 1 i ω ,p . Nev ertheless, it is useful to lab el the classes this wa y , and w e will do so. R emark 14 . F rom the proof of Lemma 12, we ha ve the follo wing inclusions b et w een the four classes inv olv ed. hB p 1 i ω ,p ⊆ h NEQ , B p 1 i ω ,p h IMP , B p 1 i ω ,p ⊆ h OR , B p 1 i ω ,p . In fact, h NEQ , B p 1 i ω ,p and h IMP , B p 1 i ω ,p are incomparable, and hence all the inclusions are actually strict. F or one non-inclusion, note the clone h IMP , B p 1 i ω ,p con tains only lsm func- tions, and hence do es not contain NEQ. F or the other, we claim that any binary function in the clone h NEQ , B p 1 i ω ,p has one of three forms, U 1 ( x ) U 2 ( y ), U ( x )EQ( x, y ) or U ( x )NEQ( x, y ), and then observe that IMP matches none of these. The claim is a special case of a more general one, namely that any function in h NEQ , B p 1 i ω ,p is of the form F ϕ , where ϕ is a product of atomic formulas inv olving only unary functions and NEQ. T o sho w this, w e need only consider summing o v er a single v ariable. By induction, assume we ha ve a pps-formula of the form P y ∈{ 0 , 1 } F ϕ ( x , z ) F ψ ( x , y ), where F ψ is a pro duct of atomic formulas in volving y (and certain other v ariables x ), and F ϕ is a pro duct not inv olving y . Then X y ∈{ 0 , 1 } F ϕ ( x , z ) F ψ ( x , y ) = F ϕ ( x , z ) X y ∈{ 0 , 1 } U ( y ) k Y i =1 NEQ( x i , y ) = F ϕ ( x , z ) ¯ U ( x 1 ) k Y i =1 EQ( x i , x 1 ) , where ¯ U ( x 1 ) = U (1 − x 1 ). The product of equalities can b e remo ved by substituting x j ( j = 2 , . . . , k ) by x 1 in ϕ ( x , z ), contin uing the induction. Finally , it is straigh tforw ard to show that this class is closed under limits. That is, the limit of a sequence of functions whic h are pro ducts of unary and NEQ functions must itself b e of this form. T o see this, note that ev ery k -ary function in this class can b e written as a pro duct of O ( k 2 ) unary and NEQ functions. Then the conclusion follows b y a standard compactness argument. The efficient v ersion also follows. 8 The class h OR , B p 1 i ω ,p In the conserv ative case, we sho w that, somewhat surprisingly , the clone generated b y the single binary function OR contains every function in B p . Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 19 Lemma 15. h OR , B p 1 i ω ,p = B p . Pr o of. Supp ose F ∈ B p n . Supp ose x 1 , . . . , x n are v ariables. F or each A ⊆ [ n ], let 1 A b e the assignmen t to x 1 , . . . , x n in which x i = 1 if i ∈ A and x i = 0 otherwise. Then we will use the notation F ( A ) as shorthand for F ( 1 A ). Let A = { A : F ( A ) > 0 } , and let µ = min A ∈A F ( A ). F or an y A ⊆ [ n ], let u A ∈ B p 1 b e the function such that u A (0) = 1 and u A (1) = 2 F ( A ) /µ − 1 ≥ 1. Note that every function u A is in B p 1 and w e ha ve IMP , NAND ∈ h OR , B p 1 i ω ,p , from the pro of of Lemma 12. Our goal will b e to show that there is a finite subset S F of { IMP , NAND } ∪ B p 1 and a TM M F,S F with the follo wing property: on input ε > 0, M F,S F computes an arit y- n pps- form ula ψ ov er S F suc h that k F ψ − F k ∞ < ε . The running time of M F,S F should be at most a p olynomial in log ε − 1 . T o define S F , w e will use t wo unary functions U 1 and U 2 (b oth of which are actually constant functions). W e define these by U 1 (0) = U 1 (1) = 1 / 2 and U 2 (0) = U 2 (1) = µ/ 2. Then S F = { IMP , NAND , U 1 , U 2 } ∪ S A ∈A { u A } . Let V = { v 1 , . . . , v n } . F or A ∈ A , introduce a new v ariable z A . Let V 00 = V ∪ { z A | A ∈ A} . Let ψ 1 = X V 00 Y A ∈A u A ( z A ) ! Y i ∈ A IMP( z A , x i ) ! Y i / ∈ A NAND( z A , x i ) ! . F or every A ∈ A the assignmen t x = 1 A can b e extended in t wo wa ys (b oth with z A = 0 and with z A = 1) to satisfy (17) Y i ∈ A IMP( z A , x i ) ! Y i / ∈ A NAND( z A , x i ) ! = 1 . An y other assignment x can b e extended in only one wa y ( z A = 0) to satisfy (17). So if A ∈ A then F ψ 1 ( A ) = (2 F ( A ) /µ − 1) + 1 = 2 F ( A ) /µ. On the other hand, if A / ∈ A then F ψ 1 ( A ) = 1 . W e hav e sho wn that F ψ 1 ∈ h S F i . Let us now define ψ 2 = X V 00 Y A ∈A Y i ∈ A IMP( z A , x i ) ! Y i / ∈ A NAND( z A , x i ) ! . As b efore, for every A ∈ A the assignment x = 1 A can b e extended in tw o wa ys ( z A = 0 and z A = 1) to satisfy (17), and any other assignment x can b e extended in only one wa y ( z A = 0) to satisfy it. So F ψ 2 ( A ) = 2 ( A ∈ A ) , F ψ 2 ( A ) = 1 ( A / ∈ A ) . Th us F ψ 2 ∈ h S F i . No w define F 3 b y F 3 ( A ) = U 1 ( x 1 ) F ψ 2 ( A ), so F 3 ∈ h S F i , where F 3 ( A ) = 1 ( A ∈ A ) , F 3 ( A ) = 1 / 2 ( A / ∈ A ) . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 20 No w lim k →∞ F k 3 = F 0 , where F 0 ( A ) = 1 ( A ∈ A ) , F 0 ( A ) = 0 ( A / ∈ A ) , and thus F 0 ∈ h S F i ω ,p . Note that F 0 = R F , the underlying relation of F . No w define F 4 = F ψ 1 F 0 , so that F 4 ( A ) = 2 F ( A ) /µ ( A ∈ A ) , F 4 ( A ) = 0 ( A / ∈ A ) , Th us, by Lemma 4, F 4 ∈ h S F i ω ,p . No w define F 5 b y F 5 ( A ) = U 2 ( x 1 ) F 4 ( A ), so F 5 ∈ h S F i ω ,p , where F 5 ( A ) = F ( A ) ( A ∈ A ) , F 5 ( A ) = 0 ( A / ∈ A ) . Since F 5 = F , the pro of is complete. 9 The main theorem In this section w e pro ve our main structural result, which characterises, in the conserv ative case, the clones generated b y a single pseudo-Bo olean function. Since it is known that any clone generated by a finite set of functions can b e generated by a single function [7], w e hav e a characterisation of all finitely generated functional clones. Theorem 16. Supp ose F ∈ B p . • If F / ∈ h NEQ , B p 1 i then IMP ∈ h F , B p 1 i ω ,p , and henc e h IMP , B p 1 i ω ,p ⊆ h F , B p 1 i ω ,p • If, in addition, F / ∈ LSM then h F , B p 1 i ω ,p = B p . The non-efficient version — with B , B 1 r eplacing B p , B p 1 , and h·i ω r eplacing h·i ω ,p — also holds. Pr o of. W e start with the first part of the theorem. The aim is to sho w that either IMP ∈ h F , B p 1 i ω ,p or F ∈ h NEQ , B p 1 i . Let C b e the relational clone h R F , δ 0 , δ 1 i R . Since { R F , δ 0 , δ 1 } ⊆ { R F 0 | F 0 ∈ { F } ∪ B p 1 } , C ⊆ h R F 0 | F 0 ∈ { F } ∪ B p 1 i R , so by Lemma 5, C ⊆ { R F 0 | F 0 ∈ h F , B p 1 i} . First, supp ose IMP ∈ C . Then h F , B p 1 i ω ,p con tains a function F 0 suc h that R F 0 = IMP. The function F 0 falls in to parts (iv) or (v) of Lemma 12, so b y this lemma, h F, B p 1 i ω ,p is either h IMP , B p 1 i ω ,p or h OR , B p 1 i ω ,p . Either w ay , h F , B p 1 i ω ,p con tains IMP (as noted in Remark 14). Similarly , if OR ∈ C or NAND ∈ C then IMP ∈ h F , B p 1 i ω ,p . W e no w consider the p ossibilities. If R F is not affine, then Creignou, Khanna and Sudan [15, Lemma 5.30] ha ve sho wn that one of IMP, OR and NAND is in C . This is also stated and pro v ed as [20, Lemma 15]. In fact, the set of all relational clones (also called “co-clones”) is w ell understo o d. They are listed in [16, T able 2], whic h gives a plain basis for eac h relational clone. There is a similar table in [4] (though the bases given there are not plain). A Hasse diagram illustrating the inclusions b et w een the relational clones is depicted in [3, Figure 2]. This diagram is repro duced here as Figure 1. A do wnw ards edge from one clone to another indicates that the low er clone is a subset of the higher one. F or example, since there is a Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 21 IBF IR 0 IR 1 IR 2 IM IM 0 IM 1 IM 2 ID IL IE IV IN II ID 1 ID 2 IL 1 IL 0 IL 2 IL 3 IN 2 II 2 II 1 II 0 IV 1 IV 2 IE 2 IE 0 IV 0 IE 1 IS 0 2 IS 0 3 IS 02 2 IS 02 3 IS 01 2 IS 01 3 IS 00 2 IS 0 IS 00 3 IS 02 IS 01 IS 00 IS 10 IS 11 IS 12 IS 1 IS 10 3 IS 11 3 IS 12 3 IS 10 2 IS 11 2 IS 1 3 IS 12 2 IS 1 2 Figure 1: Post’s lattice from [3, Fig. 2]. path (in this case, an edge) from ID 1 do wn to IR 2 in Figure 1, we deduce that IR 2 ⊂ ID 1 . W e will not require bases for all relational clones, but w e ha v e repro duced the part of [16, T able 2] that we use here as T able 1. If R F is affine then the relations in C are given b y linear equations, so C is either the relational clone IL 2 (whose plain basis the set of all Bo olean linear equations) or C is some subset of IL 2 , in which case it is b elo w IL 2 in Figure 1. No w, EQ, δ 0 and δ 1 are in C . The relational clone con taining these relations (and nothing else) is IR 2 , so C is a (not necessarily prop er) superset of IR 2 . Thus, C is (not necessarily strictly) ab o v e IR 2 in Figure 1. F rom the figure, it is clear that the only p ossibilities are that C is one of the relational clones IL 2 , ID 1 and IR 2 . No w IR 2 ⊂ ID 1 and the plain basis of ID 1 is { EQ , NEQ , δ 0 , δ 1 } . Therefore if C = IR 2 or The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 22 Plain Basis IR 2 { EQ , δ 0 , δ 1 } ID 1 { EQ , NEQ , δ 0 , δ 1 } IL 2 {{ ( x 1 , . . . , x k ) ∈ { 0 , 1 } k | x 1 + . . . + x k = c (mo d 2) } | k ∈ N , c ∈ { 0 , 1 }} T able 1: The relev ant portion of T able 2 of [16]: Some relational clones and their plain bases. C = ID 1 , then R F is definable by a CNF formula o ver { EQ , NEQ , δ 0 , δ 1 } . Supp ose that F ( x ) has arit y n and, to av oid trivialities, that R F is not the empt y relation. Supp ose that ψ ( v 1 , . . . , v n ) is a CNF formula o v er { EQ , NEQ , δ 0 , δ 1 } implemen ting the relation R ψ = R F . Let V = { v 1 , . . . , v n } . Let ψ i b e the pro jection of ψ on to v ariable v i . ψ i is one of the three unary relations { (0) } , { (1) } , and { (0) , (1) } . Let V 0 = { v i ∈ V | ψ i = { (0) , (1) }} . ( V 0 is the set of v ariables that are not pinned in R F .) F or v i ∈ V 0 and v j ∈ V 0 , let ψ i,j b e the pro jection of ψ on to v ariables v i and v j . ψ i,j is a binary relation. Of the 16 p ossible binary relations, the only ones that can occur are EQ, NEQ and { 0 , 1 } 2 . The empt y relation is ruled out since R F is not empty . The four single-tuple binary relations are ruled out since v i and v j are in V 0 . F or the same reason, the other four tw o-tuple binary relations are ruled out. The three-tuple binary relations are ruled out since ψ i,j ∈ ID 1 . W e define an equiv alence relation ∼ on V 0 in which v i ∼ v j iff ψ i,j ∈ { EQ , NEQ } . Let V 00 con tain exactly one v ariable from each equiv alence class in V 0 . Let k = | V 00 | . F or con v enience, w e will assume V 00 = { v 1 , . . . , v k } . (This can b e ac hiev ed b y renaming v ariables.) No w, for every assignmen t x : { v 1 , . . . , v k } → { 0 , 1 } there is exactly one assignment y : { v k +1 , . . . , v n } → { 0 , 1 } such that R F ( x , y ) = 1. Let σ ( x ) be this assignment y . Now, define the arity- k function G by G ( x ) = F ( x , σ ( x )). Note that (18) G ( x ) = X y ∈{ 0 , 1 } n − k F ( x , y ) , where y is an assignment y : { v k +1 , . . . , v n } → { 0 , 1 } . Clearly , from (18), G ∈ h F , B p 1 i ω ,p . Also, by construction, G ( x ) is a p ermissiv e function so w e can apply Lemma 8. W e finish with tw o cases. Case 1. Ev ery 2-pinning of G is log-modular. Then G is log-modular, b y Lemma 8. This means (see, for example, [5, Prop osition 24]) that g = log 2 G is an affine function of x 1 , . . . , x k and ¯ x 1 , . . . , ¯ x k so G ∈ h NEQ , B p 1 i . F or example, if g = a 0 + a 1 x 1 + a 2 x 2 + a 3 ¯ x 3 then G can b e written as G ( x 1 , x 2 , x 3 ) = X y 3 U 0 U 1 ( x 1 ) U 2 ( x 2 ) U 3 ( y 3 )NEQ( x 3 , y 3 ) , where U 0 = 2 a 0 ∈ B p 0 and U i ( x ) = 2 a i x ∈ B p 1 . Since F ( x , y ) = R F ( x , y ) G ( x ), w e conclude that F ∈ h NEQ , B p 1 i . Case 2. There is a 2-pinning G 0 of G that is not log-mo dular. Since G is strictly p ositive, so is G 0 . Since G ∈ h F , B p 1 i ω ,p , so is G 0 . By Lemma 12, (parts (iv) or (v)), IMP ∈ h G 0 , B p 1 i ω ,p . By Lemma 4, IMP ∈ h F , B p 1 i ω ,p . Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 23 Finally , we consider the case in whic h C = IL 2 . Let ⊕ 3 b e the relation { (0 , 0 , 0) , (0 , 1 , 1) , (1 , 0 , 1) , (1 , 1 , 0) } con taining all triples whose Bo olean sums are 0. F rom the plain basis of IL 2 (T able 1), w e see that the relation ⊕ 3 is in C , so h F , B p 1 i con tains a function F 0 with R F 0 = ⊕ 3 . Let F 00 b e the symmetrisation of F 0 implemen ted b y F 00 ( x, y , z ) = F 0 ( x, y , z ) F 0 ( x, z , y ) F 0 ( y , x, z ) F 0 ( y , z , x ) F 0 ( z , x, y ) F 0 ( z , y, x ) . No w let µ 0 = F 00 (0 , 0 , 0) and µ 2 = F 00 (0 , 1 , 1). Let U b e the unary function with U (0) = µ − 1 / 3 0 and U (1) = µ 1 / 6 0 µ − 1 / 2 2 . Note that since F ∈ B p , the appropriate ro ots of µ 0 and µ 2 are efficiently computable, so U ∈ B p 1 . Now ⊕ 3 ( x, y , z ) = U ( x ) U ( y ) U ( z ) F 00 ( x, y , z ), so ⊕ 3 ∈ h F , B p 1 i . Finally , let U 0 b e the unary function defined by U 0 (0) = 1 and U 0 (1) = 2 and let G ( x, z ) = P y ⊕ 3 ( x, y , z ) U 0 ( y ). Note that G (0 , 0) = G (1 , 1) = 1 and G (0 , 1) = G (1 , 0) = 2. By Lemma 1, G is in h F , B p 1 i . But by Lemma 12, IMP ∈ h G, B p 1 i ω ,p so by Lemma 4, IMP ∈ h F , B p 1 i ω ,p . W e now pro v e Part 2 of the theorem. Suppose that F is not lsm and that F / ∈ h NEQ , B p 1 i so, by Part 1 of the theorem, we hav e IMP ∈ h F , B p 1 i ω ,p . Let H ( x 1 , x 2 ) = X y 1 ,y 2 IMP( y 1 , x 1 )IMP( y 1 , x 2 )IMP( x 1 , y 2 )IMP( x 2 , y 2 ) . Note that H (0 , 0) = H (1 , 1) = 2 and H (0 , 1) = H (1 , 0) = 1. Now for an y in teger k , let H k ( x 1 , . . . , x n ) = X y 1 ,...,y n F ( y 1 , . . . , y n ) n Y i =1 H ( x i , y i ) k . By construction, H k is strictly p ositiv e. Also, as k gets large, H k ( x 1 , . . . , x n ) gets closer and closer to 2 kn F ( x 1 , . . . , x n ). Th us, for sufficien tly large k , H k is not lsm. By Lemma 1, H ∈ h F, B p 1 i ω ,p so H k ∈ h F, B p 1 i ω ,p . Applying Lemma 8 to H k , there is a binary function F 1 ∈ h F , B p 1 i that is not lsm so F 1 (0 , 0) F 1 (1 , 1) < F 1 (0 , 1) F 1 (1 , 0) . By P arts (iii) and (v) of Lemma 12, w e either ha ve NEQ ∈ h F , B p 1 i or OR ∈ h F , B p 1 i . In the latter case, w e are finished by Lemma 15. In the former case, we are also finished since (in the notation of the pro of of Lemma 12) M (NEQ) M (IMP) = M (OR) so OR ∈ h IMP , NEQ i . 10 Complexit y-theoretic consequences In order to explore the consequences of Theorem 16 for the computational complexit y of appro ximately ev aluating # CSP s, we recall the following definitions of FPRASes and AP- reductions from [18]. F or our purp oses, a coun ting problem is a function Π from instances w (enco ded as a word o ver some alphab et Σ ) to a num b er Π ( w ) ∈ R ≥ 0 . F or example, w migh t enco de an instance I of a counting CSP problem # CSP ( Γ ), in which case Π ( w ) w ould b e the partition function Z ( I ) asso ciated with I . A r andomise d appr oximation scheme for Π is a The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 24 randomised algorithm that takes an instance w and returns an appro ximation Y to Π ( w ). The approximation sc heme has a parameter ε > 0 which sp ecifies the error tolerance. Since the algorithm is randomised, the output Y is a random v ariable dep ending on the “coin tosses” made by the algorithm. W e require that, for every instance w and ev ery ε > 0, (19) Pr  e − ε Π ( w ) ≤ Y ≤ e ε Π ( w )  ≥ 3 / 4 . The randomised appro ximation scheme is said to b e a ful ly p olynomial r andomise d appr oxi- mation scheme , or FPRAS , if it runs in time b ounded by a p olynomial in | w | (the length of the w ord w ) and ε − 1 . See Mitzenmacher and Upfal [30, Definition 10.2]. Note that the quan- tit y 3 / 4 in Equation (19) could b e changed to any v alue in the op en in terv al ( 1 / 2 , 1) without c hanging the set of problems that ha ve randomised approximation sc hemes [26, Lemma 6.1]. Supp ose that Π 1 and Π 2 are functions from Σ ∗ to R ≥ 0 . An “approximation-preserving reduction” (AP-reduction) [18] from Π 1 to Π 2 giv es a w ay to turn an FPRAS for Π 2 in to an FPRAS for Π 1 . Sp ecifically , an AP-r e duction fr om Π 1 to Π 2 is a randomised algorithm A for computing Π 1 using an oracle 3 for Π 2 . The algorithm A tak es as input a pair ( w , ε ) ∈ Σ ∗ × (0 , 1), and satisfies the following three conditions: (i) ev ery oracle call made by A is of the form ( v, δ ), where v ∈ Σ ∗ is an instance of Π 2 , and 0 < δ < 1 is an error b ound satisfying δ − 1 ≤ p oly( | w | , ε − 1 ); (ii) the algorithm A meets the sp ecification for b eing a randomised appro ximation sc heme for Π 1 (as describ ed ab o ve) whenev er the oracle meets the specification for being a randomised appro ximation sc heme for Π 2 ; and (iii) the run- time of A is p olynomial in | w | and ε − 1 . Note that the class of functions computable by an FPRAS is closed under AP-reducibility . Informally , AP-reducibility is the most lib eral notion of reduction meeting this requirement. If an AP-reduction from Π 1 to Π 2 exists w e write Π 1 ≤ AP Π 2 . If Π 1 ≤ AP Π 2 and Π 2 ≤ AP Π 1 then w e sa y that Π 1 and Π 2 ar e AP-interr e ducible , and write Π 1 = AP Π 2 . A word of w arning about terminology . Subsequent to [18] the notation ≤ AP has b een used to denote a differen t t yp e of approximation-preserving reduction which applies to opti- misation problems. W e will not study optimisation problems in this paper, so hop efully this will not cause confusion. The complexity of approximating Boolean #CSPs in the un weigh ted case, where the functions in Γ hav e co domain { 0 , 1 } , w as studied earlier [20] by some of the authors of this pap er. Two counting problems play ed a sp ecial role there, and in previous w ork in the complexit y of approximate coun ting [18]. They also play a k ey role here. Name # SA T Instanc e A Bo olean form ula ϕ in conjunctiv e normal form. Output The n umber of satisfying assignments of ϕ . 3 The reader who is not familiar with oracle T uring machines can just think of this as an imaginary (un written) subroutine for computing Π 2 . Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 25 Name # BIS . Instanc e A bipartite graph B . Output The n umber of indep endent sets in B . An FPRAS for # SA T would, in particular, ha v e to decide with high probabilit y b et w een a formula having some satisfying assignments or having none. Thus # SA T cannot hav e an FPRAS unless NP = RP . 4 The same is true of an y problem to which # SA T is AP- reducible. As far as we are aw are, the complexity of approximating # BIS do es not relate to an y of the standard complexit y theoretic assumptions, suc h as NP 6 = RP . Nevertheless, there is increasing empirical evidence that no FPRAS for # BIS exists, and we adopt this as a w orking hypothesis. Of course, this hypothesis implies that no # BIS -hard problem (problem to which # BIS is AP-reducible) admits an FPRAS. Finally , a precise statemen t of the computational task we are interested in. A (weigh ted) #CSP problem is parameterised by a finite subset F of B p and defined as follo ws. Name # CSP ( F ) Instanc e A pps-formula ψ consisting of a pro duct of m atomic F -form ulas ov er n free v ari- ables x . (Thus, ψ has no b ound v ariables.) Output The v alue P x ∈{ 0 , 1 } n F ψ ( x ) where F ψ is the function defined by that form ula. Officially , the input size | w | is the length of the enco ding of the instance. Ho w ev er, we shall tak e the size of a # CSP ( F ) instance to b e n + m , where n is the n umber of (free) v ariables and m is the num b er of constraints (atomic formulas). This is acceptable, as w e are only concerned to measure the input size within a p olynomial factor; moreov er, w e ha v e restricted F to b e finite, thereb y av oiding the issue of how to enco de the constraint functions F . W e typically denote an instance of # CSP ( F ) by I and the output b y Z ( I ); by analogy with systems in statistical physics w e refer to Z ( I ) as the partition function. Aside from simplifying the representation of problem instances, there is another, more imp ortan t reason for decreeing that F is finite, namely , that it allows us to prov e the following basic lemma relating functional clones and computational complexity . It is, of course, based on a similar result for classical decision CSPs. Lemma 17. Supp ose that F is a finite subset of B p . If F ∈ hF i ω ,p then # CSP ( F , F ) ≤ AP # CSP ( F ) . Pr o of. Let k b e the arit y of F . Let M b e a TM whic h, on input ε 0 > 0, computes a k -ary pps-form ula ψ ov er F ∪ EQ suc h that k F ψ − F k ∞ < ε 0 . W e can assume without loss of generalit y that no function in { F } ∪ F is identically zero (otherwise ev ery #CSP instance using this function has partition function 0). Let µ max b e the maximum v alue in the range of F and let µ min b e the minimum of 1 and the minim um non-zero v alue in the range of F . 4 The supp osed FPRAS w ould provide a p olynomial-time decision pro cedure for satisfiability with tw o- sided error; how ev er, there is a standard trick for con v erting tw o-sided error to the one-sided error demanded b y the definition of RP [34, Thm 10.5.9]. The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 26 Similarly , let S b e the set of non-zero v alues in the range of functions in F ∪ { EQ } . Let ν max b e the maxim um v alue in S and let ν min b e the minim um of 1 and the minim um v alue in S . Consider an input ( I , ε ) where I is an instance of # CSP ( F , F ) and ε is an accuracy parameter. Supp ose that I has n v ariables, m F -constrain ts, and m 0 other constrain ts. W e can assume without loss of generalit y that m > 0 (otherwise, I is an instance of # CSP ( F )). The k ey idea of the pro of is to construct an instance I 0 of # CSP ( F ) by replacing each F -constraint in I with the set of constrain ts and extra (b ound) v ariables in the form ula ψ that is output b y M with input ε 0 . W e determine how small to make ε 0 in terms of the follo wing quan tities. Let A = 4 m µ min 2 n µ m max ν m 0 max B = 2 n ( µ max + 1) m − 1 ν m 0 max C = µ m min ν m 0 min . Let ε 0 = ε 4 C A + B . The time needed to construct ψ for a given ε 0 > 0 is at most p oly (log ( ε 0 − 1 )), whic h is at most a polynomial in n , m , m 0 and ε − 1 , as required b y the definition of AP- reduction. W e shall see that ( I 0 , ε/ 2) is the sought-for instance/tolerance pair required by our reduction. Let I ψ b e the instance formed from I by replacing ev ery F -constraint with an F ψ - constrain t. Note that Z ( I ψ ) = Z ( I 0 ), since I 0 , an instance of # CSP ( F ), is an implementation of I ψ . W e w an t to sho w that if an oracle produces a sufficien tly accurate appro ximation to Z ( I 0 ) (and hence to Z ( I ψ )) then we can deduce a sufficien tly accurate approximation to Z ( I ). Observ e that the definition of FPRAS allows no margin of error when Z ( I ) = 0, and our reduction must giv e the correct result, namely 0, in this case. Therefore w e need to treat separately the cases Z ( I ) = 0 and Z ( I ) > 0. W e will sho w that (20) Z ( I ) = 0 implies Z ( I ψ ) < C / 3 , and (21) Z ( I ) > 0 implies Z ( I ψ ) > 2 C / 3; moreo v er, in the latter case, (22) e − ε/ 2 Z ( I ) ≤ Z ( I ψ ) ≤ e ε/ 2 Z ( I ) . These estimates are enough to ensure correctness of the reduction. F or a call to an oracle for # CSP ( F ) with instance I 0 and accuracy parameter ε/ 2 w ould return a result in the range [ e − ε/ 2 Z ( I ψ ) , e ε/ 2 Z ( I ψ )] with high probabilit y . Observ e that this estimate is sufficient to distinguish b et ween cases (20) and (21). In the former case, w e are able to return the exact result, namely 0. In the latter case, we return the result given b y the oracle, which b y (22) satisfies the conditions for an FPRAS. T o establish (20 – 22), let Y 0 b e the set of assignmen ts to the v ariables of instance I whic h make a non-zero con tribution to Z ( I ) and let Y 00 b e the remaining assignments to the v ariables of instance I . Let Z 0 ( I ψ ) be the con tribution to Z ( I ψ ) due to assignments in Y 0 and Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 27 Z 00 ( I ψ ) b e the con tribution to Z ( I ψ ) due to assignments in Y 00 (so Z ( I ψ ) = Z 0 ( I ψ ) + Z 00 ( I ψ )). W e can similarly write Z ( I ) = Z 0 ( I ) + Z 00 ( I ), though of course Z 00 ( I ) = 0. First, note that if | F ψ ( x ) − F ( x ) | ≤ ε 0 and F ( x ) > 0 then | F ψ ( x ) /F ( x ) − 1 | ≤ ε 0 /F ( x ) ≤ ε 0 /µ min , so e − 2 ε 0 /µ min ≤ F ψ ( x ) F ( x ) ≤ e 2 ε 0 /µ min . W e conclude that e − 2 ε 0 m/µ min Z 0 ( I ) ≤ Z 0 ( I ψ ) ≤ e 2 ε 0 m/µ min Z 0 ( I ) , so | Z 0 ( I ) − Z 0 ( I ψ ) | ≤ 4 ε 0 m µ min Z ( I ) ≤ ε 0 A. F urthermore, | Z 00 ( I ) − Z 00 ( I ψ ) | = Z 00 ( I ψ ) ≤ ε 0 B . Here we use k F ψ − F k ∞ < ε 0 < 1; the “ + 1” in the definition of B absorbs the discrepancy b et w een F ψ and F . Com bining these tw o inequalities yields (23) | Z ( I ) − Z ( I ψ ) | ≤ ε 0 ( A + B ) ≤ εC 4 . No w, Z ( I ) > 0 implies Z ( I ) ≥ C , and hence (20) and (21) follow directly from (23). If Z ( I ) > 0 w e further hav e     Z ( I ψ ) Z ( I ) − 1     ≤ ε 0 ( A + B ) Z ( I ) ≤ ε 0 ( A + B ) C ≤ ε/ 3 . This establishes (22) and completes the v erification of the reduction. Theorem 18. Supp ose F is a finite subset of B p . • If F ⊆ h NEQ , B p 1 i then, for any finite subset S of B p 1 , ther e is an FPRAS for # CSP ( F , S ) . • Otherwise, ◦ Ther e is a finite subset S of B p 1 such that # BIS ≤ AP # CSP ( F , S ) . ◦ If ther e is a function F ∈ F such that F / ∈ LSM then ther e is a finite subset S of B p 1 such that # SA T = AP # CSP ( F , S ) . Pr o of. First, suppose that F ⊆ h NEQ , B p 1 i . Let S b e a finite subset of B p 1 . Given an m - constrain t input I of # CSP ( F , S ) and an accuracy parameter ε , we first appro ximate each arit y- k function F ∈ F used in I with a function b F : { 0 , 1 } k → Q ≥ 0 suc h that R b F = R F , and for every x for which F ( x ) > 0, (24) e − ε/m ≤ b F ( x ) F ( x ) ≤ e ε/m . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 28 Let b F = { b F | F ∈ F } and let b I b e the instance of # CSP ( b F , S ) formed from I b y replacing eac h F -constrain t with b F . [19, Theorem 4] gives a p olynomial-time algorithm for computing the partition function Z ( b I ), which satisfies (25) e − ε Z ( I ) ≤ Z ( b I ) ≤ e ε Z ( I ) . Second, supp ose that F 6⊆ h NEQ , B p 1 i . By Theorem 16, IMP ∈ hF , B p 1 i ω ,p . By Observ a- tion 3, there is a finite subset S of B p 1 suc h that IMP ∈ hF , S i ω ,p . Thus, # CSP (IMP) ≤ AP # CSP ( F , S ), by Lemma 17. How ev er, # BIS = AP # CSP (IMP) by [20, Theorem 3]. Finally , supp ose that there is a function F ∈ F suc h that F / ∈ LSM . By Theorem 16, h F , B p 1 i ω ,p = B p so OR ∈ h F , B p 1 i ω ,p . By Observ ation 3, there is a finite subset S of B p 1 suc h that OR ∈ h F , S i ω ,p , so b y Lemma 17, # CSP (OR) ≤ AP # CSP ( F , S ). Ho wev er, by [20, Lemma 7] # SA T ≤ AP # CSP (OR). T o see that # CSP ( F , S ) ≤ AP # SA T , let I b e an m -constrain t instance of # CSP ( F , S ). F or each function G ∈ F ∪ S , define b G as in (24). Let b I b e the instance of # CSP ( { b G | G ∈ F ∪ S } ) formed from I by replacing each G -constrain t with a b G -constrain t. Equation (25) holds, as ab o v e. F urthermore, from [19, Section 1.3] the problem of ev aluating # CSP ( { b G | G ∈ F ∪ S } ) (even with b G as part of the input) is in # P Q , the complexity class comprising functions whic h are a function in # P divided by a function in FP , so can b e AP-reduced to # SA T . Example 19 . Let F ∈ B p 2 b e the function defined b y F (0 , 0) = F (1 , 1) = λ and F (0 , 1) = F (1 , 0) = 1, where λ > 1. Then, from Theorem 18, # CSP ( F , S ) is # BIS -hard, for some set S of unary weigh ts. (In fact, this coun ting CSP is also # BIS -easy .) Note that # CSP ( F , S ) is nothing other than the ferromagnetic Ising mo del with an applied field. So we recov er, with no effort, the main result of Goldb erg and Jerrum’s inv estigation of this mo del [21]. Example 20 . If F is as b efore, but λ ∈ (0 , 1), then F / ∈ LSM and Theorem 18 tells us that # CSP ( F , S ) is # SA T -hard, for some set S of unary weigh ts. This is a restatemen t of the kno wn fact that the partition function of the antiferromagnetic Ising mo del is hard to appro ximate [25]. Actually , this is true without weigh ts, but that is not directly implied by Theorem 18. 11 The classes h LSM k i In this section, we will be concerned with expressibility , and less so with efficient computabil- it y . Th us, w e will use function classes without attempting to distinguish the efficiently computable functions in the class from the remainder. Define LSM k = LSM ∩ B k . It follows from the proof of Lemma 12 that h LSM 2 i = h IMP , B 1 i . Since LSM is cen tral to Theorem 16, we need to consider whether LSM = h LSM 2 i ω and, if not, what internal structure it may p ossess. T o this end, w e consider here the functional clones h LSM k i ω for k > 2. As mentioned in the abstract, we will make use of t wo transforms: the M¨ obius transform to show h LSM 3 i ω = h LSM 2 i ω (in fact w e pro ve the stronger statemen t h LSM 3 i = h LSM 2 i ), and the F ourier transform to show that h LSM 4 i ω 6 = h LSM 2 i ω . See [2, 36, 33] for corresp onding results in the con text of optimisation. Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 29 F or all x , y ∈ { 0 , 1 } n , we will write x ≤ y to mean that for all 1 ≤ i ≤ n we ha v e x i ≤ y i . F or all f ∈ B n define the M¨ obius tr ansform e f ∈ B n b y e f ( y ) = X w ≤ y ( − 1) | y − w | f ( w ) ( y ∈ { 0 , 1 } n ) , (26) and note that the M¨ obius transform is inv ertible: f ( x ) = X y ≤ x e f ( y ) ( x ∈ { 0 , 1 } n ) . (27) See also [24] for further information. W e will not require an ything other than (26) and (27). W e next sho w that certain simple functions are in h LSM 2 i . Lemma 21. L et y ∈ { 0 , 1 } n . L et t ∈ R , with t ≥ 0 if | y | > 1 . L et F ∈ B n b e the unique function satisfying ] log F ( y ) = t and ] log F ( x ) = 0 for x 6 = y . (Explicitly, F ( x ) = e t for y ≤ x and F ( x ) = 1 otherwise.) Then F ∈ h LSM 2 i . Pr o of. If t ≥ 0 define U ∈ LSM 1 b y U (0) = 1 and U (1) = e t − 1. W e will argue that for all x we hav e F ( x ) = X z U ( z ) Y i : y i =1 IMP( z , x i ) . Indeed if y ≤ x we get F ( x ) = U (0) + U (1) = e t , and otherwise F ( x ) = U (0) = 1. No w we consider the case | y | ≤ 1. If y = 0 let i = 1, and otherwise let i be the unique index with y i = 1. Then F ( x ) = U ( x i ) where U (0) = F ( 0 ) and U (1) = F ( 1 ). Hence F ∈ h LSM 1 i ⊂ h LSM 2 i . If x ∈ { 0 , 1 } n , let ¯ x = 1 − x and, if F ∈ B n , let ¯ F ( x ) = F ( ¯ x ). W e will use the following simple fact. Lemma 22. F ∈ LSM k iff ¯ F ∈ LSM k . Pr o of. By symmetry , it suffices to show that, for any x , y ∈ { 0 , 1 } k , ¯ F ( x ) ¯ F ( y ) = F ( ¯ x ) F ( ¯ y ) ≤ F ( ¯ x ∧ ¯ y ) F ( ¯ x ∨ ¯ y ) = F ( x ∨ y ) F ( x ∧ y ) = ¯ F ( x ∨ y ) ¯ F ( x ∧ y ) . No w w e show that it is only necessary to consider permissive functions. The construction used in the lemma is adapted from one given, in a more general setting, by T opkis [31]. Lemma 23. F or every F ∈ LSM k ther e exists G ∈ LSM > 0 k such that F = R F G . F urthermor e R F ∈ h LSM 2 i , so h LSM k i = h LSM > 0 k , LSM 2 i . Pr o of. First, assume F ( 0 ) 6 = 0. Let µ = min x { F ( x ) | F ( x ) 6 = 0 } / max x F ( x ). Set G ( x ) = max { F ( y ) µ | x |−| y | | y ≤ x } . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 30 Then G is strictly p ositive and G ( x ) = F ( x ) wherever F ( x ) 6 = 0. It remains to show that G ∈ LSM . F or all x , x 0 there exist y ≤ x and y 0 ≤ x 0 suc h that G ( x ) G ( x 0 ) = F ( y ) F ( y 0 ) µ | x |−| y | + | x 0 |−| y 0 | ≤ F ( y ∧ y 0 ) F ( y ∨ y 0 ) µ | x |−| y | + | x 0 |−| y 0 | = F ( y ∧ y 0 ) F ( y ∨ y 0 ) µ | x ∧ x 0 |−| y ∧ y 0 | + | x ∨ x 0 |−| y ∨ y 0 | ≤ G ( x ∧ x 0 ) G ( x ∨ x 0 ) . No w we deal with the case F ( 0 ) = 0. Let F 0 ( x ) = F ( x ) for all x 6 = 0 and let F 0 ( 0 ) = 1. Then F 0 ∈ LSM and F 0 ( 0 ) 6 = 0, and we ha v e shown that there exists G ∈ LSM > 0 suc h that F 0 = R F 0 G . But then F = R F G . By [20, Corollary 18], R F is a conjunction of implications and constan ts, and hence R F ∈ h δ 0 , δ 1 , IMP i ⊂ h LSM 2 i . Thus h LSM k i ⊆ h LSM > 0 k , LSM 2 i . The reverse inclusion is trivial. Lemma 24. h LSM 3 i = h LSM 2 i . Pr o of. F rom Lemma 23, w e need only prov e LSM > 0 3 ⊆ h LSM 2 i . Th us let F ∈ LSM > 0 3 , f = log F , and first assume e f (1 , 1 , 1) ≥ 0. W e will sho w that F ∈ h LSM 2 i . Note that, b y log-sup ermodularity of F , e f (1 , 1 , 0) = f (0 , 0 , 0) − f (1 , 0 , 0) − f (0 , 1 , 0) + f (1 , 1 , 0) ≥ 0 . and similarly e f (1 , 0 , 1) , e f (0 , 1 , 1) ≥ 0. Hence e f ( y ) ≥ 0 for all | y | > 1. F or all y ∈ { 0 , 1 } 3 let F y b e the unique function satisfying ^ log F y ( y ) = e f ( y ) and ^ log F y ( z ) = 0 for z 6 = y . Then ] log F = P y ^ log F y , which implies log F = P y log F y , which implies F = Q y F y . By Lemma 21 we hav e F y ∈ h LSM 2 i for all y , and therefore F ∈ h LSM 2 i . If e f (1 , 1 , 1) < 0, let H = F . Note that H ∈ LSM > 0 3 and ] log H (1 , 1 , 1) > 0, so by the previous paragraph, H ∈ h LSM 2 i . By Lemma 22 this implies F ∈ h LSM 2 i . In view of Lemma 24, it might b e conjectured that LSM = h LSM 2 i ω . In fact, this is not the case, as we will now sho w. First w e consider the class P of functions F ∈ B for whic h the F ourier tr ansform b F has nonnegativ e co efficien ts, where b F ( y ) = 1 2 n X w ∈{ 0 , 1 } n ( − 1) | w ∧ y | F ( w ) ( y ∈ { 0 , 1 } n ) . (28) Th us F ∈ P if and only if b F ∈ B . See [17] for further information. W e will use (28) and the c onvolution the or em : for all F , G ∈ B n w e ha v e d F G ( x ) = X y ∈{ 0 , 1 } n b F ( y ) b G ( x ⊕ y ) ( x , y ∈ { 0 , 1 } n ) . (29) where ⊕ denotes comp onen t wise addition mo dulo 2. See for example [17, Section 2.3] for a pro of of the dual statement. T o show that P is closed under pps-formula ev aluation, it is useful to restrict to atomic form ulas where v ariables are not rep eated within a scop e. Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 31 Lemma 25. L et F ⊆ B . F or al l pps-formulas ψ over F ther e is another pps-formula ψ 0 over F ∪ { EQ } such that F ψ = F ψ 0 and no atomic formula of ψ 0 c ontains a r ep e ate d variable. Pr o of. Giv en ψ obtain ψ 0 as follows. F or eac h v ariable v i that is used d i ≥ 2 times in total in ψ , replace the uses of v i b y new distinct v ariables v 1 i , · · · , v d i i , m ultiply b y atomic form ulas EQ( v i , v j i ) for 1 ≤ j ≤ d i , then sum o ver these new v ariables v j i . Lemma 26. P is close d under addition, summation, pr o ducts and limits. Mor e over, P is a pps ω -definable functional clone. Pr o of. If F , G ∈ P , then \ F + G = b F + b G is clearly non-negativ e, and d F G is nonnegative b y the con volution theorem (29). F or summation, as in Lemma 6, we consider summing o v er the last v ariable. So, let H ( x ) = P t F ( x , t ). Then it follo ws easily from (28) that b H ( y ) = 2 b F ( y , 0) ≥ 0 for all y . F or limits note that if F n → F then c F n → b F , and a limit of non-negativ e functions is non-negative. Let ψ b e a pps-form ula ov er P ∪ { EQ } . W e will argue that that F ψ ∈ P . By Lemma 25 there is a pps-form ula ψ 0 o v er P ∪ { EQ } such that F ψ = F ψ 0 and such that no atomic form ula of ψ contains a rep eated v ariable. The functions F ϕ defined b y atomic form ulas ϕ = G ( v i 1 , · · · , v i k ) of ψ 0 are therefore “expansions”: p erm utations of the function G 0 ∈ B n , n ≥ k , defined b y G 0 ( x , x 0 ) = G ( x ) ( x ∈ { 0 , 1 } k and x 0 ∈ { 0 , 1 } n − k ) . (30) It therefore suffices to c heck that P is closed under expansions. Let G 0 b e the expansion defined b y (30). Then, for all y ∈ { 0 , 1 } k and y 0 ∈ { 0 , 1 } n − k , we ha ve c G 0 ( y , y 0 ) = b G ( y ) if y 0 = 0 k , and c G 0 ( y , y 0 ) = 0 otherwise, and hence G 0 ∈ P . Note that c EQ = 1 2 EQ, so EQ ∈ P . Th us P is a pps-definable functional clone, but it is also closed under limits. F or F ∈ B , let F ? denote F ¯ F . No w let C b e the class of functions F ∈ B suc h that G ? ∈ P for every pinning G ( x ) = F ( x ; c ). Note, in particular, that if U ∈ B 1 , U ? ( z ) = U (0) U (1), a nonnegativ e constan t. Therefore we hav e B 1 ⊆ C and, to establish that F ∈ C , we need only c hec k pinnings of F of arity at least 2. Lemma 27. C is a pps ω -definable functional clone. Pr o of. As in Lemma 26 w e will c hec k that C is closed under “expansions”, pro ducts, sum- mations, and limits. But a pinning of an expansion (or pro duct, summation, or limit) of functions in C is an expansion (or pro duct, summation, or limit) of pinnings of functions in C , which are necessarily in C b ecause C is closed under pinnings. So it suffices to c hec k the C condition for trivial pinnings, for example to chec k closure under pro ducts it suffices to sho w that F , G ∈ C implies ( F G ) ? ∈ P . Let G ∈ C ha ve arit y k , let n ≥ k , let G 0 b e the function defined by (30). Note that G 0 G 0 is an expansion of GG , so G 0 G 0 ∈ P and G 0 ∈ C . W e hav e EQ ∈ C , since EQ EQ = EQ ∈ P . Closure under pro duct follo ws from Lemma 26 and the observ ation that ( F G ) ? = F ? G ? . F or summation, again as in Lemma 6, w e consider summing o ver the last v ariable. Then, if H ( x ) = P t F ( x , t ), where F has arit y k + 1, then H ? ( x ) = P t F ( x , t ) P t ¯ F ( x , t ) = ( F 0 ) ? ( x ) + ( F 1 ) ? ( x ) + P t F ? ( x , t ) . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 32 where F 0 and F 1 are the pinnings F i ( x ) = F ( x ; i ). W e hav e ( F 0 ) ? , ( F 1 ) ? ∈ P b y the pinning assumption, and the arity k function P t F ? ( x , t ) is in P by Lemma 26. Th us H ? is the sum of three functions in P , and so, using Lemma 26 again, H ? ∈ P . Finally note that C is closed under limits: if F n → F as n → ∞ then F ? n → F ? , but P is closed under limits. Lemma 28. h LSM 2 i ω ⊆ C . Pr o of. Let F ∈ LSM 2 . Note that c F ? (0 , 0) = ( F (0 , 0) F (1 , 1)+ F (0 , 1) F (1 , 0)) / 2, and c F ? (0 , 1) = c F ? (1 , 0) = 0, and c F ? (1 , 1) = ( F (0 , 0) F (1 , 1) − F (0 , 1) F (1 , 0)) / 2 ≥ 0. So F ? ∈ P , and hence F ∈ C . Th us LSM 2 ⊆ C and, since C is a pps ω -definable functional clone, h LSM 2 i ω ⊆ C . Lemma 29. h LSM 2 i ω ⊂ h LSM 4 i ω . Pr o of. Since LSM 2 ⊆ C by Lemma 28, w e need only exhibit a function F ∈ LSM 4 whic h is not in C . Define F : { 0 , 1 } 4 → R > 0 b y F ( x 1 , x 2 , x 3 , x 4 ) =    4 , if x 1 + x 2 + x 3 + x 4 = 4; 2 , if x 1 + x 2 + x 3 + x 4 = 3; 1 , otherwise. T o show F ∈ LSM 4 , b y the symmetry of F and Lemma 8, it suffices to show that the three 2-pinnings F (0 , 0 , x 3 , x 4 ), F (0 , 1 , x 3 , x 4 ) and F (1 , 1 , x 3 , x 4 ) are lsm. This is equiv alen t to the inequalities 1 × 1 ≥ 1 × 1, 2 × 1 ≥ 1 × 1, and 4 × 1 ≥ 2 × 2 resp ectively , which clearly hold. T o show that F / ∈ C , we need only use (28) to calculate c F ? (1 , 1 , 1 , 1) = 4 × 1 − 4 × 2 + 6 × 1 − 4 × 2 + 4 × 1 2 4 = − 1 8 < 0 . Indeed F ∈ h LSM 4 i ω but F / ∈ C . By Lemma 28, h LSM 2 i ω ⊆ h LSM 4 i ω ∩ C ⊂ h LSM 4 i ω . Unfortunately , this approac h does not seem to extend to showing h LSM 4 i ω ⊂ LSM or ev en h LSM 4 i ⊂ LSM . Neither can we extend the result of Lemma 24 to show that h LSM 4 i ω = h LSM 5 i ω . Ho wev er, w e will ven ture the following, whic h is true for k = 1. Conje ctur e 30 . F or all k ≥ 1, h LSM 2 k i ω = h LSM 2 k +1 i ω ⊂ h LSM 2 k +2 i ω . A consequence of a pro of of Conjecture 30 would b e that LSM 6 = hF i ω for an y finite set of functions F . 12 Restricted unary w eigh ts In this section and the next, w e depart from the conserv ative case, and consider allo wing only restricted classes of unary weigh ts. W e hav e already noted that restricting to nonnegative (as opp osed to arbitrary real) unary w eigh ts pro duces a richer lattice of functional clones, and an apparently ric her complexit y landscap e. Thus, b y further restricting the unary functions av ailable, we might exp ect to further refine the lattice of functional clones. In this section, w e will consider the unary functions that fa vour 1 o ver 0, or vice versa. With a view to studying this setting, let B down 1 (resp ectiv ely B up 1 ) b e the class of unary Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 33 functions U from B 1 suc h that U (1) ≤ U (0) (resp ectively , U (0) ≤ U (1)). By B down ,p 1 and B up 1 w e denote the efficien t versions of these sets. Also denote b y EQ 0 the p ermissive e quality function defined by EQ 0 ( x, y ) = 2 if x = y , and EQ 0 ( x, y ) = 1 otherwise. The first hint that partitioning B 1 in to B up 1 and B down 1 ma y yield new phenomena comes from the observ ation that for any finite subset S of B down ,p 1 , the problem # CSP (EQ 0 , S ) reduces to the ferromagnetic Ising mo del with a consistent external field, for which Jerrum and Sinclair ha ve giv en an FPRAS [25]. (A consisten t field is one that fav ours one of the t w o spins consisten tly ov er every site.) The p oin t here is that # CSP (EQ 0 , S ) is tractable, ev en though EQ 0 / ∈ h NEQ , B 1 i ω . In con trast, b y Theorem 18 or from the arguments in [21], there is a finite subset S of B p 1 suc h that # CSP (EQ 0 , S ) — the ferromagnetic Ising mo del with lo cal fields, with different spins fa v oured at different sites — is # BIS -hard. Of course similar remarks apply to B up ,p 1 . In terms of functional clones, the clone h EQ 0 , B down 1 i ω is not amongst those w e met in § 9: it is incomparable with h NEQ , B 1 i ω , and strictly con tained in h IMP , B 1 i ω . Sp ecifically , we ha v e Lemma 31. (i) NEQ / ∈ h EQ 0 , B down 1 i ω . (ii) EQ 0 / ∈ h NEQ , B 1 i ω . (iii) h EQ 0 , B down 1 i ω ⊂ h EQ 0 , B 1 i ω = h IMP , B 1 i ω , and h EQ 0 , B down ,p 1 i ω ,p ⊂ h EQ 0 , B p 1 i ω ,p = h IMP , B p 1 i ω ,p . Pr o of. Recall the class P of functions with non-negativ e F ourier co efficien ts defined in § 11. Note that P is a pps ω -definable functional clone b y Lemma 26. Note that d EQ 0 (0 , 0) = 6 / 4 and d EQ 0 (1 , 1) = 2 / 4 and d EQ 0 (0 , 1) = d EQ 0 (1 , 0) = 0, so EQ 0 ∈ P . Also, for an y U ∈ B 1 w e alw a ys ha ve b U (0) ≥ 0, but b U (1) = ( U (0) − U (1)) / 2 ≥ 0 if and only if U ∈ B down 1 . So h EQ 0 , B down 1 i ω ⊆ P . F or (i) note that [ NEQ(1 , 1) = − 2 / 4 < 0 so NEQ / ∈ P . F or (ii), Remark 14 sho w ed that all functions in h NEQ , B 1 i ω are pro ducts of atomic form ulas. Therefore, if EQ 0 ∈ h NEQ , B 1 i ω , it m ust hav e one of the three forms U 1 ( x ) U 2 ( y ), U 1 ( x )EQ( x, y ) or U 1 ( x )NEQ( x, y ), where U 1 , U 2 ∈ B 1 . No w note that EQ 0 ( x, y ) is not of any of these. F or (iii), the inclusion h EQ 0 , B down 1 i ω ⊆ h EQ 0 , B 1 i ω is trivial. It is strict since, as we sho w ed ab o v e, h EQ 0 , B down 1 i ω ∩ B 1 = B down 1 . The equalit y follows from Lemma 12(iv). It is interesting to note that the strict inclusion b et w een h EQ 0 , B down 1 i ω ,p and h EQ 0 , B 1 i ω ,p is pro v able, ev en though the gap in t he computational complexity of the related counting problems is only susp ected. The other side of the coin is that tw o functional clones ma y differ, without there being a corresp onding gap in complexit y b etw een the t wo counting CSPs. The main result of the section exhibits this phenomenon in a natural context: the t w o functional clones are incomparable, but there is an appro ximation-preserving reduction from one of the corresp onding coun ting CSPs to the other. This is in teresting, as it demonstrates that it is sometimes necessary , when constructing appro ximation-preserving reductions, to go b ey ond the gadgetry implied b y the clone construction (even with the lib eral notion employ ed here, including limits). The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 34 Recall that ⊕ 3 is the relation { (0 , 0 , 0) , (0 , 1 , 1) , (1 , 0 , 1) , (1 , 1 , 0) } . Lemma 32. ⊕ 3 / ∈ h IMP , B down ,p 1 i ω ,p and IMP / ∈ h⊕ 3 , B down ,p 1 i ω ,p Pr o of. First w e show that ⊕ 3 / ∈ h IMP , B down ,p 1 i ω ,p . By Lemma 7, h IMP , B down ,p 1 i ω ,p ⊆ LSM . Ho w ever, ⊕ 3 / ∈ LSM , since for x = (1 , 1 , 0) and y = (0 , 1 , 1), 0 = ⊕ 3 ( x ∨ y ) ⊕ 3 ( x ∧ y ) < ⊕ 3 ( x ) ⊕ 3 ( y ) = 1 . No w w e sho w that IMP / ∈ h⊕ 3 , B down ,p 1 i ω ,p . Recall the class P of functions with non- negativ e F ourier co efficien ts defined in § 11. Note that P is a pps ω -definable functional clone b y Lemma 26. F or all U ∈ B down 1 w e ha v e b U (0) = ( U (0) + U (1)) / 2 ≥ 0 and b U (1) = ( U (0) − U (1)) / 2 ≥ 0, so U ∈ P . Also, c ⊕ 3 = 1 2 EQ 3 where EQ 3 is the arity 3 equality relation { (0 , 0 , 0) , (1 , 1 , 1) } . So h⊕ 3 , B down ,p 1 i ω ,p ⊆ P . But d IMP(0 , 1) = (1 − 1 − 1) / 4 < 0, so IMP / ∈ P . W e kno w now that IMP is not pps ω -definable in terms of ⊕ 3 and B down ,p 1 . In contrast, we see in the next result that IMP is nevertheless efficien tly reducible to ⊕ 3 and B down ,p 1 . Lemma 33. Ther e is a finite subset S of B down ,p 1 such that # CSP (IMP) ≤ AP # CSP ( ⊕ 3 , S ) Pr o of. First, we need some definitions. Suppose that M is a matrix o ver GF(2) with ro ws V and columns E with | V | = n . F or a column e and a “configuration” σ : V → { 0 , 1 } , define δ e ( σ ) to b e L i ∈ V M i,e σ ( i ), where the addition is ov er GF(2). δ e ( σ ) is the parity of the n um b er of 1s in column e of M that are assigned to 1 by σ . Giv en a parameter y > 0, the Ising p artition function of the binary matroid M represen ted by M is giv en b y Z Ising ( M ; y ) = X σ : V →{ 0 , 1 } Y e ∈ E y 1 ⊕ δ e ( σ ) . No w, from [20, Theorem 3], # CSP (IMP) = AP # BIS . Also, for every efficien tly approx- imable real num b er y > 1, from [23, Theorem 1] there is an AP-reduction from # BIS to the problem of computing Z Ising ( M ; y ), for giv en M . The set of subsets A ⊆ E such that the submatrix corresp onding to A has an ev en n um b er of 1s in ev ery row is called the cycle sp ac e of M and is denoted C ( M ). A standard calculation expresses Z Ising ( M ; y ) in terms of C ( M ). Let w = ( y − 1) / ( y + 1). Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 35 X σ : V →{ 0 , 1 } Y e ∈ E y 1 ⊕ δ e ( σ ) = X σ Y e  y + 1 2 + y − 1 2 ( − 1) δ e ( σ )  =  y + 1 2  | E | X σ Y e  1 + w ( − 1) δ e ( σ )  =  y + 1 2  | E | X σ X A ⊆ E Y e ∈ A w ( − 1) δ e ( σ ) =  y + 1 2  | E | X A ⊆ E w | A | X σ Y e ∈ A ( − 1) δ e ( σ ) =  y + 1 2  | E | X A ∈C ( M ) w | A | 2 n , =  y + 1 2  | E | 2 n X A ∈C ( M ) w | A | . Here is the justification of the penultimate line (why only A ∈ C ( M ) con tribute to the sum, and wh y the factor 2 n ): Supp ose, for a set A ⊆ E , that some row i has has an o dd n um b er of 1’s in columns in A . Then for an y configuration σ 0 : V \ { i } → { 0 , 1 } , one of the con tributions extending σ 0 to domain V con tributes − 1 and the other con tributes +1. On the other hand, if i has an even n um b er of 1’s in A , then the t wo con tributions are the same, so we just get a factor of 2 times the con tribution from the smaller problem, without this ro w. Note that, since y > 1, w e hav e 0 < w < 1. No w the p oin t is that it is easy to express the sum P A ∈C ( M ) w | A | as the solution to an instance of # CSP ( ⊕ 3 , U w ), where U w is the unary function defined b y U w (0) = 1 and U w (1) = w . A v ector x represen ts the choice of A ⊆ E — the j ’th column is in A iff x j = 1. Then the constrain t that the submatrix corresp onding to A has an even n umber of 1s in some ro w, say ro w i , is given b y the linear equation L j : M i,j =1 x j = 0. If this linear equation has just t wo terms then it is an equality , and it can b e represen ted in the CSP instance b y substituting one v ariable for the other. Otherwise, it can b e expressed using conjunctions of atomic form ulas ⊕ 3 . Th us, w e hav e an AP-reduction from # CSP (IMP) to # CSP ( ⊕ 3 , U w ). R emark 34 . Lemma 32 and 33 sho w that, as far as counting CSPs are concerned, the ex- pressibilit y provided by efficien t pps ω -definable functional clones is more limited than AP- reductions. Here w e show that the problem # CSP (IMP) is AP-reducible to a # CSP problem whose constraint language consists of functional constrain ts from ⊕ 3 ∪ B down ,p 1 , but w e aren’t able to express IMP using ⊕ 3 ∪ B down ,p 1 . On the other hand, if the definition of efficien t pps ω - definable functional clones w ere someho w extended to remedy this deficiency , then Lemma 17 w ould probably ha ve to be w eakened. While w e do kno w (from Lemma 33) that there is a finite subset S of B down ,p 1 for which # CSP (IMP) ≤ AP # CSP ( ⊕ 3 , S ), the corresp onding stronger statement from Lemma 17, # CSP (IMP , ⊕ 3 , S ) ≤ AP # CSP ( ⊕ 3 , S ), is unlik ely to b e true since # CSP (IMP , ⊕ 3 , S ) = AP # SA T [20, Theorem 3]. The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 36 R emark 35 . Lemma 32, as with the earlier Lemma 31, sho ws that there ma y b e a rich structure of efficient functional clones hF i ω ,p with B down ,p 1 ⊆ F . By con trast, Theorem 16 and Lemma 7 guaran tee that if B p 1 ⊆ F , then, the only p ossibilities are • hF i ω ,p ⊆ h NEQ , B p 1 i ω ,p , or • h IMP , B p 1 i ω ,p ⊆ hF i ω ,p ⊆ LSM , • or hF i ω ,p = B p . 13 Using few er w eigh ts W e sa w that a finite set of unary w eights suffices to generate the functional clones that w e encoun tered in previous sections. Here we observe that just one or tw o w eights often suffice. In the following prop osition, 1 2 denotes the constant n ullary function that takes v alue 1 2 . Lemma 36. (i) B 1 ⊆ h IMP , 1 2 i ω ( B p 1 ⊆ h IMP , 1 2 i ω ,p ). (ii) B up 1 ⊆ h OR , 1 2 i ω ( B up ,p 1 ⊆ h OR , 1 2 i ω ,p ). (iii) B down 1 ⊆ h NAND , 1 2 i ω ( B down ,p 1 ⊆ h NAND , 1 2 i ω ,p ). Pr o of. Note that (iii) is the same as (ii) with the roles of 0 and 1 reversed, so w e will just pro v e (i) and (ii). W e start with a general construction that w orks for b oth parts (i) and (ii) of the prop osition. Let F b e a binary function and I , J instances of # CSP ( F ). W e assume the sets of v ariables of I and J are disjoin t. The disjoin t sum I ] J of I and J is the instance whose set of v ariables is the union of those of I and J , and F ( x, y ) is in I ] J if and only if F ( x, y ) o ccurs in I or J . The ordinal sum I + ≤ J of I and J is their disjoin t sum along with every atomic form ula F ( x, y ) such that x is a v ariable of I and y is a v ariable of J . Claim. (i) F or any F ∈ B 2 , Z ( I ] J ) = Z ( I ) · Z ( J ). (ii) If F ∈ { IMP , OR } then Z ( I + ≤ J ) = Z ( I ) + Z ( J ) − 1. The first part is trivial. T o show the second part consider an assignmen t ( x , y ) suc h that x , y map the v ariables of I , J , resp ectiv ely , to { 0 , 1 } , and F I + ≤ J ( x , y ) 6 = 0. If F = IMP and any of the comp onen ts of x equals 1, then y = 1 . How ev er, if x = 0 (or y = 1 ) then y (resp. x ) can b e any legitimate assignmen t of J (resp. I ). If F = OR then one of the x , y m ust b e 1 , while the remaining one can b e any assignmen t with F I ( x ) 6 = 0 or F J ( y ) 6 = 0. This completes the pro of of the claim. Denote the instance consisting of a single v ariable without constraints b y 2 , the disjoin t sum of k instances 2 b y 2 k , and the ordinal sum I + ≤ . . . + ≤ I of k copies of instance I by k · I . (Note that the op erator + ≤ is asso ciativ e, so this makes sense.) Let also 1 2 denote the instance consisting of a single nullary 1 2 function, and let 1 2 k denote the sum of k copies of 1 2 . Note that Z ( 2 ) = 2 and Z ( 1 2 ) = 1 2 , justifying the notation. Note that for ev ery natural n um b er a and ev ery p ositiv e in teger ` , Z ( a · 2 ` ) = a 2 ` − a + 1. (This can b e pro ved b y induction on a with base case a = 0, using Part (ii) of the claim for the Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 37 inductiv e step.) F urthermore, for every p ositive integer k , if a 1 , . . . , a k are natural n um b ers then Z ( a 1 · 2 1 + ≤ · · · + ≤ a k · 2 k ) = ( a 1 2 1 + · · · + a k 2 k ) − ( a 1 + · · · + a k ) + 1. (This can b e pro v ed b y induction on k using base case k = 1 using the previous observ ation.) Supp ose G ∈ B 1 and let G ( n ) b e a rational v alued appro ximation to G such that G ( n ) ( a ) 6 = 0 and | G ( n ) ( a ) − G ( a ) | ≤ 2 − n . Assume that this rational approximation is given as a finite binary expansion, so that G ( n ) (0) = 1 2 m ( a 0 + a 1 2 1 + · · · + a k 2 k ) 6 = 0 and G ( n ) (1) = 1 2 m ( b 0 + b 1 2 1 + · · · + b ` 2 ` ) 6 = 0. Let I , J be instances of # CSP ( F ) given b y I = a 1 · 2 1 + ≤ · · · + ≤ a k · 2 k + ≤ ( a 0 + a 1 + · · · + a k − 1) · 2 , J = b 1 · 2 1 + ≤ · · · + ≤ b ` · 2 ` + ≤ ( b 0 + b 1 + · · · + b ` − 1) · 2 . F rom the observ ations ab ov e, Z (( a 0 + · · · + a k − 1) · 2 ) = a 0 + · · · + a k so Z ( I ) = 2 m G ( n ) (0). Similarly , Z ( J ) = 2 m G ( n ) (1). Let V 0 , V 1 b e the v ariables of I , J , resp ectiv ely , and let C 0 (resp ectiv ely , C 1 ) b e the set of pairs ( x, y ) suc h that F ( x, y ) is an atomic formula of I (resp ectiv ely , J ). First supp ose F = IMP. Consider the form ula ψ n = X ( 1 2 ) m   Y ( a,b ) ∈ C 0 ∪ C 1 IMP( a, b )   Y a ∈ V 0 IMP( c, a ) ! Y b ∈ V 1 IMP( b, c ) ! where c is a new v ariable and the sum is ov er all v ariables in V 0 ∪ V 1 . An assignment x : V 0 ∪ V 1 ∪ { c } → { 0 , 1 } can only con tribute to F ψ n if either: x ( c ) = 0 and x ( b ) = 0 for all b ∈ V 1 , or x ( c ) = 1 and x ( a ) = 1 for all a ∈ V 0 . Hence F ψ n (0) = 2 − m Z ( I ) = G ( n ) (0) and F ψ n (1) = 2 − m Z ( J ) = G ( n ) (1). No w suppose F = OR, and let G ∈ B up 1 and G ( n ) b e as b efore, but with the restriction G (1) > G (0). This time, let G ( n ) (0) = 1 2 m ( a 0 + a 1 2 1 + · · · + a k 2 k ) 6 = 0 and G ( n ) (1) − G ( n ) (0) = 1 2 m ( b 0 + b 1 2 1 + . . . + b ` 2 ` ) 6 = 0. Here we are using the fact that G ( n ) (1) − G ( n ) (0) > 0, whic h follo ws from G (1) > G (0) for sufficien tly large n . Let instances I , J b e defined for the v alues a 0 + a 1 2 1 + · · · + a k 2 k , 1 + b 0 + b 1 2 1 + · · · + b ` 2 ` in the similar wa y to b efore (but note the extra 1); and let V 0 , V 1 , C 0 , C 1 again denote the set of v ariables and constraints of I , J . As b efore Z ( I ) = 2 m G ( n ) (0) and Z ( J ) = 2 m ( G ( n ) (1) − G ( n ) (0)) + 1. Let K = I + ≤ J and let C b e the set of scop es of the constraints in K . Consider the formula ψ n = X ( 1 2 ) m   Y ( a,b ) ∈ C OR( a, b )   Y b ∈ V 1 OR( b, c ) ! , where c is a new free v ariable and the sum is ov er all v ariables in V 0 ∪ V 1 . An assignment x : V 0 ∪ V 1 ∪ { c } → { 0 , 1 } can only contribute to F ψ n if either: x ( c ) = 0 and x ( b ) = 1 for all b ∈ V 0 , or x ( c ) = 1. Therefore F ψ n (0) = 2 − m Z ( I ) = G ( n ) (0) and F ψ n (1) = 2 − m Z ( I + ≤ J ) = 2 − m ( Z ( I ) + Z ( J ) − 1) = G ( n ) (1). T o obtain the efficient version of the proposition let M 0 and M 1 b e TMs that, giv en n , compute the first n bits of G (0) and G (1) resp ectively , in time p olynomial in n . Then a TM M 0 that constructs G ε ∈ h F, 1 2 i such that k G ε − G k ∞ < ε w orks as follows. First, it finds the smallest n such that n > log ε − 1 . Then it runs M 0 and M 1 on input n to find G ( n ) (0) and G ( n ) (1). Finally , M 0 outputs the form ula ψ n . The running time of M 0 is the sum of: the time to run M 0 , the time to run M 1 , and time O (log 2 ε − 1 ) to construct ψ n . The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 38 Corollary 37. L et G ∈ B 1 . (F or the r esults on efficient pps -definability assume G ∈ B p 1 .) (i) If G (0) > G (1) and G (1) 6 = 0 then B 1 ⊆ h OR , G, 1 2 i ω , and B p 1 ⊆ h OR , G, 1 2 i ω ,p . (ii) If G (0) < G (1) and G (0) 6 = 0 then B 1 ⊆ h NAND , G, 1 2 i ω , and B p 1 ⊆ h NAND , G, 1 2 i ω ,p . Pr o of. W e prov e (i), as (ii) is quite similar. Let H b e a function in B 1 . If H (0) ≤ H (1) then, b y Prop osition 36, H ∈ h OR , 1 2 i ω (or H ∈ h OR , 1 2 i ω ,p ). Assume H (0) > H (1). There is k such that G (0) k G (1) k > H (0) H (1) . Let H 0 = H /G k . Then H 0 ∈ B up 1 so, b y Prop osition 36, H 0 ∈ h OR , 1 2 i ω . Hence H ∈ h OR , G, 1 2 i ω . Also, if G, H ∈ B p 1 then H 0 ∈ B up ,p 1 so H 0 ∈ h OR , 1 2 i ω ,p . Hence H ∈ h OR , G, 1 2 i ω ,p . Corollary 38. B ⊆ h OR , NAND , 1 2 i ω and B p ⊆ h OR , NAND , 1 2 i ω ,p . Pr o of. Let F ∈ B p . Let U ( x ) = P y NAND( x, y ). Then U (0) = 2 and U (1) = 1 and U ∈ h OR , NAND , 1 2 i ω ,p . By Corollary 37 w e ha ve B p 1 ⊆ h OR , U, 1 2 i ω ,p , and b y Lemma 15, F ∈ h OR , B p 1 i ω ,p . So F ∈ h OR , NAND , 1 2 i ω ,p b y Lemma 4. References [1] R. Ahlswede and D. E. D a ykin , An ine quality for the weights of two families of sets, their unions and interse ctions , Z. W ahrsc h. V erw. Gebiete, 43 (1978), pp. 183–185. [2] A. Billionnet and M. Minoux , Maximizing a sup ermo dular pseudob o ole an function: A p olynomial algorithm for sup ermo dular cubic functions , Discrete Applied Mathemat- ics, 12 (1985), pp. 1 – 11. [3] E. B ¨ ohler, N. Creignou, S. Reith, and H. V ollmer , Playing with Bo ole an blo cks, p art II: Constr aint satisfaction pr oblems , ACM SIGACT Newsletter, 35 (2004), pp. 22–35. [4] E. B ¨ ohler, S. Reith, H. Schnoor, and H. Vollmer , Bases for Bo ole an c o-clones , Inf. Pro cess. Lett., 96 (2005), pp. 59–66. [5] E. Boros and P. L. Hammer , Pseudo-Bo ole an optimization , Discrete Applied Math- ematics, 123 (2002), pp. 155–225. [6] A. A. Bula to v , Complexity of c onservative c onstr aint satisfaction pr oblems , ACM T rans. Comput. Log., 12 (2011), pp. 24:1–24:66. [7] A. A. Bula to v, M. D yer, L. A. Goldber g, M. Jalsenius, M. Jerrum, and D. Richerby , The c omplexity of weighte d and unweighte d #CSP , J. Comput. Syst. Sci., 78 (2012), pp. 681–688. Andrei A. Bulato v, Martin Dyer, Leslie Ann Goldb erg, Mark Jerrum and Colin McQuillan 39 [8] A. A. Bula to v, M. Dyer, L. A. Goldberg, and M. Jerrum , L o g-sup ermo dular functions, functional clones and c ounting CSPs , in 29th International Symp osium on Theoretical Asp ects of Computer Science, Schloss Dagstuhl - Leibniz-Zen trum f ¨ ur In- formatik, 2012, pp. 302–313. [9] A. A. Bula tov and M. Gr ohe , The c omplexity of p artition functions , Theor. Com- put. Sci., 348 (2005), pp. 148–186. [10] J.-Y. Cai, X. Chen, and P. Lu , Non-ne gative weighte d #CSPs: An effe ctive c om- plexity dichotomy , CoRR, abs/1012.5659 (2010). [11] J.-Y. Cai, P. Lu, and M. Xia , Dichotomy for Holant* pr oblems of Bo ole an domain , in Proceedings of the 22nd Annual A CM-SIAM Symp osium on Discrete Algorithms, 2011, pp. 1714–1728. [12] P. Chebolu, L. A. Goldber g, and R. Mar tin , The c omplexity of appr oximately c ounting stable matchings , Theoretical Computer Science, 437 (2012), pp. 35 – 68. [13] X. Chen , Guest c olumn: Complexity dichotomies of c ounting pr oblems , SIGA CT News, 42 (2011), pp. 54–76. [14] D. Cohen and P. Jea v ons , Chapter 8: The c omplexity of c onstr aint languages , in Handb ook of Constrain t Programming, vol. 2 of F oundations of Artificial In telligence, Elsevier, 2006, pp. 245–280. [15] N. Creignou, S. Khanna, and M. Sudan , Complexity Classific ations of Bo ole an Constr aint Satisfaction Pr oblems , SIAM, Philadelphia, P A, USA, 2001. [16] N. Creignou, P. K olaitis, and B. Zanuttini , Structur e identific ation of Bo ole an r elations and plain b ases for c o-clones , Journal of Computer and System Sciences, 74 (2008), pp. 1103–1115. [17] R. de Wolf , A Brief Intr o duction to F ourier Analysis on the Bo ole an Cub e , no. 1 in Graduate Surveys, Theory of Computing Library , 2008. [18] M. D yer, L. A. Goldberg, C. Greenhill, and M. Jerr um , The r elative c om- plexity of appr oximate c ounting pr oblems , Algorithmica, 38 (2004), pp. 471–500. [19] M. Dyer, L. A. Goldberg, and M. Jerrum , The c omplexity of weighte d Bo ole an #CSP , SIAM Journal on Computing, 38 (2009), pp. 1970–1986. [20] , An appr oximation trichotomy for Bo ole an #CSP , Journal of Computer and Sys- tem Sciences, 76 (2010), pp. 267–277. [21] L. A. Goldberg and M. Jerrum , The c omplexity of ferr omagnetic Ising with lo c al fields , Combin. Probab. Comput., 16 (2007), pp. 43–61. The expressibilit y of functions on the Bo olean domain, with applications to Counting CSPs 40 [22] L. A. Goldberg and M. Jerrum , Appr oximating the p artition function of the ferr o- magnetic Potts mo del , in Automata, Languages and Programming, 37th In ternational Collo quium, Pro ceedings, P art I, vol. 6198 of Lecture Notes in Computer Science, Springer, 2010, pp. 396–407. [23] , Appr oximating the Tutte p olynomial of a binary matr oid and other r elate d c ombi- natorial p olynomials , CoRR, abs/1006.5234 (2010). [24] M. Grabisch, J.-L. Marichal, and M. Roubens , Equivalent r epr esentations of set functions , Math. Op er. Res., 25 (2000), pp. 157–178. [25] M. Jerrum and A. Sinclair , Polynomial-time appr oximation algorithms for the Ising mo del , SIAM J. Comput., 22 (1993), pp. 1087–1116. [26] M. Jerrum, L. G. V aliant, and V. V azirani , R andom gener ation of c ombinatorial structur es fr om a uniform distribution , Theoret. Comput. Sci., 43 (1986), pp. 169–188. [27] K.-I. K o and H. Friedman , Computational c omplexity of r e al functions , Theoretical Computer Science, 20 (1982), pp. 323–352. [28] V. K olmogoro v and S. ˇ Zivn ´ y , The c omplexity of c onservative value d CSPs , in Pro ceedings of the 23rd Annual ACM-SIAM Symp osium on Discrete Algorithms, SIAM, 2012, pp. 750–759. [29] C. McQuillan , LSM is not gener ate d by binary functions , CoRR, abs/1110.0461 (2011). [30] M. Mitzenmacher and E. Upf al , Pr ob ability and Computing , Cam bridge Univ ersity Press, Cambridge, 2005. [31] D. M. Topkis , Minimizing a submo dular function on a lattic e , Op erations Researc h, 26 (1978), pp. 305–321. [32] J. Tor ´ an , On the c omplexity of c omputable r e al se quenc es , RAIR O Inform. Th ´ eor. Appl., 21 (1987), pp. 175–180. [33] S. ˇ Zivn ´ y and P. Jea v ons , Classes of submo dular c onstr aints expr essible by gr aph cuts , Constraints, 15 (2010), pp. 430–452. [34] I. Wegener , Complexity The ory , Springer-V erlag, Berlin, 2005. [35] T. Y amakami , Appr oximate c ounting for c omplex-weighte d Bo ole an c onstr aint satis- faction pr oblems , CoRR, abs/1007.0391 (2010). [36] S. ˇ Zivn ´ y, D. Cohen, and P. Jea v ons , The expr essive p ower of binary submo dular functions , Discrete Appl. Math., 157 (2009), pp. 3347–3358.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment