FKT is Not Universal — A Planar Holant Dichotomy for Symmetric Constraints∗

We prove a complexity classification for Holant problems defined by an arbitrary set of complex-valued symmetric constraint functions on Boolean variables. This is to specifically answer the question: Is the Fisher-Kasteleyn-Temperley (FKT) algorithm under a holographic transformation [45] a universal strategy to obtain polynomial-time algorithms for problems over planar graphs that are intractable on general graphs? There are problems that are #P-hard on general graphs but polynomial-time solvable on planar graphs. For spin systems [31] and counting constraint satisfaction problems (#CSP) [26], a recurring theme has emerged that a holographic reduction to FKT precisely captures these problems. Surprisingly, for Holant, we discover new planar tractable problems that are not expressible by a holographic reduction to FKT. In particular, a straightforward formulation of a dichotomy for planar Holant problems along the above recurring theme is false. A dichotomy theorem for #CSP, which denotes #CSP where every variable appears a multiple of d times, has been an important tool in previous work. However the proof for the #CSP dichotomy violates planarity, and it does not generalize to the planar case easily. In fact, due to our newly discovered tractable problems, the putative form of a planar #CSP dichotomy is false when d ≥ 5. Nevertheless, we prove a dichotomy for planar #CSP. In this case, the putative form of the dichotomy is true. (This is presented in Part II of the paper.) We manage to prove the planar Holant dichotomy relying only on this planar #CSP dichotomy, without resorting to a more general planar #CSP dichotomy for d ≥ 3. A special case of the new polynomial-time computable problems is counting perfect matchings (#PM) over k-uniform hypergraphs when the incidence graph is planar and k ≥ 5. The same problem is #P-hard when k = 3 or k = 4, which is also a consequence of our dichotomy. When k = 2, it becomes #PM over planar graphs and is tractable again. More generally, over hypergraphs with specified hyperedge sizes and the same planarity assumption, #PM is polynomial-time computable if the greatest common divisor (gcd) of all hyperedge sizes is at least 5. It is worth noting that it is the gcd, and not a bound on hyperedge sizes, that is the criterion for tractability. ∗A preliminary version appeared in FOCS 2015 [9]. †Department of Computer Science, University of Wisconsin–Madison. Supported by NSF CCF-1714275. ‡School of Computer Science & Information Technology, Northeast Normal University, Changchun, China. Supported by National Natural Science Foundation of China (Grant No. 61872076). §School of Informatics, University of Edinburgh. This project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 947778). ¶Blocher Consulting.

For four decades, the FKT algorithm stood as the polynomial-time algorithm for any counting problem over planar graphs that is #P-hard over general graphs. Then Valiant introduced matchgates [43,42] and holographic reductions to the FKT algorithm [45,44]. These reductions differ from classical ones by introducing quantum-like superpositions. This novel technique extended the reach of the FKT algorithm and produced polynomial-time algorithms for a number of problems for which only exponential-time algorithms were previously known.
Since the new polynomial-time algorithms appear so exotic and unexpected, and since they solve problems that appear so close to being #P-hard, they challenge our faith in the well-accepted conjecture that P = NP. Quoting Valiant [44]: "The objects enumerated are sets of polynomial systems such that the solvability of any one member would give a polynomial time algorithm for a specific problem. . . . the situation with the P = NP question is not dissimilar to that of other unresolved enumerative conjectures in mathematics. The possibility that accidental or freak objects in the enumeration exist cannot be discounted if the objects in the enumeration have not been studied systematically." Indeed, if any "freak" object exists in this framework, it would collapse #P to P.
Therefore, over the past 10 to 15 years, this technique has been intensely studied in order to gain a systematic understanding of the limit of the trio of holographic reductions, matchgates, and the FKT algorithm [42,6,7,15,46,16,32,38,37]. Without settling the P versus #P question, the best hope is to achieve a complexity classification. This program finds its sharpest expression in a complexity dichotomy theorem, which classifies every problem expressible in a framework as either solvable in P or #P-hard, with nothing in between.
Out of this work, a strong theme has emerged. For a wide variety of problems, such as those expressible as a #CSP, holographic reductions to the FKT algorithm is a universal technique for turning problems that are #P-hard in general to P-time solvable over planar graphs. In fact, a preponderance of evidence suggests the following putative classification of all counting problems defined by local constraints into exactly three categories: (1) those that are P-time solvable over general graphs; (2) those that are P-time solvable over planar graphs but #P-hard over general graphs; and (3) those that remain #P-hard over planar graphs. Moreover, category (2) consists precisely of those problems that are holographically reducible to the FKT algorithm. This theme is so strong that it has become an intuitive and trusty guide for us when we investigate unknown problems and plan proof strategies. In fact, many of the results in the present paper are proved in this way. However, one is still left wondering whether the FKT algorithm is universal, or more precisely, is the combined algorithmic power of holographic reductions, matchgates, and the FKT algorithm sufficient to capture all tractable problems over planar graphs that are intractable in general?
We list some of the supporting evidence for this putative classification. These date back to the classification of the complexity of the Tutte polynomial [48,47]. It has also been an unfailing theme in the classification of spin systems and #CSP [31,19,14,26]. However, these frameworks do not capture all locally specified counting problems. Some natural problems, such as counting perfect matchings (#PM), are not expressible as a point on the Tutte polynomial or a #CSP, and #PM is provably not expressible within the special case of vertex assignment models [24,23,40]. However, this is the problem for which FKT was designed, and is the basis of Valiant's matchgates and holographic reductions.
A refined framework, called Holant problems [17], was proposed to address this issue. It is an edge assignment model. It naturally encodes and expresses #PM as well as Valiant's matchgates and holographic reductions. Thus, Holant is the proper framework in which to study the power of holographic algorithms. It is also more general than #CSP in that any #CSP problem is a special case of a Holant problem, and a complete complexity classification for Holant problems implies one for #CSP.
In this paper, we classify for the first time the complexity of Holant problems over planar graphs with an arbitrary set of symmetric complex-valued constraint functions. Our result generalizes both the dichotomy for Holant [27,11] and the dichotomy for planar #CSP [19,26]. Surprisingly, we discover new planar tractable problems that are not expressible by a holographic reduction to matchgates and FKT. To the best of our knowledge, this is the first primitive extension since FKT to a problem solvable in P over planar instances but #P-hard in general. We consider this extension primitive in the sense that it provably cannot be obtained by applying any holographic reduction to matchgates and FKT. Furthermore, our dichotomy theorem says that this completes the picture: there are no more undiscovered extensions for problems expressible in this framework, unless #P collapses to P. In particular, the putative form of the planar Holant dichotomy is false.
Before stating our main theorem, we give a brief description of the Holant framework [17]. Fix a set of local constraint functions F. A signature grid Ω = (G, π) is a tuple, where G = (V, E) is a graph, π labels each v ∈ V with a function f v ∈ F with input variables from the incident edges E(v) at v. Each f v maps {0, 1} deg(v) to C. We consider all 0-1 edge assignments. An assignment σ for every e ∈ E gives an evaluation v∈V f v (σ | E(v) ), where σ | E(v) denotes the restriction of σ to E(v). The counting problem on the instance Ω is to compute ( 1.1) holographic reductions to FKT and those newly discovered. Explicit criteria for these are also proved in this paper. Let us meet some new tractable problems. We consider some orientation problems, which are Holant problems after a complex-valued holographic transformation. 1 Given a planar graph, we allow two kinds of vertices. The first kind can be either a sink or a source while the second kind must have exactly one incoming edge. The goal is to compute the number of orientations satisfying these constraints. This problem can be expressed in the Holant framework under a Ztransformation, where Z = 1 1 i −i . It can be shown that this is equivalent to the Holant problem on the edge-vertex incidence graph where we assign the Disequality function to every edge, we assign either the Equality function or the ExactOne function to each vertex. Suppose vertices assigned Equality functions all have degree k. If k = 2, then this problem can be solved by FKT. We show that this problem is #P-hard if k = 3 or k = 4, but is tractable again if k ≥ 5. The algorithm involves a recursive procedure that simplifies the instance until it can be solved by known algorithms, including FKT. The algorithm crucially uses global topological properties of planar graphs, in particular Euler's characteristic formula. If the graph is not planar, then this algorithm does not work, and indeed the problem is #P-hard over general graphs.
More generally, we allow vertices of arbitrary degrees to be assigned Equality. If all the degrees are at most 2, then the problem is tractable by the FKT algorithm. Otherwise, the complexity depends on the greatest common divisor (gcd) of the degrees. The problem is tractable if gcd ≥ 5 and #P-hard if gcd ≤ 4. It is worth noting that the criterion for tractability is not a degree lower bound. Moreover, the planarity assumption and the degree rigidity pose a formidable challenge in the hardness proofs for gcd ≤ 4.
If the graph is bipartite with Equality functions assigned on one side and ExactOne functions on the other, then this is the problem of #PM over hypergraphs with planar incidence graphs. Our results imply that the complexity of this problem depends on the gcd of the hyperedge sizes. The problem is computable in polynomial time when gcd ≥ 5 and is #P-hard when gcd ≤ 4 (assuming there are hyperedges of size at least 3). For a formal statement, see Theorem 7. 17.
Most of the reductions in previous Holant dichotomy theorems [27,11] do not hold for planar graphs, so we are forced to develop new techniques and formulate new proof strategies. In particular, an important ingredient in previous proofs is the #CSP d dichotomy by Huang and Lu [27]. Here #CSP d denotes #CSP where every variable appears a multiple of d times. The very first step in the #CSP d dichotomy proof uses a pinning technique. In this proof multiple copies of a graph are created and vertices are connected across different copies. But this construction fundamentally violates planarity. Moreover, as a consequence of the new dichotomy, this violation of planarity is unavoidable. Owing to our newly discovered tractable problems, the putative form of a planar #CSP d dichotomy is false when d ≥ 5. Nevertheless, we prove a dichotomy for planar #CSP 2 for which the putative form is true (which is lucky for us but not obvious in hindsight). Obtaining a dichotomy for planar #CSP 2 is essential because it captures a significant fraction of planar Holant problems either directly or through reductions. We manage to prove the planar Holant dichotomy without appealing to planar #CSP d for d ≥ 3.
The proof of the planar #CSP 2 dichotomy comprises the entire Part II of this paper. A 1 This transformation is Z = . It is common that one problem can be transformed to another over C while one or both problems are specified by real-valued constraint functions, and provably no transformation exists over R. Thus it is both natural and proper to study the classification question over complex-valued constraint functions. For example, the integer-valued orientation problem studied here is complex weighted if expressed directly as Holant. brief outline of this proof of the planar #CSP 2 dichotomy is given in Section 5 of Part I. Among the concepts and techniques introduced are some special tractable families of constraint functions specific to the #CSP 2 framework. We also introduce a derivative operator ∂ and its inverse operator integral to streamline the proof argument. It also uses some elementary properties of cyclotomic fields . We began this project expecting to prove the putative form of the planar Holant dichotomy. It was determined that a planar #CSP d dichotomy in the putative form would be both a more modest, and thus hopefully more attainable, intermediate step as well as a good launch station for the final goal. However after some attempt, even the planar #CSP d dichotomy appeared too difficult to achieve, and so we scaled back the ambition to prove just a planar #CSP 2 dichotomy. Luckily, a successful #CSP 2 dichotomy can carry most of the weight of a full #CSP d dichotomy, and, as it turned out, the putative form of the planar #CSP 2 dichotomy is true while that of planar #CSP d is not. Ironically, many steps of our proof in this paper were guided by the putative form of the complexity classification. The discovery of the new tractable problems changed the original plan, but also helped complete the picture.
Coming back to the challenge of the P vs. NP question posed by Valiant's holographic algorithms, we venture the opinion that the dichotomy theorem provides one satisfactory answer. Indeed, it would be difficult to conceive a world where #P is P, and yet all this algebraic theory can somehow maintain a consistent, sharp but faux division where there is none. (Consider the following Gedankenexperiment: #P is really equal to P, but Nature conspires against us and keeps scores on how much of #P we have learned to be in P. For every problem in this broad class that is yet unknown to be in P we are allowed to prove it #P-hard-a superfluous notion really, since every problem in #P, being equal to P, is #P-hard. But for every problem in this broad class already known to be in P, it makes sure that our proof for #P-hardness on that problem fails, thus preventing us from making the ultimate discovery. This seems to us most implausible. ) After the preliminary version of the present paper [9] appeared in FOCS 2015, more progress has been made in the classification program of counting problems [36,1,20,2,8]. Ironically, if we go back to the #CSP setting, then holographic algorithms with matchgates become universal again [8], despite the fact that it is designed for the Holant setting. This generalizes the previous classification theorem [26] from symmetric constraint functions to general (not necessarily symmetric) constraint functions. Nevertheless, many problems are still left open, most of which relate to generalizing results in the current paper to asymmetric (i.e., not necessarily symmetric) signatures. For example, a #CSP 2 dichotomy has been proved for asymmetric signatures (by combining results from [36] and [20]). But it is open in the planar setting. Also, classifying all Holant problems for general asymmetric complex-weighted signatures remains elusive. Partial results have been obtained for Holant c problems [2] or Holant problems with non-negatively weighted signatures [36].

Problems and Definitions
The framework of Holant problems is defined for functions mapping any [q] n → R for a finite q and some commutative semiring R. In this paper, we investigate complex-weighted Boolean Holant problems, that is, all functions are of the form [2] n → C. For consideration of models of computation, functions take complex algebraic numbers.
Graphs may have self-loops and parallel edges. A graph without self-loops or parallel edges is a simple graph. Fix a set of local constraint functions F. A signature grid Ω = (G, π) consists of a graph G = (V, E), where π assigns to each vertex v ∈ V and its incident edges some f v ∈ F and its input variables. We say that Ω is a planar signature grid if G is planar, where the variables of f v are ordered counterclockwise starting from an edge specified by π. The Holant problem on instance Ω is to evaluate Holant(Ω; F) = σ v∈V f v (σ | E(v) ), a sum over all edge assignments σ : E → {0, 1}, where E(v) denotes the incident edges of v and σ | E(v) denotes the restriction of σ to E(v). We write G in place of Ω when π is clear from context.
A function f v can be represented by listing its values in lexicographical order as in a truth table, which is a vector in C 2 deg(v) , or as a tensor in (C 2 ) ⊗ deg (v) . A function f ∈ F is also called a signature. A symmetric signature f on n Boolean variables can be expressed as [f 0 , f 1 , . . . , f n ], where f w is the value of f on inputs of Hamming weight w. An example is the Equality signature = n of arity n, which is [1, 0, . . . , 0, 1] with n − 1 zero entries.
In this paper, we prove complexity classifications for counting problems specified by symmetric signatures. A Holant problem is parametrized by a set of signatures. The problem Pl-Holant(F) is defined similarly using a planar signature grid. A signature f of arity n is degenerate if there exist unary signatures u j ∈ C 2 (1 ≤ j ≤ n) such that f = u 1 ⊗ · · · ⊗ u n . A symmetric degenerate signature has the form u ⊗n . Replacing such signatures by n copies of the corresponding unary signature does not change the Holant value.
Replacing a signature f ∈ F by a constant multiple cf , where c = 0, does not change the complexity of Holant(F). In this paper, we may say we obtain a signature f when in fact we have obtained a signature cf for some c = 0. It introduces a global nonzero factor c n to Holant(Ω; F), where n is the number of occurrences of cf in Ω.
We allow F to be an infinite set. For Pl-Holant(F) to be tractable, the problem must be computable in polynomial time even when the description of the signatures in the input Ω are included in the input size, where a local constraint function f is specified by its signature entries. In contrast, we say Pl-Holant(F) is #P-hard if there exists a finite subset of F for which the problem is #P-hard. We say a signature set F is tractable (resp. #P-hard) if the corresponding counting problem Pl-Holant(F) is tractable (resp. #P-hard). Similarly for a signature f , we say f is tractable (resp. #P-hard) if {f } is. We denote polynomial time Turing reduction and equivalence by ≤ T and ≡ T respectively.

Holographic Reduction
To introduce the idea of holographic reductions, it is convenient to consider bipartite graphs. For a general graph, we can always transform it into a bipartite graph while preserving the Holant value, as follows. For each edge in the graph, we replace it by a path of length two. (This operation is called the 2-stretch of the graph and yields the edge-vertex incidence graph.) Each new vertex is assigned the binary Equality signature (= 2 ) = [1, 0, 1].
We use Holant (F | G) to denote the Holant problem over signature grids with a bipartite graph H = (U, V, E), where each vertex in U or V is assigned a signature in F or G, respectively. Signatures in F are considered as row vectors (or covariant tensors); signatures in G are considered as column vectors (or contravariant tensors) [22]. Similarly, Pl-Holant (F | G) denotes the Holant problem over signature grids with a planar bipartite graph.
For a 2-by-2 matrix T and a signature set F, define T F = {g | ∃f ∈ F of arity n, g = T ⊗n f }, and similarly for FT . Whenever we write T ⊗n f or T F, we view the signatures as column vectors; similarly for f T ⊗n or FT as row vectors. In the special case that T = 1 1 1 −1 , we also define T F = F.
Let T be an invertible 2-by-2 matrix. The holographic transformation defined by T is the following operation: given a signature grid Ω = (H, π) of Holant (F | G), for the same bipartite graph H, we get a new grid Ω ′ = (H, π ′ ) of Holant FT | T −1 G by replacing each signature in F or G with the corresponding signature in FT or T −1 G. [45]). If T ∈ C 2×2 is an invertible matrix, then we have Holant(Ω; F | G) = Holant(Ω ′ ; FT | T −1 G).

Theorem 2.2 (Valiant's Holant Theorem
Therefore, an invertible holographic transformation does not change the complexity of the Holant problem in the bipartite setting. Furthermore, there is a special kind of holographic transformations, the orthogonal transformations, that preserve the binary equality and thus can be used freely in the standard setting. An important definition involving a holographic transformation is the notion of a signature set being transformable. Definition 2. 4. We say a signature set F is C -transformable if there exists a T ∈ GL 2 (C) such that [1,0,1]T ⊗2 ∈ C and F ⊆ T C .
This definition is important because if Pl-Holant(C ) is tractable, then Pl-Holant(F) is tractable for any C -transformable set F.

Counting Constraint Satisfaction Problems
We can define the framework of counting constraint satisfaction problems (#CSP) in terms of the Holant framework. An instance of #CSP(F) has the following bipartite view. Create a vertex for each variable and each constraint. Connect a variable vertex to a constraint vertex if the variable appears in the constraint. This bipartite graph is also known as the constraint graph. Each variable can be viewed as an Equality function. In this way we obtain a signature grid. A variable can take values 0 or 1, and the Equality function forces all incident edges to take the same value. Under this view, we see that #CSP(F) ≡ T Holant (EQ | F ), where EQ = {= 1 , = 2 , = 3 , . . . } is the set of Equality signatures of all arities. By restricting to planar constraint graphs, we have the planar #CSP framework, which we denote by Pl-#CSP. The construction above also shows that Pl-#CSP(F) ≡ T Pl-Holant (EQ | F ). (

2.2)
For the second equivalence the reduction from left to right is trivial. For the other direction, we take a signature grid for the problem on the right and create a bipartite signature grid for the problem on the left such that both signature grids have the same Holant value up to an easily computable factor. If two signatures in F are assigned to adjacent vertices, then we subdivide all edges between them and assign the binary Equality signature = 2 ∈ EQ d to all new vertices. Suppose Equality signatures = n , = m ∈ EQ d are assigned to adjacent vertices connected by k edges. If n = m = k, then we simply remove these two vertices. The Holant of the resulting signature grid differs from the original by a factor of 2. Otherwise, we contract all k edges and assign = n+m−2k ∈ EQ d to the new vertex.

Realization
One basic notion used throughout the paper is realization. We say a signature f is realizable or constructible from a signature set F if there is a gadget with some dangling edges such that each vertex is assigned a signature from F, and the resulting graph, when viewed as a black-box signature with inputs on the dangling edges, is exactly f . If f is realizable from a set F, then we can freely add f into F while preserving the complexity. (Often it is convenient to ignore a nonzero constant factor for the signature realized by a gadget construction; however at other times it is more convenient to keep the exact value so that claims of a particular construction can be more readily verified numerically.) Formally, such a notion is defined by an F-gate [19]. An F-gate is similar to a signature grid (G, π) for Holant(F) except that G = (V, E, D) is a graph with some dangling edges D. The dangling edges define external variables for the F-gate. (See Figure 1 for an example. ) We denote the regular edges in E by 1, 2, . . . , m and the dangling edges in D by m + 1, . . . , m + n. Then we can define a function Γ for this F-gate as Γ(y 1 , . . . , y n ) = x 1 ,. ..,xm∈{0,1} H(x 1 , . . . , x m , y 1 , . . . , y n ), where (y 1 , . . . , y n ) ∈ {0, 1} n is an assignment on the dangling edges and H(x 1 , . . . , x m , y 1 , . . . , y n ) is the value of the signature grid on an assignment of all edges in G, which is the product of evaluations at all internal vertices. We also call this function Γ the signature of the F-gate.
An F-gate is planar if the underlying graph G is a planar graph, and the dangling edges, ordered counterclockwise corresponding to the order of the input variables, are in the outer face in a planar embedding. A planar F-gate can be used in a planar signature grid as if it is just a single vertex with the particular signature.
Using the idea of planar F-gates, we can reduce one planar Holant problem to another. Suppose g is the signature of some planar F-gate. Then Pl-Holant(F ∪{g}) ≤ T Pl-Holant(F). The reduction is simple. Given an instance of Pl-Holant(F ∪ {g}), by replacing every appearance of g by the Fgate, we get an instance of Pl-Holant(F). Since the signature of the F-gate is g, the Holant values for these two signature grids are identical.
Although our main result is about symmetric signatures, some of our proofs utilize asymmetric signatures. When a gadget has an asymmetric signature, we indicate the ordering of the variables by placing a hollow diamond on the edge corresponding to the first input in the figure. The remaining inputs are ordered counterclockwise around the vertex. (See Figure 8 for two examples. ) We note that even for a very simple signature set F, the signatures for all F-gates can be quite complicated and expressive.

Tractable Signature Sets
We define the sets of signatures that were previously known to be tractable. All quotations of results and definitions from [11,26,12], both in this section and throughout the paper, refer to the full versions of these papers.

Affine Signatures
Definition 2.5 (Definition 3.1 in [18]). A k-ary function f (x 1 , . . . , x k ) is affine if it has the form λ · χ Ax=b · i n j=1 ⟨v j ,x⟩ , where λ ∈ C, A is a matrix over the two-element finite field F 2 , b and v j are vectors over F 2 , x = (x 1 , x 2 , . . . , x k ) T , and χ is a 0-1 indicator function such that χ Ax=b is 1 iff Ax = b. Note that the dot product v j , x is calculated over F 2 with output in {0, 1}, and the summation n j=1 on the exponent of i = √ −1 is evaluated as a sum mod 4 of 0-1 terms. We use A to denote the set of all affine functions.
Notice that there is no restriction on the number of rows in the matrix A. It is permissible that A is the zero matrix so that χ Ax=0 = 1 holds for all x. An equivalent way to express the exponent of i is as a quadratic polynomial where all cross terms have an even coefficient (cf. [5]) . It is known that the set of non-degenerate symmetric signatures in A is precisely the nonzero signatures (λ = 0 in the expressions below) in F 1 ∪ F 2 ∪ F 3 with arity at least 2, where F 1 , F 2 , and F 3 are three families of signatures defined as . . , r = 0, 1, 2, 3 , . . , r = 0, 1, 2, 3 , and . . , r = 0, 1, 2, 3 . We explicitly list these signatures up to an arbitrary constant multiple from C: For a function f ∈ P of arity n, since the product of unary, binary equality, and binary disequality functions in its definition can be on separate and overlapping choices of subsets of n variables, f in general is not symmetric. For example, P contains weighted binary disequality functions f (x, y), where f (0, 0) = f (1, 1) = 0, f (0, 1) = a, and f (1, 0) = b. We denote this by its truth table (0, a, b, 0). An alternate definition for P, implicit in [21], is the tensor closure of signatures with support on two complementary bit vectors. It can be shown (see [27, Lemma 2.2]) that if f is a symmetric signature in P, then f is either degenerate, binary Disequality = 2 , or [a, 0, . . . , 0, b] for some a, b ∈ C.

Matchgate Signatures
Matchgates were introduced by Valiant [43,42] to give polynomial-time algorithms for a collection of counting problems over planar graphs. As the name suggests, problems expressible by matchgates can be reduced to computing a weighted sum of perfect matchings. The latter problem is tractable over planar graphs by Kasteleyn's algorithm [30], a.k.a. the FKT algorithm [41,29]. These counting problems are naturally expressed in the Holant framework using matchgate signatures. We use M to denote the set of all matchgate signatures; thus Pl-Holant(M ) is tractable. The function [0, 1, 0, . . . , 0] of arity k belongs to M , and is called the ExactOne k function. More generally, we can define ExactOne k:a 1 ,. ..,a k as a weighted version of ExactOne k , which takes value a i if the input has Hamming weight 1 and x i = 1; the function outputs 0 on all other inputs. This function also belongs to M .
Holographic transformations extend the reach of the FKT algorithm even further, as stated below.
Roughly speaking, the symmetric matchgate signatures have 0 for every other entry (which is called the parity condition), and form a geometric progression with the remaining entries.
Another useful way to view the symmetric signature in M is via a low tensor rank decomposition. To state these low rank decompositions, we use the following definition. Definition 2. 9. Let S n be the symmetric group of degree n. Then for positive integers t and n with t ≤ n and unary signatures v, v 1 , . . . , v where the ordered sequence (u 1 , u 2 , . . . , u Proposition 2. 10. Let f be a symmetric signature in M of arity n. Then there exist a, b, λ ∈ C such that f takes one of the following forms: n is even, 2[a n , 0, a n−2 b 2 , 0, . . . , 0, ab n−1 , 0] n is odd; . . , 0, ab n−1 , 0] n is even, . While the symmetric signature notation such as [0, λ, 0, . . . , 0] is intuitive, the notation of tensor powers and Sym t n (−; −) will be convenient for holographic transformations. The understanding of matchgates was further developed in [16], which characterized, for every symmetric signature, the set of holographic transformations under which the transformed signature becomes a matchgate signature.

Vanishing Signatures
The fact that V is closed under orthogonal transformations follows directly from the next lemma. (Lemma 29, p.1690 in [11]). For a symmetric signature f of arity n, σ ∈ {+, −}, and an orthogonal matrix

Lemma 2.14
The following characterization of vanishing signature sets holds.
To prove this theorem, two more definitions were made, which complement the previous two definitions because of Corollary 2. 18.
The following lemma gives a simple formula for the recurrence degree of a signature when expressed under the Z transformation. (Lemma 30, p. 1690 of [11]). Suppose f is a symmetric signature of arity n. Let

Lemma 2.19
d iff all nonzero entries off are among the first d entries in its symmetric signature notation.
The following lemma is a reduction involving binary signatures in the Z basis. It is used in Section 4 to help determine what binary signatures can mix with vanishing signatures. The original statement is for general graphs, but the proof clearly holds for planar graphs as well. (Lemma 65, p. 1724 in [11]). Let x ∈ C. If x = 0, then for any set F containing

Lemma 2.20
for any v ∈ C.

Some Known Dichotomies
In all other cases the problem is #P-hard.
Theorem 2.24 is stated in an explicit form that is easy to apply. Conceptually, it can be restated as Theorem 2.24 ′ , which supports the putative form of the Pl-#CSP d dichotomy. We denote by M = HM the set of Matchgate signatures M transformed by the Hadamard basis Further suppose that f is a non-degenerate, symmetric, complex-valued binary signature in Boolean variables. Then Pl-Holant (f | G) is #P-hard unless f satisfies one of the following conditions, in which case, the problem is computable in polynomial time: Lastly, we quote the Pl-#CSP dichotomy for symmetric signatures. It also supports the putative form of a dichotomy, which states that holographic algorithms using matchgates followed by the FKT algorithm is a universal strategy.  An example of a redundant matrix is the signature matrix of a symmetric arity 4 signature. Definition 2.27 (Definition 33, p. 1693 in [11]). The signature matrix of a symmetric arity 4

Redundant Signature Matrices and Related Hardness Results
This definition extends to an asymmetric signature g as g 0000 g 0010 g 0001 g 0011 g 0100 g 0110 g 0101 g 0111 g 1000 g 1010 g 1001 g 1011 g 1100 g 1110 g 1101 g 1111 where g wxyz is the output of g on input wxyz. When we present g as an F-gate, we order the four external edges ABCD counterclockwise. In M g , the row index bits are ordered AB and the column (a) A counterclockwise rotation: Hollow diamonds inside and outside the box mark the first variable before and after the rotation. Other variables are cyclically ordered.  index bits are ordered DC, in the reverse order. We order them in this way so that when we link two arity 4 F-gates with signature matrices A and B, the resulting signature matrix is the matrix product AB.
If M g is redundant, we also define the compressed signature matrix of g in C 3×3 as Lemma 2.28 (Corollary 3.8 in [26]). Let f be an arity 4 signature with complex weights. If M f is redundant and M f is nonsingular, then Pl-Holant(f ) is #P-hard.
Furthermore, by combining Lemma 2.28 with Lemma 39 (p. 1702) in [11], we obtain the planar version of Corollary 40 (p. 1703) in [11]. 29. Let f be an arity 4 signature with complex weights. If there exists a nonsingular matrix In the course of working with symmetric signatures, we sometimes construct gadgets with signatures that are not symmetric. The power of Lemma 2.28 and Corollary 2.29 is that they apply to such signatures provided the corresponding signature matrix is redundant. Starting from a signature with a non-redundant signature matrix, sometimes one can apply a rotation to obtain a signature with a redundant signature matrix (see Figure 2).

A -, P-, and M -transformable Signatures
In this section, we investigate the properties of A -, P-, and M -transformable signatures. Throughout, we define α = 1+i √ 2 = √ i = e πi 4 and use O 2 (C) to denote the group of 2-by-2 orthogonal matrices over C. While the main results in this section assume that the signatures involved are symmetric, we note that some of the lemmas also hold without this assumption.

Characterization of A -and P-transformable Signatures
A -and P-transformable signatures have been well studied in previous work [11,12]. We summarize some useful notions and lemmas here. The three sets A 1 , A 2 , and A 3 capture all symmetric Atransformable signatures.
There is a similar characterization for P-transformable signatures.
Definition 3. 4. A signature f of arity n is in P 1 if it is symmetric and there exist an H ∈ O 2 (C) and a nonzero c ∈ C such that f = cH ⊗n We define P 2 = A 2 . For k ∈ {1, 2}, when such an H exists, we say that f ∈ P k with transformation H. If f ∈ P k with I 2 , then we say f is in the canonical form of P k . Lemma 3.5 (Lemma 59, p. 1717 in [11]). Let f be a non-degenerate symmetric signature. Then These classes A i and P j contain only symmetric functions. These are transformed classes based on (symmetric functions in) A and P. They are not subsets of A and P respectively. However, A and P do contain nonsymmetric functions. The same remark applies to the classes M k for k = 1, 2, 3, 4 from Definition 3.9 in subsection 3.2, in relation to M .
We can define

Characterization of M -transformable Signatures
the stabilizer group of M . Technically this set is the left stabilizer group of M , but it is easy to see that the left and right stabilizer groups of M coincide. It is easy to prove that We use four sets to characterize the M -transformable signatures. The function Sym t n (−; −) is defined in Definition 2.9. Definition 3. 9. A signature f of arity n is in M k for k = 1, 2, 3, 4, if it is symmetric and there exist an H ∈ O 2 (C) and nonzero constants c, γ ∈ C such that f has the form (k) as follows: . . , 0], and form (4)    We note that M 1 ⊂ A 1 ⊂ P 1 and A 2 = P 2 ⊂ M 2 . Also note that P 1 ∩M 2 ⊆ A 1 . See Figure 3 for a visual description of the relationships among these sets.
Next we show that M k for k = 1, 2, 3, 4 captures all M -transformable signatures.
Proof. Assume that f is M -transformable of arity n. By applying Lemma 3.8 to {f }, we have f ∈ 1 1 i −i M or there exists an H ∈ SO 2 (C) such that f ∈ HM . Proposition 2.10 lists the symmetric signatures in M . Since we are only interested in non-degenerate signatures, we only consider a, b, and λ that are nonzero. Now we consider the possible cases.
Then we have the form  15. To show that Z ⊗n g is not A -, P-, M -transformable, we only need to show that 3.5 and 3.11, and the fact that M 1 ⊂ A 1 ⊂ P 1 and A 2 = P 2 ⊂ M 2 . See Figure 3.
We first show that Z ⊗n g ∈ P 1 ∪ M 2 ∪ A 3 . We say a signature f = [f 0 , f 1 , . . . , f n ] satisfies a second order recurrence of type a, b, c if af k − bf k+1 + cf k+2 = 0 for 1 ≤ k ≤ n − 2, for some a, b and c not all zero. Symmetric signatures in A , P, M all satisfy second order recurrences, and this property is invariant under a holographic transformation. So signatures in P 1 ∪ M 2 ∪ A 3 also satisfy second order recurrences. The recurrence af k − bf k+1 + cf k+2 = 0 has characteristic equation a − bX + cX 2 = 0. Suppose Z ⊗n g ∈ P 1 ∪ M 2 ∪ A 3 , then for some H ∈ O 2 (C), f = H ⊗n Z ⊗n g = (HZ) ⊗n g has the canonical form given in Definitions 3.4, 3.9 or 3. 1. As such, f satisfies a second order recurrence, and so does (Z −1 ) ⊗n f . We have HZ = ZD or ZD [ 0 1 1 0 ] for some non-singular diagonal D.
We assume the former; the proof is similar for the latter.
Next suppose n = 3, and we show that up to a nonzero constant. It is easy to check that (Z −1 ) ⊗n f satisfies a second order recurrence whose two eigenvalues sum to zero. However For ⊗3 . Thus the weight 1 and weight 2 entries of (Z −1 ) ⊗n f are either equal or sum to zero. For ). Again f = ((cH) −1 Z) ⊗n g = Z ⊗n g ′ for some g ′ having the same form as g or its reversal. Then g ′ = (Z −1 ) ⊗n f is the signature [n, n − 2, . . . , −(n − 2), −n], up to a nonzero constant. The weight 1 entry and weight n − 1 entry have the same absolute value. By the form of g ′ this is a contradiction.
Finally if Z ⊗n g ∈ M 4 , then by Lemma 3.10, Z ⊗n g = cZ ⊗n f , for some nonzero constant c ∈ C, and f = Sym n−1 n ( In either case, after canceling out Z, the weight 0 entry is 0 in the expression but not so in g; a contradiction.

Mixing with Vanishing Signatures
In this section, we prove some hardness results for vanishing signature sets when augmented by other signatures. We first consider the mixing of vanishing signatures with unary and binary signatures. Over general graphs, these cases are handled by Lemma 44 and Lemma 45 (p. 1708) in [11]. One can check that the hardness in Lemma 44 in [11] holds for planar graphs. We state the planar version of Lemma 44 in [11] and provide a proof for completeness. Specifically, the reduction to obtain the signature f ′′ is planar and Pl-Holant(f ′′ ) is #P-hard by Theorem 2.22.
Suppose v = u ⊗m is a symmetric degenerate signature for some unary signature u and some integer m ≥ 1. If u is not a multiple of [1, σi], then Pl-Holant(f, v) is #P-hard.

Proof.
We consider σ = + since the other case is similar. Since f ∈ V + , we have n > 2d ≥ 4. Under a holographic transformation by Z, we have 19. We This signature is on the right hand side of the bipartite Holant problem Pl- With two more self-loops, we get [1, 0] ⊗(n−2d) , also on the right.
We claim that we can use [1,0] up to a nonzero factor b m . We repeat this process until we get a tensor power [1, 0] ⊗ℓ for some ℓ ≤ m. We can do a similar construction if m > n − 2d. Repeat this process, which is a subtractive Euclidean algorithm. Halt upon getting both [1,0] the latter being counting Eulerian Orientations over planar 4-regular graphs, which is #P-hard by Corollary 2.29 (or more directly by [26,Theorem 3.7]). Thus, Pl-Holant(f, v) is #P-hard.
The last problem is #P-hard by Corollary 2.23 after dividing by √ c. Next we prove the planar version of Lemma 45 (p. 1708) in [11] using Lemma 4.2. We have to rule out the planar tractable case f ∈ M ± 4 . Also note that if f ∈ V ± is a symmetric non-degenerate signature, then f has arity at least 3. This is because a unary signature is degenerate, and if a binary symmetric signature f is vanishing, then its vanishing degree is greater than 1, hence at least 2, and therefore f is also degenerate. In the following lemma, we explicitly state this condition arity(f ) ≥ 3.
Proof. We consider σ = + since the other case is similar. Under a Z transformation, Lemma 2.19 with a nonzero entryĥ 2 , here we normalized to 1. Moreover since h is non-degenerate, so isĥ, and therefore b 2 = a.
We prove the lemma by induction on the arity of f (or equivalentlyf ). There are two base cases, n = 3 and n = 4. However, the arity 3 case is easily reduced to the arity 4 case. We show this first, and then show that the lemma holds in the arity 4 case.
Assume n = 3. Since f ∈ V + , by Definition 2.13, Corollary 2.18 and Lemma 2.14, we have the formf = [f 0 ,f 1 , 0, 0]. Moreover, since f is nondegenerate, we havef 1 = 0 and we can normalize it to 1. So we have the formf = [t, 1, 0, 0]. By Lemma 2.19, we have t = 0 as f ∈ M + 4 . Consider the gadget in Figure 4. We assignf to the circle vertices and = 2 to the square vertex. Letf ′ be the signature of the resulting gadget. The signaturef ′ may not seem symmetric by construction, but in fact it is, and it has signaturef ′ = [2t, 1, 0, 0, 0]. The crucial observation is that it takes the same value 0 on inputs 1010 and 1100, where bits are ordered counterclockwise, starting from an arbitrary edge. (Note thatf ′ outputs value 0 even when both copies off have 01 on the dangling edges.) This finishes our reduction to n = 4. Now we consider the base case of n = 4. 0}. This implies that rd + (f ) = 1 and by Lemma 2.19,  Then we connect two copies ofĥ via = 2 , and get h ′ = [2ab, a + b 2 , 2b]. By connecting this h ′ tô f via = 2 , we get [2(a − b 2 ), 2b, 0], using t = −2b. Since a = b 2 and b = 0, we can once again interpolate any [v, 1, 0] by Lemma 2. 20.
Hence, we have the signature [v, 1, 0], where v ∈ C is for us to choose. We construct the gadget in Figure 5 with the circles assigned [v, 1, 0], the squares assigned = 2 , and the triangle assigned [a, b, 1]. The resulting gadget has signature [a + 2bv + v 2 , b + v, 1], which can be verified by the matrix product v 1 1 0 Now we do the induction step. Assume n ≥ 5. The construction is essentially identical to the case n = 4, but for clarity we spell it out. Since f is non-degenerate, rd If t + 2b = 0, then we are done by induction hypothesis. Otherwise t = −2b, and we connect twoĥ together via = 2   Next we consider mixing signatures from V + and V − . This is a planar version of Lemma 46 (p. 1711) in [11]. However, for planar graphs, there is a tractable case when one signature is in M + 4 and the other is in M − 4 . This case was shown to be #P-hard over general graphs by Lemma 43 in [11] (p. 1704) using a nonplanar reduction. One can check that the rest of the proof of Lemma 46 in [11] holds for planar graphs. For completeness we include a proof.
, arity(f ) = n and arity(g) = n ′ , then 2d < n and 2d ′ < n ′ . Under a holographic transformation by  ) . We can connect all n ′ − 2 edges of the second to the first, connected by = 2 . This gives [1, 0] ⊗(n−n ′ ) . We can continue subtracting the smaller arity from the larger one. We continue this process in a subtractive version of the Euclidean algorithm, and end up with both [1, 0] ⊗t and [0, 1] ⊗t , where t = gcd(n − 2, n ′ − 2) = gcd(n − n ′ , n ′ − 2). In particular, t | n − n ′ and by taking n−n ′ t copies of [0, 1] ⊗t , we can get [0, 1] ⊗(n−n ′ ) . Connecting this back tof via = 2 , we get a symmetric signature of arity n ′ consisting of the first n ′ + 1 entries off . A similar proof works when n ′ > n.
Thus we may assume n = n ′ . As shown above we also have [0, 1] ⊗(n−2) . Connecting When signatures in both M + 4 and M − 4 appear, we show that the only degenerate signatures that mix must also be vanishing. Let v = u ⊗m be a degenerate signature for some unary signature u and some integer m ≥ 1. If u is not a multiple of [1, ±i], then Pl-Holant(f, g, v) is #P-hard.
Proof. Suppose f is of arity n and g of arity ℓ. Under a holographic transformation by Z, we have . Lemma 2.19 and it is not a multiple of Z ⊗2 [c, 0, 1] for any c = 0. Hence Pl-Holant(f, g, v) is #P-hard by Lemma 4.4, where (g, Z ⊗2 h) plays the role of "(f, h)" in Lemma 4.4 and σ = −.
We also consider the mixing of vanishing signatures with those in P 2 .  Lemma 2.19, the support off is on entries with Hamming weight at most d and includes the entry of Hamming weight exactly d. Now f / ∈ M 4 , so by Lemma 3.10, we (and up to a nonzero scalar in either case).
In the second case, we have m ≥ 5 since 2 ≤ d < m 2 . Furthermore, we may assume that d = 2, since otherwise can we do d − 2 self-loops onf via = 2 . With this assumption, we do two self-loops onf via = 2 to get [1, 0] ⊗(m−4) on the right side. By a similar argument as in the previous case, we can construct . This can be seen as follows. From the = 2 on the LHS, any edge assignment must assign 0's and 1's to exactly half of the edges. However, considering from the RHS, if any occurrence of the signature [f 0 ,f 1 , 1, 0, 0] is assigned more 0's than 1's, then some other occurrence must be assigned more 1's than 0's which results in a global factor 0. Thus each occurrence of the signature [f 0 ,f 1 , 1, 0, 0] is assigned exactly two 0's and two 1's, which is equivalent to [0, 0, 1, 0, 0]. The problem Pl-Holant( = 2 | [0, 0, 1, 0, 0]) is counting Eulerian Orientations in planar 4-regular graphs. This problem was proved #P-hard for general 4-regular graphs by Huang and Lu [27] and improved to planar 4-regular graphs by Guo and Williams [26]. It is also a consequence of Corollary 2. 29. Thus Pl-Holant( = 2 |f , = n ) is #P-hard as well.

Dichotomy for Pl-#CSP 2 and Related Lemmas
In this section, we state the dichotomy for Pl-#CSP 2 . We defer the proof to Part II of this paper, where we will restate it as Theorem 9. 2. In this section we provide a sketch of the proof. Afterwards, we discuss several related lemmas, which are used for the full dichotomy of Pl-Holant. Proof Sketch. We first define some tractable families of signatures specific to the Pl-#CSP 2 frame- One can show that A covers Case 1 above, and M covers Case 3. The proof will revolve around these tractable classes.
The overall plan is to break the proof into two main steps. The first step is to prove the dichotomy theorem for Pl-#CSP 2 (F) when there is at least one nonzero signature of odd arity in F. In this case, we can make use of a lemma showing that we can simulate Pl-#CSP(F) by Pl-#CSP 2 (F) if F includes a unary signature [a, b] with ab = 0. Then we can apply the known dichotomy Theorem 2.25 for Pl-#CSP. However this strategy (provably) cannot work when every signature in F satisfies the parity constraint. In that case we employ other means. This first step of the proof is relatively uncomplicated.
The second step is to deal with the case when all nonzero signatures in F have even arity. This is where the real difficulties lie. In this case it is impossible to directly construct any unary signature. So we cannot use that lemma pertaining to a unary signature. But we prove another lemma which provides a way to simulate Pl-#CSP(F) by Pl-#CSP 2 (F) in a global fashion, if F includes some tensor power of the form [a, b] ⊗2 where ab = 0. Moreover, we have a lucky break (for the complexity of the proof) if F includes a signature that is in M \ (P ∪ A ). In this case, we can construct a special binary signature, and obtain [1, 1] ⊗2 by interpolation. This proof uses some elementary properties of cyclotomic fields. This simplifies the proof greatly. For all other cases (when F has only even arity signatures), the proof gets going in earnest-we will attempt an induction on the arity of signatures.
The lowest arity of this induction will be 2. We will try to reduce the arity to 2 whenever possible; however for many cases an arity reduction to 2 destroys the #P-hardness at hand. Therefore the true basis of this induction proof of Pl-#CSP 2 starts with arity 4. Consequently we will first prove a dichotomy theorem for Pl-#CSP 2 (f ), where f is a signature of arity 4. Several tools will be used. These include the rank criterion for redundant signatures, Theorem 2.24 for arity 2 signatures, and a trick we call the Three Stooges by domain pairing.
However, in the next step we do not attempt a general Pl-#CSP 2 dichotomy for a single signature of even arity. This would have been natural at this point, but it would have been too difficult. We will need some additional leverage by proving a conditional "No-Mixing" Lemma for pairs of signatures of even arity. So, seemingly taking a detour, we prove that for two signatures f and g both of even arity, that individually belong to some tractable class, but do not belong to a single tractable class in the conjectured dichotomy (that is yet to be proved), the problem Pl-#CSP 2 (f, g) is #P-hard. We prove this No-Mixing Lemma for any pair of signatures f and g both of even arity, not restricted to arity 4. Even though at this point we only have a dichotomy for a single signature of arity 4, we prove this No-Mixing Lemma for higher even arity pairs f and g by simulating two signatures f ′ and g ′ of arity 4 that belong to different tractable sets, from that of Pl-#CSP 2 (f, g). After this arity reduction (within the No-Mixing Lemma), we prove that Pl-#CSP 2 (f ′ , g ′ ) is #P-hard by the dichotomy for a single signature of arity 4. After this, we prove a No-Mixing Lemma for a set of signatures F of even arities, which states that if F is contained in the union of all tractable classes, then it is still #P-hard unless it is entirely contained in one single tractable class. Note that at this point we still only have a conditional No-Mixing Lemma in the sense that we have to assume every signature in F belongs to some tractable set.
We then attempt the proof of a Pl-#CSP 2 dichotomy for a single signature of arbitrary even arity. This uses all the previous lemmas, in particular the (conditional) No-Mixing Lemma for a set of signatures. However, after completing the proof of this Pl-#CSP 2 dichotomy for a single signature of even arity, the No-Mixing Lemma becomes absolute.
Finally the dichotomy for a single signature of even arity is logically extended to a dichotomy theorem for Pl-#CSP 2 (F) where all signatures in F have even arity. Together with the first main step when F contains some nonzero signature of odd arity, this completes the proof of Theorem 5.1.

Related Lemmas
Now we give some consequences of Theorem 5. 1. These are cases that can be reduced to Pl-#CSP 2 . We consider signatures in P 1 , M 2 \ P 2 , A 3 , or M 3 .
All signatures stated in lemmas and corollaries in this section are assumed symmetric. We begin with the cases of P 1 and A 3 . The proofs of the following two lemmas are contained in the proofs of Lemma 61 and Lemma 63 in [11] respectively. One can check that the reductions in these proofs are planar.
The proof of this corollary is straightforward. To illustrate the power of Theorem 5.1, we give a short proof here.
Corollary 5.4 is useful in Section 8. In Section 6, we need the following further specialization. For the case of A 3 , some case analysis is required. Corollary 5. 6. Let F be a set of signatures. Suppose there exists f ∈ F that is a non-degenerate signature of arity n ≥ 3 in A 3 We apply Theorem 5.1 to Pl-#CSP 2 (F ′ ). The consequence is that Pl-#CSP 2 (F ′ ) (and hence Pl- 4 . Notice that g ∈ P and hence the first case is impossible. Suppose using Proposition 3. 6. Hence F is M -transformable in this case. The last case is when Therefore F is A -transformable. This finishes the proof.
Again, we specialize Corollary 5.6 to our need.
The next case is when f is in M 2 but not P 2 .
Lemma 5. 8 where H is an orthogonal 2-by-2 matrix and γ = 0, ±i. We first show that where In this case, we do the transformation T : By connecting g to two inputs of = n , we get = n−2 up to a constant factor of 1 + γ 2 = 0 as γ = ±i.
We repeat this process. If n is even, then we get = 2 eventually, which is on the right hand side in the above Pl-Holant problem. If n is odd, then eventually we get = 3 and (= 1 ) = [ Next we show that Let N = 1+γ 2 1−γ 2 1−γ 2 1+γ 2 be the signature matrix of g. If there is a positive integer k and a nonzero constant c such that N k = cI 2 , where I 2 is the 2-by-2 identity matrix, then we may directly implement = 2 on the left by connecting k copies of [1 + γ 2 , 1 − γ 2 , 1 + γ 2 ] via = 2 on the right. This implies (5.6) holds.
Otherwise such k and c do not exist. The two eigenvalues of N are λ 1 = 2 and λ 2 = 2γ 2 . If λ 1 = λ 2 , then γ 2 = 1 and N = [ 2 0 0 2 ]. Contradiction. Hence λ 1 = λ 2 , and N is diagonalizable. Let N = P λ 1 0 0 λ 2 P −1 , for some non-singular matrix P . By connecting l many copies of N on the left via = 2 on the right, where l is a positive integer, we can implement N l = P Consider an instance Ω of Pl-Holant = 2 , g |= 2 , = n , T −1 F . Suppose that the left = 2 appears t times. Let l be a positive integer. We obtain Ω l from Ω by replacing each occurrence of = 2 on the left with N l .
Since N l = P λ l 1 0 0 λ l 2 P −1 , we can view our construction of Ω l as replacing N l by 3 signatures, with matrix P , λ l 1 0 0 λ l 2 , and P −1 , respectively. This does not change the Holant value. We stratify the assignments in Ω l based on the assignments to the t occurrences of the signature whose matrix is the diagonal matrix Suppose there are i many times it was assigned 00 with function value λ l 1 , and j times 11 with function value λ l 2 . Clearly i+j = t if the assignment has a nonzero evaluation. Let c ij be the sum over all such assignments of the products of evaluations of all signatures (including the signatures corresponding to matrices P and P −1 ) in Ω l except for this diagonal one. Then By an oracle for Pl-Holant g |= 2 , = n , T −1 F , we can get Holant Ω l for any 1 ≤ l ≤ t + 1. Recall that for any positive integer l, (λ 1 /λ 2 ) l = 1. This implies that for any two distinct integers i, j ≥ 0, (λ 1 /λ 2 ) i = (λ 1 /λ 2 ) j . Therefore we get a non-singular Vandermonde system. We can solve all c ij for i + j = t given Holant Ω l for all 1 ≤ l ≤ t + 1. Then notice that i+j=t c ij is the Holant value of Ω l by replacing both λ l 1 and λ l 2 with 1, which is the instance Ω as P I 2 P −1 = I 2 . Therefore we may compute Holant Ω via t + 1 many oracle calls to Pl-Holant g | = 2 , = n , T −1 F . This finishes the reduction in (5.6).
The problem Pl-Holant = 2 , g | = 2 , = n , T −1 F in the left hand side of (5.6) has = 2 on both sides. Therefore we may lift the bipartite restriction. Combining it with (5.5), we get Notice that given an equality of arity n ≥ 3, we can always construct all equalities of even arity, regardless of the parity of n, in the Pl-Holant setting. Therefore, we have finishing the proof of ( 5.4) in the case f = H ⊗n 1 To complete the proof of ( 5.4), there is another case that . . , 0, −1] has arity n: We then do the same construction as in the previous case of connecting g to Notice that our previous binary interpolation proof only relies on g and = 2 . Hence we get We apply Theorem 5.1 to Pl-#CSP 2 (T −1 F, g). Then we have that Pl-#CSP 2 (T −1 F, g) (and hence Pl- 4 . We deal with these three cases. We start with the simplest case P, then M , and then A . 1. The first case is that T −1 F ∪ {g} ⊆ P. Recall that γ = 0 or ±i, it can be verified that g ∈ P unless γ 2 = 1. Hence γ = ±1. In either case we have that 1 1 γ −γ is an orthogonal matrix up to a nonzero scalar, and hence so is T . This implies that F is P-transformable. 2 , then T is an orthogonal matrix as 1 1 γ −γ is, up to a factor of 1 is either [1, 0, 1] when r = 0, 2, or [0, 1, 0] when r = 1, 3, up to a nonzero factor. Otherwise γ 2 = 1 and it is straightforward to verify that g ∈ [ 1 0 0 i r ] M for r = 1, 3. Hence we may assume that Hence F ⊆ HM and F is M -transformable. 3. In the last case, 1−γ 2 = ±i. This implies that γ = α l for some integer l = 1, 3, 5, 7. We may assume l = 1 as other cases are similar. In this case it is possible that Hence, F is A -transformable, so Pl-Holant(F) is tractable. This finishes the proof. Lemma 5.8 leads to the following specialization.
By the definition of M 3 , we may assume, up to a nonzero constant, thatf = (H −1 ) ⊗n f = ExactOne n for some orthogonal matrix H ∈ O 2 (C). After zero or more self loops, we can further assume that eitherf = ExactOne 3 orf = ExactOne 4 depending on the parity of n. Supposef = ExactOne 3 . Consider the gadget in Figure 6a. We assignf to all vertices. The signature of the resulting gadget is g = [0, 1, 0, 1], which is in M 2 and not in P 2 = A 2 by Lemma 3.2. Thus, the claim follows from Lemma 5. 8.
Otherwise,f = ExactOne 4 . Consider the gadget in Figure 6b. We assignf to all vertices. Note that this is a matchgate. The signature of the resulting gadget is [0, 2, 0, 1, 0], which is in M 2 and not in P 2 = A 2 by Lemma 3.2. Thus, the claim follows from Lemma 5.8. This completes the proof of the claim.
However, as f ∈ F and f ∈ M 3 , F cannot be A -or P-transformable by Lemma 3.12. Also by Lemma 3.12 . This implies that F ⊆ HM . Once again, we specialize Lemma 5.10 to our needs.

Single Signature Dichotomy
Theorem 6.1 is the single signature dichotomy for Pl-Holant problems.

Theorem 6.1. If f is a non-degenerate symmetric signature of arity n ≥ 3 with complex weights in Boolean variables, then
and therefore we can also write the expression in Theorem 6.1 However we retain the term M 4 for convenience later. Indeed, Figure 3). Thus the expression in Theorem 6.1 can also be written as In this form, the conclusion of Theorem 6.1 is clear: 3.11 and Theorem 2. 15.
We prove Theorem 6.1 by induction on the arity. Before proceeding to the proof, we first introduce several lemmas involved in the inductive step. All signatures stated in lemmas and corollaries in this section are assumed symmetric, unless indicated otherwise (e.g., the signatureĝ in Lemma 6.7).

. . .
(a) A binary construction . . . Figure 7: Two gadgets used. In the normal basis, circles are assigned f and squares are assigned = 2 . In the Z basis, circles are assignedf and squares are assigned = 2 .

Lemmas applied to Non-Degenerate Signatures in the Inductive Step
The single signature dichotomy relies on the following key lemma. The important assumption here is that f ′ is non-degenerate.
Lemma 6.2 depends on several results, each of which handles a different case. In fact, the proof of Lemma 6.2 is a straightforward combination of Corollary 5.5 (for P 1 ), Corollary 5.7 (for A 3 ), Corollary 5.9 (for M 2 \ P 2 ), and Corollary 5.11 (for M 3 ) from Section 5, as well as Corollary 6.4 (for P 2 ) and Lemma 6.5 (for V ), which we will prove shortly. These last two results handle the cases f ′ ∈ P 2 and f ′ ∈ V respectively. Note that M 4 ⊂ V . First we consider the case of f ′ ∈ P 2 and show the following lemma.
Proof. First we use the gadget in Figure 7b, where we put f on both vertices. Let the resulting signature be h = Z ⊗4ĥ . It is easier to calculateĥ, that is, h in the Z basis. Indeed,ĥ is not symmetric, butĥ has the following matrix representation as n ≥ 5: Notice that this matrix is redundant, and det( Mĥ) = −4(n − 2)(ab + n − 2). If ab = 2 − n, then by Corollary 2.29 Pl-Holant(h) is #P-hard, and so is Pl-Holant(f ). Hence in the following we assume up to a nonzero factor. Thus a self loop by (= 2 ) becomes a self loop by ( = 2 ) after the Z transformation. Applying the Z transformation we get the following: We get this expression of f ′ because doing a self loop commutes with the operation of holographic transformations.
If n ≥ 7, then we use the gadget in Figure 7b again, where we put g on both vertices this time. We get some signature h ′ , which in Z basis has the following matrix representation as n − 2 ≥ 5: Once again this matrix is redundant. It can be simplified as ab = 2 − n. The compressed matrix is It is easy to compute that det( The remaining cases are n = 6 and n = 5. When n = 6, ab At last, n = 5 and ab = 2 − n = −3. We also haveĝ = [ab + 4, b, a, ab  This lemma essentially handles the case of f ′ ∈ P 2 due to the following corollary.
Proof. Since f ′ ∈ P 2 = A 2 , we can assume by Lemma 3 Since H does not change the complexity, we may assume we are under this transformation. Then up to a nonzero constant f is of the form Z ⊗n [a, 1, 0, . . . , 0, 1, b] of arity n. The claim follows by Lemma 6. 3.
The next lemma handles the case when f ′ is a non-degenerate vanishing signature. Its proof is partly contained in the proof of Theorem 64 (p. 1720) in [11]. We include this part here for completeness. As we shall see, the case of f ′ ∈ M 4 is a special case of this result. 15. For simplicity, assume that f ′ ∈ V + . The other case is similar.

Lemma 6.5. Suppose f is a non-degenerate signature of arity
Note that f ′ is of arity n − 2 ≥ 3. Recall Definition 2.13 and Corollary 2. 18. 19. Note that adding a self-loop in the standard basis is the same as connecting to [0, 1, 0] in the Z basis. Hence we may The last entry ofĥ is c when d = 2 and is 0 when d > 2.
As n > 2d, we may do two more self loops and get . It is the same as getting the last n − k + 1 = 2d + 1 signature entries off up to a nonzero scalar. We may repeat this operation zero or more times until the arity k ′ of the resulting signature is less than or equal to k. We claim that this signature has the formĝ = [0, . . . , 0, c]. In other words, the k ′ + 1 entries of g consist of the last c and k ′ many 0's from the signaturef , all appearing afterf d . This is because there are n − d − 1 many 0 entries in the signaturef afterf d , and Having both [1, 0] ⊗k andĝ = [0, 1] ⊗k ′ in the Z basis, we realize [0, 1] ⊗t using the subtractive Euclidean argument as in Lemma 4.1, where t = gcd(k, k ′ ). Then we put k t many copies of [0, 1] ⊗t together to get [0, 1] ⊗k . Connectĥ with [0, 1] ⊗k by [0, 1, 0]. Note that due to [0, 1, 0] flipping the bits, this gets the prefix ofĥ of arity arity(h) − k. Recall that arity(h) = n − 2d + 4, and hence The last entry is 0 (and not c), because k ≥ 1 and arity(ĥ) ≥ 5.
However, as explained in the proof of Lemma 4.7, the problem Pl-Holant

Lemmas Applied to Degenerate Signatures in the Inductive
Step Lemma 6.2 does not solve the case when f ′ is degenerate. In general, when f ′ is degenerate, the inductive step is straightforward unless f ′ is also vanishing. Lemma 6.6 and 6.8 are the two missing pieces to this end.
. Now consider the gadget in Figure 7a withf assigned to both vertices. This gadget has the binary signature . This can be verified as By the form of g 1 = [0, ab, 2b] and b = 0, it follows from Lemma 2.19 that Notice that h is non-degenerate and h ∈ V + . Since The next case uses the following technical lemma. It is also applied more than once in Section 7.

Lemma 6.7. Letĝ be the arity 4 signature whose matrix is
Proof. Consider the gadget in Figure 8a. We assign [0, 0, 0, 1, 0] to the triangle vertices, [0, 1, 0, 0, 0] to the circle vertices,ĝ to the pentagon vertex, and [0, 1, 0] to the square vertices. Letĥ be the signature of this gadget. By adding two more disequality signatures and then grouping appropriately, it is clear that the gadget in Figure 8b has the same signature of the gadget in Figure 8a, where the circle vertices are still assigned [0, 1, 0, 0, 0], the square vertices are still assigned [0, 1, 0], and the diamond vertex is assigned the quaternary equality signature. To compute the signatureĥ, first compute the signatureĥ ′ of the inner gadget enclosed by the dashed line, which has signature matrix Then by Figure 9, the signature matrix ofĥ is Mĥ = We use one more gadget before we finish the proof using interpolation. Consider the gadget in Figure 10b. We assignĥ to the circle vertices and [0, 1, 0] to the square vertices. The signature of the resulting gadget isr with signature matrix Mr (see Figure 2 for the signature of a rotated copy ofĥ that appears as the second circle vertex in Figure 10b), where So we can constructr in the RHS of Pl- where F is a set of symmetric signatures containingr, and the signature matrix ofr ′ is Suppose thatr ′ appears n times in Ω. We construct from Ω a sequence of instances Ω s of Pl-Holant ( = 2 | F ) indexed by s ≥ 1. We obtain Ω s from Ω by replacing each occurrence ofr ′ with the gadget N s in Figure 11 withr assigned to the circle vertices and [0, 1, 0] assigned to the square vertices. In Ω s , the edge corresponding to the ith significant index bit of N s connects to the same location as the edge corresponding to the ith significant index bit ofr ′ in Ω.
We can express the signature matrix of N s as we can view our construction of Ω s as first replacing Mr′ with XP diag 1, 1 + √ 3, 1 − √ 3, 1 P −1 , which does not change the Holant value, and then replacing the diagonal matrix with the diagonal matrix diag 1, 4 We stratify the assignments in Ω based on the assignments to the n occurrences of the signature whose signature matrix is the diagonal matrix  We only need to consider the assignments that assign • i many times the bit patterns 0000 or 1111, • j many times the bit pattern 0110, and • k many times the bit pattern 1001, since any other assignment contributes a factor of 0. Let c ijk be the sum over all such assignments of the products of evaluations of all signatures (including the signatures corresponding to the signature matrices X, P , and P −1 ) in Ω except for signature corresponding to the signature matrix in (6.8). Then and the value of the Holant on Ω s , for s ≥ 1, is We argue that this Vandermonde system has full rank, which is to say that 4 + 2 Since any nonzero integer power of 4 + 2 √ 3 is not rational, we must have j − k = j ′ − k ′ . And in this case, 4 k−k ′ = 1, and hence k = k ′ and j = j ′ . Therefore, we can solve for the unknown c ijk 's and obtain the value of Holant Ω . Thus we have a reduction After a counterclockwise rotation ofr ′ (c.f. Figure 2), the rotated form ofr ′ has matrix     which is redundant and its compressed form is nonsingular. Hence by Corollary 2.29 the following equivalent problems Since we can constructr ∈ F in the RHS of Pl-Holant ( = 2 | [0, 1, 0, 0, 0], [0, 0, 0, 1, 0],ĝ), the lemma follows.
With Lemma 6.7 at hand, we continue to prove Lemma 6.8.
Under a holographic transformation by We show how to construct the following three signatures:

Proof of the Single Signature Dichotomy
Now we are ready to prove the dichotomy for a single signature, Theorem 6.1, which states: If f is a non-degenerate symmetric signature of arity n ≥ 3 with complex weights in Boolean variables, then Pl-Holant(f ) is #P-hard unless f ∈ P 1 ∪M 2 ∪A 3 ∪M 3 ∪M 4 ∪V , in which case the problem is computable in polynomial time.
Proof of Theorem 6. 1. The proof is by induction on n. The base cases of n = 3 and n = 4 are proved in Theorem 2. 22. Now assume n ≥ 5.
With the signature f , we form a self loop to get a signature f ′ of arity at least 3. In general we use prime to denote the signature with a self loop. We consider separately whether or not f ′ is degenerate. • Then there are three cases to consider. 1. Since an orthogonal transformation keeps = 2 invariant, this transformation commutes with the operation of taking a self loop, i.e., f ′ = (f ) ′ . Here (f ) ′ is the function obtained fromf by taking a self loop. As (f ) ′ = [1, 0] ⊗(n−2) , we havef 0 +f 2 = 1 and for every integer 1 ≤ k ≤ n − 2, we havef k = −f k+2 . With one or more self loops on (f ) ′ , we eventually obtain either [1, 0] when n is odd or [1, 0, 0] when n is even. In either case, we connect [1,0] or [1, 0, 0] tof until we get an arity 4 signature, which . This is possible because that the parity matches and the arity off is at least 5 andĝ is transformed by T −1 into the arity 4 equality = 4 , since By Theorem 2.24, Pl-Holant ĥ | = 4 is #P-hard asf 2 = 0. ) . We consider the first case since the other case is similar.

If a
In the first case, the characteristic polynomial of the recurrence relation of Hence there exist a 0 , a 1 , and c such that Let f + and f − be two signatures of arity n such that is the all zero signature, a contradiction. If c = 0, then f is vanishing, one of the tractable cases. Now we assume a 1 c = 0 and show that Note that the arity n ≥ 5, so the nonzero entries in the sum do not collide.

Under the holographic transformation
Depending on whetherf 0 = 0 or not, we apply Lemma 6.8 or Lemma 6.6 and Pl- Note that f ′ has arity n − 2 ≥ 3, and every signature in M 4 of arity at least 3 is also in V . Hence the exceptional case is equivalent to In this case, we apply Lemma 6.2 to The exceptional cases imply that f is Aor P-or M -transformable or vanishing, and Pl-Holant(f ) is tractable.

Mixing P 2 and M 4 -Equalities and Matchgates in the Z Basis
Given a set F of symmetric signatures, by Theorem Furthermore, we have already proved that the desired full dichotomy holds if F contains such an The remaining cases are when all non-degenerate signatures of arity at least 3 in F are contained in P 2 ∪ M 4 ∪ V . In this section, we consider the mixing of P 2 and M 4 . For this, we do a holographic transformation by At this stage of our proof, we found a big surprise. Against the putative form of a complexity classification for planar counting problems, we found that the complexity of the problem Pl-Holant ( = 2 | = k , ExactOne d ) depends on the values of d and k, and the problem is tractable for all large k. This result has the consequence that, for the first time since Kasteleyn's algorithm, we have discovered some new primitive tractable family of counting problems on planar graphs. These problems cannot be captured by a holographic reduction to Kasteleyn's algorithm, or any other known algorithm. Thus for planar problems the paradigm of holographic algorithms using matchgates (i.e., being M -transformable) is not universal. Let

Hardness when k = 3 or 4
We begin with some hardness results.  Step two: Contract edges Figure 14: A reduction from Pl-Holant (EQ | h) to Pl-Holant(g) for any binary signature h and a quaternary signature g that depends on h. The circle vertices are assigned = 4 or = 3 respectively, the triangle vertex is assigned h, and the square vertex is assigned the signature of the gadget to its left. Finally, we build the gadget in Figure 12b. We place = 3 on each circle and = 2 on each square. It is easy to see that there are only two support vectors of the resulting signature, which are 0101 and 1010. Recall the definition (6.7) of the partial crossoverĝ. This gadget realizes exactlyĝ.
By Lemma 6.7, For k = 4, we need the following lemma.

Lemma 7.2.
Let g be the arity 4 signature whose matrix is Figure 15: A plane graph (a), its medial graph (c), and both graphs superimposed (b).
Fix an embedding of G in the plane. This defines a cyclic ordering of the edges incident to each vertex. Consider a vertex u ∈ U of degree k. It is assigned the signature = k . We decompose u into k vertices. Then we connect the k edges originally incident to u to these k new vertices so that each vertex is incident to exactly one edge. We also connect these k new vertices in a cycle according to the cyclic ordering induced on them by their incident edges. Each of these vertices has degree 3, and we assign them = 3 . Clearly the Holant value is unchanged. This completes step one. An example of this step applied to a vertex of degree 4 is given in Figure 14a. The resulting graph has the following properties: (1) it is planar; (2) every vertex is either degree 2 (in V and assigned h) or degree 3 (newly created and assigned = 3 ); (3) each degree 2 vertex is connected to two degree 3 vertices; and (4) each degree 3 vertex is connected to one degree 2 vertex and two other degree 3 vertices. Now step two. For every v ∈ V , v has degree 2. We contract the two edges incident to v, or equivalently, we replace the two circle vertices and one triangle vertex boxed in Figure 14b with a single (square) vertex of degree 4. The resulting graph G ′ = (V ′ , E ′ ) is planar and 4-regular.
Next we determine what is the signature on v ′ ∈ V ′ after this contraction. Clearly the two inputs to each original circle have to be the same (as illustrated in the first figure in Figure 14b). Therefore its support is 0000, 0110, 1001, 1111, listed starting from the diamond and going counterclockwise. Moreover, due to the triangle assigned h in the middle, the weight on 0000 is 2, and every other weight is 1. Hence it is exactly the signature g, with the diamond in Figure 14b marking the first input bit. This finishes the proof.
Remark 4. From the planar embedding of the graph G, treating h vertices as edges, the resulting graph G ′ is known as the medial graph of G. The (constructive) definition is usually phrased in the following way. The medial graph G m of plane graph G has a vertex on each edge of G and two vertices in G m are joined by an edge for each face of G in which their corresponding edges occur consecutively. See Figure 15 for an example. However, our construction described in the proof clearly extends to nonplanar graphs as well. Figure 16: Grid-like gadget used in the proof of Lemma 7.3, whose support vectors are 00110011, 11001100, and 11111111. Each square is assigned a binary disequality = 2 , circle = 4 , and triangle [0, 1, 0, 0].
Proof. Consider the gadget in Figure 16. We assign binary disequality = 2 to the square vertices, = 4 to the circle vertices, and [0, 1, 0, 0] to the triangle vertices. We show that the support of the resulting signature is the set {00110011, 11001100, 11111111}, where each vector is the assignment ordered counterclockwise starting from the diamond point.
We call the equality signature = 4 in the middle the origin. There are two possible assignments at the origin. If it is assigned 0, then every adjacent perfect matching signature [0, 1, 0, 0] is matched to the half edge towards the origin, and every equality = 4 is forced to be 1. This gives the support vector 11111111.
The other possibility is that the origin is 1. In this case, we can remove the origin leaving the outer cycle, with every [0, 1, 0, 0] becoming [0, 1, 0]. This is effectively a cycle of four equalities connected by = 2 . It is easy to see that there are only two support vectors, which are exactly 00110011 and 11001100.
Every pair of half edges at each corner always take the same value. We further connect each pair of these edges to different copy of = 4 via two copies of = 2 . This results in a gadget with signature f whose support is the complement of the original support, that is, {11001100, 00110011, 00000000}.
Now consider the gadget in Figure 17a. We assign = 2 to the square vertices, = 4 to the circle vertices, [0, 1, 0, 0] to the triangle vertices, and f to the pentagon vertex. Notice that each pair of edges coming out of the pentagon vertex are from the same corner of the gadget in Figure 16 used to realize f . We now study the signature of this gadget.
Notice that if an = 4 on the outer cycle is assigned 0, then the two adjacent perfect matchings must match half edges toward that = 4 , and their outgoing edges must be 0. Furthermore, the two = 4 one more step away must be 1. A further observation is that any pair of consecutive = 4 's cannot be both 0, and if a pair of consecutive = 4 's are both 1, then the [0, 1, 0, 0] between them must have a 1 going out. In Figure 17a, we call the pentagon connecting to four equalities = 4 on the upper right f 1 and the other one f 2 . Let g be the signature of resulting gadget. We further order the f1 f2 (a) Gadget with signature g. Each square is assigned a binary disequality ̸ =2, circle =4, triangle [0, 1, 0, 0], and pentagon f .  external wires of f 1 , f 2 , and g counterclockwise, each starting from edge marked with a diamond. With this notation and these observations, we get Table 17b listing the support of g. The support of g is {11111111, 01111000, 11110000, 10000111, 00000000, 00001111, 00000000}, and 00000000 has multiplicity 2.
Next we use a domain pairing argument. First we move = 4 to the left hand side, by connecting four = 2 into it. We apply the domain pairing on the problem Pl-Holant (= 4 | g). Specifically, we use = 4 as = 2 , by pairing each pair of edges together. We also pair adjacent two outputs of g counterclockwise, starting from the diamond point. Each pair of output wires of g are connected to a pair of wires from = 4 on the left hand side. Note that = 4 enforces that each pair of edges always takes the same value. We re-interpret 00 or 11 as 0 or 1 in the Boolean domain. In this way, we can treat g as an arity 4 signature g ′ in the Boolean domain. So the reduction is We get the expression of g ′ next. The two support bit strings 01111000 and 10000111 of g are eliminated as they do not agree on adjacent paired outputs. So in the paired (Boolean) domain, the support of g ′ becomes {1111, 1100, 0011, 0000} where 0000 has multiplicity 2. We further rotate g ′ as a Boolean domain signature such that the support is {1111, 0110, 1001, 0000}. Now it is easy to see that the matrix of g ′ , an arity 4 signature in the Boolean domain, is To extend Lemma Furthermore, we can construct = ℓk and ExactOne 2+ℓ(d−2) in the right hand side, for all ℓ ≥ 1.

Proof.
We can construct = ℓk on the right, for any integer ℓ ≥ 1, by = 2 on the left and = k on the right, as follows. If we connect two copies of = k via = 2 we get a signature of arity 2k − 2 with k − 1 consecutive external wires labeled + and the others labeled −. As k ≥ 3, we can take 2 wires of the k − 1 wires labeled − and attach to two copies of = k via two = 2 . This creates a signature of arity Finally connect k − 3 pairs of adjacent +/− labeled wires by = 2 recursively. This creates a planar gadget with an equality signature of arity 3(k − 1) − (k − 3) = 2k, up to a nonzero constant factor. This can be extended to any = ℓk by applying the same process on any consecutive k wires.
Next we construct [0, 1] ⊗r for some integer r ≥ 1 on the right hand side. We get [1, 0] ⊗(d−2) by a self-loop of ExactOne d via = 2 , ignoring the factor 2. We pick an integer ℓ large enough so that Given an instance Ω of Pl-Holant ( = 2 | = k , ExactOne d , [0, 1], F) with an underlying plane graph G, consider the dual graph G * of G. Take a spanning tree T of G * , with the external face as the root. In each face F , let c F be the number of [0, 1]'s in the face F . We start from the leaves to recursively move all the pinnings of [0, 1] to the external face. Suppose we are working on the face F as a leaf of T , and it is not the root (the external face). If c F = 0 then we just remove the leaf from T and recurse on another leaf. Otherwise we remove all [0, 1]'s in F , creating c F dangling edges in the face F . Let s be the smallest integer such that sr ≥ c F . We replace the = 2 edge bordering between F and its parent F ′ by a chain of three signatures: are all pinned to 0, then this chain becomes a chain of three ( = 3 )'s, and thus functionally equivalent to the original single = 2 between F and F ′ .) From ExactOne 2+ℓ(d−2) there are two edges connected to the two adjacent copies of = 2 . Of the other ℓ(d − 2) edges we will put sr − c F many dangling edges in F , and the remaining Hence there are sr dangling edges in F , including those c F many that were connected to [0, 1]'s via = 2 before we removed the [0, 1]'s. We put s copies of [0, 1] ⊗r inside the face F to pin all of them in a planar way. We add ℓ(d − 2) − (sr − c F ) to c F ′ , and they are all pinned to 0 (by connecting to [0, 1] via = 2 ). Remove the leaf F from T , and recurse.
After the process, all [0, 1]'s are in the external face of G. Suppose the number is p. We put r disjoint copies of G together to form a planar signature grid. Apply a total of pr many [0, 1]'s by p copies of [0, 1] ⊗r in a planar way. This is now an instance of Pl-Holant ( = 2 | = k , ExactOne d , F) and the Holant value is the rth power of that of Ω. Since the Holant value of Ω is a nonnegative integer, we can take the rth root and finish the reduction.

Tractability when k ≥ 5
On the other hand, if the arity k of the equality signature is at least 5, then Pl-Holant ( In this subsection we will first prove that this problem is tractable for k ≥ 6. After that we will return to = 5 . To prove this, we first do some preprocessing. Let G be the underlying graph of an instance of Pl-Holant ( = 2 | = k , EO). First, we may assume no copy of = k has a self loop by = 2 , since this results in 0 for the overall Holant value. Similarly we may assume that no ExactOne d in EO has more than one self loops by = 2 , since this also results in 0. If a single self loop by a = 2 is applied to some ExactOne d , the signature ExactOne d is changed to [1, 0] ⊗(d−2) with a factor 2. In this way we can eliminate all self loops by = 2 on all signatures on the RHS, resulting in some pinning signatures [1,0]. These pinning signatures can be applied recursively. Any ExactOne d−1 is just = 2 on RHS, which combined with its adjacent two copies of = 2 of LHS, is equivalent to a single = 2 of LHS. Finally, whenever an ExactOne d and another ExactOne ℓ are connected by a = 2 , we replace it by a single ExactOne d+ℓ−2 , shrinking the edge between (and remove the connecting = 2 ). After these steps, we may assume that all pinning signatures [1, 0] and [0, 1] are eliminated, our instance graph G of Pl-Holant ( = 2 | = k , EO) has no self loops by = 2 on RHS signatures, and no = 2 connects two EO signatures on RHS.
Next we define an E k -block. If we view every = 2 in the LHS of the bipartite graph G as an edge, then we get a graph G ′ on the RHS vertices of G only. Every vertex in G ′ is labeled by = k or some ExactOne d , and every edge is labeled by = 2 . The vertices of G ′ labeled by = k form connected components, with edges labeled by = 2 . All edges in G ′ from such a connected component to the rest of G ′ (if the rest is nonempty) must connect to some EO signatures. We define an E k -block to be such a connected component of = k vertices, including the outgoing edges (if any) with all edges (including the outgoing edges) labeled by = 2 . We call these outgoing edges of an E k -block dangling edges. Notice that the signature defined by an E k -block has either exactly two or zero support vectors. This depends on whether or not there exists a contradiction, which is formed by an odd cycle of = k connected by = 2 , i.e., a sequence of odd number of vertices labeled by = k connected by edges labeled by = 2 in G ′ . We say an E k -block is trivial if it has no support. This is easy to check. The two support vectors of a nontrivial E k -block are complements of each other. We mark dangling edges of a nontrivial E k -block by "+" or "−" signs. Dangling edges marked with the same sign take the same value on both support vectors while dangling edges marked with different signs take opposite values on both support vectors. This marking is unique except one may exchange all ± with ∓. The marking uniquely determines the signature of an E k -block. Let n + and n − be the numbers of dangling edges marked + and − respectively. Then it is easy to see that An example of E 6 -block is illustrated in Figure 18, with 8 + signs and 2 − signs.
Recall that we have eliminated all edges (labeled by = 2 ) between EO signatures. Thus if we define the graph between EO signatures on the one hand and E k -block's on the other hand, we have a bipartite (multi)-graph. Since we consider the dangling edges of any E k -block as part of the E k -block, we get a bipartite (multi)-graph where edges are labeled by (= 2 ). This bipartite graph may have multiple edges between a pair of E k -block and ExactOne d signatures. More importantly, we claim that it is a planar bipartite (multi)-graph.
Formally we define a contraction process on the underlying planar connected (multi)-graph for an E k -block (which includes the dangling edges). Recursively, pick any non-dangling non-loop edge e, we shrink it to a point, maintaining planarity. The local cyclic orders of incident edges of the two vertices of e are spliced along e to form the cyclic order of the new vertex. For any self loop created we simply remove it. This contraction process ends in a single point with a cyclic order of the dangling edges.
After this contraction, we obtain a planar bipartite (multi)-graph connected between EO signatures and E k -block's by edges labeled by = 2 . Note that the connection becomes = 2 because the dangling edges (labeled by = 2 ) of an E k -block are considered as part of the E k -block which is now represented by a single vertex after the contraction.
The following Lemma 7.6 is a key observation that for a planar bipartite (multi)-graph, if its degrees are large, then it cannot be simple, i.e., it must have parallel edges. Lemma 7. 6. Let G = (L ∪ R, E) be a nonempty planar bipartite (multi)-graph with parts L and R. If every vertex in L has degree at least 6 and every vertex in R has degree at least 3, then G is not simple. Proof. We may assume G is connected; otherwise we prove the lemma for a connected component of G. For a contradiction, suppose G is simple. Let v, e and f be the total number of vertices, edges, and faces, respectively. Let v i be the number of vertices of degree i in L, where i ≥ 6, and u j be the number of vertices of degree j in R, where j ≥ 3. Since G is simple and bipartite, each face has at least 4 edges. Thus, 2e ≥ 4f.
Then starting from Euler's characteristic equation for planar graphs, we have Here we used the trivial fact that 1/2 = 1/6 + 1/3. Lemma 7.6 does not give us tractability for the case of k ≥ 6 yet. The reason is that given an instance of Pl-Holant ( = 2 | = k , EO), after the preprocessing and forming E k -blocks to make the graph bipartite, it is possible to have E k -blocks of arity less than 6, in which case Lemma 7.6 does not apply. However, for k ≥ 6 and a nontrivial E k -block of arity n where n < 6, by (7.9) and the fact that 0 ≤ n + , n − ≤ n < k, we see that n + = n − , and n = n + + n − must be even. If k = 5, Figure 19: Arity 4 E k -blocks.
and n < 5, we also have n must be even. Moreover Figure 19a depicts the two possibilities of E k -blocks of arity 4 up to a rotation. An E k -block of arity 4 can be viewed as a pair of = 2 in parallel, but there is a correlation between them, namely their support vectors are paired up in a unique way. If we replace the contracted E k -block of arity 4 by two parallel edges as indicated in Fig 19b, one can revert back to a planar realization in the E k -block as it connects to the rest of the graph. This can be seen by reversing the contraction process step by step. Alternatively we can just use the following direct construction of E k -blocks of arity 4 for the two types in Figure 19a. The two types are denoted by their circular markings + + −− and + − +−. If we connect two copies of = k by =, we get the signature represented by the marking + · · · + − · · · − with k − 1 consecutive +'s and −'s. Then we connect the middle k − 3 ≥ 0 pairs of + and − by = to get + + −−. For + − +−, we start from + + −−, and turn the middle + to k − 1 consecutive −'s by connecting another copy of = k using =. Similarly we can turn the middle − to k − 1 consecutive +'s. So we get + − · · · − + · · · + − where there are k − 1 consecutive −'s and +'s. Then we cancel the middle k − 2 pairs of ± by connecting = to get + − +−. Both constructions are completed by adding an extra = on all the dangling edges.
We will show in the following lemma how to replace E k -blocks of arity 4 by some other signatures while keeping track of the Holant value. We also observe that the tractable set described in Lemma 7.7 allows binary = 2 and unary [1, 0] and [0, 1] signatures in addition to EO and = k .
. Without loss of generality, we assume that Ω is connected. Any occurrence of = 2 of the right hand side can be removed as follows: It is connected to two adjacent copies of = 2 of the left hand side. We replace this chain of three copies of = 2 by a single = 2 from the left hand side.
The given signatures have no weight, however the proof below can be adapted to the weighted case. For the unweighted case, we only need to count the number of satisfying assignments. We call an edge in the bipartite instance graph of Ω pinned if it has the same value in all satisfying assignments, if there is any. Clearly any edge incident to a vertex assigned [1,0] When an edge is pinned to a known value, we can get a smaller instance of the problem Pl-Holant( = 2 |= k , EO, = 2 , [1, 0], [0, 1]) without changing the number of satisfying assignments. In our algorithm we may also find a contradiction and simply return 0. If e is a pinned edge, then it is adjacent to another edge e ′ via = 2 on the left hand side, and both e and e ′ are pinned. We remove e, e ′ , and = 2 , and perform the following on e (and on e ′ as well). If the other endpoint of e is u = [1,0] or [0, 1] we either remove that u if the pinned value on e is consistent with u, or return 0 otherwise. If the other endpoint of e is = k , then all edges of this = k are pinned to the same value which we can recursively apply. If the other endpoint of e is ExactOne d ∈ EO, then we replace this signature by ExactOne d−1 when the pinned value is 0; or if the pinned value is 1 then the remaining d − 1 edges of this ExactOne d are pinned to 0 which we recursively apply. Notice that we may create an ExactOne 2 (i.e. = 2 ) on the right hand side when we pin 0 on ExactOne 3 . Such = 2 's are replaced as described at the beginning. It is easy to see that all these steps do not change the number of satisfying assignments, and work in polynomial time.
If Ω does not contain any EO signatures, i.e., any ExactOne d function (for some d ≥ 3), then Ω is an instance of P and therefore tractable. If Ω does not contain any = k , then it is an instance of M and therefore also tractable. So we may assume Ω contains at least one = k and at least one EO signature. Then, we claim that there always exists an edge in Ω that is pinned, or there is a contradiction. Furthermore, in polynomial time we can find a pinned edge with a known value, or return that there is a contradiction. (If there is a contradiction in Ω, we may still return a purported pinned edge with a known value, which we can apply and simplify Ω. The contradiction will eventually be found.) The lemma follows from the claim, for we either recurse on a smaller instance or have a tractable instance. Now we assume Ω is an instance where at least one = k and at least one ExactOne d ∈ EO appear. We assume no = 2 appears on the right hand side. If any [1,0] or [1,0] appear, then we have found a pinned edge with a known value. Hence we may assume neither [1,0] If a signature ExactOne d ∈ EO is connected to itself by a self-loop through a = 2 , then there are two choices for the assignment on this pair of edges through the = 2 , but the remaining d − 2 ≥ 1 edges are pinned to 0. We can keep track of the factor 2 and have found a pinned edge with a known value. Thus we may assume there are no self-loops via = 2 on EO signatures.
Next we consider the case that two separate (occurrences of) signatures from EO, say, ExactOne d and ExactOne ℓ , are connected by some number of = 2 's. (Here d = ℓ is permitted.) Depending on the number of connecting edges, there are three cases: 1. The connection is by a single = 2 . We contract the connecting edge, maintaining planarity, and replace these three signatures by an ExactOne d+ℓ−2 to get a new instance Ω ′ . If an edge is pinned in Ω ′ then it is also pinned in Ω to the same value. We continue with Ω ′ . 2. The connection is by two = 2 's. There are two choices for the assignment on these two pairs of edges through = 2 , but the remaining d + ℓ − 4 ≥ 2 edges are pinned to 0. 3. The connection is by at least three = 2 's. The three = 2 's cannot be all satisfied, so there is no satisfying assignment, a contradiction. We return the value 0. Hence, we may assume there is no connection via any number of = 2 's among EO signatures.
We can now use our definition of an E k -block (before Lemma 7.6) as a connected component composed of = k and = 2 . All external connecting edges of each E k -block are marked with + or − and this can be found by testing bipartiteness of an E k -block where we treat = 2 's as edges and = k 's as vertices. If any E k -block is not bipartite, we return 0. Such an E k -block is called trivial. In the following we may assume no trivial E k -block exists. We contract all E k -blocks and maintain planarity, as described earlier: For each E k -block we contract two vertices that are connected by an edge, one edge at a time, and remove self loops in this contraction process. Any nontrivial E k -block of arity 2 has signature = 2 , by (7.9). If there is a nontrivial E k -block of arity 2, we replace it with an edge labeled by = 2 to form an instance Ω ′ , maintaining planarity, such that any pinned edge in Triangles are assigned EO signatures and circles are E k -blocks of arity 4.
(b) Break the EO-Eq-4-block into three components. Squares are assigned ̸ =2. The component in the middle contains a cycle, and hence is degenerate. The other two are equivalent to EO signatures.

Figure 20: EO-Eq-4-blocks
Ω ′ corresponds to a pinned edge in Ω. This new edge is between EO signatures and can be dealt with as described earlier. So we may assume the arity of any E k -block is at least 4. Since k ≥ 6, the only possible E k -blocks of arity 4 are those in Figure 19a up to a rotation. Since there is at least one ExactOne d signature with d ≥ 3, forming E k -blocks does not consume all of Ω.
After these steps we may consider Ω a bipartite graph, with one side consisting of E k -blocks and the other side EO signatures. And they are now connected by edges labeled by = 2 .
Suppose there are parallel edges between an E k -block and an ExactOne d signature. We show that this always leads to some pinned edges. If two parallel edges are marked by the same sign in the E k -block, then they must be pinned to 0. If they are marked by different signs, then the remaining d − 2 ≥ 1 edges of the ExactOne d signature must be pinned to 0. Therefore, we may assume there are no parallel edges between any E k -block and any EO signature.
The next thing we do is to consider E k -blocks of arity 4 with EO signatures together. Call a connected component consisting of E k -blocks of arity 4 and EO signatures an EO-Eq-4-block. Figure 20a illustrates an example. Notice that the two possibilities of E k -blocks of arity 4 can be viewed as two parallel = 2 's but with some correlation between them. This is illustrated in Figure 19b. Note that the two dotted lines in Figure 19b represent different correlations.
At this point we would like to replace every E k -block of arity 4 by two parallel = 2 's. However this replacement destroys the equivalence of the Holant values, before and after.
The surprising move of this proof is that we shall do so anyway! Suppose we ignore the correlation for the time being and replace every E k -block of arity 4 by two parallel = 2 's (each parallel copy of = 2 is technically a path of length 2, with the middle vertex labeled by = 2 ) as in Figure 19b. This replacement produces a planar signature grid Ω 1 . Every edge in Ω 1 corresponds to a unique edge in Ω. The set of satisfying assignments of Ω 1 is a superset of that of Ω. Moreover, if there is an edge pinned in Ω 1 to a known value, the corresponding edge is also pinned in Ω to the same value. Once we find that in Ω 1 we revert back to work in Ω and apply the pinned value to the pinned edge.
All that remains to be shown is that pinning always happens in Ω 1 . Each EO-Eq-4-block splits into some number of connected components in Ω 1 . Suppose some component contains a cycle. Such a cycle must alternate between = 2 (these are the newly created ones from splitting the E k -blocks of arity 4) and ExactOne d signatures for d ≥ 3 (the cycle may involve only one ExactOne d and one = 2 , in which case the cycle has length 2). Each cycle has even length (as each copy of = 2 takes length 2), and there are exactly two potential satisfying assignments, which assign exactly one 0 and one 1 to the two cycle edges incident to each ExactOne d signature. Then any edge not on the cycle but incident to some vertex in the cycle is pinned to 0. Such edges must exist, for ExactOne d signatures in the cycle are of arity at least 3. Thus we have found pinned edges.
Hence we may assume there are no cycles in these components, and every such component forms a tree. We can view this tree as a tree on vertices labeled by EO functions and edges by = 2 's. Since we have at least one copy of = 2 in each component, and it does not form a loop on an EO signature, the tree has n ≥ 2 vertices, and n − 1 edges. Similar to the discussion in item 1 above for connecting two EO functions ExactOne d and ExactOne ℓ by a single = 2 , the whole tree is an ExactOne t function for some arity t. Since each vertex in the tree has degree at least 3, the arity t ≥ 3n − 2(n − 1) = n + 2 ≥ 4. We replace these components by ExactOne t 's.
Thus, each connected component in the graph underlying Ω 1 is a planar bipartite graph with E k -blocks of arity at least 6 on the one side and EO signatures on the other. By Lemma 7.6, no component is simple, which means that there are parallel edges between some E k -block and some EO signature. As discussed earlier, there must exist some pinned edge, and we can find a pinned edge with a known value in polynomial time. This finishes the proof.
As indicated in the proof, Lemma 7.7 holds for the weighted version of the signature sets as well. As defined in Section 2, a weighted binary disequality (0, a, b, 0) (in truth table notation)  We now briefly describe the modifications needed to prove Lemma 7.8, the weighted version of Lemma 7.7. First, the removal of weighted = 2 from the RHS still works provided we keep track of the resulting weighted = 2 on the RHS after combining a chain of three weighted = 2 's. Next for a pinned edge e connected by a weighted = 2 on the LHS with another edge e ′ , we obtain a factor depending on the pinned value is 0 or 1, and e ′ is also pinned to the same value as e. The update on the weighted = k or weighted EO signatures that are connected to e and e ′ on the RHS can be done similarly, keeping track of a multiplicative factor.
If a weighted EO signature ExactOne k:c 1 ,. ..,c k has its ith and jth variables connected to the 1st and 2nd variables of a weighted = 2 signature (0, a, b, 0), we obtain [1, 0] ⊗(k−2) multiplied by ac j +bc i . If ExactOne n:c 1 ,. ..,cn and ExactOne m:d 1 ,. ..,dm are connected by (0, a, b, 0), for notational simplicity we may assume the nth variable of ExactOne n:c 1 ,. ..,cn is connected to the 1st variable of (0, a, b, 0), and the mth variable of ExactOne m:d 1 ,. ..,dm to the second. Then we obtain a weighted version of ExactOne n+m−2 , where the parameters are ac i d m for 1 ≤ i ≤ n − 1 and bc n d j−n+1 for n ≤ j ≤ n + m − 2.
Weighted versions of E k -block are defined in the same way, except there will be two factors (a, b) associated to it: When all + dangling edges are assigned 1 and all − dangling edges are assigned 0, we get value a, and in the complement assignment we get value b.
Finally when we split an E k -block of arity 4 into two parallel = 2 's, we do not have to keep track of the weight of the E k -block of arity 4, because the purpose of that split is just to find a pinned edge. When such a pinned edge is found we revert back from Ω 1 to Ω and continue there.
These observations lead to: · · · · · · · · · (a) Type 1 · · · · · · · · · · · · (b) Type 2  Unlike the situation in Lemma 7.6, a planar (5, 3)-regular bipartite graph can be simple. However, we show that any planar simple bipartite graph where the degree from one side is at least 5 and the degree from the other side is at least 3 must have a special induced subgraph. We call this structure a "wheel", which is pictured in Figure 21  Proof. Let V = L ∪ R be the set of vertices and let F be the set of faces. We assign a score s v to each of its vertices v ∈ V . We will define s v so that v∈V  3. For −|E|, we separate two cases. As G is simple and bipartite, there is no self loop. For any edge if one of the two endpoints has degree 3, we give the degree 3 vertex a score of − 7 12 , and the other one − 5 12 . This is well defined because all degree 3 vertices are in R. If the endpoints are not of degree 3, we give each endpoint − 1 2 . This accounts for −|E|. Note that since G is bipartite, every k-gon face has k even. And since G has no parallel edges, we have k > 2. Hence k ≥ 4. Also, the number of occurrences v appears when we traverse all faces is the degree of v. Thus the total score for v coming from all faces is at most deg(v) 4 . Now we have the following claim. Claim: s v ≤ 0 unless v ∈ L and deg(v) = 5. To prove the claim, first suppose v ∈ L and has degree d ≥ 6. Then Next, suppose v ∈ R and v has degree d ≥ 4. Then every edge incident to v gives a score − 1 2 . Hence, The remaining case is that v ∈ R and v has degree 3. Then, The claim is proved.
Since the total score is positive, there must exist v ∈ L, deg(v) = 5, and s v > 0. Because G is bipartite and simple, v and its five neighboring vertices v 1 , . . . , v 5 are six distinct vertices.
We then claim that there must exist such a v so that all five occurrences of adjacent faces are 4-gons. Suppose otherwise. Then for any such v, among the five occurrences of faces adjacent to v, at least one occurrence of a k-gon has k ≥ 6. In this case, Moreover, if v is adjacent to more than one occurrences of k-gons with k ≥ 6, Then contrary to the assumption that s v > 0. Hence v is adjacent to exactly one occurrence of k-gon with k ≥ 6-we will call it F v -and all other occurrences are 4-gons. Clearly In F v , v has two neighbors in R. We associate each vertex v that has a positive score to the vertex on F v that is the next one in clockwise order from v. By bipartiteness, every such v is associated to a vertex in R. We do this association in all occurrences of faces containing at least one positively scored vertex. It is possible that more than one such v are associated to the same u ∈ R. Suppose a vertex u ∈ R is associated to from ℓ different such vertices of positive score. This means that u is adjacent to at least ℓ many occurrences of k-gons with k ≥ 6. Note that ℓ ≤ deg(u). Then, if u has degree 3 then 0 ≤ ℓ ≤ 3, and u has score If u has degree d ≥ 4 then 0 ≤ ℓ ≤ d, and u has score Hence in any case, we have s u ≤ − ℓ 12 . This implies that the total score of u and all positively scored vertices associated to u is at most 0. However each positively scored vertex is associated to a vertex in R. Hence the total score cannot be positive. This is a contradiction.
Therefore there exists v ∈ L such that s v > 0, and has degree 5, and all adjacent occurrences of faces are 4-gons. Then we can name these five occurrences of 4-gons to have vertex sets If all neighbors of v have degree 3, that is a wheel of type 1 as in Figure 21a. If one neighbor of v has degree ≥ 4, that is a wheel of type 2 as in Figure 21b.
As we shall see, either structure in Figure 21 leads to pinned edges. Proof. We proceed as in Lemma 7.7 up until the point of getting Ω 1 . Note that due to (7.9) the only nontrivial E 5 -blocks of arity ≤ 4 are = 2 and those in Figure 19a. Moreover, each connected component of Ω 1 is planar and bipartite with vertices on one side having degree at least 5 and those on the other at least 3. We only need to show that there are edges pinned in Ω 1 . Unlike in Lemma 7.7, the underlying graph of Ω 1 does not satisfy the condition of Lemma 7.6 but that of Lemma 7.9. If the graph is not simple, then there are pinned edges similar to Lemma 7.7. Otherwise by Lemma 7.9, the wheel structure in Figure 21 appears. Note that by (7.9), n + ≡ n − mod 5 and the arity n + + n − = 5 imply that the center vertex, which is an E 5 -block, has signature = 5 . All we need to show is that wheel structures of either type contain pinned edges.
First we claim that if a wheel of either type has a E 5 -block, call it E 1 , on the outer circuit that has different sign labels (+/−) on the two edges incident to it along the circuit, then the center vertex denoted by E o and has signature = 5 , is pinned. This is pictured in Figure 22a. It does not matter whether the wheel is type 1 or 2, or the position of E 1 relative to the special triangle P 1 in type 2. Because E o is an equality, both e 1 and e 2 , the two edges incident to E o that are connected to the two EO signatures flanking E 1 , must take the same value. If both e 1 and e 2 are assigned 1, then the two incoming wires of E 1 along the circuit have to be both assigned 0, whereas they are marked by different signs. This is a contradiction. Hence both e 1 and e 2 are pinned to 0 as well as all edges incident to E o .
We may therefore assume that each E 5 -block has equal signs along the outer circuit, either ++ or −− (some may have ++ while others may have −−). Then as far as the two edges along the e2 e1 · · · · · · · · · · · · (a) Different signs of an E5-block along the outer circuit lead to pinning Eo e e ′ P1 · · · · · · · · · · · · (b) Edges e and e ′ are pinned in wheels of type 2 outer circuit incident to each E 5 -block are concerned, each E 5 -block serves as a binary equality; this is true regardless whether the five triangle vertices for E 5 -block's along the outer circuit in Figure 21 are distinct or not.
Suppose the wheel has type 1. If the edges incident to E o are assigned 0, then the five ExactOne 3 signatures along the outer circuit have all effectively become = 2 along the circuit. If we now consider the E 5 -block signatures along the outer circuit as equalities (since they have signs ++ or −−) and treat them as edges, we get a cycle on the five ExactOne 3 signatures along the outer circuit as a cycle of five = 2 's. This has no satisfying assignment. Hence E o and all its incident edges are pinned to 1.
Otherwise the wheel is of type 2, and each E 5 -block has signs ++ or −− along the outer circuit. We denote by P 1 the special ExactOne d function that has arity d > 3. We claim that the two edges e and e ′ incident to P 1 along the circuit are both pinned to 0. This is illustrated in Figure 22b. As P 1 is ExactOne d , at most one of e and e ′ is 1. If one of e and e ′ is 1, the other is 0, and as P 1 is an ExactOne d function its edge to E o is also 0, and thus all edges incident to E o are 0. As all five neighbors of E o are EO functions, the four ExactOne 3 functions effectively become ( = 2 ) functions along the wheel, and we can remove E o and its incident edges. This becomes the same situation as in the previous case of type 1, where effectively a circuit of five binary equalities are linked by five binary disequalities, which has no valid assignment. This implies that both e and e ′ are pinned to 0. This finishes the proof.
Similar considerations as that after the proof of Lemma 7.7 lead to the weighted version of Lemma 7.10.

Lemmas related to M 4 and P 2
Now we prove some lemmas relating to M 4 and P 2 , defined in Section 3, that are used in the proof of the full dichotomy, Theorem 8. 1.
Recall that AllButOne d is the signature [0, . . . , 0, 1, 0] of arity d, which is the reverse of ExactOne d . After a Z transformation, M 4 contains both AllButOne d and ExactOne d . However, for arity at least 3, if both appear, then with any = k the problem is hard.  > 4), and obtain ExactOne 4 and AllButOne 4 . If either of the two arities d 1 or d 2 is 3, then we connect two copies together via = 2 to realize an arity 4 copy.
Moreover, we use the gadget illustrated in Figure 23 to create the functionĝ in Lemma 6.7 as an E k -block. Then by Lemma 6.7 By definition P 2 = A 2 , and by Lemma 3.2, signatures in P 2 are non-degenerate weighted equalities under the Z transformation. The next several lemmas show that the hardness criterion is the same regardless of the weight. We do another diagonal transformation by D = 1 0 0 c 1/n . Then Pl-Holant(f, g 1 , g 2 ) where in the last line we ignored several nonzero factors. The lemma follows from Lemma 7.12. We also need to consider the mixture of P 2 and binary signatures.

Proof. We do a Z transformation and get
where in the second line we ignore a nonzero factor on If (ZD 1 ) −1 ⊗2 h ∈ P, then h ∈ ZD 1 P = ZP as D 1 ∈ Stab(P). In the latter case, we construct = 2n on the right by connecting three copies of = n to one copy of = n via = 2 . We do the same construction again to realize = 4n using = 2n . We connect n − 1 many [a, b, c]'s to = 2n via = 2 to realize a binary weighted equality [1, 0, r] with r = (a/c) n−1 = 0 ignoring a factor of c n−1 . Note that r 2n = (a/c) 2n(n−1) = 1. Then we do another diagonal transformation of D 2 = 1 0 0 r 1/2 to get Pl- as r 2n = 1.
Hence we have = 2 and = 4n on the right. With = 2 on the left, we get = 2 on the left and therefore equalities of all even arities on the right. Let D = (D 1 D 2 ) −1 . Then we have the reduction chain:  The proof of this lemma is divided into two parts: We first prove the lemma when F * ∩ P 2 = F ∩ P 2 . In this case, there exists some degenerate signature (ZD[a, b]) ⊗m ∈ F for some ab = 0 and m ≥ 1. Since F * ∩ P 2 contains unary signatures, we have k = 1, where k is the gcd of arities defined in the statement of the lemma. We prove that in this case the problem Pl-Holant(F) is #P-hard. Indeed, we have and we prove the former problem is #P-hard.
We write d = 2 + δ, with δ ≥ 1, and we perform the following operations.
up to a nonzero factor. Hence Finally, Pl-Holant (= s | h) is #P-hard by Theorem 2. 24. This completes the first part of the proof, and now for the second part we assume F * ∩ P 2 = F ∩ P 2 .
By a weighted equality we mean a signature of the form [a, 0, . . . , 0, b] of some arity ≥ 1, where ab = 0. Recall that P 2 consists of the Z transformation of all weighted equalities (see Lemma 3.2). Weighted equalities are transformed to weighted equalities under the diagonal transformation D. Let G be the set of weighted equalities in (ZD) −1 F. In other words, G = (ZD) −1 (F ∩ P 2 ) as (ZD) −1 P 2 contains all weighted equalities. Moreover, up to a nonzero factor, (= n ) ∈ G, as the signature g = (ZD) ⊗n (= n ) ∈ F ≥3 nd ∩ P 2 ⊆ F ∩ P 2 . Pick any g 1 , g 2 ∈ G of arities ℓ 1 and ℓ 2 . Let r = gcd(ℓ 1 , ℓ 2 ). Let t 1 , t 2 be two positive integers such that t 1 ℓ 1 − t 2 ℓ 2 = r. Then connecting t 1 copies of g 1 and t 2 copies of g 2 via = 2 in a bipartite and planar way, we get a weighted equality signature of arity r.
Applying the same argument repeatedly, we can construct a weighted equality h of arity k. We can choose a diagonal transformation D 1 of rank 2 that transforms it to = k , that is, where in the last line we ignored nonzero factors of ExactOne d and = 2 . If k = 3 or 4, then the hardness follows from Corollary 7.5.
If k = 1 or 2, then on the right hand side we have = k , which is = 1 or = 2 , and a weighted equality We move the = k to the left hand side via = 2 . Then we connect zero or more copies of this = k , which is = 1 or = 2 , toĝ ′ such that its arity is 3 or 4. (It is possible that n = 3 or 4 to begin with, and if so we do nothing.) We are done by yet another diagonal transformation and Corollary 7.5. Lemma 7. 16. Let F be a set of symmetric signatures. Suppose F ⊆ ZP ∪M σ 4 for some σ ∈ {+, −} and the greatest common divisor of the arities of all signatures in F * ∩ P 2 is k ≥ 5. Then Pl-Holant(F) can be computed in polynomial time. Proof. We may assume that σ = + and the case of σ = − is similar. We do a Z transformation on Pl-Holant(F), and get a problem of Pl-Holant = 2 | Z −1 F .
As stated after Definition 2.6, symmetric signatures in P are either degenerate, or binary Disequality = 2 , or [a, 0, . . . , 0, b] for some a, b ∈ C. There is a 1-1 correspondence between degenerate signatures in F and degenerate signatures in Z −1 F, and every degenerate signature in F can be written as (Z[a, b]) ⊗m for some m ≥ 1 and a,  The reduction goes as follows. With = 2 on the left hand side and = t on the right hand side, we can construct all E t -blocks and hence all of EQ t on the right. Note that G ⊆ EQ t . Then we move all signatures in G to the left via = 2 .
The #P-hardness of Pl-Holant G | EO + for t ≤ 4 follows from Corollary 7. 5. We give a reduction to Pl-Holant G | EO + . We construct = 2 on the left using the gadget pictured in Figure 7a with (= r ) ∈ G on the left side assigned to circle vertices and = 2 on the right side assigned to square vertices. Then we move G to the right side via = 2 on the right side. We construct = t on the right side in the same Euclidean process using G of the right side and = 2 of the left side. This gives us a reduction from Pl-Holant ( = 2 | = t , EO), which is #P-hard by Corollary 7.5 if t = 3, 4. Otherwise t = 1, 2. Recall that (= r ) ∈ G for some r ≥ 3. We use = t to reduce the arity of = r to 3 or 4, if necessary. Again we are done by Corollary 7. 5  Proof. We may assume that F contains no identically 0 signatures. We note that removing any identically 0 signature from a set does not affect its complexity, being either tractable or #P-hard, and it does not affect the set F satisfying any of the listed conditions in Case 1 to 7. If all non-degenerate signatures in F are of arity at most 2, then the problem is tractable case 1. Otherwise, there is a non-degenerate signature f ∈ F of arity at least 3. By Theorem 6.1, 3 , then we are done by Corollary 5.4, Lemma 5.8, Corollary 5.6, or Lemma 5.10 respectively. Therefore, we assume that none of these is the case. This implies that F ≥3 nd is nonempty and that each of its signatures is in P 2 or in M 4 or vanishing. That is, In fact, as stated after Lemma 3.10, all signatures in M 4 of arity at least 3 already belong to V . We keep M 4 in the union because M 4 is treated separately than V \ M 4 in the following proof.
Suppose there exists some f ∈ F ≥3 nd that is in V \ M 4 . We assume f ∈ V + since the other case V − is similar. In this case, we show that Pl-Holant(F) is #P-hard, unless F is in Case 4 or Case 2 We will discuss non-degenerate signatures of arity ≥ 3, of arity 2, and degenerate signatures separately. 1. For any g ∈ F ≥3 nd , since signatures in M 4 of arity at least 3 already belong to V , we have g ∈ P 2 ∪ V . If g ∈ P 2 , then Pl-Holant(f, g) is #P-hard by Lemma 4.7. If g ∈ V − , then Pl-Holant(f, g) is #P-hard by Lemma 4.5 as f ∈ M 4 . Therefore we may assume g ∈ V + . 2. For any non-degenerate binary signature h ∈ F , it must be that h ∈ R + 2 as otherwise Pl-Holant(f, h) is #P-hard by Lemma 4. 3. 3. If rd + (g) = 1 for all g ∈ F ≥3 nd , then F ≥3 nd ⊆ R + 2 by Lemma 2. 19. Together with the fact just proved that all non-degenerate binary in F are in R + 2 , Case 5 is satisfied. Otherwise there exists g ∈ F ≥3 nd such that rd + (g) ≥ 2. By the first item above, g ∈ V + . If F contains any degenerate signature v = u ⊗m for m ≥ 1 and some unary u that is not a multiple of [1, i], then by Lemma

Suppose F ≥3
nd ⊆ P 2 . If F contains a non-degenerate binary signature h, then we apply Lemma 7.14 and Pl-Holant(F) is #P-hard unless h ∈ ZP, or Pl-#CSP 2 (DZ −1 F) ≤ T Pl-Holant(F) for some diagonal transformation D. If it is the latter case, then by Theorem 5.1, either Pl-Holant(F) is #P-hard, or DZ −1 F is a subset of T A , P, or T 1 1 1 −1 M , for some diagonal matrix T . We claim that in any of these cases Pl-Holant(F) is tractable.  13

Planar #CSP 2 Dichotomy
In Part II of this paper, we prove Theorem 9.2, which is the complexity dichotomy theorem of Pl-#CSP 2 (F), where F is a set of complex-valued symmetric signatures on Boolean variables. After we define some relevant notions, we give an outline of the proof of Theorem 9.2. Throughout Part II, we denote by α (respectively ρ) any quantity that satisfies α 4 = −1 (respectively ρ 4 = 1) and ϵ = ±1.

Preliminaries
We will first define some tractable families of signatures that are expressible under a holographic transformation, specific to the Pl-#CSP 2 framework.   4 . Also note that for all such T , we have (= 2n In the proof of No-Mixing of different tractable sets in later sections, because of a particular order in which we carry out the proof, to make an overall logical structure more apparent we introduce the following notations We will prove the following Main Theorem of Part II. It is not hard to see that this is a rephrase of Theorem 5.1 from Part I. It follows from Theorem 11.13, Theorem 16.5 and Theorem 15.4, which will be shown in later sections. It follows from the definition of P-transformability, A -transformability and M -transformability that if F ⊆ S k for any 1 ≤ k ≤ 5, then Pl-#CSP 2 (F) is tractable.

Theorem 9.2. For any set of complex-valued symmetric signatures F on Boolean variables, if
Proof Outline of Theorem 9. 2. The overall plan is to break the proof into two main steps.
The first step is to prove the dichotomy theorem for Pl-#CSP 2 (F) when there is at least one nonzero signature of odd arity in F. In this case we can make use of Lemma 10.2 that shows that we can simulate Pl-#CSP(F) by Pl-#CSP 2 (F) if F includes a unary signature [a, b] with ab = 0. Then we can apply the known dichotomy Theorem 9.22 for Pl-#CSP. However this strategy (provably) cannot work when every signature in F satisfies parity constraints, as in this case there is no unary signature [a, b] with ab = 0. For this case we employ other means. This first step of the proof is relatively uncomplicated.
The second step is to deal with the case when all nonzero signatures in F have even arity. This is where the real difficulties lie. In this case it is impossible to directly construct any unary signature. So we cannot use Lemma 10.2  In this case, we can construct a special binary signature, and then use Lemma 13.2 to obtain [1, 1] ⊗2 by interpolation. This proof uses the theory of cyclotomic fields. This simplifies the proof greatly. For all other cases (when F has only even arity signatures), the proof gets going in earnest-we will attempt an induction on the arity of signatures.
The lowest arity of this induction will be 2. We will try to reduce the arity to 2 whenever possible; however for many cases an arity reduction to 2 destroys the #P-hardness at hand. Therefore the true basis of this induction proof of Pl-#CSP 2 starts with arity 4. Consequently we will first prove a dichotomy theorem for Pl-#CSP 2 (f ), where f is a signature of arity 4. This proof is presented in Section 12. Several tools will be used. These include the rank criterion for redundant signatures, Theorem 9.21 for arity 2 signatures, and a trick we call the Three Stooges by domain pairing.
However in the next step we do not attempt a general Pl-#CSP 2 dichotomy for a single signature of even arity. This would have been natural at this point, but it would have been too difficult. We will need some additional leverage by proving a conditional No-Mixing Lemma for pairs of signatures of even arity. So, seemingly taking a detour, we prove that for two signatures f and g both of even arity, that individually belong to some tractable class, but do not belong to a single tractable class in the conjectured Pl-#CSP 2 dichotomy (that is yet to be proved), the problem Pl-#CSP 2 (f, g) is #P-hard. We prove this No-Mixing Lemma for any pair of signatures f and g both of even arity, not restricted to arity 4. Even though at this point we only have a dichotomy for a single signature of arity 4, we prove this No-Mixing Lemma for higher even arity pairs f and g by simulating two signatures f ′ and g ′ of arity 4 that belong to different tractable sets, from that of Pl-#CSP 2 (f, g). After this arity reduction (within the No-Mixing Lemma), we prove that Pl-#CSP 2 (f ′ , g ′ ) is #P-hard by the dichotomy for a single signature of arity 4. After this, we prove a No-Mixing Lemma for a set of signatures F of even arities, which states that if F is contained in the union of all tractable classes, then it is still #P-hard unless it is entirely contained in a single tractable class. Note that at this point we still only have a conditional No-Mixing Lemma in the sense that we have to assume every signature in F belongs to some tractable set.
We then attempt the proof of a Pl-#CSP 2 dichotomy for a single signature of arbitrary even arity. This uses all the previous lemmas, in particular the conditional No-Mixing Lemma for a set of signatures. However, after completing the proof of this Pl-#CSP 2 dichotomy for a single signature of even arity, the conditional No-Mixing Lemma becomes unconditional.
Finally the dichotomy for a single signature of even arity is logically extended to a dichotomy theorem for Pl-#CSP 2 (F) for a set of signatures where all signatures in F have even arity. Together with the first main step when F contains some nonzero signature of odd arity, this completes the proof of Theorem 9.2.
In the rest of this Section 9, we will introduce the operators ∂ and , and give some characterizations of the tractable classes. We will also introduce some preliminary lemmas, including one using the domain pairing technique, and list some known dichotomies. In Section 10, we discuss a technique to simulate Pl-#CSP by Pl-#CSP 2 . Section 11 proves Theorem 9.2 in the case when F contains at least one nonzero signature of odd arity. Section 12 proves the base case of the even arity case of Theorem 9.2 when F consists of a single signature of arity 4. Section 13 gives an application of cyclotomic field which simplifies the proof of Theorem 9.2 when F contains a signature in M \ (P ∪ A ). Section 14 proves the conditional No Mixing lemmas for a pair of signatures of even arity. Section 15 generalizes the No Mixing lemmas to a set of signatures of even arity. Section 16 finishes the proof of Theorem 9.2.
Remark 5. We occasionally make some remarks (such as Remark 6 and Remark 7 in Subsection 13.2) to explain the complications forced upon the proof by various reasons, and why another more straightforward approach would not succeed. These remarks are not logically necessary to the proof, but hopefully they provide some insight and point out pitfalls in the proof.
In this section we collect a number of simple facts which may appear disparate and unmotivated. They are collected here in one place for the convenience of presenting the proof in later sections. Readers can skim these first and come back to them when needed.
The next lemma is a simple fact that is used many times. It says that the set {0, 1, i, −1, −i, ∞} is closed set-wise under the mapping z → z+1 z−1 on the extended complex plane C ∪ {∞}. The proof is straightforward, so we omit it. This derivative signature will be denoted by ∂ g (f ). If km < n and we connect k copies of g to f , which is the same as forming ∂ g (f ) sequentially k times, the resulting repeated derivative signature is denoted by ∂ k g (f ). If g = [1, 0, 1], we denote ∂ g (f ) simply by ∂(f ).

Calculus:
Our proof will make substantial use of an analog calculus using this notion of a derivative. This calculus is essentially a systematic way to calculate the signatures of some gadget constructions.
In a Pl-Holant problem Pl-Holant(G | F ), if g ∈ G and f ∈ F , then we say that g is from the LHS and f is from the RHS. If f has arity n and g has arity m, and n > m, then we can form the signature ∂ g (f ) and Pl-Holant To familiarize the readers with this calculus, we list some simple calculations below, which we will use often in our proofs freely without comments. Recall that we use ϵ to denote ±1.
For any g, the operator ∂ g (·) is a linear operator. It also depends on g linearly. . . , f n−2 + f n ] has arity n − 2. 3. Let f be of arity n and f k = ϵ k (n − 2k) for some ϵ = ±1 and for 0 ≤ k ≤ n, then

For
• ∂(f ) has arity n ′ = n − 2 and (∂(f )) k = 2ϵ k (n ′ − 2k). If n is odd, then ∂ n−1  Now we define an inverse operator (·) to ∂. Just like the usual calculus there is a certain non-uniqueness in the expression in an indefinite integral; this non-uniqueness is addressed in Lemma 9.5. One reasonable definition for ([f 0 , f 1 , . . where we define f k = 0 for all k > n. Clearly ∂(F ) = f . − y), · · · , i n (x + (−1) n y)] for some constants x and y.  ⊗n . In this paper, we choose to write the expression (f ) by the following definition when a certain special expression of f exists. This is more convenient for our proofs.

Definition 9.6. For n ≥ 3, (·) is a linear operator and
• If the signature g has arity n − 2 and g k = ϵ k (n − 2 − 2k), then (g) has arity n and [ (g)] k = 1 2 ϵ k (n − 2k). • If the signature g has arity n − 2 and g k = (ϵi) k (n − 2 − 2k), then (g) has arity n and Clearly for all f where (f ) is given in the above definition, ∂[ (f )] = f . When we prove the dichotomy theorem for Pl-#CSP 2 (f ), where f has arity n, we can get a signature f ′ of arity n − 2 by taking a self loop with f , i.e., f ′ Thus Pl-#CSP 2 (f ) is also #P-hard. Definition 9.6 allows us to write down an explicit expression for (f ′ ) for all cases when f ′ ∈ P ∪ A ∪ M .
The following is an explicit list of (f ′ ) for f ′ We can recover f up to the constants x, y from ∂(f ) by Lemma 9.5. This list is for the convenience of the readers.
Note that all the f ′ in the list are linear combinations of the signatures in Definition 9.6 and (·) is a linear operator. So the list follows from Definition 9.6 directly.
The following lemma is used to determine whether a binary signature belongs to various tractable sets P, A , A † , M , and M † . It can be proved directly by the definition. = [a, b, −a] or [a, 0, a]. Proof. The condition for f ∈ P follows from Definition 2. 6.

Lemma 9.8. For any binary symmetric signature
The condition for f ∈ A follows from the lists after Definition 2. 5.
Then the condition for f ∈ A † follows from the condition f ∈ A . By Proposition 2.8, one binary signature is in M iff it has the form [x, 0, y] or [0, x, 0]. After the holographic transformation using 1 1 1 −1 , we get the condition for f ∈ M . Then after the holographic transformation using [ 1 0 0 i ], we get the condition for f ∈ M † . Corollary 9.9 gives some necessary conditions for a binary signature to belong to a tractable set.

Corollary 9.9. For any binary signature f = [a, b, c],
• f ∈ P =⇒ f satisfies either the parity constraints or b 2 = ac.
Furthermore, all signatures in each tractable set satisfy a second-order recurrence relation. For a non-degenerate symmetric signature f of arity at least 3, if f has type a, b, c , its type is uniquely determined up to a nonzero multiple. The next lemma states this type information for the various tractable sets. We can use the lemma to check whether a symmetric signature can possibly be in a tractable set. Lemma 9. 11. Let f ∈ P ∪ A ∪ M be non-degenerate and have arity ≥ 3.
After the holographic transformation using [ 1 0 0 α ], we get the conditions for f ∈ A † and f ∈ A † \ P.
By Proposition 2.8, f ′ ∈ M iff f ′ ∈ x, 0, y or f ′ ∈ 0, 1, 0 . Then after the holographic transformation using 1 1 1 The following two corollaries follow from Lemma 9.8 for the binary case, and Lemma 9.11 for arity n ≥ 3.
The following lemma gives a characterization of M \ (P ∪ A ). By the second-order recurrence relation of the signatures in M \ (P ∪ A ), we have the following lemma that will be used in the proof of Theorem 11.11. Recall that M = M ∪ M † . For f with arity n ≥ 3, by Lemma 9.11, there exists a constants c = 0 such that f ∈ 1, c, 1 . Note that there exists f k = 0, where 1 ≤ k ≤ n − 1 by f / ∈ P. If f satisfies the parity constraints, The proof for f ∈ M † \ (P ∪ A ) follows from a holographic transformation by The following lemma gives a characterization of nonzero signatures in M . A Gen-Eq is a signature of the form f = [a, 0, . . . , 0, b], called a generalized equality (with a = 0 or b = 0 allowed.)

Lemma 9.16. A Gen-Eq signature f is in
Suppose f is a symmetric signature that is not a Gen-Eq. Then f ∈ M iff f satisfies a secondorder recurrence f k − cf k+1 + f k+2 = 0 (for 0 ≤ k ≤ arity(f ) − 2) and the following conditions hold.
If f has arity 2n, then Proof. By Proposition 2.8 and the holographic transformation using 1 1 Gen-Eq f ∈ M iff it takes the first form with st = 0. Suppose f is not a Gen-Eq, then we have st = 0 in the first form. In particular f is not identically zero. In both forms, f satisfies a second-order recurrence , for some c. For example in the first form with a tensor sum, the product of the eigenvalues s/t · t/s = 1.
We proof the lemma for the case that m = 2n is even (the odd-arity case is similar and we omit it here).
If For odd arity, the proof is similar. We omit it here.
Corollary 9. 17. If f ∈ M † has even arity 2n, then In other words, for all 0 ≤ k ≤ 2n, The discussion above is a characterization of symmetric tractable signatures. In more detail, we characterize the binary symmetric tractable signatures in Lemma 9.8 and Corollary 9. 9. For symmetric signatures of arity ≥ 3, we use the type of the second-order recurrence relation to characterize them in Lemma 9.11. More characterizations are given in Lemma 9.14 and 9. 16. Moreover, by Definition 2.6, all unary signatures are in P. If a unary signature satisfies the parity constraints, then it is in P ∩ A ∩ A † , but is not in M ∪ M † . We summarize these relationships among the tractable signatures in Figure 35 and 36. In the proof of Pl-#CSP 2 dichotomy, we often use the following Corollary. It gives a characterization of a signature of arity 4 in M . It follows directly from Lemma 9.16 and the definition of Corollary 9. 18. An arity 4 signature f ∈ M has one of the following forms: An arity 4 signature f ∈ M † has one of the following forms: The following lemma can be proved by domain pairing. We can use it to derive #P-hardness of Pl-#CSP 2 problems by applying the known dichotomy of Pl-#CSP. Proof. For any instance of Pl-#CSP(g), we replace each edge e by two edges that connect the same incident nodes of e. For each variable node that is connected to k edges, we replace its label = k by = 2k . We replace each occurrence of g by f as a constraint. Then the new instance is a problem in Pl-#CSP 2 (f ) and has the same value as the given instance of Pl-#CSP(g), because g k = f 2k .
Note that the values f 2k+1 with an odd index contribute nothing to the partition function in this instance.
The Otherwise a = −1. Consider the gadget in Figure 24b. We assign f to the circle vertices and = 4 to the square vertices. This gives −8[1, 0, −1] ⊗2 on the left as desired.
Next we state a couple of complexity dichotomy theorems that were previously shown [13,31]. They are also quoted as Theorem 2.24 in Section 2 of Part I. Here we restate them for easier reference. The first is a dichotomy theorem about Boolean domain spin systems (counting complex weighted graph homomorphisms) on degree prescribed graphs. It includes Pl-#CSP 2 (f ), where f is a symmetric binary signature, as a special case.
is #P-hard unless one of the following conditions holds: 1.

In any exceptional case, the problem is computable in polynomial time.
Theorem 9.21 is explicit and easy to apply. Conceptually, it can be restated as Theorem 9.21 ′ , which supports the putative form of a Pl-#CSP d dichotomy (which is false, by Theorem 8.1 of Part I, for d > 2).
Further suppose that f is a non-degenerate, symmetric, complex-valued binary signature in Boolean variables. Then Pl-Holant (f | G) is #P-hard unless f satisfies one of the following conditions, in which case, the problem is computable in polynomial time: 1. there The following theorem is the dichotomy theorem of Pl-#CSP(F), where F is a set of symmetric signatures. This is also quoted as Theorem 2.25 in Part I.

Theorem 9.22 (Theorem 9.3 in [26]). Let F be any set of symmetric, complex-valued signatures in Boolean variables. Then Pl-#CSP(F) is #P-hard unless F ⊆ A , F ⊆ P, or F ⊆ M , in which case the problem is computable in polynomial time.
We repeat the definition of redundant matrices in Section 2.7.

Definition 9.23 (Definition 32, p. 1692 in [11]). A 4-by-4 matrix is redundant if its middle two rows and middle two columns are the same.
An example of a redundant matrix is the signature matrix of a symmetric arity 4 signature. Definition 9.24 (Definition 33, p. 1693 in [11]). The signature matrix of a symmetric arity 4 This definition extends to an asymmetric signature g as g 0000 g 0010 g 0001 g 0011 g 0100 g 0110 g 0101 g 0111 g 1000 g 1010 g 1001 g 1011 g 1100 g 1110 g 1101 g 1111 When we present g as an F-gate, we order the four external edges ABCD counterclockwise. In M g , the row index bits are ordered AB and the column index bits are ordered DC, in reverse order. This is for convenience so that the signature matrix of the linking of two arity 4 F-gates is the matrix product of the signature matrices of the two F-gates.
If M g is redundant, we also define the compressed signature matrix of g as The definition of compressed signature matrix is a slight change from [26] where M g 1 0 0 0 2 0 0 0 1 is called by that name. It does not affect the following lemma. We repeat the following lemma from [26], which is very convenient to apply.
The following lemma shows that if we have a unary [1, ξ] ∈ F with ξ = 0, then either F is contained in one single tractable set or Pl-#CSP 2 (F) is #P-hard. We will use this lemma for the case that F contains at least one nonzero signature of odd arity. The proof of this lemma also demonstrates in a simple setting the idea that will be used in the proof of Lemma 10.3. (= 2k ) of arity k on the LHS in Pl-Holant(EQ 2 |F) ≡ Pl-#CSP 2 (F), for all k ≥ 1. By a holographic transformation using T −1 , where T = 1 0 0 ξ , we have (E k k (ξ))T −1 = (= k ) on the LHS, and (10.13) where EQ on LHS of the Holant instance comes from E k k (ξ) in the second step of the reduction. If T F ⊈ P, T F ⊈ A and T F ⊈ M , then Pl-#CSP(T F) is #P-hard by Theorem 9. 22. Thus

Pl-#CSP(T F) ≤ T Pl-Holant(EQ ∪ EQ
Lemma 10.2 allows us to transfer the complexity question of Pl-#CSP 2 to that of Pl-#CSP, to which we can apply the known dichotomy (Theorem 9.22). However it requires a unary signature. We observe that if all signatures in F have even arities, then there is no way to construct a unary in Pl-#CSP 2 (F). In this case, we use the next lemma, which is similar to Lemma 10.2. It shows that if we have [1, ξ] ⊗2 with ξ = 0 in F, then we can still transfer the question of Pl-#CSP 2 to that of Pl-#CSP. It is proved using a global simulation of Pl-#CSP by Pl-#CSP 2 .

Lemma 10.3. Let F be a set of signatures of even arities. Suppose
} be the subset of signatures of odd arity in E(ξ). Let E e (ξ) = {E k k (ξ) | k ≡ 0 (mod 2)} be the subset of signatures E ℓ k (ξ) ∈ E(ξ) with even arity k and ℓ = k. Note that not all even arity signatures in E(ξ) are in E e (ξ); in partiuclar, k ≥ 2 for any E k k (ξ) ∈ E e (ξ). We will prove that Pl-Holant(E o (ξ) ∪ E e (ξ) | F) ≤ T Pl-#CSP 2 (F), and the conclusion of the lemma will follow by a holographic transformation.
For the rest of this proof, we write E ℓ k for E ℓ k (ξ). We first give an intuitive description of the proof method. For k ≥ 1 and ℓ ≥ 0, we have all of Given any instance Ω of Pl-Holant(E o (ξ) ∪ E e (ξ) | F ), since all signatures in F have even arities, the number of E ℓ k of odd arity in the LHS must be even. In each connected component of Ω, we will match up all LHS E ℓ k of odd arity in pairs in a planar way, and replace each by an even arity E ℓ−1 k+1 connected by [1, ξ] ⊗2 . When an odd arity E k ℓ is the signature assigned to a vertex on an edge separating two faces of the planar graph of Ω, we may consider this E k ℓ as belonging to either of the two faces. If an even arity E k k is such a signature between two faces, we can first transform it to an odd arity E k−1 k+1 . We will then carefully account for the number of odd arity signatures in E o (ξ) within each face, and argue that they can all be matched up in pairs in a planar way. Now we give the proof. First, we may assume that the planar graph Ω is connected and is given a planar embedding, since the Holant value on Ω is the product over its connected components.
The number of E ℓ k ∈ E o (ξ) of odd arity on the LHS is even in each connected component of Ω. We will match up pairs of E ℓ k of odd arity and use copies of [1, ξ] ⊗2 within each connected component. Let T be a spanning tree of the dual graph of Ω, and we pick the external face of Ω as the root of T . We will process each face of Ω by going from the leaves of T to the root. We prune the tree T as we carry out this process; after we have dealt with one face (a leaf node in the current tree) we will delete it from the tree T . If on a leaf (and non-root) node of the current T , i.e., a face F of Ω, there are an even number of odd arity LHS signatures in E o (ξ), we replace each such E ℓ k ∈ E o (ξ) by E ℓ−1 k+1 , and then we connect adjacent pairs of them in clockwise order within the face F with [1, ξ] ⊗2 . This maintains planarity, and as noted above this does not change the Holant value. Then we delete this F from T .
Suppose on the leaf node F there are an odd number of odd arity LHS signatures in E o (ξ), and suppose F is not the root of T . Let F ′ be the parent node of F in T and let e = {u, v} be the edge connecting F ′ and F . Since Pl-Holant(E o (ξ) ∪ E e (ξ) | F) is bipartite, either u or v is labeled by a signature from the LHS signature set E o (ξ) ∪ E e (ξ). We have two cases. 1. It is some E ℓ k ∈ E o (ξ). Then both k, ℓ ≥ 1 are odd. We match up the other (zero or more) odd arity LHS signatures in E o (ξ) within F in pairs, and replace them by even arity signatures in E(ξ) as above, connected with [1, ξ] ⊗2 in pairs while maintaining planarity as above. Then we delete this leaf node F from T and consider the odd arity E ℓ k , which is on either u or v, to belong to F ′ .

It is some E 2k
2k ∈ E e (ξ), for some k ≥ 1. On F there must be some LHS odd arity E t s ∈ E o (ξ) since there are an odd number of them in F . We find clockwise the first such E t s in F starting from E 2k 2k , and replace both E t s by E t−1 s+1 , and E 2k 2k by E 2k−1 2k+1 , and connect them by [1, ξ] ⊗2 . Note that E t−1 s+1 has even arity and t − 1 ≥ 0 is even, and E 2k−1 2k+1 has odd arity and 2k − 1 ≥ 1 is odd. This replacement does not change the Holant value, maintains planarity, and effectively changes the arity of E 2k 2k between F and F ′ to being odd. So we have transformed this case to case 1. Thus we can match up the other odd arity LHS signatures in E o (ξ) within F in pairs, and replace them by even arity signatures in E(ξ) and connected with [1, ξ] ⊗2 in pairs as above. Then we delete F from T and consider the odd arity E 2k−1 2k+1 belonging to F ′ . The above process does not change the property that the total number of LHS odd arity signatures from E o (ξ) is even. The proof is completed by induction. After the tree has been pruned so that only the root of T remains, there must be an even number of E ℓ k of odd arity in the external face corresponding to this root node, including those that have been transformed by its children in T and considered to belong to the root node. We can pair them up just as before.
This proves the reduction Then by a holographic transformation using T −1 , where T = 1 0 0 ξ , we have The rest of the proof is essentially the same as the proof of Lemma 10 Figure 25. We assignf to the circle vertices and [1, 0, 1] ⊗2 the dashed subgadgets rotated appropriately so that it is equivalent to assigning [1, 0, 1] to the square vertices. The signature of this gadget is = 4 , for any 0 ≤ r ≤ 3.  Now we simulate Pl-#CSP 2 (ĝ) by Pl-Holant(EQ 4 | [1, 0, 1] ⊗2 ,ĝ). Ifĝ has arity 2n ≡ 0 (mod 4), then we are done by Lemma 10.4. Ifĝ has arity 2n ≡ 2 (mod 4), then in an instance Ω of Pl-#CSP 2 (ĝ), the number of occurrences of Equalities of arity ≡ 2 (mod 4) has the same parity as the number of occurrences ofĝ, which could be odd. However, we observe that all entries of signatures in Pl-#CSP 2 (ĝ) are nonnegative integers. Thus the value of Ω is a nonnegative integer. Let Ω Ω be the disjoint union of two copies of Ω as a plane graph with a common external face, then the value of Ω Ω is the square of the value of Ω. Thus computing the values on Ω Ω and Ω are equivalent. In Ω Ω, the number of Equalities of arity ≡ 2 (mod 4) is even. Now we can use the same global simulation as in Lemma 10.4, except that in the last step we may use one extra copy of [1, 0, 1] ⊗2 to connect two Equalities of arity ≡ 2 (mod 4) at the two root nodes of the two spanning trees of the dual graphs of Ω, if the number of occurrences of Equalities of arity ≡ 2 (mod 4) in Ω is odd. Thus we have

Dichotomy Theorem when F Contains an Odd Arity Signature
In this section, we give a dichotomy theorem for Pl-#CSP 2 (F), where F includes at least one nonzero signature f that has odd arity.  , E), where G is bipartite and planar, and every vertex in U has degree 2. We replace every vertex in V of degree k (which is assigned = k ∈ EQ) with a vertex of degree 2k, and bundle two adjacent variables to form k bundles of 2 edges each. The k bundles correspond to the k incident edges of the original vertex with degree k. We assign = 2k to the new vertices of degree 2k.
To simulate [x 2 , y 2 , y 2 ], we connect two copies of f = [x, 0, y, 0] by a single edge as shown in Figure 26 to form a gadget with signature h (a 1 , a 2 , b 1 , b 2 1 , b 1 , c)f (a 2 , b 2 , c).
We replace every (degree 2) vertex in U (which is assigned [x 2 , y 2 , y 2 ]) by a degree 4 vertex assigned h, where the variables of h are bundled as (a 1 , a 2 ) and (b 1 , b 2 ).
The vertices in this new graph G ′ are connected as in the original graph G, except that every original edge is replaced by two edges that connect to the same side of the gadget in Figure 26. Notice that h is only connected by (a 1 , a 2 ) and (b 1 , b 2 ) to some bundle of two incident edges of an equality signature. Since this equality signature enforces that the value on each bundle is either (0, 0) or (1, 1), we only need to consider the restriction of h to the domain {(0, 0), (1, 1)}. On this domain, h = [x 2 , y 2 , y 2 ] is a symmetric signature of arity 2. Therefore, the signature grid Ω ′ with underlying graph G ′ has the same Holant value as the original signature grid Ω.
The following lemma is a dichotomy for Pl-#CSP 2 (f ) where f is a symmetric ternary signature.

Lemma 11.2. Let f be a symmetric signature of arity 3, then Pl-#CSP
, the proof follows from a holographic transformation using [ 0 1 1 0 ]. In the following, assume that f does not satisfy the parity constraints. Firstly, we have • For (f 0 + f 2 )(f 1 + f 3 ) = 0, we are done by Lemma 10.2.
Since f does not satisfy the parity constraints, The next lemma shows that if we have an odd arity signature in M \ (P ∪ A ), then we can prove Theorem 9.2 directly. The key point is that we can use such a signature to get a unary [1, ξ] with ξ = 0. Lemma 11. 3. Let F be a symmetric signature set and suppose f ∈ F has odd arity.
Proof. We will use our calculus with the derivative operator ∂. Firstly, we prove the lemma for f ∈ M \ (P ∪ A ). We already have F ⊈ P, F ⊈ A , F ⊈ A † by the presence of f , and F ⊈ M † by Corollary 9. 13. If we can construct a unary [a, b] with ab = 0, then we can finish the proof by Lemma 10.2. As f ∈ P and has odd arity, its arity n ≥ 3. By Lemma 9.14, the signature f ∈ M \ (P ∪ A ) can take one of the following two forms (see the Calculus after Definition 9.4):  Similarly, for f ∈ M † \ (P ∪ A ), we just need to construct a unary [a, b] with ab = 0. [1, ±i]. By Lemma 9.14, we have st = 0 and s 4 = t 4 , and so this is a nonzero multiple of [1, ±i]. So we are done by Lemma 10.2. We remark that the use of ∂ = 4 instead of just ∂ in this proof is necessary, because ∂ 2 (f ) = 0 when f k = λ(ϵi) k (n − 2k) and n ≥ 5. One may also suppose that the case for M † \ (P ∪ A ) can be reduced to the case for M \ (P ∪ A ) by the transformation T = [ 1 0 0 i ]. While T transforms M † to M , and keeps P and A invariant, this transformation does not keep EQ 2 invariant. In fact [1, 0, 1]T ⊗2 = [1, 0, −1] ∈ EQ 2 . Therefore we need to handle the proof for M † \ (P ∪ A ) separately.
By definitions of P and A , we have the following simple lemma.
Lemma 11. 4. Assume that f satisfies the parity constraints, then f ∈ P ∪ A iff f belongs to the following set, up to a scalar factor Proof. Note that f satisfies the parity constraints. Then by Definition 2.6, f ∈ P iff f belongs to up to a scalar factor. Moreover, by the lists after Definition 2.5, f ∈ A \ P satisfies the parity constraints iff f has the form [1, ρ] ⊗n ± [1, −ρ] ⊗n up to a scalar factor. Then after the holographic transformation using [ 1 0 0 α ], f ∈ A † \ P iff f has the form [1, α] ⊗n ± [1, −α] ⊗n up to a scalar factor. This finishes the proof.
The next lemma shows that if we have a nonzero odd arity signature f ∈ P ∪ A that does not satisfy the parity constraints, then we can obtain a unary [a, b] with ab = 0. Note that if we have a unary [a, b] with ab = 0, then we can apply Lemma 10.2. Lemma 11.5. If f ∈ P ∪ A has odd arity and does not satisfy the parity constraints, then we can construct a unary [a, b] with ab = 0 in Pl-#CSP 2 (f ).
Proof. Let f have arity 2n + 1, n ≥ 0. Not satisfying the parity constraints implies that f is not identically 0. Up to a nonzero factor, f has one of the following forms. If .
If a signature f satisfies the parity constraints, then there is no way to construct [a, b] with ab = 0 from f . In fact in Pl-#CSP 2 using f , the signature of any {f }-gate will also satisfy the parity constraints, and in particular a unary signature can only be a multiple of [1,0] or [0, 1]. The next lemma shows that if we have a nonzero odd arity signature f ∈ P ∪ A that satisfies the parity constraints, then we can obtain [1,0] or [0, 1]. We also remark that in Pl-#CSP 2 using signatures of even arity one can only produce signatures of even arity, and thus no unary signatures. Lemma 11. 6. If a nonzero f ∈ P ∪ A has odd arity and satisfies the parity constraints, then we can construct a unary [1,0] or [0, 1] in Pl-#CSP 2 (f ). Lemma 11.4, any nonzero f of odd arity belongs to the following set, up to a nonzero factor,  The next lemma shows that if we already have [1,0] or [0, 1] and also a signature f of any arity that does not satisfy the parity constraints, then we can construct a unary [a, b] with ab = 0.

Proof. By
Either i or j is odd. And so we have either = i+1 or = j+1 , and we can get either Then with two nonzero entries.
The next lemma assumes the presence of a non-degenerate binary Gen-Eq. The conclusion is about a transformed signature but still in the Pl-#CSP 2 setting.   11. 8.f satisfies a second-order recurrence with eigenvalues ±x − 1 2 ρ with sum 0 and product −ρ 2 /x. Hencef has type −ρ 2 /x, 0, 1 . Moreover, the second-order recurrence relation is unique up to a scalar sincê f is non-degenerate and has arity 3. By (x −1 ρ 2 ) 4 = 1, we havef / ∈ P ∪ A ∪ M by Lemma 9.11. So Pl-#CSP 2 (f ) is #P-hard by Lemma 11.2. Thus Pl-#CSP 2 (f, h) is #P-hard.  Proof. Consider the gadget in Figure 27. We assign f to the circle vertices and g to the triangle vertices. Let h be the signature of this gadget.
Recall the notations S 1 , . . . , S 5 introduced in (9.12). We have Now we can prove a conditional No-Mixing theorem for Pl-#CSP 2 when a set of signatures F is assumed to consist of only tractable signatures and has at least one nonzero signature of odd arity.
Theorem 11.11. Let F ⊆ 5 k=1 S k be a set of symmetric signatures that includes at least one nonzero signature of odd arity. If F ⊈ S k for all 1 ≤ k ≤ 5, then Pl-#CSP 2 (F) is #P-hard.
Proof. If F contains a signature of odd arity in M \ (P ∪ A ), then we are done by Lemma 11.3. Thus we can assume that F contains at least one nonzero signature of odd arity f ∈ P ∪ A .
By Lemma 11.5, if f does not satisfy the parity constraints, then we have a unary [a, b] with ab = 0 and we are done by Lemma 10.2. Otherwise, we have [1,0] or [0, 1] by Lemma 11.6. If there exists a signature in F that does not satisfy the parity constraints, then we can obtain a unary [a, b] with ab = 0 by Lemma 11.7. Thus we are done by Lemma 10.2. Now we can assume that F includes a nonzero odd arity signature f ∈ P ∪ A and all signatures in F satisfy the parity constraints. Thus F ∩ M \ (P ∪ A ) = ∅ by Corollary 9. 15 Note that the following signatures are all in 5 k=3 S k (see Figure 35): For n ≥ Let to the given condition of the theorem. Let If S = ∅ and T = ∅, then there exist g, h ∈ F ′ such that g = [1, α] By a similar proof as in the previous case, first getting [0, 1] or [1, 0] by Lemma 11.6, we can have Lemma 11.9. So Pl-#CSP 2 (F) is #P-hard. If Now we can prove the dichotomy for Pl-#CSP 2 with a single symmetric signature of odd arity.

Theorem 11.12. If f is a symmetric signature of odd arity, then either
Proof. Let f have arity 2n + 1. If 2n + 1 = 1, then f ∈ P. If 2n + 1 = 3, then we are done by Lemma 11.2. In the following, assume that 2n , then we are done by Lemma 11.3. So we can assume that f ′ ∈ P ∪ A . Note that f ′ has odd arity, so if f ′ does not satisfy the parity constraints, then we have [a, b] with ab = 0 by Lemma 11.5 and we are done by Lemma 10.2. Otherwise, either f ′ is identically zero or, as f ′ has odd arity and satisfies the parity constraints, by Lemma 11.4 Note that xy = 0 and f is non-degenerate. And by its second-order recurrence, f ∈ 1, 0, 1 . it follows from Lemma 9.11 Lemma 11.6. So if f does not satisfy the parity constraints, then we have [a, b] with ab = 0 by Lemma 11.7 and we are done by Lemma 10.2. So we can assume that f satisfies the parity constraints in the following. Lemma 9.5. . ⊗3 } with a + sign, we have ∂(f (4) ) = 2(1 + α 2 ) n−1 [1,0] and ∂ [1,0] In either case, we have [1, 0, α 2 ]. Then we have f (5) 11.11. Otherwise, xy = 0 and x 4 = y 4 . Then f (5) If x = y = 0, then f ∈ A . In the following, assume that (x, y) = (0, 0). : Gadget used to obtain a signature whose signature matrix is redundant.
After the holographic transformation by [ 0 1 . Since this matrix is nonsingular, we are done by Lemma 9. 25.
the proof follows from the previous case by a holographic transformation using [ 0 1 1 0 ]. By Theorem 11.11 and Theorem 11.12, we have the following dichotomy theorem.
The following lemma is proved by the technique of domain pairing.
Proof. Let f ′ be the signature of the gadget in Figure 29 and f ′′ be the signature of the gadget in Figure 29 rotated 90 • . Then f ′ has a signature matrix on the left, and f ′′ has a signature matrix on the right:     a 2 +c 2 +2b 2 ab+cd+2bc ab+cd+2bc ac+ce+2bd ab+cd+2bc b 2 +d 2 +2c 2 b 2 +d 2 +2c 2 bc+de+2cd We highlight the relevant entries in the display below (in fact, readers should only focus on the entries highlighted; see Figure 2 in Part I for an illustration of the rotation operation): We demonstrate a simple use of the "Three Stooges" in the following lemma. Then combining three reductions, we have Pl-#CSP 2 ([1, 0, a, 0, a 2 ]) ≤ Pl-#CSP 2 (f ), where a 4 = 0, 1. Thus Pl-#CSP 2 (f ) is #P-hard by Lemma 12.3. Now we are ready to prove the following theorem.
This implies that f ∈ M † by Corollary 9. 18. In the following, assume that x 2 = y 2 in addition to D = 0. In this case, the "Three Stooges" are , and We will prove that Pl- ∈ M , then by Lemma 9.8 and the fact that x 2 = y 2 , we must have and 2b 2 + x 2 + y 2 = 0.   This completes the proof of Theorem 12.5.

Dichotomy Theorem with a Signature in M \ (P ∪ A )
The next three lemmas are crucial. The purpose of these lemmas is to give a similar result as Lemma 11.3 when the signature set F contains some f ∈ M \ (P ∪ A ), and all signatures in F have even arity. The proof uses an argument involving the degree of extension of a cyclotomic field . We first prove that if we have an even arity signature in M \ (P ∪ A ), then we can construct a binary [1, a, 1] with a 4 / ∈ {0, 1}. Proof. If f has arity 2, then we are done by Lemma 9.14. Thus, we assume that f has arity 2n ≥ 4. By Lemma 9.14, we have either f = [s, t] ⊗2n ± [t, s] ⊗2n with s 4 = t 4 and st = 0 or f k = ϵ k (2n − 2k) up to a scalar.
where c ℓ is the sum, over all assignments that assign 00 to ℓ copies of 1+x 0 0 1−x and 11 to the remaining n − ℓ copies, of the product of evaluations of all other signatures from F and those copies of H. If we construct a sequence Ω k of instances of This is a Vandermonde system of full rank, and we can solve for all c ℓ and find the value Z(Ω).

Dichotomy Theorem with a Signature in M † \ (P ∪ A )
We would like to prove a corresponding statement to Lemma 13.3 after replacing the condition . This corresponding statement is indeed true and is implied by Theorem 9.2, the final dichotomy theorem for Pl-#CSP 2 . However, at this point leading up to the proof of Theorem 9.2, we are not able to prove it. Instead, we prove a weaker version, Lemma 13.7, in which f is assisted by a binary signature other than a multiple of [1, 0, 1].
Remark 6. Here we explain some of the difficulties in the proof caused by structural complications of the signatures involved.
When we prove the No-Mixing statements for M the crucial step is the ability to construct [1, ξ] ⊗2 with ξ = 0 in the Pl-#CSP 2 setting (cf. Lemma 13.1 and Lemma 13.2). This is the key, and the only known method, for us to leverage the existing dichotomy for Pl-#CSP (cf. Lemma 10.3). Then in a similar spirit, to prove the No-Mixing statements for M † , we would like to be able to construct [1, ξ] ⊗2 as well.
A signature f = [f 0 , . . . , f n ] is called an odd signature if f 2k = 0 for all k ≥ 0, and an even signature if f 2k+1 = 0 for all k ≥ 0.
In any F-gate H, if every signature in F satisfies the parity constraints, then the signature of H also satisfies the parity constraints. In fact the parity of the signature of H is the same as the parity of the number of occurrences of odd signatures of F in H. To see this, suppose σ is a {0, 1}-assignment to all the edges of H, including internal and external edges, that has a nonzero evaluation on H. By the parity constraints, each odd (resp. even) signature appearing in H has an odd (resp. even) number of incident edges assigned 1. Adding up all these numbers mod 2, noting that each internal edge of H assigned 1 contributes 2 to the sum while each external edge of H assigned 1 contributes 1, we get N ≡ 2X + Y ≡ Y (mod 2), where N is the number of occurrences of odd signatures of F in H, and X (resp. Y ) is the number of internal (resp. external) edges assigned to 1 by σ. Hence H has the same parity as N . As indicated, therefore, we prove a weaker version of Lemma 13.3 in this subsection, namely Lemma 13.7, in which f is assisted by a binary signature other than a multiple of [1, 0, 1].
Remark 7. Lemma 13.3 and Lemma 13.7 will substantially simplify the succeeding proof for No-Mixing Lemmas concerning M and M † . Thus it is natural that we wish to do the same for A , and that means we would like to construct [1, ξ] Unfortunately, for most cases of f ∈ A this is impossible.
First, for a signature f ∈ A , if f satisfies the parity constraints, then all signatures constructed in Pl-#CSP 2 (f ) satisfy the parity constraints, since all EQ 2 also satisfy the parity constraints. So it is impossible to construct [1, ξ] If a signature f ∈ A is degenerate and does not satisfy the parity constraints, then  ⊗2 . . . , (−1) n ] up to the scalar 1 ± i. In any construction in Pl-#CSP 2 (f ), if we ignore a global scalar factor which is a power of 1 ± i, all entries of the constructed signature are real numbers. Thus the ratio of any two nonzero entries is a real number. But this is not the case with [1, ±i] ⊗2 . This implies that we cannot construct [1, ±i]

No-Mixing of a Pair of Signatures of Even Arity
The general theme of this section and the next is that, for planar Pl-#CSP 2 problems, various tractable signatures of different types cannot mix. In these two sections, all signatures are of even arity. In this section we prove a No-Mixing theorem for a pair of signatures. This will be extended to a set of signatures in the next section.
Recall that The general form of the No-Mixing theorem to be proved in this section is as follows: Let f and g be two symmetric signatures of even arity. Suppose for some 1 ≤ j < i ≤ 5, f ∈ S i \ S j and g ∈ S j \ S i , and for all 1 ≤ k ≤ 5, {f, g} ⊆ S k . Then Pl-#CSP 2 (f, g) is #P-hard. We will call such a statement No-Mixing-(i, j) (or No-Mixing theorem-(i, j), or a No-Mixing lemma).
It is easy to see that, with possibly switching the names f and g, the condition stated above is equivalent to the following assumption: However under this assumption, we make the following observation that any index i for which f ∈ S i can be chosen as the distinguishing index: If f ∈ S i for some i, then there exists some j = i such that g ∈ S j \ S i and f ∈ S i \ S j .
In particular, neither f nor g can be identically 0. We will prove the No-Mixing theorem-(i, j) in a reverse lexicographic order of (i, j): We order the statements as (5, 4), (5, 3), (5, 2), (5, 1), (4, 3), (4, 2), (4, 1), (3,2), (3, 1), (2, 1). After having proved all No-Mixing theorem-(i ′ , j ′ ) preceding (i, j) in this order, we assume there are two signatures f and g such that f ∈ S i \ S j and g ∈ S j \ S i . Now we may make the following additional assumption: Indeed, if f or g belongs to S k for some k > i, then let k be the maximum index such that S k contains either f or g. Then by the observation above, there exists some j = k such that one signature belongs to S j \ S k , and the other one belongs to S k \ S j . By the maximality of k, we have k > j. Since k > i and No-Mixing theorem-(k, j) has already been proved, we have Pl-#CSP 2 (f, g) is #P-hard. Moreover, if g ∈ j<ℓ≤i S ℓ , then g ∈ S ℓ for some j < ℓ < i, as g / ∈ S i . Then f ∈ S i \ S ℓ since {f, g} ⊆ S ℓ , and also g ∈ S ℓ \ S i . Hence Pl-#CSP 2 (f, g) is #P-hard by No-Mixing-(i, ℓ) already proved.
We now proceed with this plan. We first prove a preliminary result, which allows us to construct signatures of arbitrarily high even arities from a given binary signature.  For any binary signature [a, b, c], any integer k ≥ 1, and any signature set F, Proof. We take 2k copies of [a, b, c] and connect one input of each [a, b, c] to an edge of = 2k . The In the next lemma, we will prove that for any symmetric signature f ∈ A \ P of even arity, we can construct an arity 4 signature g ∈ A \ P in Pl-#CSP 2 ({f } ∪ F ). Thus we can assume that we have an arity 4 signature g ∈ A \ P in the proof of the No-Mixing lemma of P versus A , namely No-Mixing-(5, 4). We can prove a similar result for A † \ P. This is for the proof of No-Mixing-(5, 3).

Lemma 14.2.
For any symmetric signature f ∈ A \ P (respectively, f ∈ A † \ P) of even arity 2n ≥ 2, there exists a symmetric signature g ∈ A \ P (respectively, g ∈ A † \ P) of arity 4, such that for any set F, Proof  Figure 35). Then by our calculus, we have ∂ n−2 (f ) Clearly it is in A † and is non-degenerate. It also has type −α 2 , 0, 1 and therefore it is not in P.

Mixing with S 5 = P
In this subsection, we prove No-Mixing-(5, j), for 1 ≤ j ≤ 4, namely the No-Mixing of one signature in P and another signature in a different tractable set. Thus we assume there is some f ∈ S 5 = P, and some g ∈ S k for some 1 ≤ k ≤ 4, and for no 1 ≤ k ≤ 5, {f, g} ⊂ S k . Under this assumption we show that Pl-#CSP 2 (f, g) is #P-hard. As explained earlier, for j < k < 5, when we prove No-Mixing-(5, j), we can make logical use of No-Mixing-(5, k).
Proof. As explained earlier, since f ∈ P, there exists some 1 ≤ k ≤ 4, such that g ∈ S k \ P and f ∈ P \ S k . Since , then a fortiori, g ∈ M \ (P ∪ A ). Therefore we are done by Lemma 13.3. The other case is g ∈ A † \(P ∪A ∪ M † ), then a fortiori, g ∈ A † \P, and by Lemma 14.2, we have an arity 4 signature g ′ ∈ A † \P. By definition (see Figure 35), g ′ = [ ⊗2 . Then again we are done by Lemma 10. 3.
Thus g ∈ M \ (P ∪ A ). If g ∈ M \ (P ∪ A ), then we are done by Lemma 13.3. If g ∈ M † \ (P ∪ A ), then we are done by Lemma 13.7, where the binary signature is supplied by As f ∈ P, we have g ∈ P. Then we have an arity 4 signature g ′ ∈ A \ P by Lemma 14. Figure 32: Two gadgets used in the proof of Lemma 14.4. as This is a contradiction. Thus we have x 4 = 0, 1. ⊗4 . Then by Lemma 11.8, Pl-#CSP 2 ( g ′ ) ≤Pl-#CSP 2 (f, g). Note that g ′ has type −x −1 γ 2 , 0, 1 by calculating the trace and product of the eigenvalues of the second order recurrence relation. Note that (−x −1 γ 2 ) 4 = x −4 = 0, 1. Thus g ′ ∈ P ∪ A ∪ M by Lemma 9.11. This implies that Pl-#CSP 2 ( g ′ ) is #P-hard by Theorem 12. 5

Mixing with S 4 = A
In this subsection, we prove the No-Mixing lemma of A with other tractable sets. Because we have already proved Lemma 14.3, the No-Mixing lemma for S 5 = P, we only need to consider No-Mixing-(4, j) of S 4 There is a particular case involving A and A † that requires some special care. This is when two signatures f ∈ A and g ∈ A † both satisfy the parity constraints. We deal with this case first. Furthermore, by Lemma 14.2, for two signatures f ∈ A \ P and g ∈ A † \ P we may assume the signatures f and g have arity 4. Hence the next lemma considers signatures f and g of arity 4.
Proof. There are four cases depending on the combination of the two ± signs. ⊗4 . Consider the gadget in Figure 32a. We assign g to the circle vertex and f to the triangle vertex. Since both f = 2[1, 0, ρ 2 , 0, 1] and g = 2[1, 0, α 2 , 0, −1] have even parity, the signature of this gadget also has even parity. It is also clearly a redundant signature by design. Hence there are only five signature entries we need to compute. E.g., the entry of Hamming weight 0 is g 0 f 0 + g 2 f 2 = 4(1 + α 2 ρ 2 ). Up to a factor of 4, the signature of this gadget has signature matrix     after a 90 • counterclockwise rotation of the gadget. (See Figure 2 in Part I for an illustration of the rotation operation.) Taking the four corner entries, we define the binary signature h = [α 2 ρ 2 + 1, 2α 2 ρ 2 , α 2 ρ 2 − 1]. By domain pairing, Pl-#CSP(h) ≤ T Pl-#CSP 2 (f, g). (Domain pairing is the following reduction: In an instance of Pl-#CSP(h) replace every occurrence of h by a copy of the 90 • counterclockwise rotated gadget, and replace both edges of h by two parallel edges each, and replace every (= k ) in the Pl-#CSP(h) instance by (= 2k ) in Pl-#CSP 2 (f, g). Note that the rotation is necessary to create a symmetric binary signature h in the paired domain.) Note that α 2 = ±i and ρ 2 = ±1, so α 2 ρ 2 ± 1 has norm √ 2, while 2α 2 ρ 2 has norm 2. Also α 2 ρ 2 + 1 = α 2 ρ 2 − 1. Hence h / ∈ P ∪ A by Corollary 9.9 and also h / ∈ M by Lemma 9. 8. Thus Pl-#CSP(h) is #P-hard by Theorem 9. 22. So Pl-#CSP 2 (f, g) is #P-hard. ⊗4 . Consider the same construction. Up to a nonzero factor of 4αρ, the signature of this gadget has the signature matrix  after a 90 • counterclockwise rotation of the gadget. Let h = [2, 1+α 2 ρ 2 , 2α 2 ρ 2 ]. By domain pairing, we have Pl-#CSP(h) ≤ T Pl-#CSP 2 (f, g). Note that 1 + α 2 ρ 2 = 1 ± i has norm √ 2 while 2α 2 ρ 2 = 2 but has norm 2. Hence h / ∈ P ∪ A ∪ M by Corollary 9.9 and Lemma 9. 8. Thus we are done by Theorem 9. 22. ⊗4 . Consider the gadget in Figure 32b. We assign f to the circle vertices and g to the triangle vertex. Up to a nonzero factor of 16α 2 ρ 2 , the signature of this gadget has the signature matrix  after a 90 • rotation of the gadget. Let h = [2, ρ 2 , 2]. We also have g × = 2[1, α 2 ] ⊗2 by domain pairing with g (see Lemma 9.19). Then Pl-#CSP(g × , h) ≤ T Pl-#CSP 2 (f, g). Note that |ρ 2 | = 1 = 2, so by Lemma 9.8 and Corollary 9.9, h ∈ M \ (P ∪ A ). Also by Lemma 9.8 and (α 2 ) 2 = −1 = 1 we have g × / ∈ M . Thus we are done by Theorem 9. 22. Note that in this case, the rotation is necessary to create a non-degenerate binary signature h in the paired domain. ⊗4 . Consider the gadget in Figure 32b. We assign g to the circle vertices and f to the triangle vertex. Up to a nonzero factor of 16α 2 ρ 2 , the signature of this gadget has the signature matrix  Then each copy of f has an odd number of incident edges assigned to 1.
Summing these numbers (mod 2) over all copies of f we get a number ≡ N f (mod 2), since each of these numbers is ≡ 1 (mod 2). Similarly each copy of g has an even number of incident edges assigned to 1. Summing these numbers (mod 2) over all copies of g we get a number ≡ 0 (mod 2).
On the other hand, if we add these two sums together we get 2X + Y where X is the number of internal edges and Y is the number of external edges assigned to 1 by σ. This is because each internal edge assigned to 1 appears exactly twice in the sum. Hence this number is ≡ Y (mod 2).
We conclude that N f ≡ Y (mod 2), the Hamming weight of σ on the external edges.
If N f is odd, from any constructed signature of arity 4, by rotation and domain pairing we can only get the identically zero binary signature. Thus we must use f an even number of times. Using g alone will not get out of A † , which is a tractable set. Thus we must use f at least twice. Also using g alone will not get out of A , another tractable set. Therefore we must use g at least once. Therefore the construction we give is the simplest possible.
The same consideration applies for the construction in the fourth case.
The next Lemma deals with the situation when we have a binary signature in A \ P and an arity 4 signature in A † \ P.  9. This implies that Pl-#CSP 2 ([1, 1−x 1+x α, α 2 ]) is #P-hard by Theorem 9.21 ′ . Thus Pl-#CSP 2 (f, g) is #P-hard.
The next lemma is the No-Mixing lemma of A with the other tractable sets, namely the statements No-Mixing-(4, j) for 1 ≤ j ≤ 3. Having already proved Lemma 14.3, we can assume that both f and g are not in S 5 = P.
In the following, we will construct [1, 0, 1] ⊗2 on RHS for Hence we can always obtain a nonzero binary signature that is not λ[1, 0, 1] from f .
Note that g ∈ M \ (P ∪ A ). If g ∈ M \ (P ∪ A ), we are done by Lemma 13.3. For g ∈ M † \ (P ∪ A ), since we have a nonzero binary signature that is not λ[1, 0, 1], we are done by Lemma 13.7.  Proof. For all five cases, it is easy to show that the listed signatures in the displayed set are indeed members of the respective stated intersection, bear in mind that the signatures all have even arity. E.g., the signature f = [1, 0, . . . , 0, i r ] is clearly in P (as well as A ), and it has even arity 2n, and thus under the transformation T = [ 1 0

Mixing with
In the following, we prove that if f is a nonzero signature of even arity and is in the stated intersection then it is among the listed types. 1 9.11, f has type 0, 1, 0 or 1, 0, ±i and the second-order recurrence relation is unique up to a scalar. If f has type 1, 0, ±i , then f / ∈ P ∪ A by Lemma 9.11. This contradicts that f ∈ A † ∩ (P ∪ A ). If f has type 0, 1, 0 , then f = [1, 0, . . . , 0, x] with x = 0 up to a nonzero scalar, because f is non-degenerate. Moreover, if x 4 = 1, bear in mind that f has even arity, then f / ∈ A † and this contradicts that f ∈ A † ∩ (P ∪ A ). Hence x 4 = 1 and f = [1, 0, . . . , 0, i r ], for some 0 ≤ r ≤ 3; this is among the listed types. Summarizing, we proved that if f ∈ A † ∩ (P ∪ A ) then f is among the listed types. (c.) If f ∈ M ∩ (P ∪ A ) is non-degenerate and has arity 2n ≥ 4, by f ∈ M and Lemma 9.11, f has type 0, 1, 0 or 1, c, 1 , and the second-order recurrence relation is unique up to a scalar. If f has type 1, c, 1 with c = 0, then f / ∈ P ∪ A by Lemma 9.11 and this contradicts that f ∈ M ∩ (P ∪ A ). If f has type 1, 0, 1 , then there exist constants x and y such that ⊗2n . By non-degeneracy, we get xy = 0, and by its type 1, 0, 1 , f ∈ P by Lemma 9.11. Thus f ∈ A . In fact by Lemma 9.11 Then the proof of this case follows from the previous case by a transformation using Moreover We state the following simple lemma which allows us to replace a signature set F in the proof of the No-Mixing Theorem by a smaller set F ′ that subtracts from F those signatures that belong to all common tractable signature sets.

Lemma 15.2. Let F be a set of symmetric signatures such that for all
, the set of signatures in F excluding those that belong to all five tractable signature sets. Then for all 1 ≤ k ≤ 5, F ′ ⊆ S k and Pl-#CSP 2 (F ′ ) ≤ Pl-#CSP 2 (F).
Proof. Suppose for some 1 ≤ k ≤ 5, F ′ ⊆ S k , then clearly F ⊆ S k . The reduction is trivial since Suppose F is as given in Lemma 15.2, and F ∩ ( 5 k=1 S k ) = ∅, i.e., there exists some signature in F outside of all five tractable signature sets. Let j = min{k | F ∩ S k = ∅, 1 ≤ k ≤ 5}. Then j is well defined. Then by definition and De Morgan's laws F ′ = F \ ( 5 k=j S k ), is also the set of signatures in F excluding those that belong to all signature sets S k for j ≤ k ≤ 5. By Lemma 15.2 we have F ′ ⊆ S k , for j ≤ k ≤ 5, F ′ ∩ S k = ∅ for 1 ≤ k < j (by definition), and Pl-#CSP 2 (F ′ ) ≤ Pl-#CSP 2 (F). For ease of application we state this as a corollary. Corollary 15. 3. Let F be a set of symmetric signatures such that for all 1 ≤ k ≤ 5, F ⊆ S k . Furthermore suppose F ∩ ( 5 k=1 S k ) = ∅ and let j = min{k | F ∩ S k = ∅, 1 ≤ k ≤ 5}. Let F ′ = F \ ( 5 k=j S k ). Then for all j ≤ k ≤ 5, F ′ ⊆ S k and Pl-#CSP 2 (F ′ ) ≤ Pl-#CSP 2 (F).
Proof. If F ⊆ S k for some 1 ≤ k ≤ 5, then tractability follows from the definition of Ptransformability, A -transformability and M -transformability. Now suppose F ⊈ S k for all 1 ≤ k ≤ 5. We first replace F by F ′ = F \ ( 5 k=1 S k ). This also excludes the identically 0 signature. By Lemma 15.2, we still have F ′ ⊈ S k for 1 ≤ k ≤ 5, and we only need to prove Pl-#CSP 2 (F ′ ) is #P-hard.

Dichotomy Theorem for an Even-Arity Signature
In this section, we prove the dichotomy theorem for Pl-#CSP 2 (f ), where f has a general even arity 2n. If 2n = 2 or 4, then it has been proved in Theorem 9.21 ′ and Theorem 12.5 respectively. Thus we will assume 2n ≥ 6.
The next simple lemma is to determine if a symmetric signature satisfies a second-order recurrence relation. In the following proof, we often argue that a signature f does not belong to P ∪ A ∪ M by Lemma 9.11. And we show that Lemma 9.11 applies by showing that f does not satisfy any second-order recurrence relation. This observation also extends to a sum of tensor powers by linearity. We will use this simple fact in the next lemma. Since M f has a rank 3 submatrix  11. For 2n = 6 and t = −1, Mf is a 2 × 3 matrix and has rank less than 3. So it always satisfies a second-order recurrence relation. But we still show thatf / ∈ P ∪ A ∪ M . Note thatf = [a + 1, −a, a, −a + t] when n = 3.
(a) (b) Figure 34: Two gadgets used to obtain a signature whose signature matrix is redundant. The dashed subgadgets are assigned [1, 0, 1] ⊗2 rotated so that it is equivalent to assigning [1, 0, 1] to the square vertices.
If a + b 2 = 0, then this matrix is nonsingular, so we are done by Lemma 9. 25. Otherwise we have 4a 2 +4b 2 +a = 0 and a+b 2 = 0. Also we have a = 0. By solving these two equations, a = 3 4 and b = ± We will use the next lemma in the proof of Theorem 16.5 for the case that ∂(f ) = [1, i] In this case, we will transform Pl-#CSP 2 to Pl-#CSP 4 by holographic transformation and gadget construction. This is why we have to deal with Pl-#CSP 4 problems in the next lemma. Proof. In Pl-#CSP 4 (f, [1, 0, 1] ⊗2 , [1, 0, 1, 0, 1]), we do not have = 2 on the left, so we cannot connect the two edges on the right freely. But we do have [1, 0, 1] ⊗2 on the right and = 4 on the left, so we can do a loop to a pair of = 4 on the left respectively and we get [1, 0, 1] ⊗2 on the left.
Suppose a 2 = 1. Consider the gadget in Figure 34a. We assign f to the circle vertices and [1, 0, 1] ⊗2 to the dashed subgadgets rotated so that it is equivalent to assigning [1, 0, 1] to the square vertices, where there are 2n − 2 parallel edges connecting the 2 copies of f with 2n − 2 square vertices. The signature f ′ of this gadget is redundant, and its compressed signature matrix is 2n−2 0 0 0 1+a 2 0 0 0 (2n−2)a 2 , which is nonsingular, by a 2 = 1. Thus we have where the first ≤ T is by Lemma 10.4. Then we are done by Lemma 9. 25.
Now we are ready to prove the main theorem of this section, the dichotomy of Pl-#CSP 2 (f ), where f has a general even arity 2n. We will prove the theorem by induction on the arity 2n. The base cases 2n = 2 and 2n = 4 are already done in Theorem 9.21 ′ and Theorem 12.5, respectively. We always have f ′ = ∂(f ) in Pl-#CSP 2 (f ) which has arity 2n − 2. If f ′ / ∈ P ∪ A ∪ M , then Pl-#CSP 2 (f ′ ) is #P-hard by induction and Pl-#CSP 2 (f ) is #P-hard. Otherwise, for f ′ ∈ P ∪ A ∪ M , we can explicitly express f by the integral operator (f ′ ). We will prove the theorem in the following order: (1) f ′ ∈ P, (2) f ′ ∈ A † \ P, (3) f ′ ∈ A \ P, (4) f ′ ∈ M \ (P ∪ A ), and (5) f ′ ∈ M † \ (P ∪ A ).
• For 2n ≡ 2 (mod 4), we cannot reduce the arity of f to 4 by = 4 directly as in the previous case. We will construct a binary signature that is not λ [1,0,1] ⊗4 . With the same reason as in the previous case, f (4) / ∈ P ∪ A ∪ M by its type, and by xy = 0, x 4 = y 4 . Thus Pl-#CSP 2 (f (4) ) is #P-hard by Theorem 12. 5. So Pl-#CSP 2 (f ) is #P-hard. . Note that f ′′ is redundant. If a 2 + b 2 = 0, then the compressed signature matrix of f ′′ is nonsingular and we are done by Lemma 9. 25. Otherwise, we have a = ±ib. We claim that f ′′ / ∈ P ∪ A ∪ M . Note that ab = 0 by (a, b) = (0, 0) and a = ±ib. If f ′′ is degenerate, then by (f ′′ 1 ) 2 = f ′′ 0 f ′′ 2 , we have −a − a 2 = b 2 . This implies that a = 0. It is a contradiction. Moreover, note that f ′′ = [1 + a, ∓ia, −a, ±ia, a] and has type 0, 1, ∓i . Since f ′′ is non-degenerate and has arity ≥ 3, the second order recurrence relation 0, 1, ±i is unique up to a scalar. Thus f ′′ / ∈ P ∪ A ∪ M by Lemma 9.11. So Pl-#CSP 2 (f ′′ ) is #P-hard by Theorem 12.5 and we are done.   ). If x = y = 0, then f ∈ A † . In the following, assume that (x, y) = (0, 0). Note that f ′ has type 1, 0, ±i up to a scalar. And this second-order recurrence relation is unique up to a scalar. Thus f ′ ∈ A † \ (P ∪ A ∪ M ) by Lemma 9.11. In the following, we complete the proof by constructing a signature of even arity in (P ∪ A ∪ M ) \ A † and apply Theorem 15.4, or constructing an arity 4 signature that is not in P ∪ A ∪ M and apply Theorem 12. 5. . Note that f ′′′ is redundant. If (−1) r x + y = 0, then the compressed signature matrix of f ′′′ is nonsingular and we are done by Lemma 9. 25. Otherwise, we have x = ±y, and thus both x, y = 0. It is easy to see that f ′′′ does not satisfy the second order recurrence relations 0, 1, 0 , 1, 0, ±1 , 1, 0, ±i . Thus f ′′′ / ∈ P ∪ A by Lemma 9. 11. We consider three possibilities for f ′′′ .  [u, v, w, v, u] with (u + w)w = 2v 2 in Corollary 9.18 is impossible because w = 0 here and (u + w)w = 2v 2 would force v = 0.) Then we are done by Lemma 13.4, because f ′′′ plays the role of both f and g in Lemma 13.4, and f / is #P-hard by Theorem 12.5 and we are done.
-For 2n ≡ 2 (mod 4), we cannot claim the reduction in ( 16.29) since Lemma 10.4 requires that all signatures on the right have arity ≡ 0 (mod 4). We get around this difficulty by constructing some arity 4 signatures in Pl-#CSP 4 ( f ), and then use Lemma 10.4 for these arity 4 signatures. (1 + i r )xy (1 + i r )xy y 3 .